html_url stringlengths 48 51 | title stringlengths 5 280 | comments stringlengths 63 51.8k | body stringlengths 0 36.2k ⌀ | comment_length int64 16 1.52k | text stringlengths 159 54.1k | embeddings listlengths 768 768 |
|---|---|---|---|---|---|---|
https://github.com/huggingface/datasets/issues/5577 | Cannot load `the_pile_openwebtext2` | Hi! I've merged a PR to use `int32` instead of `int8` for `reddit_scores`, so it should work now.
| ### Describe the bug
I met the same bug mentioned in #3053 which is never fixed. Because several `reddit_scores` are larger than `int8` even `int16`. https://huggingface.co/datasets/the_pile_openwebtext2/blob/main/the_pile_openwebtext2.py#L62
### Steps to reproduce the bug
```python3
from datasets import load_dataset
dataset = load_dataset("the_pile_openwebtext2")
```
### Expected behavior
load as normal.
### Environment info
- `datasets` version: 2.10.0
- Platform: Linux-5.4.143.bsk.7-amd64-x86_64-with-glibc2.31
- Python version: 3.9.2
- PyArrow version: 11.0.0
- Pandas version: 1.5.3 | 18 | Cannot load `the_pile_openwebtext2`
### Describe the bug
I met the same bug mentioned in #3053 which is never fixed. Because several `reddit_scores` are larger than `int8` even `int16`. https://huggingface.co/datasets/the_pile_openwebtext2/blob/main/the_pile_openwebtext2.py#L62
### Steps to reproduce the bug
```python3
from datasets import load_dataset
dataset = load_dataset("the_pile_openwebtext2")
```
### Expected behavior
load as normal.
### Environment info
- `datasets` version: 2.10.0
- Platform: Linux-5.4.143.bsk.7-amd64-x86_64-with-glibc2.31
- Python version: 3.9.2
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
Hi! I've merged a PR to use `int32` instead of `int8` for `reddit_scores`, so it should work now.
| [
-0.09743817895650864,
-0.25990134477615356,
-0.016660965979099274,
0.7843771576881409,
0.14893141388893127,
0.11092916876077652,
0.2464834302663803,
0.37515589594841003,
0.36859920620918274,
-0.06786458194255829,
-0.321153849363327,
0.10087927430868149,
0.1531553417444229,
0.20926694571971893,
-0.03954514116048813,
0.0937064066529274,
-0.1450469195842743,
-0.057243019342422485,
-0.04493149369955063,
0.004571270197629929,
-0.3304319679737091,
0.009150337427854538,
-0.4011642336845398,
0.01859208196401596,
-0.11238983273506165,
0.3674144744873047,
0.06821394711732864,
0.4223805069923401,
-0.12075991183519363,
-0.2013425976037979,
0.19017820060253143,
-0.06754165887832642,
0.09605962038040161,
0.7093840837478638,
-0.00011039967648684978,
-0.15454979240894318,
0.21678723394870758,
-0.013747494667768478,
-0.14415186643600464,
-0.35275083780288696,
0.13598215579986572,
-0.3016224205493927,
0.008147021755576134,
-0.2374947965145111,
0.07042396813631058,
-0.34872937202453613,
-0.08610472828149796,
-0.03983933478593826,
0.24807541072368622,
0.1294444054365158,
0.21131402254104614,
0.3285462558269501,
0.35364508628845215,
-0.025750862434506416,
0.4552662670612335,
-0.15107068419456482,
-0.06015704572200775,
0.44012588262557983,
0.058067694306373596,
0.2128998339176178,
-0.011674217879772186,
-0.03714882582426071,
-0.042122386395931244,
0.010801383294165134,
0.01563025638461113,
0.05866965651512146,
0.1516469269990921,
-0.06059275567531586,
-0.006767004728317261,
0.25261157751083374,
0.21338757872581482,
-0.04102768003940582,
-0.26090654730796814,
-0.14666199684143066,
-0.18020813167095184,
-0.21427187323570251,
0.1996469497680664,
0.2623978555202484,
0.20670218765735626,
0.14273160696029663,
-0.08261052519083023,
0.1260051727294922,
-0.15518394112586975,
0.2952840328216553,
-0.010026402771472931,
0.19819730520248413,
-0.22105270624160767,
0.17673949897289276,
0.19558179378509521,
-0.17334848642349243,
0.045639388263225555,
0.2409796565771103,
-0.08921876549720764,
0.15906396508216858,
-0.2405584305524826,
0.06662362068891525,
0.08065439760684967,
-0.056421346962451935,
0.2586028575897217,
0.09739382565021515,
0.13108690083026886,
0.22683703899383545,
-0.2332097887992859,
0.08867304772138596,
0.3972317576408386,
0.17270253598690033,
-0.21452659368515015,
0.05279188230633736,
0.3304303288459778,
0.16445685923099518,
-0.14991876482963562,
-0.1804606318473816,
-0.19510801136493683,
-0.4304942190647125,
0.11759693920612335,
-0.17670786380767822,
0.4449373483657837,
-0.27139392495155334,
-0.37111201882362366,
0.0541696734726429,
0.16180121898651123,
-0.05174849182367325,
0.07243580371141434,
0.3466618061065674,
-0.1513361930847168,
0.30072978138923645,
0.1781720668077469,
0.4869793653488159,
-0.04788189008831978,
-0.0967831164598465,
-0.158770352602005,
0.009720325469970703,
0.07041347026824951,
-0.08721134811639786,
0.31438419222831726,
-0.45472556352615356,
0.567407488822937,
0.14896762371063232,
0.6579991579055786,
-0.32796454429626465,
-0.3197372555732727,
-0.01897210069000721,
0.1666267067193985,
0.20500178635120392,
0.014418426901102066,
0.07787259668111801,
0.2566036880016327,
-0.028788777068257332,
-0.014342308044433594,
0.10194432735443115,
-0.20044711232185364,
-0.280194491147995,
-0.18843930959701538,
0.10391606390476227,
-0.203138530254364,
-0.03874388337135315,
-0.34533050656318665,
-0.16748593747615814,
0.02310660481452942,
-0.03903256356716156,
-0.03261169046163559,
-0.12327024340629578,
0.06073493883013725,
-0.18576091527938843,
0.12205220013856888,
0.21625521779060364,
-0.12120658159255981,
0.22775930166244507,
0.01404171995818615,
0.25183525681495667,
0.011551253497600555,
0.3239941895008087,
-0.2027132362127304,
-0.38440290093421936,
-0.22193144261837006,
0.025571539998054504,
0.31668972969055176,
-0.28542304039001465,
-0.5499891638755798,
0.05849200114607811,
0.019983500242233276,
0.07244216650724411,
0.061417922377586365,
-0.025848980993032455,
-0.10948331654071808,
-0.254190057516098,
0.05847227945923805,
0.2713771462440491,
0.15623991191387177,
0.13408897817134857,
-0.38036927580833435,
-0.33294305205345154,
0.22678500413894653,
0.28568822145462036,
0.12850221991539001,
-0.21092307567596436,
0.0737401694059372,
-0.10892246663570404,
0.32392966747283936,
0.10532385855913162,
-0.055706657469272614,
-0.23904035985469818,
0.2512318789958954,
0.20362605154514313,
0.10421281307935715,
-0.38847702741622925,
0.010941144078969955,
0.22911480069160461,
-0.10755915194749832,
-0.17963935434818268,
0.45834439992904663,
-0.018754325807094574,
-0.6928480267524719,
-0.019018948078155518,
-0.006624821573495865,
0.0652923732995987,
0.03740888088941574,
-0.08042453229427338,
0.17258146405220032,
-0.2718670070171356,
-0.3288266956806183,
0.017015021294355392,
-0.1868334263563156,
0.1627397984266281,
0.03495161980390549,
0.016202298924326897,
-0.07869698107242584,
-0.16990450024604797,
0.17238205671310425,
0.05516575276851654,
0.168382465839386,
-0.07219186425209045,
-0.16627660393714905,
0.2588442265987396,
-0.33603549003601074,
-0.12881846725940704,
0.004132993519306183,
0.09833173453807831,
0.18689517676830292,
-0.3020073175430298,
0.2979257106781006,
0.36774134635925293,
0.1413537561893463,
-0.01706426963210106,
0.08585193753242493,
0.20525121688842773,
0.14001888036727905,
0.054312434047460556,
-0.05227222293615341,
-0.14603111147880554,
0.13382726907730103,
-0.04441678896546364,
0.10747358202934265,
-0.15257608890533447,
-0.014156315475702286,
0.043854452669620514,
0.22047679126262665,
-0.023828798905014992,
-0.03763843700289726,
0.045746657997369766,
0.2596302628517151,
0.15514838695526123,
0.14514020085334778,
0.46995261311531067,
-0.10491567105054855,
-0.040814995765686035,
-0.5495643019676208,
-0.3381386697292328,
0.35529446601867676,
0.20593217015266418,
-0.019453179091215134,
0.03316861018538475,
0.051750753074884415,
-0.16455015540122986,
0.2509268820285797,
0.20139726996421814,
0.3263697624206543,
0.24591422080993652,
0.32084590196609497,
0.06209563463926315,
-0.30229610204696655,
0.011107400059700012,
-0.06315339356660843,
0.08159926533699036,
-0.42220064997673035,
-0.011862662620842457,
0.03803442418575287,
-0.0034804493188858032,
-0.005694973282516003,
-0.0868019163608551,
-0.18872515857219696,
-0.2050500065088272,
-0.1282743364572525,
0.23183295130729675,
-0.10315731167793274,
-0.11271946877241135,
0.09259770810604095,
0.24501222372055054,
0.1448907107114792,
0.42236486077308655,
-0.12852108478546143,
0.09036388248205185,
-0.2821023464202881,
-0.03021382912993431,
0.19364690780639648,
-0.27751684188842773,
0.22887183725833893,
-0.07790780812501907,
-0.1495051383972168,
-0.1683623045682907,
-0.5258381366729736,
-0.17113952338695526,
0.051933400332927704,
0.49650096893310547,
0.040059614926576614,
0.33156073093414307,
-0.12305835634469986,
-0.1378374993801117,
0.3056775629520416,
-0.2747513949871063,
-0.049598462879657745,
0.08714049309492111,
0.046038661152124405,
0.17151913046836853,
0.004387404769659042,
-0.4353417456150055,
0.06901327520608902,
-0.4925401508808136,
0.5143956542015076,
0.11184217035770416,
0.06829320639371872,
0.18473206460475922,
0.16613461077213287,
0.16550526022911072,
0.24237129092216492,
0.25560465455055237,
-0.31801947951316833,
-0.5026987195014954,
0.5486792922019958,
-0.23231877386569977,
-0.48820117115974426,
-0.10731959342956543,
0.28184956312179565,
-0.1194225549697876,
-0.2573014497756958,
-0.41202378273010254,
-0.00034058094024658203,
-0.279642254114151,
-0.12508247792720795,
-0.1671755313873291,
0.3522654175758362,
-0.19201970100402832,
-0.30468758940696716,
-0.1503424048423767,
-0.017363950610160828,
-0.22399842739105225,
0.007599547505378723,
0.3733905851840973,
0.08584018051624298,
-0.13416960835456848,
0.34569454193115234,
-0.15189330279827118,
0.1654277741909027,
0.16333557665348053,
0.11979271471500397,
0.40187689661979675,
0.27683573961257935,
0.21671071648597717,
-0.10938402265310287,
-0.25833868980407715,
0.012354937382042408,
-0.13953900337219238,
0.14423231780529022,
0.495988667011261,
0.13373592495918274,
0.012882722541689873,
-0.20837776362895966,
-0.1599668562412262,
-0.4194502532482147,
-0.07423650473356247,
0.08021977543830872,
0.012756295502185822,
-0.21497011184692383,
0.037112485617399216,
-0.18387115001678467,
-0.25559550523757935,
-0.23658794164657593,
-0.005743753630667925,
-0.14133299887180328,
0.02720918506383896,
-0.13162633776664734,
0.1453908532857895,
0.11457402259111404,
-0.247744619846344,
0.4071727395057678,
-0.1311119645833969,
0.2158917635679245,
0.18056875467300415,
-0.24368199706077576,
0.03834979608654976,
0.07005507498979568,
0.5168315172195435,
0.14965152740478516,
0.35264480113983154,
0.14276224374771118,
0.034381479024887085,
-0.7929534912109375,
-0.07049380242824554,
-0.15807080268859863,
0.07134173810482025,
0.5958107113838196,
0.4786520004272461,
-0.43243908882141113,
0.10495705902576447,
0.515802800655365,
0.24209526181221008,
-0.042464479804039,
-0.49301621317863464,
-0.5140719413757324,
-0.29167094826698303,
-0.18114058673381805,
-0.024488970637321472,
0.4802881181240082,
0.43059998750686646,
-0.4685870409011841,
-0.16687428951263428,
-0.28713271021842957,
-0.3407125473022461,
0.2874811887741089,
-0.09737573564052582,
0.28589847683906555,
0.2470879703760147,
0.17057262361049652,
0.01940956525504589,
0.05643682926893234,
-0.22806522250175476,
0.5621803998947144,
0.3342343270778656,
-0.378579705953598,
0.04533889517188072,
-0.07629898935556412,
0.30988427996635437,
0.35803085565567017,
0.02376943826675415,
-0.20074808597564697,
-0.2902056872844696,
0.2162400335073471,
-0.14340800046920776,
0.1398417353630066,
0.109794981777668,
-0.09318259358406067,
-0.11287494003772736,
-0.2997691333293915,
0.6407533884048462,
-0.1151445209980011,
0.06419931352138519,
0.47557714581489563,
0.11558439582586288,
-0.03679278492927551,
0.38424181938171387,
0.005293495953083038,
1.0793445110321045,
-0.4253697395324707,
-0.15797226130962372,
0.09754491597414017,
-0.2583528459072113,
-0.011151366867125034,
-0.08727097511291504,
-0.07298272103071213,
-0.39610937237739563,
-0.39076298475265503,
0.3131962716579437,
-0.12848632037639618,
-0.1258385181427002,
0.45559293031692505,
0.056838784366846085,
0.08417864143848419,
-0.2827322781085968,
-0.15302744507789612,
0.05059235543012619,
0.2593443691730499,
-0.15237706899642944,
-0.07161068916320801,
-0.7340561151504517,
0.0792459100484848,
-0.03167523443698883,
0.03314835950732231,
-0.14063391089439392,
-0.0029909946024417877,
0.023995351046323776,
-0.1733323484659195,
-0.18626408278942108,
0.19703638553619385,
-0.030710170045495033,
0.28689754009246826,
0.08764138072729111,
-0.11926382035017014,
0.16203811764717102,
0.2816413342952728,
0.4523247480392456,
0.13416129350662231,
-0.15456333756446838,
-0.01637221872806549,
-0.054372064769268036,
-0.2117730975151062,
0.1709747016429901,
0.20577940344810486,
-0.026392919942736626,
0.008954644203186035,
-0.4550932049751282,
0.19153402745723724,
0.07021348178386688,
-0.2669087052345276,
0.26729920506477356,
0.24768565595149994,
0.22355593740940094,
-0.3248300552368164,
-0.1816350668668747,
-0.22439450025558472,
0.20892997086048126,
-0.2816164791584015,
0.11814746260643005,
0.2507398724555969,
-0.04770001024007797,
-0.008132636547088623,
0.3205675780773163,
-0.5802887678146362,
-0.13773739337921143,
0.49280184507369995,
-0.21600878238677979,
0.13985861837863922,
0.2584948241710663,
0.33328741788864136,
-0.10145443677902222,
-0.049397896975278854,
0.07174498587846756,
-0.16681084036827087,
-0.515785276889801,
0.3356456458568573,
0.04397117346525192,
-0.01913987100124359,
-0.15990881621837616,
0.21354420483112335,
0.2558371126651764,
0.017959725111722946,
0.08226992189884186,
-0.5563074350357056,
-0.10956472158432007,
-0.0035496801137924194,
0.012063317000865936,
0.016193486750125885,
0.0420893058180809,
-0.2035766988992691,
-0.07394073158502579,
0.051586709916591644,
-0.28370174765586853,
0.3746134340763092,
-0.08746902644634247,
-0.10942244529724121,
-0.04431213438510895,
-0.13237518072128296,
0.22753417491912842,
0.24748949706554413,
0.06346971541643143,
0.026191337034106255,
-0.05031852424144745,
-0.21437889337539673,
-0.28419774770736694,
0.14791767299175262,
-0.11312947422266006,
-0.26960185170173645,
-0.14953061938285828,
-0.1951838880777359,
-0.10115611553192139,
-0.22361557185649872,
0.22687843441963196,
0.20456421375274658,
0.20658275485038757,
-0.0006395988166332245,
0.16603122651576996,
-0.08544863015413284,
-0.07396560907363892,
0.12190697342157364,
-0.006228007376194,
0.3767697215080261,
0.19946585595607758,
0.07199922949075699,
0.1902036815881729,
0.014146924018859863,
-0.05043480172753334,
-0.14844006299972534,
0.2704765796661377,
-0.0739702358841896,
0.36317282915115356,
-0.30137544870376587,
0.017580430954694748,
0.5751031041145325,
0.0858147069811821,
0.41612929105758667,
-0.1934281289577484,
0.06573930382728577,
-0.07319270074367523,
0.19733361899852753,
-0.3616333603858948,
0.2574813663959503,
-0.04779348894953728,
0.04598041623830795,
-0.2538713812828064,
0.15773329138755798,
0.11652857065200806,
-0.15502655506134033,
-0.265764057636261,
0.24873998761177063,
0.3905317187309265,
0.16077007353305817,
0.11275282502174377,
-0.007892671972513199,
-0.07508252561092377,
-0.29355984926223755,
0.28418877720832825,
-0.03967614844441414,
0.31071436405181885,
-0.14476096630096436,
-0.039294034242630005,
0.04621785879135132,
-0.520828127861023,
0.25855591893196106,
-0.1850367784500122,
-0.28881558775901794,
0.19048021733760834,
0.5871046781539917,
-0.026452451944351196,
-0.08087008446455002,
-0.05886031687259674,
0.5438182353973389,
-0.19900521636009216,
0.17667758464813232,
-0.517331063747406,
0.14905673265457153,
-0.0840999186038971,
-0.10398851335048676,
0.2970159351825714,
-0.3121892213821411,
-0.15844124555587769,
0.19722652435302734,
-0.13221265375614166,
-0.14028382301330566,
0.1271888017654419,
0.17233678698539734,
-0.21234230697155,
-0.5056359767913818,
-0.03382120281457901,
0.27711784839630127,
0.23453742265701294,
-0.3886021077632904,
0.10593175888061523,
0.37205934524536133,
-0.18523818254470825,
0.25771617889404297,
0.7170893549919128,
0.304721474647522,
0.3264843225479126,
-0.1452368199825287,
0.04524138942360878,
0.12333916127681732,
-0.012792336754500866,
-0.26273444294929504,
0.06321769952774048,
0.005877137184143066,
0.295579731464386,
0.23566822707653046,
0.15176920592784882,
-0.16404621303081512,
-0.35346558690071106,
0.0027597807347774506,
0.3270297348499298,
-0.45495396852493286,
0.1137208566069603,
-0.26789313554763794,
-0.13508453965187073,
-0.013347774744033813,
-0.11148735135793686,
-0.3987303078174591,
-0.11709065735340118,
0.23748308420181274,
-0.04393971338868141,
0.14582237601280212,
-0.06507685035467148,
0.08752962201833725,
-0.04729234054684639,
0.519442081451416,
0.40702250599861145,
-0.26282402873039246,
-0.25726041197776794,
-0.2917436957359314,
-0.6273719668388367,
0.35051658749580383,
0.16799767315387726,
0.16871443390846252,
0.24261750280857086,
0.3080030679702759,
-0.02847154438495636,
0.009373920038342476,
0.16341251134872437,
-0.040592074394226074,
0.018463127315044403,
-0.09348253905773163,
-0.2881948947906494,
-0.12443265318870544,
0.06697549670934677,
0.21977244317531586,
0.09518083184957504,
-0.12187882512807846,
-0.04435430094599724,
-0.2590256929397583,
0.03014480322599411,
-0.3250749707221985,
0.12642107903957367,
-0.10183188319206238,
-0.07472480833530426,
0.6069639325141907,
0.023241925984621048,
0.1222371906042099,
0.009226001799106598,
-0.11652461439371109,
-0.22028246521949768,
-0.30111008882522583,
0.14097754657268524,
0.4337860345840454,
-0.17163197696208954,
0.05729072540998459,
-0.19724729657173157,
-0.14594267308712006,
-0.014296400360763073,
0.08436798304319382,
-0.1975213587284088,
-0.3192427158355713,
-0.22877486050128937,
-0.25092485547065735,
-0.09132352471351624,
-0.06994673609733582,
-0.031239371746778488,
0.08998291194438934,
-0.1893196851015091,
-0.03367125242948532,
0.07813498377799988,
-0.455863893032074,
0.47230520844459534,
-0.21089611947536469,
-0.3395943343639374,
-0.13597413897514343,
0.5322208404541016,
-0.1145186498761177,
0.03262363746762276,
-0.5003731846809387,
0.34201210737228394,
0.36071130633354187,
0.3470224440097809,
-0.34384703636169434,
0.2912892997264862,
-0.4892374277114868,
-0.10786023736000061,
-0.10973010957241058,
0.39856991171836853,
0.14680686593055725,
-0.09291127324104309,
-0.021121060475707054,
-0.05167122557759285
] |
https://github.com/huggingface/datasets/issues/5575 | Metadata for each column | Hi! Indeed it would be useful to support this. PyArrow natively supports schema-level and column-level metadata, so implementing this should be straightforward. The API I have in mind would work as follows:
```python
col_feature = Value("string", metadata="Some column-level metadata")
features = Features({"col": col_feature}, metadata="Some schema-level metadata")
```
WDYT? | ### Feature request
Being able to put some metadata for each column as a string or any other type.
### Motivation
I will bring the motivation by an example, lets say we are experimenting with embedding produced by some image encoder network, and we want to iterate through a couple of preprocessing and see which one works better in our downstream task, here as workaround right now what I do is the compute the hash of the preprocessing that the images went through as part of the new columns name, it would be nice to attach some kinda meta data in these scenarios to the each columns. metadata
### Your contribution
Maybe we could map another relational like database as the metadata? | 48 | Metadata for each column
### Feature request
Being able to put some metadata for each column as a string or any other type.
### Motivation
I will bring the motivation by an example, lets say we are experimenting with embedding produced by some image encoder network, and we want to iterate through a couple of preprocessing and see which one works better in our downstream task, here as workaround right now what I do is the compute the hash of the preprocessing that the images went through as part of the new columns name, it would be nice to attach some kinda meta data in these scenarios to the each columns. metadata
### Your contribution
Maybe we could map another relational like database as the metadata?
Hi! Indeed it would be useful to support this. PyArrow natively supports schema-level and column-level metadata, so implementing this should be straightforward. The API I have in mind would work as follows:
```python
col_feature = Value("string", metadata="Some column-level metadata")
features = Features({"col": col_feature}, metadata="Some schema-level metadata")
```
WDYT? | [
0.31374481320381165,
0.20439878106117249,
-0.04834020137786865,
-0.16208350658416748,
0.5069150328636169,
0.16051587462425232,
0.21719485521316528,
0.35996705293655396,
-0.42453205585479736,
0.15107227861881256,
0.16561944782733917,
0.3521377742290497,
-0.2388565093278885,
0.4132709503173828,
0.16718684136867523,
-0.5080682039260864,
0.09846759587526321,
0.20880654454231262,
0.09775085747241974,
0.34851735830307007,
-0.07810662686824799,
-0.03097064234316349,
0.2159533053636551,
0.09751173853874207,
-0.23759673535823822,
0.07128055393695831,
-0.3630654513835907,
-0.19098353385925293,
-0.27172890305519104,
-0.39055633544921875,
-0.3463227450847626,
0.05120948702096939,
0.09739868342876434,
-0.04405995458364487,
-0.0001160211322712712,
-0.1631259322166443,
0.01646379381418228,
-0.09719274193048477,
-0.19057318568229675,
-0.2884923219680786,
0.18880003690719604,
-0.21654479205608368,
0.040111422538757324,
-0.3158109188079834,
0.11060062795877457,
-0.19377277791500092,
-0.17293918132781982,
-0.16843992471694946,
-0.21897916495800018,
-0.06717599928379059,
0.15221506357192993,
-0.03788556903600693,
0.18351151049137115,
0.1427200585603714,
0.6907685399055481,
0.3538395166397095,
-0.4306078255176544,
0.15064626932144165,
0.43423664569854736,
-0.2936714291572571,
0.1905299723148346,
0.35492774844169617,
-0.17565417289733887,
-0.15978647768497467,
0.2843455970287323,
0.4772043526172638,
0.24242302775382996,
-0.031092792749404907,
0.03754948824644089,
0.09753777086734772,
0.4884093999862671,
-0.42350390553474426,
-0.3836198151111603,
-0.07049412280321121,
0.047221481800079346,
-0.32528921961784363,
-0.14868107438087463,
0.5607177019119263,
0.08393222093582153,
0.14656195044517517,
0.022621238604187965,
0.16072684526443481,
-0.1171882152557373,
0.07657019048929214,
-0.13988424837589264,
0.4515035152435303,
0.10049232840538025,
-0.006327830255031586,
-0.14511948823928833,
-0.06717429310083389,
-0.02681136503815651,
0.11731507629156113,
0.08129933476448059,
0.28331172466278076,
0.11219348013401031,
-0.21559420228004456,
-0.030704990029335022,
-0.10990748554468155,
0.017033759504556656,
0.05920206010341644,
0.08177964389324188,
-0.11869574338197708,
0.06165280565619469,
0.23427802324295044,
0.07047952711582184,
-0.3097245395183563,
0.1480749249458313,
-0.273674339056015,
0.21656042337417603,
-0.32292982935905457,
0.19432981312274933,
-0.20293498039245605,
0.05154692381620407,
0.6057829260826111,
0.2073393017053604,
-0.0726027712225914,
0.2515793442726135,
0.07847908139228821,
0.037956953048706055,
0.12985147535800934,
-0.3344212770462036,
-0.02565610222518444,
-0.28302261233329773,
0.02617032825946808,
0.01415997464209795,
-0.14661124348640442,
-0.10280586034059525,
0.16961519420146942,
0.45426177978515625,
-0.1039680540561676,
0.05088707432150841,
0.19704943895339966,
-0.11167123168706894,
0.40317368507385254,
0.13384513556957245,
-0.05554228648543358,
0.051323696970939636,
0.08742343634366989,
0.0643363744020462,
-0.22209763526916504,
0.11241064965724945,
-0.00932769663631916,
-0.045099176466464996,
0.2282378226518631,
-0.18559561669826508,
-0.09605872631072998,
-0.013810131698846817,
-0.015512119978666306,
-0.5228541493415833,
0.21977978944778442,
-0.23035630583763123,
-0.17714975774288177,
-0.4428814649581909,
0.09359657764434814,
0.0492992177605629,
-0.10490782558917999,
0.06433764100074768,
0.04223532974720001,
0.1130596399307251,
0.1374633014202118,
0.15588632225990295,
0.3276013731956482,
0.009567555040121078,
-0.4783717095851898,
-0.1799355149269104,
-0.12365992367267609,
-0.33215856552124023,
-0.059217117726802826,
0.5393032431602478,
0.2229081243276596,
-0.09771733731031418,
-0.15550653636455536,
-0.0022184939589351416,
0.15289565920829773,
0.218147411942482,
0.3580893874168396,
0.17351341247558594,
-0.29587221145629883,
0.2611900568008423,
0.09364966303110123,
0.10509270429611206,
0.08166530728340149,
0.18393954634666443,
0.21194812655448914,
0.13661891222000122,
0.007200836669653654,
0.21897444128990173,
0.38214629888534546,
-0.17420682311058044,
0.25219276547431946,
0.18563078343868256,
-0.2937963306903839,
-0.12822648882865906,
0.2663727402687073,
-0.08397082984447479,
-0.08003485947847366,
0.042094480246305466,
-0.4710957109928131,
0.14568671584129333,
-0.35114312171936035,
0.16126415133476257,
-0.006017401814460754,
0.3084070384502411,
0.38658708333969116,
-0.05525318533182144,
-0.5132192969322205,
-0.25721654295921326,
-0.0124861691147089,
0.2365792691707611,
0.3728945851325989,
-0.6054110527038574,
-0.601643443107605,
0.0910760760307312,
0.15002650022506714,
0.18339991569519043,
0.20063865184783936,
0.13108810782432556,
-0.08449356257915497,
-0.1229727566242218,
-0.05146067216992378,
-0.34065961837768555,
-0.06524357199668884,
0.005290506407618523,
0.05729474127292633,
0.12618155777454376,
0.16615429520606995,
0.06970551609992981,
-0.27181491255760193,
-0.15583831071853638,
0.44613897800445557,
-0.10679518431425095,
0.09768622368574142,
0.4216594099998474,
0.15864816308021545,
0.02131783217191696,
0.04944480583071709,
-0.18855562806129456,
0.8389525413513184,
0.024284714832901955,
0.1685532182455063,
0.14343596994876862,
-0.3034127354621887,
0.01743052527308464,
-0.13758060336112976,
-0.29096582531929016,
0.4719703197479248,
-0.04887765273451805,
0.27228236198425293,
-0.0818202942609787,
0.023388316854834557,
0.08830096572637558,
0.034107085317373276,
-0.36775314807891846,
-0.1757013350725174,
-0.2953197658061981,
0.07062132656574249,
-0.1723128855228424,
0.0529584176838398,
-0.26181894540786743,
0.1806233823299408,
0.3776546120643616,
-0.2057371884584427,
0.27273815870285034,
-0.013942785561084747,
-0.1447599232196808,
0.061432547867298126,
-0.02862066961824894,
-0.46560928225517273,
0.26226192712783813,
0.18682731688022614,
-0.04370160773396492,
0.062325604259967804,
-0.06611347943544388,
0.09519977867603302,
0.08683156222105026,
0.1198444664478302,
0.20889706909656525,
0.000097617506980896,
0.4655114412307739,
0.1536995768547058,
0.0626055896282196,
-0.07905789464712143,
-0.013436726294457912,
-0.021416665986180305,
-0.26158973574638367,
0.1116018071770668,
-0.10885406285524368,
0.18471059203147888,
0.12547343969345093,
-0.7706852555274963,
-0.06899194419384003,
-0.29189610481262207,
0.1747075766324997,
0.0321175679564476,
-0.06031746789813042,
-0.08778887987136841,
-0.2202436476945877,
0.4431167542934418,
-0.014222046360373497,
-0.350955605506897,
-0.11794282495975494,
-0.509846568107605,
0.2833717465400696,
0.006217308342456818,
-0.04835360124707222,
-0.2082393914461136,
0.4582250416278839,
0.11825978010892868,
0.1287686824798584,
-0.2360256016254425,
-0.6518945097923279,
0.14514021575450897,
-0.3169521689414978,
0.17109304666519165,
0.16658097505569458,
0.1814010739326477,
0.2968461513519287,
-0.24105209112167358,
0.19751973450183868,
0.2631756067276001,
-0.08094397187232971,
0.06586959213018417,
0.16093145310878754,
-0.0007568380096927285,
-0.16758432984352112,
0.17603379487991333,
-0.43589872121810913,
-0.11643914878368378,
0.3996143937110901,
-0.08403608202934265,
0.2936185300350189,
-0.20702648162841797,
-0.1577378362417221,
-0.45798811316490173,
-0.37388861179351807,
0.17173252999782562,
0.017644302919507027,
-0.24410352110862732,
0.15312086045742035,
-0.23504552245140076,
-0.07544070482254028,
0.007201690226793289,
0.08562720566987991,
-0.07675646245479584,
0.19186411798000336,
0.0346672460436821,
-0.42191988229751587,
0.13298900425434113,
0.4875248670578003,
0.05581013113260269,
-0.03532212972640991,
0.31108835339546204,
0.45673754811286926,
-0.014883127994835377,
0.1525801420211792,
-0.2465871125459671,
-0.1692950427532196,
0.1798127293586731,
-0.22569340467453003,
0.17413300275802612,
0.2226487100124359,
0.09392236173152924,
0.044885508716106415,
-0.4826148450374603,
-0.17941759526729584,
0.2769903540611267,
-0.32550162076950073,
-0.07635146379470825,
-0.03457745909690857,
-0.12281370908021927,
-0.253665566444397,
-0.3506319224834442,
0.09274851530790329,
0.24731341004371643,
0.08482033014297485,
-0.13202056288719177,
-0.031053906306624413,
0.18325388431549072,
-0.36045387387275696,
-0.1169658899307251,
0.38661932945251465,
-0.06272777169942856,
0.45235908031463623,
-0.23350682854652405,
-0.12629258632659912,
-0.23178642988204956,
-0.2414059042930603,
0.22936712205410004,
0.04061877354979515,
-0.00866670161485672,
-0.16065703332424164,
-0.0514313168823719,
-0.11978748440742493,
0.004500187933444977,
0.05960080027580261,
0.3142513334751129,
-0.17103543877601624,
0.03857015445828438,
-0.17432162165641785,
0.12929551303386688,
0.01103682816028595,
0.21565166115760803,
-0.21944354474544525,
-0.28496265411376953,
-0.025670304894447327,
0.06328590959310532,
0.09275274723768234,
-0.22884050011634827,
-0.12733493745326996,
-0.02160661295056343,
-0.0687180906534195,
0.7039300203323364,
-0.24746173620224,
-0.040327344089746475,
0.5249207019805908,
-0.23008500039577484,
-0.12395185232162476,
-0.33909091353416443,
-0.16246555745601654,
-0.2000764012336731,
0.032178543508052826,
-0.17707526683807373,
-0.013421677052974701,
0.2836245000362396,
0.1102411225438118,
-0.03833656758069992,
-0.10227320343255997,
0.15374231338500977,
0.2564564347267151,
0.1165478527545929,
-0.26918157935142517,
-0.0978119745850563,
-0.031144285574555397,
-0.11790840327739716,
0.18437540531158447,
0.10483524203300476,
0.1303005814552307,
-0.12248577177524567,
-0.14898155629634857,
-0.12472120672464371,
-0.38796353340148926,
0.6633894443511963,
0.11959245800971985,
0.23495309054851532,
0.41231009364128113,
-0.4669548571109772,
-0.1316785365343094,
-0.7129158973693848,
-0.3219168484210968,
0.32349005341529846,
-0.15551960468292236,
-0.045193418860435486,
-0.271352082490921,
0.8301065564155579,
0.25933998823165894,
-0.14610274136066437,
-0.15199971199035645,
0.3963318467140198,
-0.2044321745634079,
0.4111030697822571,
0.4229796826839447,
1.1230077743530273,
-0.2772468328475952,
0.45274049043655396,
0.04214433580636978,
-0.36177921295166016,
0.24771471321582794,
-0.5346390604972839,
0.14967407286167145,
-0.4131448268890381,
-0.1207154244184494,
-0.30438196659088135,
0.009970013052225113,
0.1703416109085083,
0.2117685228586197,
-0.16518136858940125,
-0.17893968522548676,
-0.2591363191604614,
0.46316513419151306,
0.20219843089580536,
-0.11835741996765137,
-0.0799742341041565,
-0.3157823383808136,
-0.3101259469985962,
0.033649228513240814,
-0.03119310736656189,
-0.24555900692939758,
-0.029099106788635254,
-0.20704440772533417,
-0.2757668197154999,
0.13036715984344482,
-0.13568320870399475,
-0.1304052174091339,
0.22225657105445862,
-0.08348726481199265,
0.06001398339867592,
0.11345067620277405,
-0.2935202717781067,
-0.2616345286369324,
0.05111777409911156,
-0.06669096648693085,
-0.04783747345209122,
-0.08023463189601898,
-0.031165190041065216,
0.00609244080260396,
0.053398698568344116,
0.025208842009305954,
0.08969254791736603,
0.1613643765449524,
-0.19270148873329163,
0.424263060092926,
0.17935466766357422,
-0.18488463759422302,
-0.4663681089878082,
-0.07769665122032166,
0.0319056361913681,
-0.2807352542877197,
-0.07112938165664673,
-0.08101165294647217,
0.09130614995956421,
-0.03063681721687317,
0.11721400916576385,
-0.0022764429450035095,
-0.05220731720328331,
0.4016147553920746,
-0.1890101283788681,
-0.02919529750943184,
-0.024454452097415924,
-0.0037473514676094055,
0.045807551592588425,
0.017720408737659454,
-0.018408682197332382,
-0.027595985680818558,
-0.2550777792930603,
-0.029276452958583832,
0.010270930826663971,
-0.05729006230831146,
-0.0806620791554451,
-0.21040669083595276,
0.2540798485279083,
-0.15270747244358063,
-0.0922819972038269,
0.28773605823516846,
0.15960906445980072,
0.004132978618144989,
-0.04884925112128258,
-0.2324100136756897,
-0.029632121324539185,
0.47050100564956665,
0.2555657625198364,
0.1916310340166092,
-0.06656679511070251,
0.14759300649166107,
-0.24487650394439697,
0.3865854740142822,
-0.2979021668434143,
-0.24496476352214813,
0.21567414700984955,
0.1316642165184021,
0.30466094613075256,
0.07376673817634583,
-0.11315484344959259,
0.06840150058269501,
0.15148195624351501,
0.047330379486083984,
0.21388386189937592,
-0.11012526601552963,
-0.19094428420066833,
0.13446304202079773,
0.05040266364812851,
0.4019530415534973,
0.06219255551695824,
0.04814229905605316,
-0.2106294184923172,
-0.2911630868911743,
0.11412669718265533,
0.20131537318229675,
-0.03607366979122162,
0.14658182859420776,
0.2722634971141815,
0.2712821364402771,
-0.07443840801715851,
0.08287784457206726,
0.09289474040269852,
0.22670778632164001,
0.15446293354034424,
0.09731864929199219,
-0.45504263043403625,
0.11977486312389374,
0.31746530532836914,
0.3659551739692688,
0.09489212185144424,
-0.36515891551971436,
0.4044739902019501,
0.09352265298366547,
-0.016061803326010704,
-0.1695825755596161,
0.26564836502075195,
0.04128199815750122,
-0.17633824050426483,
0.03545655310153961,
0.08731832355260849,
0.1783810555934906,
-0.1539216935634613,
-0.14102619886398315,
-0.06553927063941956,
0.021759329363703728,
0.10355678200721741,
0.41795143485069275,
0.40699851512908936,
0.4364783763885498,
-0.22946010529994965,
-0.1821039915084839,
0.35372164845466614,
-0.0027780719101428986,
-0.5180044174194336,
0.3266274631023407,
0.21843497455120087,
0.022796232253313065,
0.4009232521057129,
0.19469156861305237,
0.20476040244102478,
-0.15766948461532593,
0.01369079202413559,
0.15943582355976105,
0.2785707414150238,
-0.2953720688819885,
0.14716701209545135,
0.1592397689819336,
0.08590178191661835,
0.08711227774620056,
0.5711953639984131,
-0.0017119348049163818,
0.10256171971559525,
0.18788309395313263,
0.46144899725914,
-0.01710757240653038,
-0.13845905661582947,
0.3784608244895935,
0.0666324719786644,
-0.351735383272171,
-0.03718061372637749,
-0.10623490810394287,
-0.11247605085372925,
-0.2711787521839142,
-0.050954367965459824,
-0.37508630752563477,
0.6289637088775635,
-0.05882933735847473,
0.41527044773101807,
-0.16191114485263824,
-0.008163344115018845,
0.036570921540260315,
0.4250326454639435,
-0.10631394386291504,
-0.023363245651125908,
0.01636461913585663,
0.03898056223988533,
-0.028983224183321,
-0.09308528155088425,
0.29596224427223206,
0.36746910214424133,
-0.0836966335773468,
0.37878066301345825,
-0.6709499359130859,
-0.10389325022697449,
0.20279234647750854,
0.0714365541934967,
0.2873193025588989,
0.13325798511505127,
-0.0270388163626194,
0.11736972630023956,
-0.02722788043320179,
0.05679049342870712,
0.14542700350284576,
0.17072723805904388,
0.17340700328350067,
0.22411422431468964,
0.38652393221855164,
-0.4884513318538666,
0.285205602645874,
-0.018194496631622314,
-0.24486234784126282,
-0.30587470531463623,
0.3566235303878784,
0.37244200706481934,
0.009106742218136787,
0.3536109924316406,
0.06027569621801376,
0.30893194675445557,
0.15849968791007996,
0.392723023891449,
0.20755401253700256,
-0.14632566273212433,
0.011556945741176605,
-0.15363682806491852,
-0.1311694085597992,
-0.40386638045310974,
-0.49835488200187683,
0.15732981264591217,
-0.005666624754667282,
0.5706347823143005,
0.2120741307735443,
-0.2981119751930237,
-0.21917343139648438,
-0.11678484827280045,
0.26248204708099365,
-0.3499967157840729,
-0.050452861934900284,
0.22757947444915771,
0.03280176222324371,
-0.1652582734823227,
0.11135493963956833,
-0.04408017918467522,
0.14171361923217773,
0.06623409688472748,
-0.623538613319397,
0.2192704677581787,
0.14484716951847076,
0.08783920109272003,
0.25585198402404785,
-0.47271519899368286,
0.2660753130912781,
-0.0421019047498703,
-0.057485952973365784,
-0.10488727688789368,
0.08131382614374161,
-0.11005360633134842,
0.08132109045982361,
0.03371896967291832,
-0.24292844533920288,
0.005775636062026024,
-0.15049926936626434,
-0.21803610026836395,
0.10556118935346603,
-0.38839781284332275,
-0.16008307039737701,
-0.16397370398044586,
-0.04631805419921875,
0.12191764265298843,
-0.1148223727941513,
-0.2764779031276703,
-0.026484839618206024,
-0.06696194410324097,
0.30268892645835876,
-0.05360005795955658,
-0.30563104152679443,
0.27062132954597473,
-0.017600208520889282,
-0.3742041289806366,
0.12176508456468582,
0.04958861321210861,
-0.12830471992492676,
0.2560425102710724,
-0.5302765965461731,
0.030228756368160248,
0.39131441712379456,
0.016951346769928932,
0.02828017622232437,
0.299740195274353,
0.18134477734565735,
-0.16634653508663177,
-0.2743378281593323,
-0.31382906436920166,
-0.25220876932144165,
0.262358158826828,
-0.760342538356781,
-0.4503679871559143
] |
https://github.com/huggingface/datasets/issues/5575 | Metadata for each column | Sorry for the late reply,
Yes, I think this is the most straight-forward approach with the things that we already have.
| ### Feature request
Being able to put some metadata for each column as a string or any other type.
### Motivation
I will bring the motivation by an example, lets say we are experimenting with embedding produced by some image encoder network, and we want to iterate through a couple of preprocessing and see which one works better in our downstream task, here as workaround right now what I do is the compute the hash of the preprocessing that the images went through as part of the new columns name, it would be nice to attach some kinda meta data in these scenarios to the each columns. metadata
### Your contribution
Maybe we could map another relational like database as the metadata? | 21 | Metadata for each column
### Feature request
Being able to put some metadata for each column as a string or any other type.
### Motivation
I will bring the motivation by an example, lets say we are experimenting with embedding produced by some image encoder network, and we want to iterate through a couple of preprocessing and see which one works better in our downstream task, here as workaround right now what I do is the compute the hash of the preprocessing that the images went through as part of the new columns name, it would be nice to attach some kinda meta data in these scenarios to the each columns. metadata
### Your contribution
Maybe we could map another relational like database as the metadata?
Sorry for the late reply,
Yes, I think this is the most straight-forward approach with the things that we already have.
| [
0.2485368698835373,
0.05798117816448212,
-0.11101052165031433,
-0.08875031769275665,
0.3689016103744507,
0.15508323907852173,
0.22258585691452026,
0.36999601125717163,
-0.23646502196788788,
0.30512604117393494,
0.2991870939731598,
0.3311542272567749,
-0.22174367308616638,
0.43635693192481995,
0.09814350306987762,
-0.38717854022979736,
0.08052140474319458,
0.18042749166488647,
-0.09749051928520203,
0.3854851722717285,
-0.03984389454126358,
-0.046439751982688904,
0.28949683904647827,
-0.05488291382789612,
-0.2690216302871704,
0.12952901422977448,
-0.33968082070350647,
-0.35414600372314453,
-0.20722903311252594,
-0.41014352440834045,
-0.5343249440193176,
0.2584684193134308,
0.114543616771698,
-0.012536406517028809,
-0.00010650784679455683,
-0.29146808385849,
0.005353968590497971,
-0.14920687675476074,
-0.27657127380371094,
-0.1965359002351761,
-0.22662517428398132,
-0.30847206711769104,
0.04459656774997711,
-0.30658572912216187,
0.06300549954175949,
0.057222943753004074,
-0.14147913455963135,
-0.35521605610847473,
-0.26795607805252075,
-0.19117100536823273,
0.24434195458889008,
-0.18144601583480835,
-0.051371000707149506,
-0.01860135607421398,
0.47408971190452576,
0.5058501958847046,
-0.42841967940330505,
0.035412974655628204,
0.5151962637901306,
-0.060119956731796265,
0.12198506295681,
0.6304017305374146,
-0.032531946897506714,
-0.18739110231399536,
0.21231681108474731,
0.3165471851825714,
0.29703474044799805,
0.06962990760803223,
0.09195256233215332,
0.2722194194793701,
0.6086833477020264,
-0.1859549582004547,
-0.27206191420555115,
0.0027809590101242065,
0.13923034071922302,
-0.2775890827178955,
-0.15776163339614868,
0.3470732867717743,
0.2503700852394104,
0.13547979295253754,
-0.05594327673316002,
-0.01107962615787983,
-0.11492165923118591,
-0.06997127830982208,
0.048354633152484894,
0.2186318188905716,
0.0028110863640904427,
-0.11536625772714615,
-0.2078428715467453,
-0.023192308843135834,
-0.04601317271590233,
0.12453244626522064,
0.011089883744716644,
0.0286799855530262,
0.10970397293567657,
-0.2985762357711792,
-0.17764568328857422,
-0.13945868611335754,
0.04685858637094498,
0.1426682472229004,
0.1736043393611908,
-0.06343469023704529,
0.016965989023447037,
0.14942944049835205,
0.049237437546253204,
-0.24429702758789062,
0.24061337113380432,
-0.22070133686065674,
0.15624624490737915,
-0.24753962457180023,
0.014519192278385162,
-0.2747458219528198,
0.14792728424072266,
0.681519627571106,
-0.0716572254896164,
-0.04381950944662094,
0.0876459926366806,
0.039841536432504654,
-0.030557963997125626,
0.15353265404701233,
0.024363361299037933,
-0.02561071142554283,
-0.09785066545009613,
0.08237570524215698,
-0.002265688730403781,
-0.04964233189821243,
0.020343143492937088,
0.02321988344192505,
0.5372830629348755,
-0.27802419662475586,
0.044955018907785416,
0.14922097325325012,
-0.18367765843868256,
0.36075323820114136,
0.11876146495342255,
-0.1777772307395935,
0.047843754291534424,
0.01976430043578148,
0.0399622917175293,
-0.31927138566970825,
0.1438169628381729,
-0.009262069128453732,
0.13201597332954407,
0.021505173295736313,
-0.2799273133277893,
-0.13681292533874512,
-0.02015656977891922,
0.15171509981155396,
-0.4619034230709076,
0.013111639767885208,
-0.2565324902534485,
-0.11470977216959,
-0.49307936429977417,
0.18525046110153198,
0.24220077693462372,
-0.02680893987417221,
0.194774329662323,
0.25270771980285645,
-0.002360619604587555,
0.13086725771427155,
0.203924298286438,
0.4745992422103882,
-0.07822468131780624,
-0.2982490360736847,
-0.28824713826179504,
0.032962895929813385,
-0.1988387256860733,
0.09673501551151276,
0.2681717872619629,
0.15399271249771118,
-0.14232417941093445,
-0.2940446734428406,
-0.007838004268705845,
0.14131970703601837,
0.1887384057044983,
0.14094732701778412,
0.13288335502147675,
-0.15692196786403656,
0.42984241247177124,
0.23018786311149597,
0.006280049681663513,
-0.04179631173610687,
0.2754482626914978,
0.3916392922401428,
0.196829691529274,
-0.06529116630554199,
0.03874332457780838,
0.18874244391918182,
-0.2709767520427704,
0.23517167568206787,
0.1726571023464203,
-0.3780272901058197,
-0.24826006591320038,
0.1916889250278473,
-0.09982515871524811,
0.021300964057445526,
0.10634618252515793,
-0.2881198823451996,
-0.003756903111934662,
-0.22925424575805664,
0.16032180190086365,
-0.03660865128040314,
0.1005757600069046,
0.31184571981430054,
-0.12788748741149902,
-0.4176618456840515,
-0.2665298581123352,
-0.09193727374076843,
0.2586963176727295,
0.17252206802368164,
-0.16685070097446442,
-0.5518927574157715,
0.03932395577430725,
0.15255247056484222,
0.3178679645061493,
0.19720551371574402,
0.2757999300956726,
-0.03914165496826172,
-0.3748818039894104,
-0.17307282984256744,
-0.39687660336494446,
0.26215943694114685,
-0.2440328598022461,
-0.06089377775788307,
0.09954504668712616,
-0.0820908471941948,
0.043914519250392914,
-0.07061038911342621,
-0.06961994618177414,
0.4465145766735077,
-0.1116611436009407,
0.14472223818302155,
0.2988687753677368,
0.13384538888931274,
-0.04068055748939514,
0.10225170105695724,
0.03710835427045822,
0.6814525723457336,
0.050579167902469635,
0.1259194016456604,
0.14878758788108826,
-0.4112216532230377,
-0.07189048826694489,
-0.12760856747627258,
-0.48502835631370544,
0.358955055475235,
-0.1871386617422104,
0.3050641417503357,
-0.0782792866230011,
0.052123792469501495,
0.09894919395446777,
-0.014566678553819656,
-0.3672337830066681,
-0.3969334661960602,
-0.27203142642974854,
0.16057085990905762,
-0.15309594571590424,
0.10533053427934647,
-0.21923837065696716,
0.2197968065738678,
0.29671135544776917,
-0.024409634992480278,
0.27530109882354736,
0.18354162573814392,
-0.007296547293663025,
-0.018577203154563904,
-0.017149103805422783,
-0.23692162334918976,
0.19197285175323486,
0.21874336898326874,
0.04110024869441986,
-0.039970919489860535,
-0.001535777933895588,
0.024215105921030045,
0.17514590919017792,
0.09782104194164276,
0.01788618229329586,
-0.0008451826870441437,
0.18967095017433167,
0.16412211954593658,
0.10837983340024948,
-0.18990804255008698,
0.017797665670514107,
-0.009069560095667839,
-0.08547763526439667,
-0.037156809121370316,
-0.1348673552274704,
0.08553896099328995,
0.1792408525943756,
-0.4931078553199768,
0.00494736060500145,
-0.3288649618625641,
0.24534283578395844,
-0.07895152270793915,
-0.13785170018672943,
-0.10711038112640381,
-0.25149527192115784,
0.7330605983734131,
-0.1537354737520218,
0.13423562049865723,
-0.19841918349266052,
-0.47244688868522644,
0.3336486518383026,
0.07849946618080139,
-0.0939367413520813,
-0.10620435327291489,
0.6449023485183716,
0.08615177124738693,
0.29616791009902954,
-0.373764306306839,
-0.5499107837677002,
0.10703045129776001,
-0.17954811453819275,
0.008801158517599106,
0.11918771266937256,
0.24235126376152039,
0.18536128103733063,
-0.31275200843811035,
-0.019866397604346275,
0.2310122847557068,
-0.02487165480852127,
-0.0028756223618984222,
0.24234160780906677,
0.044372741132974625,
-0.13489694893360138,
0.014662034809589386,
-0.2647051215171814,
-0.28383946418762207,
0.24203771352767944,
-0.24143220484256744,
0.3588448166847229,
-0.23560290038585663,
-0.23741468787193298,
-0.3296411335468292,
-0.4386541247367859,
0.3779929280281067,
-0.18192753195762634,
-0.25152289867401123,
-0.017184343189001083,
-0.3065274953842163,
0.01523551531136036,
-0.05318775773048401,
0.1773194968700409,
0.03789642080664635,
0.041266750544309616,
0.006137080490589142,
-0.135406956076622,
0.2231309413909912,
0.17557525634765625,
0.06930556148290634,
-0.10220929980278015,
0.2717631757259369,
0.39167124032974243,
-0.16075259447097778,
0.11421621590852737,
-0.1658669412136078,
-0.11629394441843033,
0.004440993070602417,
-0.14317670464515686,
0.20300891995429993,
0.2790862023830414,
0.008457481861114502,
-0.10244129598140717,
-0.24360138177871704,
-0.25362130999565125,
0.24156716465950012,
-0.15478622913360596,
0.13727419078350067,
-0.07706182450056076,
-0.113918237388134,
-0.20860546827316284,
-0.13380339741706848,
0.17869040369987488,
0.28337180614471436,
0.06320375204086304,
-0.07359281182289124,
-0.07694237679243088,
0.30135804414749146,
-0.2720593214035034,
-0.03355283662676811,
0.40501633286476135,
-0.2941511869430542,
0.4102458953857422,
-0.3296039402484894,
-0.22818851470947266,
-0.20560617744922638,
-0.0804731473326683,
0.21247023344039917,
0.14255020022392273,
0.07009394466876984,
-0.30325907468795776,
-0.019202327355742455,
-0.09685241430997849,
0.09164108335971832,
0.06507818400859833,
0.255966454744339,
0.0208606980741024,
-0.20405082404613495,
-0.14049407839775085,
0.04731187969446182,
0.19336923956871033,
0.11254531890153885,
-0.4473799467086792,
-0.5133541226387024,
-0.10534259676933289,
0.04054027050733566,
0.3473537564277649,
-0.05662962794303894,
0.040258463472127914,
-0.06374190002679825,
-0.08660465478897095,
0.6394204497337341,
-0.19977426528930664,
-0.12883803248405457,
0.768236517906189,
-0.2725781500339508,
-0.12442687153816223,
-0.39481407403945923,
0.012204784899950027,
0.043182626366615295,
0.0994340032339096,
-0.13739556074142456,
-0.05833002179861069,
0.047475721687078476,
0.12302196025848389,
-0.16889449954032898,
-0.15774330496788025,
0.0743391141295433,
0.23425516486167908,
0.11681453883647919,
-0.2766628563404083,
0.11869201809167862,
0.040061380714178085,
-0.04547999054193497,
0.21016228199005127,
-0.04311768710613251,
-0.04684557020664215,
-0.3028958737850189,
0.06450102478265762,
0.053831566125154495,
-0.5319137573242188,
0.5768340229988098,
0.30899578332901,
0.2874252200126648,
0.5617600679397583,
-0.44329506158828735,
-0.13735778629779816,
-0.6860140562057495,
-0.2701207399368286,
0.17890730500221252,
-0.2328842729330063,
-0.052881959825754166,
-0.2835714817047119,
0.7822747230529785,
0.13980092108249664,
-0.14357724785804749,
0.02138230949640274,
0.21170073747634888,
-0.12535600364208221,
0.34613561630249023,
0.39053571224212646,
1.1026664972305298,
-0.20177783071994781,
0.17976273596286774,
-0.1956338882446289,
-0.3394817113876343,
0.2123350352048874,
-0.5112846493721008,
-0.028767388314008713,
-0.3109895586967468,
-0.2984692454338074,
-0.26950541138648987,
0.06700609624385834,
0.19397443532943726,
0.22061794996261597,
-0.2408815175294876,
-0.22013045847415924,
-0.07879338413476944,
0.34325167536735535,
0.019841881468892097,
0.10365533828735352,
-0.10624757409095764,
-0.43884119391441345,
-0.13802698254585266,
0.11085569858551025,
-0.08579155802726746,
-0.3757009208202362,
-0.04932404309511185,
-0.1295369565486908,
-0.0011263005435466766,
0.23730672895908356,
-0.16908659040927887,
-0.181350976228714,
0.37829074263572693,
-0.08903321623802185,
-0.02201196178793907,
0.15727019309997559,
-0.09581990540027618,
-0.311955064535141,
0.34620052576065063,
0.10190697014331818,
-0.1266745775938034,
-0.10929124057292938,
-0.03444170206785202,
0.16160254180431366,
0.014039707370102406,
-0.08520971238613129,
0.15012602508068085,
0.15518057346343994,
-0.05217457562685013,
0.3030637800693512,
0.17250165343284607,
-0.25653937458992004,
-0.3558262288570404,
-0.07585747539997101,
0.1352008581161499,
-0.2457192838191986,
-0.014379335567355156,
0.1263078898191452,
-0.09792391955852509,
-0.10504195094108582,
0.19910793006420135,
0.1249171644449234,
-0.0386500284075737,
0.39939191937446594,
0.013918701559305191,
-0.02189328521490097,
-0.029775552451610565,
0.019771642982959747,
0.0890401303768158,
-0.27781254053115845,
-0.15177898108959198,
-0.0800062045454979,
-0.2844553291797638,
-0.2191600799560547,
0.12550446391105652,
0.006635310593992472,
-0.01373574510216713,
-0.1445446014404297,
0.1293603777885437,
-0.3356134295463562,
-0.07099190354347229,
0.23156209290027618,
0.25879567861557007,
0.058604590594768524,
-0.056126829236745834,
-0.09323763847351074,
-0.18021631240844727,
0.4017086625099182,
0.07919518649578094,
0.36990517377853394,
-0.23532867431640625,
-0.21884670853614807,
-0.256679892539978,
0.4868002235889435,
-0.3871304988861084,
-0.330405592918396,
0.14764800667762756,
0.20944426953792572,
0.31482332944869995,
0.09250305593013763,
-0.19401006400585175,
0.033935341984033585,
0.1667259931564331,
-0.015447098761796951,
0.13055682182312012,
-0.1710754930973053,
-0.14540351927280426,
0.11156497895717621,
-0.007970105856657028,
0.5035526156425476,
-0.1086793839931488,
0.06322100013494492,
-0.3055611252784729,
-0.28975963592529297,
0.036724578589200974,
0.052822791039943695,
-0.09078377485275269,
0.10141420364379883,
0.11005298793315887,
0.23538976907730103,
0.047502487897872925,
0.10300019383430481,
0.16566577553749084,
0.3311377465724945,
0.12352123856544495,
-0.09302274882793427,
-0.48436471819877625,
0.0032820701599121094,
0.19005557894706726,
0.40723562240600586,
0.021864652633666992,
-0.3322076201438904,
0.38906097412109375,
0.3313106894493103,
0.09199036657810211,
0.0910867378115654,
0.0786811113357544,
-0.06750498712062836,
-0.16960830986499786,
-0.006255866959691048,
0.08684582263231277,
0.27820733189582825,
-0.033494070172309875,
-0.02767854928970337,
-0.08160409331321716,
-0.02383824810385704,
0.19693830609321594,
0.39168620109558105,
0.5035295486450195,
0.4083302319049835,
-0.01722896099090576,
-0.17370405793190002,
0.14196310937404633,
-0.2711559534072876,
-0.33635205030441284,
0.17329750955104828,
0.2534915506839752,
0.05472062528133392,
0.355352520942688,
0.20664915442466736,
0.11523094028234482,
-0.19892345368862152,
0.08329717814922333,
0.2432013899087906,
0.37460795044898987,
-0.1168120801448822,
0.2392101287841797,
0.19685137271881104,
0.31800511479377747,
0.17228509485721588,
0.356823205947876,
0.08291060477495193,
0.14806851744651794,
-0.03953629732131958,
0.20559437572956085,
0.021090969443321228,
-0.2866716682910919,
0.16116628050804138,
0.038251858204603195,
-0.2561396062374115,
-0.14006274938583374,
-0.06284909695386887,
-0.17806461453437805,
-0.336727499961853,
0.09573907405138016,
-0.12767495214939117,
0.5893815755844116,
0.10322633385658264,
0.409271240234375,
-0.05096219480037689,
0.13838064670562744,
0.08319394290447235,
0.4815851151943207,
-0.26523762941360474,
-0.10102485865354538,
-0.09123900532722473,
0.19240054488182068,
0.16846834123134613,
0.13902176916599274,
-0.012402188032865524,
0.3592780530452728,
0.11785443127155304,
0.2329445332288742,
-0.4686397612094879,
-0.19062769412994385,
0.15911239385604858,
0.07838748395442963,
0.1701246201992035,
0.13849729299545288,
-0.014576219953596592,
0.17938818037509918,
-0.05572764575481415,
0.1502997726202011,
0.12585994601249695,
0.1970418095588684,
0.21137529611587524,
0.11097478866577148,
0.5635757446289062,
-0.41655969619750977,
0.18841272592544556,
-0.01954321563243866,
-0.3102686107158661,
-0.38548022508621216,
0.3070342540740967,
0.09869901835918427,
0.03936062008142471,
0.30160006880760193,
0.12867476046085358,
0.3668576180934906,
0.168949156999588,
0.2965039908885956,
-0.1803012490272522,
-0.2381376326084137,
-0.13057419657707214,
-0.044108882546424866,
-0.2514035403728485,
-0.066571444272995,
-0.3239782750606537,
0.21597608923912048,
0.03539662808179855,
0.4219760596752167,
0.20847034454345703,
-0.3650410771369934,
-0.4340455234050751,
0.0076009901240468025,
0.2445087730884552,
-0.37796857953071594,
-0.10470086336135864,
0.3712894320487976,
0.029960885643959045,
-0.10446518659591675,
0.2487202286720276,
-0.0444968082010746,
0.39234405755996704,
0.10929060727357864,
-0.4782400131225586,
0.20183095335960388,
0.11241643130779266,
0.16894814372062683,
0.10931286215782166,
-0.4509444534778595,
0.11766800284385681,
-0.16257360577583313,
-0.05478858947753906,
-0.1469063013792038,
-0.06947340816259384,
-0.013478153385221958,
0.10663251578807831,
0.1744258552789688,
-0.19663970172405243,
0.11517664045095444,
-0.07415537536144257,
-0.19579052925109863,
-0.024673163890838623,
-0.41917526721954346,
-0.005617515649646521,
-0.2901725769042969,
-0.079683318734169,
0.16543570160865784,
0.03845478966832161,
-0.18158775568008423,
-0.09887979179620743,
-0.0023220740258693695,
0.290358304977417,
-0.07401224970817566,
-0.33781757950782776,
0.06689686328172684,
0.22274358570575714,
-0.30511513352394104,
0.15742170810699463,
0.20635870099067688,
-0.01948992908000946,
0.3311190605163574,
-0.5344471335411072,
-0.06791621446609497,
0.3816138803958893,
-0.18430936336517334,
0.08211231231689453,
0.3984854817390442,
0.1159728616476059,
-0.06751596927642822,
-0.3094348907470703,
-0.23566997051239014,
-0.17581936717033386,
0.24816010892391205,
-0.7285663485527039,
-0.3810443878173828
] |
https://github.com/huggingface/datasets/issues/5575 | Metadata for each column | Hi, is this feature to be implemented in the near future? It would be really nice if that would be the case! | ### Feature request
Being able to put some metadata for each column as a string or any other type.
### Motivation
I will bring the motivation by an example, lets say we are experimenting with embedding produced by some image encoder network, and we want to iterate through a couple of preprocessing and see which one works better in our downstream task, here as workaround right now what I do is the compute the hash of the preprocessing that the images went through as part of the new columns name, it would be nice to attach some kinda meta data in these scenarios to the each columns. metadata
### Your contribution
Maybe we could map another relational like database as the metadata? | 22 | Metadata for each column
### Feature request
Being able to put some metadata for each column as a string or any other type.
### Motivation
I will bring the motivation by an example, lets say we are experimenting with embedding produced by some image encoder network, and we want to iterate through a couple of preprocessing and see which one works better in our downstream task, here as workaround right now what I do is the compute the hash of the preprocessing that the images went through as part of the new columns name, it would be nice to attach some kinda meta data in these scenarios to the each columns. metadata
### Your contribution
Maybe we could map another relational like database as the metadata?
Hi, is this feature to be implemented in the near future? It would be really nice if that would be the case! | [
0.24903671443462372,
0.02517630159854889,
-0.07613015174865723,
-0.033065132796764374,
0.40545135736465454,
0.19479331374168396,
0.2185174822807312,
0.3180500864982605,
-0.2768433392047882,
0.30030202865600586,
0.33207178115844727,
0.29961100220680237,
-0.21194390952587128,
0.3685701787471771,
0.06748016923666,
-0.4433993101119995,
0.09232087433338165,
0.19219210743904114,
-0.06954474747180939,
0.4071895480155945,
-0.06450966000556946,
-0.014210442081093788,
0.22967736423015594,
-0.05748105049133301,
-0.2940935492515564,
0.1313548982143402,
-0.34320127964019775,
-0.40788987278938293,
-0.25609734654426575,
-0.34776848554611206,
-0.4712011218070984,
0.20996123552322388,
0.10117398202419281,
0.017161928117275238,
-0.0001128385920310393,
-0.2852376699447632,
0.04503539949655533,
-0.12514451146125793,
-0.24017345905303955,
-0.25537359714508057,
-0.2282569408416748,
-0.22746533155441284,
-0.0077447183430194855,
-0.22690874338150024,
0.06969661265611649,
0.1199384555220604,
-0.23961688578128815,
-0.4077867865562439,
-0.34766876697540283,
-0.14933790266513824,
0.20592553913593292,
-0.20484349131584167,
-0.06400586664676666,
-0.010901731438934803,
0.5345180630683899,
0.5980345010757446,
-0.4170759320259094,
0.02234339527785778,
0.5206424593925476,
-0.07638899236917496,
0.23757392168045044,
0.6223508715629578,
-0.04947676509618759,
-0.2110745757818222,
0.24413958191871643,
0.312431275844574,
0.3403465151786804,
0.043573472648859024,
0.14116355776786804,
0.2847553789615631,
0.7054305672645569,
-0.1763242781162262,
-0.27304980158805847,
0.052786730229854584,
0.12008332461118698,
-0.29835429787635803,
-0.11322557181119919,
0.37713393568992615,
0.2703068256378174,
0.11758407950401306,
-0.05048178508877754,
0.02553652599453926,
-0.03860045224428177,
-0.05174197256565094,
-0.021934080868959427,
0.2575809955596924,
-0.06813821941614151,
-0.11147011071443558,
-0.15349625051021576,
-0.11394159495830536,
-0.09578007459640503,
0.06860034167766571,
-0.04883779212832451,
0.1293928325176239,
0.10525131225585938,
-0.2858583927154541,
-0.19178444147109985,
-0.1792256236076355,
0.0021551065146923065,
0.12068966776132584,
0.14508159458637238,
-0.0974886491894722,
-0.024629000574350357,
0.16857925057411194,
0.03269851207733154,
-0.2902626395225525,
0.25078800320625305,
-0.21000497043132782,
0.13603515923023224,
-0.274273544549942,
0.014973830431699753,
-0.3105751574039459,
0.13989272713661194,
0.7205010056495667,
-0.11811070144176483,
-0.06516250222921371,
0.09929327666759491,
-0.033688560128211975,
-0.05581017583608627,
0.14415450394153595,
-0.01954765059053898,
-0.029413992539048195,
-0.14742453396320343,
0.04319656267762184,
0.029855165630578995,
-0.04518159478902817,
0.0071495212614536285,
0.07673749327659607,
0.5554773807525635,
-0.23044157028198242,
0.040850792080163956,
0.17609435319900513,
-0.18861474096775055,
0.3798379600048065,
0.0844075083732605,
-0.12204301357269287,
0.004146035760641098,
0.07861941307783127,
0.016056887805461884,
-0.3855419456958771,
0.09907132387161255,
-0.04280460253357887,
0.07450778037309647,
0.10014243423938751,
-0.32449647784233093,
-0.09050633013248444,
0.03791561722755432,
0.17995572090148926,
-0.4612569212913513,
0.04721788689494133,
-0.25973355770111084,
-0.07685825228691101,
-0.5169216990470886,
0.1407191902399063,
0.2233525663614273,
-0.019258104264736176,
0.1771019697189331,
0.16501176357269287,
0.011012330651283264,
0.09610368311405182,
0.22096872329711914,
0.4760558009147644,
-0.1008644551038742,
-0.28647422790527344,
-0.30504700541496277,
0.06430051475763321,
-0.20811769366264343,
0.05598416179418564,
0.3010084331035614,
0.21100495755672455,
-0.10910039395093918,
-0.2976701259613037,
-0.004961044527590275,
0.13936075568199158,
0.1645859181880951,
0.1407848596572876,
0.13392257690429688,
-0.1654755026102066,
0.3824937343597412,
0.2892579436302185,
-0.03176259994506836,
0.002857571467757225,
0.2647435963153839,
0.37077078223228455,
0.16566625237464905,
-0.019669827073812485,
0.08681483566761017,
0.2223818600177765,
-0.2010604590177536,
0.1968921422958374,
0.17389792203903198,
-0.36276111006736755,
-0.25377094745635986,
0.1345255821943283,
-0.09185691177845001,
0.12519849836826324,
0.10708756744861603,
-0.28763097524642944,
-0.007694125175476074,
-0.20914095640182495,
0.17281855642795563,
0.002118092030286789,
0.08808667957782745,
0.3452836871147156,
-0.09222999215126038,
-0.4669000506401062,
-0.23024937510490417,
-0.1115785613656044,
0.3446650505065918,
0.16277232766151428,
-0.1856164187192917,
-0.5388012528419495,
0.05975671112537384,
0.11433639377355576,
0.24682512879371643,
0.2511800527572632,
0.1947210729122162,
0.020628079771995544,
-0.3214115500450134,
-0.1319914311170578,
-0.4297660291194916,
0.2589513659477234,
-0.2147359997034073,
-0.06001461297273636,
0.12046323716640472,
-0.03790959715843201,
0.10248491168022156,
-0.09831541031599045,
-0.1587662547826767,
0.40972840785980225,
-0.06951016932725906,
0.20056578516960144,
0.2648009955883026,
0.12541627883911133,
-0.050321292132139206,
0.05108319967985153,
0.012038182467222214,
0.7089434862136841,
0.02294541522860527,
0.10898613929748535,
0.15695425868034363,
-0.44449305534362793,
-0.02807500958442688,
-0.20947420597076416,
-0.49965402483940125,
0.31619542837142944,
-0.22659941017627716,
0.34364384412765503,
-0.09679014980792999,
0.028930289670825005,
0.07368426769971848,
0.009462270885705948,
-0.38457372784614563,
-0.42255550622940063,
-0.24816398322582245,
0.15307816863059998,
-0.19649595022201538,
0.050265729427337646,
-0.19849568605422974,
0.13157692551612854,
0.2559521794319153,
-0.006830984726548195,
0.3385401666164398,
0.1694793552160263,
-0.01984316110610962,
0.04558175057172775,
-0.0717226192355156,
-0.314955472946167,
0.3232038617134094,
0.145151287317276,
0.07716838270425797,
-0.032538995146751404,
0.041491590440273285,
0.005336064845323563,
0.14570128917694092,
0.07842684537172318,
0.036507606506347656,
0.01786595582962036,
0.2386876940727234,
0.2156212329864502,
0.09370482712984085,
-0.16466405987739563,
0.03768637031316757,
-0.0005142521113157272,
-0.11889059841632843,
-0.046264708042144775,
-0.21686306595802307,
0.07960331439971924,
0.09798042476177216,
-0.5929254293441772,
0.005490344017744064,
-0.2853594720363617,
0.15595637261867523,
-0.08280764520168304,
-0.024960115551948547,
-0.1461036056280136,
-0.23735731840133667,
0.7532357573509216,
-0.14548055827617645,
0.09426652640104294,
-0.16207921504974365,
-0.3882768750190735,
0.33551475405693054,
0.030088774859905243,
-0.14360466599464417,
-0.15485277771949768,
0.5611786246299744,
0.1299775242805481,
0.29172438383102417,
-0.36061254143714905,
-0.5600811243057251,
0.047827888280153275,
-0.15512339770793915,
-0.01882568933069706,
0.14298424124717712,
0.26055365800857544,
0.2458481639623642,
-0.25173279643058777,
-0.009678940288722515,
0.3333136737346649,
-0.029636714607477188,
0.0017465706914663315,
0.23152917623519897,
0.07701339572668076,
-0.15102165937423706,
0.14316126704216003,
-0.2671360969543457,
-0.2079159915447235,
0.31451502442359924,
-0.2736007869243622,
0.31792497634887695,
-0.18153852224349976,
-0.24708291888237,
-0.37586331367492676,
-0.5112979412078857,
0.3092597424983978,
-0.13308490812778473,
-0.304789662361145,
-0.015520434826612473,
-0.2914326786994934,
0.0337163470685482,
-0.012843511998653412,
0.19621993601322174,
0.009301207959651947,
0.04376429319381714,
-0.030916552990674973,
-0.11204648017883301,
0.19400911033153534,
0.15315309166908264,
0.012224558740854263,
-0.09011546522378922,
0.28789886832237244,
0.3604133427143097,
-0.09508560597896576,
0.08592038601636887,
-0.2591741979122162,
-0.13989442586898804,
0.024597663432359695,
-0.09974168986082077,
0.254008024930954,
0.336367666721344,
0.024995464831590652,
-0.13976065814495087,
-0.2986561954021454,
-0.255970299243927,
0.2374865859746933,
-0.1369813084602356,
0.1125400960445404,
-0.09609835594892502,
-0.16024190187454224,
-0.25311052799224854,
-0.12474945187568665,
0.20274986326694489,
0.26273563504219055,
0.053734973073005676,
-0.041072823107242584,
-0.10726192593574524,
0.2951097786426544,
-0.15891395509243011,
0.04393773153424263,
0.35070091485977173,
-0.3673047721385956,
0.4433405101299286,
-0.34104377031326294,
-0.20190879702568054,
-0.23004987835884094,
-0.0919652134180069,
0.193433940410614,
0.1920938491821289,
0.09555920213460922,
-0.2858331799507141,
-0.020924769341945648,
-0.1374741643667221,
0.16071602702140808,
0.05965951830148697,
0.23453883826732635,
0.05173260346055031,
-0.25414037704467773,
-0.05517967417836189,
0.0661936104297638,
0.24033422768115997,
0.1541443169116974,
-0.4794459939002991,
-0.4373423457145691,
-0.014284716919064522,
0.07092902809381485,
0.3554672300815582,
-0.1278010606765747,
0.07205648720264435,
-0.058308690786361694,
-0.108742356300354,
0.7888709306716919,
-0.14491689205169678,
-0.08801114559173584,
0.7640020847320557,
-0.34274718165397644,
-0.1001012772321701,
-0.43681877851486206,
-0.025018393993377686,
0.01078817993402481,
0.1732981652021408,
-0.07519467920064926,
-0.0037910323590040207,
0.12576919794082642,
0.12475008517503738,
-0.18668106198310852,
-0.1742033064365387,
0.083002008497715,
0.2320387214422226,
-0.0260753370821476,
-0.2851405739784241,
0.1836852729320526,
0.05029566213488579,
-0.0685170367360115,
0.1784079670906067,
-0.0314653143286705,
-0.04342591017484665,
-0.29927659034729004,
0.059313081204891205,
0.09197398275136948,
-0.5453423857688904,
0.6017761826515198,
0.32651078701019287,
0.30441951751708984,
0.6239739656448364,
-0.4586237967014313,
-0.16254344582557678,
-0.7215918898582458,
-0.27874013781547546,
0.24135039746761322,
-0.25137996673583984,
-0.10226669162511826,
-0.28576168417930603,
0.8685067296028137,
0.20886650681495667,
-0.1004081442952156,
0.03323892503976822,
0.2108822613954544,
-0.15028634667396545,
0.2827211022377014,
0.4187901020050049,
1.1812835931777954,
-0.16946563124656677,
0.1743268221616745,
-0.30560052394866943,
-0.372657835483551,
0.2057398557662964,
-0.5380774140357971,
-0.003146875649690628,
-0.31311115622520447,
-0.3392871618270874,
-0.3077132999897003,
0.015143375843763351,
0.31875330209732056,
0.29737138748168945,
-0.2637336552143097,
-0.2638922929763794,
-0.18606829643249512,
0.43699514865875244,
0.11881851404905319,
0.04415896534919739,
-0.07057799398899078,
-0.3957487642765045,
-0.09206771850585938,
0.07061360776424408,
-0.049221158027648926,
-0.27721986174583435,
-0.03262748569250107,
-0.14501366019248962,
-0.020018987357616425,
0.18735197186470032,
-0.23782919347286224,
-0.17265084385871887,
0.36959800124168396,
-0.08761070668697357,
-0.030849236994981766,
0.21424923837184906,
-0.05569618195295334,
-0.32545432448387146,
0.33365410566329956,
0.12875528633594513,
-0.0992022454738617,
-0.06667791306972504,
-0.025495268404483795,
0.10265711694955826,
-0.025249961763620377,
-0.013773754239082336,
0.08474621176719666,
0.15789806842803955,
-0.07370110601186752,
0.37537679076194763,
0.17646735906600952,
-0.22072313725948334,
-0.44427749514579773,
-0.09561924636363983,
0.1509040892124176,
-0.24754831194877625,
-0.08341971039772034,
0.11011722683906555,
0.06147686764597893,
-0.09935057163238525,
0.15924865007400513,
0.13866618275642395,
-0.07767730951309204,
0.4510318636894226,
-0.05880952998995781,
-0.07116388529539108,
-0.02249649167060852,
0.0891440138220787,
0.07780943810939789,
-0.3094708025455475,
-0.14531530439853668,
-0.05553556978702545,
-0.2790129482746124,
-0.18280252814292908,
0.17888480424880981,
-0.04783865809440613,
-0.008272461593151093,
-0.12968826293945312,
0.16196686029434204,
-0.24948832392692566,
-0.0697387084364891,
0.2522203326225281,
0.15298867225646973,
-0.008500359952449799,
-0.08380110561847687,
-0.1480088233947754,
-0.0909404456615448,
0.3503159284591675,
0.007828176021575928,
0.32562220096588135,
-0.23537591099739075,
-0.21980147063732147,
-0.2363748550415039,
0.516795814037323,
-0.3237551152706146,
-0.24178531765937805,
0.15452270209789276,
0.16001275181770325,
0.3812990188598633,
0.15261268615722656,
-0.22056113183498383,
0.08034305274486542,
0.11151833832263947,
0.05500531941652298,
0.16836248338222504,
-0.1077028438448906,
-0.12969188392162323,
0.14623460173606873,
0.030551377683877945,
0.5241846442222595,
-0.08818318694829941,
0.04781872779130936,
-0.32815954089164734,
-0.2532198429107666,
0.03456130996346474,
0.02856278419494629,
-0.07507044076919556,
0.06403503566980362,
0.1310315579175949,
0.3010495603084564,
0.03197261691093445,
0.11823098361492157,
0.21366991102695465,
0.31161433458328247,
0.1036849394440651,
-0.1026647537946701,
-0.4277438521385193,
0.016764596104621887,
0.11687896400690079,
0.3501012325286865,
0.011123917996883392,
-0.4107339680194855,
0.4136902987957001,
0.19811171293258667,
0.15290413796901703,
0.0780988559126854,
0.04156547412276268,
-0.06261979043483734,
-0.15189315378665924,
0.009526612237095833,
0.07585758715867996,
0.19518934190273285,
-0.00569944828748703,
-0.07351633906364441,
-0.03913504257798195,
0.052097272127866745,
0.0991138368844986,
0.34099364280700684,
0.4800134003162384,
0.4648585915565491,
-0.050260961055755615,
-0.1678573489189148,
0.21178285777568817,
-0.22220875322818756,
-0.34816041588783264,
0.2620124816894531,
0.3248315751552582,
0.03161657601594925,
0.37540093064308167,
0.24152249097824097,
0.13127410411834717,
-0.21534158289432526,
0.09622788429260254,
0.203525573015213,
0.4115043878555298,
-0.169754758477211,
0.2115810215473175,
0.08131499588489532,
0.33633720874786377,
0.20988523960113525,
0.35392969846725464,
0.09429600834846497,
0.08781557530164719,
-0.08468613773584366,
0.15000507235527039,
0.052841100841760635,
-0.25007250905036926,
0.23190142214298248,
-0.00784217193722725,
-0.2666177451610565,
-0.12416195124387741,
-0.07747337967157364,
-0.1743796169757843,
-0.31142404675483704,
0.08581266552209854,
-0.09795013070106506,
0.5961384773254395,
-0.01024162769317627,
0.4238013029098511,
-0.042761966586112976,
0.07713662087917328,
0.08444475382566452,
0.45714718103408813,
-0.25958067178726196,
-0.009516408666968346,
-0.17693953216075897,
0.2418801486492157,
0.21937376260757446,
0.09947214275598526,
0.04272343963384628,
0.4302707016468048,
0.14789032936096191,
0.2471039742231369,
-0.5951898694038391,
-0.22332854568958282,
0.236321359872818,
0.18674257397651672,
0.2105667144060135,
0.11100897192955017,
-0.03078855760395527,
0.13579364120960236,
-0.018113434314727783,
0.13961371779441833,
0.11920331418514252,
0.29947999119758606,
0.13617181777954102,
0.13235116004943848,
0.4661719799041748,
-0.3838790953159332,
0.19314149022102356,
-0.014164634048938751,
-0.2990841865539551,
-0.4064212143421173,
0.35484209656715393,
0.1221054270863533,
0.0067788660526275635,
0.33765876293182373,
0.08833294361829758,
0.35695308446884155,
0.16525483131408691,
0.3480682969093323,
-0.2199006974697113,
-0.24343401193618774,
-0.14955639839172363,
-0.03223520517349243,
-0.27879777550697327,
-0.11839517951011658,
-0.33828607201576233,
0.21649020910263062,
0.043767184019088745,
0.47742268443107605,
0.13926418125629425,
-0.35870110988616943,
-0.45079824328422546,
-0.009189890697598457,
0.3029624819755554,
-0.3678988814353943,
-0.06551970541477203,
0.3678519129753113,
0.06190723180770874,
-0.1590641587972641,
0.24536126852035522,
-0.047370683401823044,
0.4217173755168915,
0.06311235576868057,
-0.510068416595459,
0.206579327583313,
0.07309211790561676,
0.167822927236557,
0.12119150906801224,
-0.4606333076953888,
0.19988581538200378,
-0.07252684235572815,
-0.06844910234212875,
-0.1373019963502884,
-0.04168755188584328,
0.007917414419353008,
0.08658435940742493,
0.14203834533691406,
-0.16064010560512543,
0.05345406383275986,
-0.033703844994306564,
-0.21620528399944305,
-0.049931686371564865,
-0.45069968700408936,
-0.0030174381099641323,
-0.2763083279132843,
-0.10384003072977066,
0.14108633995056152,
-0.006243449170142412,
-0.13655804097652435,
-0.15446799993515015,
0.018429994583129883,
0.33660006523132324,
-0.07767269015312195,
-0.3498273491859436,
0.12177646905183792,
0.18396048247814178,
-0.33918485045433044,
0.1569354236125946,
0.19248875975608826,
-0.08505446463823318,
0.28093257546424866,
-0.5761935710906982,
-0.06642356514930725,
0.4359202980995178,
-0.1345396339893341,
0.11603705585002899,
0.337556928396225,
0.15931814908981323,
-0.05155671387910843,
-0.2850934565067291,
-0.31416887044906616,
-0.17682304978370667,
0.30668210983276367,
-0.7665977478027344,
-0.4006420373916626
] |
https://github.com/huggingface/datasets/issues/5575 | Metadata for each column | Hi, I also need this feature for tell my customer if any of the feature is encrypted with a certain key. | ### Feature request
Being able to put some metadata for each column as a string or any other type.
### Motivation
I will bring the motivation by an example, lets say we are experimenting with embedding produced by some image encoder network, and we want to iterate through a couple of preprocessing and see which one works better in our downstream task, here as workaround right now what I do is the compute the hash of the preprocessing that the images went through as part of the new columns name, it would be nice to attach some kinda meta data in these scenarios to the each columns. metadata
### Your contribution
Maybe we could map another relational like database as the metadata? | 21 | Metadata for each column
### Feature request
Being able to put some metadata for each column as a string or any other type.
### Motivation
I will bring the motivation by an example, lets say we are experimenting with embedding produced by some image encoder network, and we want to iterate through a couple of preprocessing and see which one works better in our downstream task, here as workaround right now what I do is the compute the hash of the preprocessing that the images went through as part of the new columns name, it would be nice to attach some kinda meta data in these scenarios to the each columns. metadata
### Your contribution
Maybe we could map another relational like database as the metadata?
Hi, I also need this feature for tell my customer if any of the feature is encrypted with a certain key. | [
0.22968323528766632,
0.01754799485206604,
-0.07099054753780365,
-0.04288242757320404,
0.39170706272125244,
0.21746885776519775,
0.2968093156814575,
0.2860751450061798,
-0.2980235815048218,
0.2501472234725952,
0.37875157594680786,
0.3123629689216614,
-0.2613551616668701,
0.46593835949897766,
0.0541805736720562,
-0.37598705291748047,
0.09010977298021317,
0.17146766185760498,
-0.051939353346824646,
0.40233927965164185,
-0.02910296991467476,
-0.007950758561491966,
0.2546347379684448,
0.0008213520050048828,
-0.2616705298423767,
0.07232595980167389,
-0.35778671503067017,
-0.404859721660614,
-0.17637205123901367,
-0.41625291109085083,
-0.49825137853622437,
0.19672328233718872,
0.06610576808452606,
-0.13205301761627197,
-0.00011276465374976397,
-0.2563924491405487,
-0.039854854345321655,
-0.1325557380914688,
-0.2778976559638977,
-0.20926983654499054,
-0.25127488374710083,
-0.29965806007385254,
-0.009738195687532425,
-0.33718523383140564,
0.05547422915697098,
0.111616350710392,
-0.2687511444091797,
-0.38872483372688293,
-0.3312528729438782,
-0.10203611850738525,
0.19160015881061554,
-0.1966485232114792,
-0.04211438074707985,
0.03612162545323372,
0.5380834937095642,
0.5350102782249451,
-0.4439573884010315,
-0.073110431432724,
0.4364333748817444,
-0.0713285282254219,
0.2525712251663208,
0.6823325157165527,
-0.04291621595621109,
-0.2155308872461319,
0.2646218538284302,
0.3124638795852661,
0.3304058909416199,
0.08873415738344193,
0.09904419630765915,
0.27395695447921753,
0.6579697728157043,
-0.19083702564239502,
-0.2654876112937927,
0.03544428199529648,
0.12881354987621307,
-0.29943132400512695,
-0.13767972588539124,
0.40337008237838745,
0.26773104071617126,
0.10119974613189697,
-0.05589716508984566,
0.09794477373361588,
-0.0015206187963485718,
-0.1365714967250824,
-0.041088491678237915,
0.21064059436321259,
-0.0739862397313118,
-0.0660519078373909,
-0.17167091369628906,
-0.19847390055656433,
-0.22340400516986847,
0.050232551991939545,
-0.028042782098054886,
0.0909949243068695,
0.1892019510269165,
-0.33825719356536865,
-0.15817001461982727,
-0.2743871510028839,
0.03998293727636337,
0.08586759865283966,
0.1302178055047989,
-0.09005748480558395,
0.0003138761967420578,
0.1153738722205162,
-0.011225592344999313,
-0.2828284502029419,
0.3342573642730713,
-0.22972534596920013,
0.07843749970197678,
-0.24595315754413605,
-0.025868380442261696,
-0.2950880229473114,
0.12276509404182434,
0.7513285279273987,
-0.010326072573661804,
0.003652462735772133,
0.1340896189212799,
-0.014134682714939117,
-0.09368596225976944,
0.23006466031074524,
-0.0456935353577137,
-0.0607982836663723,
-0.1120200827717781,
0.10923613607883453,
0.04232507571578026,
-0.1965874433517456,
-0.0770483911037445,
0.07938731461763382,
0.5250940918922424,
-0.2262517362833023,
0.029743265360593796,
0.252318799495697,
-0.17375648021697998,
0.3716743588447571,
0.07731293141841888,
-0.1000538319349289,
-0.004269481170922518,
0.05018924921751022,
0.004210911691188812,
-0.3786030113697052,
0.10820755362510681,
-0.05738944187760353,
0.049639955163002014,
0.05853884667158127,
-0.29267337918281555,
-0.0985013097524643,
0.04015391692519188,
0.2097253054380417,
-0.4904922842979431,
0.037860408425331116,
-0.2312491238117218,
-0.03150533512234688,
-0.4548521041870117,
0.13849733769893646,
0.11540840566158295,
-0.020822223275899887,
0.26357266306877136,
0.2138696163892746,
-0.050033681094646454,
0.17704759538173676,
0.22077085077762604,
0.5246524214744568,
-0.08719248324632645,
-0.2866051197052002,
-0.2603035867214203,
0.15620462596416473,
-0.14503034949302673,
-0.006691638380289078,
0.3387215733528137,
0.12696588039398193,
-0.15546229481697083,
-0.3673219084739685,
0.02434593066573143,
0.171269953250885,
0.1664305329322815,
0.1980598121881485,
0.21971534192562103,
-0.13092073798179626,
0.2945098876953125,
0.31837818026542664,
-0.05035531148314476,
-0.0054045189172029495,
0.2872909903526306,
0.3771529495716095,
0.13025131821632385,
0.02623698301613331,
0.05293693393468857,
0.1527155637741089,
-0.1634906530380249,
0.19069267809391022,
0.2404129058122635,
-0.4055578112602234,
-0.2283751219511032,
0.1706322282552719,
-0.07829917967319489,
0.11273370683193207,
0.10617025196552277,
-0.2787218391895294,
-0.027770720422267914,
-0.21007856726646423,
0.12019740045070648,
0.023851023986935616,
0.1271694451570511,
0.3405425548553467,
-0.117019422352314,
-0.47666090726852417,
-0.2074304223060608,
-0.05397096276283264,
0.34774139523506165,
0.1521557867527008,
-0.36277616024017334,
-0.5357192754745483,
0.10201112926006317,
0.1276339739561081,
0.20712172985076904,
0.21257072687149048,
0.2126113474369049,
0.05586417764425278,
-0.3392435312271118,
-0.0964718610048294,
-0.3015698492527008,
0.1901007443666458,
-0.07255061715841293,
-0.1297149956226349,
0.13353954255580902,
-0.07447981089353561,
0.12273825705051422,
-0.13948291540145874,
-0.16798155009746552,
0.4151252210140228,
0.040531471371650696,
0.21971766650676727,
0.24428337812423706,
0.052260324358940125,
-0.056467827409505844,
0.08829258382320404,
0.017324697226285934,
0.7965502142906189,
-0.04868607223033905,
0.09756000339984894,
0.17308162152767181,
-0.47656115889549255,
-0.016910020262002945,
-0.1384372115135193,
-0.48156067728996277,
0.4452729821205139,
-0.12853805720806122,
0.25773918628692627,
-0.10380300879478455,
0.06182534247636795,
0.10274346172809601,
-0.02448968030512333,
-0.3545544147491455,
-0.43765538930892944,
-0.263588547706604,
0.11117228865623474,
-0.31340935826301575,
0.016154538840055466,
-0.19621071219444275,
0.18202845752239227,
0.3219967186450958,
-0.010690676048398018,
0.38822975754737854,
0.10328983515501022,
-0.06287121027708054,
0.13094669580459595,
-0.049494944512844086,
-0.3941631019115448,
0.2769792675971985,
0.11696381866931915,
0.08389879763126373,
-0.01084768958389759,
0.050187937915325165,
0.09728479385375977,
0.11301888525485992,
0.02747705578804016,
-0.0712796226143837,
0.006547488272190094,
0.1816074103116989,
0.21473316848278046,
0.09641193598508835,
-0.16969601809978485,
0.09836115688085556,
-0.03355870395898819,
-0.12312737107276917,
0.018045952543616295,
-0.2531900107860565,
0.06677677482366562,
0.14219622313976288,
-0.5446011424064636,
0.07076515257358551,
-0.2584467828273773,
0.15594831109046936,
-0.06768886744976044,
-0.02976415306329727,
-0.18016910552978516,
-0.28500673174858093,
0.6774823069572449,
-0.0585918202996254,
0.01731681078672409,
-0.12232983112335205,
-0.3776324689388275,
0.3424508571624756,
0.03249137103557587,
-0.12936517596244812,
-0.07074812799692154,
0.589790403842926,
0.16670873761177063,
0.3014028072357178,
-0.42548295855522156,
-0.5223570466041565,
0.07743795961141586,
-0.1773742288351059,
-0.040651895105838776,
0.17059773206710815,
0.2529669404029846,
0.1526300460100174,
-0.23129601776599884,
0.050460051745176315,
0.3747541606426239,
-0.042455241084098816,
0.05088498443365097,
0.22819966077804565,
0.022698836401104927,
-0.15961413085460663,
0.11394263803958893,
-0.2677564024925232,
-0.18865589797496796,
0.2691543996334076,
-0.23871776461601257,
0.31516677141189575,
-0.18394069373607635,
-0.2940921187400818,
-0.3474571108818054,
-0.4318608343601227,
0.32328182458877563,
-0.17621777951717377,
-0.24889856576919556,
0.003149867057800293,
-0.29978466033935547,
0.03478175029158592,
0.023550350219011307,
0.13006968796253204,
-0.06179383024573326,
0.05385681241750717,
-0.10029447823762894,
-0.10944563895463943,
0.16833911836147308,
0.19811302423477173,
-0.0008719749748706818,
-0.145191952586174,
0.24566680192947388,
0.3632872700691223,
-0.07149388641119003,
0.10127047449350357,
-0.287805438041687,
-0.05719154328107834,
0.005167946219444275,
-0.14545166492462158,
0.1560378074645996,
0.3605395555496216,
0.05276458337903023,
-0.08004146814346313,
-0.3049822747707367,
-0.3373037278652191,
0.20246769487857819,
-0.2224174588918686,
0.025753237307071686,
-0.036335259675979614,
-0.1619890183210373,
-0.2508617043495178,
-0.07938286662101746,
0.25461065769195557,
0.28472915291786194,
-0.024230923503637314,
0.024346254765987396,
-0.06450798362493515,
0.29115939140319824,
-0.17765021324157715,
-0.08247878402471542,
0.37916499376296997,
-0.428912490606308,
0.4440566599369049,
-0.41218996047973633,
-0.11165425926446915,
-0.2869211733341217,
-0.06277533620595932,
0.2580825984477997,
0.17226465046405792,
0.04319310933351517,
-0.25585755705833435,
-0.04233058914542198,
-0.14787715673446655,
0.15052680671215057,
0.04108348488807678,
0.2225065678358078,
0.045161958783864975,
-0.32169094681739807,
-0.07142847776412964,
0.017496183514595032,
0.19372861087322235,
0.07396037876605988,
-0.42218929529190063,
-0.3358697295188904,
0.0016594063490629196,
-0.02360467240214348,
0.37672188878059387,
-0.23268204927444458,
0.02613705024123192,
-0.050563961267471313,
-0.15211164951324463,
0.8328136205673218,
-0.18088343739509583,
-0.009947188198566437,
0.6925455331802368,
-0.32674849033355713,
-0.1319098323583603,
-0.4019818603992462,
0.006359826773405075,
0.00712164118885994,
0.13006789982318878,
-0.01478487253189087,
-0.08269783854484558,
0.10016630589962006,
0.15180400013923645,
-0.17728883028030396,
-0.16314995288848877,
0.0953279584646225,
0.2657693922519684,
0.04683436080813408,
-0.2651507258415222,
0.1990344226360321,
0.10325393080711365,
-0.10247485339641571,
0.15958744287490845,
-0.07592472434043884,
-0.013465970754623413,
-0.1318235695362091,
0.0471968837082386,
0.02573208510875702,
-0.5297613143920898,
0.5039911270141602,
0.32062768936157227,
0.29068946838378906,
0.6494687795639038,
-0.4751202464103699,
-0.1733778566122055,
-0.7577322721481323,
-0.27070704102516174,
0.23599345982074738,
-0.20287631452083588,
-0.088615782558918,
-0.23205360770225525,
0.8393852114677429,
0.16409356892108917,
-0.09894726425409317,
-0.024599000811576843,
0.16053491830825806,
-0.13338175415992737,
0.2821447253227234,
0.4403482973575592,
1.1701613664627075,
-0.17416232824325562,
0.09746183454990387,
-0.22826853394508362,
-0.2056664079427719,
0.1974252164363861,
-0.5447791814804077,
-0.04286269471049309,
-0.31830117106437683,
-0.3992179334163666,
-0.3286021649837494,
-0.0008026696741580963,
0.3142538368701935,
0.2369595170021057,
-0.2960267961025238,
-0.26714593172073364,
-0.160517156124115,
0.45853284001350403,
0.10844767838716507,
-0.00041173025965690613,
-0.06160910427570343,
-0.34370478987693787,
-0.038352277129888535,
0.0652945414185524,
-0.014318116009235382,
-0.224653959274292,
0.0008737621828913689,
-0.19712723791599274,
0.010441873222589493,
0.17574404180049896,
-0.26679810881614685,
-0.11641907691955566,
0.34636399149894714,
-0.04645130783319473,
-0.062422048300504684,
0.25660043954849243,
-0.056932687759399414,
-0.3638554513454437,
0.3673244118690491,
0.1478719860315323,
-0.10321182012557983,
-0.07056820392608643,
0.019652925431728363,
0.08248645812273026,
-0.05414503440260887,
0.0083546107634902,
0.08504624664783478,
0.12642604112625122,
-0.10111705958843231,
0.37178075313568115,
0.22570249438285828,
-0.16590455174446106,
-0.39657437801361084,
-0.13063958287239075,
0.12175203859806061,
-0.26619765162467957,
-0.07785110175609589,
0.1259966790676117,
-0.0035950057208538055,
-0.10097804665565491,
0.13499987125396729,
0.19737567007541656,
-0.1200835257768631,
0.41638869047164917,
-0.069664865732193,
-0.0436788946390152,
-0.020886488258838654,
0.004527822136878967,
0.03656012564897537,
-0.18698635697364807,
-0.11176276206970215,
-0.11641058325767517,
-0.23883917927742004,
-0.18133273720741272,
0.12605717778205872,
-0.08495495468378067,
0.11933695524930954,
-0.2036513388156891,
0.16387306153774261,
-0.26663628220558167,
-0.061626385897397995,
0.2765360176563263,
0.06571877002716064,
0.08977404236793518,
-0.06335882842540741,
-0.1802670657634735,
-0.12491718679666519,
0.33314013481140137,
0.0012916624546051025,
0.3031379282474518,
-0.21025341749191284,
-0.1372944712638855,
-0.3086627721786499,
0.4799470603466034,
-0.327265202999115,
-0.2524372637271881,
0.09076663106679916,
0.13913275301456451,
0.4211631715297699,
0.1760217547416687,
-0.20631755888462067,
0.10728240013122559,
0.11656059324741364,
0.06585726886987686,
0.11816958338022232,
-0.10257437080144882,
-0.11163415014743805,
0.14772027730941772,
0.02748105302453041,
0.549157977104187,
-0.16221435368061066,
0.07067517191171646,
-0.2232741117477417,
-0.26473960280418396,
0.06459105014801025,
0.09127230197191238,
-0.100293830037117,
0.16443562507629395,
0.06353569775819778,
0.30850329995155334,
-0.06633882969617844,
0.07193047553300858,
0.15201424062252045,
0.24259814620018005,
0.11019379645586014,
-0.06801148504018784,
-0.46534231305122375,
0.0478031188249588,
0.005018115974962711,
0.34958770871162415,
0.004171133041381836,
-0.4022727906703949,
0.3933252692222595,
0.26524579524993896,
0.17096813023090363,
0.12518151104450226,
-0.053618159145116806,
-0.08742858469486237,
-0.21647289395332336,
0.02390468679368496,
0.08614929765462875,
0.20162613689899445,
-0.04018133506178856,
-0.09746772795915604,
-0.0995536595582962,
0.03006243333220482,
0.1666279286146164,
0.3290729820728302,
0.49602392315864563,
0.46869444847106934,
-0.03883582353591919,
-0.20083898305892944,
0.12875528633594513,
-0.1540537029504776,
-0.32900270819664,
0.37984293699264526,
0.2913467288017273,
0.04035288095474243,
0.36670786142349243,
0.23490722477436066,
0.1698019802570343,
-0.19120635092258453,
0.01736428588628769,
0.18854328989982605,
0.4387429654598236,
-0.22318366169929504,
0.2205674648284912,
0.07758146524429321,
0.3481489419937134,
0.22046974301338196,
0.3612675964832306,
0.0648730918765068,
0.10648651421070099,
-0.16897660493850708,
0.1860439032316208,
0.06656736880540848,
-0.2682572305202484,
0.2542996108531952,
-0.01717294752597809,
-0.24376559257507324,
-0.05846773833036423,
-0.020613357424736023,
-0.22763802111148834,
-0.3072862923145294,
0.0950218141078949,
-0.12717001140117645,
0.5519967079162598,
-0.055491313338279724,
0.4261946678161621,
0.0697973296046257,
0.10286666452884674,
0.14652839303016663,
0.46339982748031616,
-0.2925509810447693,
-0.05854877829551697,
-0.12341351807117462,
0.22484441101551056,
0.21359725296497345,
0.051199182868003845,
0.05523744970560074,
0.3501936197280884,
0.18434321880340576,
0.290571928024292,
-0.5422442555427551,
-0.22876998782157898,
0.21851639449596405,
0.11292515695095062,
0.18097642064094543,
0.1602873057126999,
0.01998385787010193,
0.12391193211078644,
-0.023172933608293533,
0.19210737943649292,
0.10236725211143494,
0.22187823057174683,
0.13797765970230103,
0.12032520771026611,
0.45640894770622253,
-0.3660517632961273,
0.20174822211265564,
0.025215134024620056,
-0.2479064166545868,
-0.4988904893398285,
0.36950621008872986,
0.22130705416202545,
0.05529429763555527,
0.32494595646858215,
0.08808809518814087,
0.2982850670814514,
0.14146685600280762,
0.33004331588745117,
-0.19296804070472717,
-0.23176686465740204,
-0.04164263978600502,
-0.06945362687110901,
-0.24657288193702698,
-0.09512090682983398,
-0.464047908782959,
0.25393402576446533,
0.04278638958930969,
0.5257875919342041,
0.16172248125076294,
-0.3959919214248657,
-0.4222218096256256,
-0.015938010066747665,
0.3412628173828125,
-0.4261082112789154,
-0.05365971848368645,
0.3715299367904663,
0.10474146157503128,
-0.13390809297561646,
0.2782137095928192,
0.005189057439565659,
0.37884894013404846,
0.08085552603006363,
-0.4868043065071106,
0.1174686849117279,
0.038629595190286636,
0.13392962515354156,
0.16309958696365356,
-0.49562719464302063,
0.3192766308784485,
-0.12818333506584167,
-0.009392330422997475,
-0.08610837161540985,
0.014034051448106766,
0.024945922195911407,
0.04303036630153656,
0.15483878552913666,
-0.17798593640327454,
0.12965606153011322,
0.10786417126655579,
-0.20496895909309387,
-0.011244449764490128,
-0.4431517720222473,
-0.1272137612104416,
-0.22957096993923187,
-0.05432935804128647,
0.12558278441429138,
0.009930131956934929,
-0.16491757333278656,
-0.081111840903759,
0.02083282545208931,
0.3102453351020813,
0.017584413290023804,
-0.33093446493148804,
0.12519977986812592,
0.1928369402885437,
-0.33939895033836365,
0.14931736886501312,
0.182871013879776,
-0.06665369123220444,
0.3174225687980652,
-0.5863174796104431,
-0.019986189901828766,
0.40904536843299866,
-0.10540398210287094,
0.10580906271934509,
0.260148823261261,
0.19644872844219208,
0.001902315765619278,
-0.2662416100502014,
-0.2990903854370117,
-0.15843069553375244,
0.3371373116970062,
-0.7423803806304932,
-0.3932575583457947
] |
https://github.com/huggingface/datasets/issues/5574 | c4 dataset streaming fails with `FileNotFoundError` | Also encountering this issue for every dataset I try to stream! Installed datasets from main:
```
- `datasets` version: 2.10.1.dev0
- Platform: macOS-13.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 10.0.1
- Pandas version: 1.5.2
```
Repro:
```python
from datasets import load_dataset
spigi = load_dataset("kensho/spgispeech", "dev", split="validation", streaming=True, use_auth_token=True)
sample = next(iter(spigi))
```
<details>
<summary> Traceback </summary>
```python
---------------------------------------------------------------------------
ClientResponseError Traceback (most recent call last)
File ~/venv/lib/python3.9/site-packages/fsspec/implementations/http.py:407, in HTTPFileSystem._info(self, url, **kwargs)
405 try:
406 info.update(
--> 407 await _file_info(
408 self.encode_url(url),
409 size_policy=policy,
410 session=session,
411 **self.kwargs,
412 **kwargs,
413 )
414 )
415 if info.get("size") is not None:
File ~/venv/lib/python3.9/site-packages/fsspec/implementations/http.py:792, in _file_info(url, session, size_policy, **kwargs)
791 async with r:
--> 792 r.raise_for_status()
794 # TODO:
795 # recognise lack of 'Accept-Ranges',
796 # or 'Accept-Ranges': 'none' (not 'bytes')
797 # to mean streaming only, no random access => return None
File ~/venv/lib/python3.9/site-packages/aiohttp/client_reqrep.py:1005, in ClientResponse.raise_for_status(self)
1004 self.release()
-> 1005 raise ClientResponseError(
1006 self.request_info,
1007 self.history,
1008 status=self.status,
1009 message=self.reason,
1010 headers=self.headers,
1011 )
ClientResponseError: 403, message='Forbidden', url=URL('[https://cdn-lfs.huggingface.co/repos/e2/89/e28905247d6f48bb4edad5baf9b1bb4158e897a13fdf18bf3b8ee89ff8387ab8/46eca7431a7b6bad344bf451800e5b10cea1dd168f26d1027a6d9eb374b7fac3?response-content-disposition=attachment%3B+filename*%3DUTF-8''dev.csv%3B+filename%3D%22dev.csv%22%3B&response-content-type=text/csv&Expires=1677494732&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL3JlcG9zL2UyLzg5L2UyODkwNTI0N2Q2ZjQ4YmI0ZWRhZDViYWY5YjFiYjQxNThlODk3YTEzZmRmMThiZjNiOGVlODlmZjgzODdhYjgvNDZlY2E3NDMxYTdiNmJhZDM0NGJmNDUxODAwZTViMTBjZWExZGQxNjhmMjZkMTAyN2E2ZDllYjM3NGI3ZmFjMz9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSomcmVzcG9uc2UtY29udGVudC10eXBlPXRleHQlMkZjc3YiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE2Nzc0OTQ3MzJ9fX1dfQ__&Signature=EzQB9f7xPckvqfFB6LzcyR-wzTnQCqtPDdWtQUzZ3QJ-gY-IHG5mxQITJgMr1nVTbJZrPmGAaDngMcPFUfSQa8RmCqYH~dZl-UGE8CO4neKNUT1DvA2WEvLDS4WaAJ3SN-9rX0uFb03~c1QS78cIgIRboYvf6ugKiJz86Bd7Vs~tcp201JFR0A6jIMseqApOnkb9d8dHMP3Ny~F6gO3Qf2QpEWM-QsDIyw2Kz2QV55nq8TsDpRYZCZo50~WwD~73Hej0PoDhEA1K37d19pa0CQhkaN-gjCrbT9xLabbvhJWa~ZkWcMdD0teCgjYqv1wKyvFXDAxukxLGEc7OBXVbYw__&Key-Pair-Id=KVTP0A1DKRTAX](https://cdn-lfs.huggingface.co/repos/e2/89/e28905247d6f48bb4edad5baf9b1bb4158e897a13fdf18bf3b8ee89ff8387ab8/46eca7431a7b6bad344bf451800e5b10cea1dd168f26d1027a6d9eb374b7fac3?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%27dev.csv%3B+filename%3D%22dev.csv%22%3B&response-content-type=text/csv&Expires=1677494732&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL3JlcG9zL2UyLzg5L2UyODkwNTI0N2Q2ZjQ4YmI0ZWRhZDViYWY5YjFiYjQxNThlODk3YTEzZmRmMThiZjNiOGVlODlmZjgzODdhYjgvNDZlY2E3NDMxYTdiNmJhZDM0NGJmNDUxODAwZTViMTBjZWExZGQxNjhmMjZkMTAyN2E2ZDllYjM3NGI3ZmFjMz9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSomcmVzcG9uc2UtY29udGVudC10eXBlPXRleHQlMkZjc3YiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE2Nzc0OTQ3MzJ9fX1dfQ__&Signature=EzQB9f7xPckvqfFB6LzcyR-wzTnQCqtPDdWtQUzZ3QJ-gY-IHG5mxQITJgMr1nVTbJZrPmGAaDngMcPFUfSQa8RmCqYH~dZl-UGE8CO4neKNUT1DvA2WEvLDS4WaAJ3SN-9rX0uFb03~c1QS78cIgIRboYvf6ugKiJz86Bd7Vs~tcp201JFR0A6jIMseqApOnkb9d8dHMP3Ny~F6gO3Qf2QpEWM-QsDIyw2Kz2QV55nq8TsDpRYZCZo50~WwD~73Hej0PoDhEA1K37d19pa0CQhkaN-gjCrbT9xLabbvhJWa~ZkWcMdD0teCgjYqv1wKyvFXDAxukxLGEc7OBXVbYw__&Key-Pair-Id=KVTP0A1DKRTAX)')
The above exception was the direct cause of the following exception:
FileNotFoundError Traceback (most recent call last)
Cell In[5], line 4
1 from datasets import load_dataset
3 spigi = load_dataset("kensho/spgispeech", "dev", split="validation", streaming=True)
----> 4 sample = next(iter(spigi))
File ~/datasets/src/datasets/iterable_dataset.py:937, in IterableDataset.__iter__(self)
934 yield from self._iter_pytorch(ex_iterable)
935 return
--> 937 for key, example in ex_iterable:
938 if self.features:
939 # `IterableDataset` automatically fills missing columns with None.
940 # This is done with `_apply_feature_types_on_example`.
941 yield _apply_feature_types_on_example(
942 example, self.features, token_per_repo_id=self._token_per_repo_id
943 )
File ~/datasets/src/datasets/iterable_dataset.py:113, in ExamplesIterable.__iter__(self)
112 def __iter__(self):
--> 113 yield from self.generate_examples_fn(**self.kwargs)
File ~/.cache/huggingface/modules/datasets_modules/datasets/kensho--spgispeech/5fbf75dd9ef795a9b5a673457d2cbaf0b8fa0de8fb62acbd1da338d83a41e2f0/spgispeech.py:186, in Spgispeech._generate_examples(self, local_extracted_archive_paths, archives, meta_path)
183 dict_keys = ["wav_filename", "wav_filesize", "transcript"]
185 logging.info("Reading metadata...")
--> 186 with open(meta_path, encoding="utf-8") as f:
187 csvreader = csv.DictReader(f, delimiter="|")
188 metadata = {x["wav_filename"]: dict((k, x[k]) for k in dict_keys) for x in csvreader}
File ~/datasets/src/datasets/streaming.py:70, in extend_module_for_streaming.<locals>.wrap_auth.<locals>.wrapper(*args, **kwargs)
68 @wraps(function)
69 def wrapper(*args, **kwargs):
---> 70 return function(*args, use_auth_token=use_auth_token, **kwargs)
File ~/datasets/src/datasets/download/streaming_download_manager.py:495, in xopen(file, mode, use_auth_token, *args, **kwargs)
493 kwargs = {**kwargs, **new_kwargs}
494 try:
--> 495 file_obj = fsspec.open(file, mode=mode, *args, **kwargs).open()
496 except ValueError as e:
497 if str(e) == "Cannot seek streaming HTTP file":
File ~/venv/lib/python3.9/site-packages/fsspec/core.py:135, in OpenFile.open(self)
128 def open(self):
129 """Materialise this as a real open file without context
130
131 The OpenFile object should be explicitly closed to avoid enclosed file
132 instances persisting. You must, therefore, keep a reference to the OpenFile
133 during the life of the file-like it generates.
134 """
--> 135 return self.__enter__()
File ~/venv/lib/python3.9/site-packages/fsspec/core.py:103, in OpenFile.__enter__(self)
100 def __enter__(self):
101 mode = self.mode.replace("t", "").replace("b", "") + "b"
--> 103 f = self.fs.open(self.path, mode=mode)
105 self.fobjects = [f]
107 if self.compression is not None:
File ~/venv/lib/python3.9/site-packages/fsspec/spec.py:1106, in AbstractFileSystem.open(self, path, mode, block_size, cache_options, compression, **kwargs)
1104 else:
1105 ac = kwargs.pop("autocommit", not self._intrans)
-> 1106 f = self._open(
1107 path,
1108 mode=mode,
1109 block_size=block_size,
1110 autocommit=ac,
1111 cache_options=cache_options,
1112 **kwargs,
1113 )
1114 if compression is not None:
1115 from fsspec.compression import compr
File ~/venv/lib/python3.9/site-packages/fsspec/implementations/http.py:346, in HTTPFileSystem._open(self, path, mode, block_size, autocommit, cache_type, cache_options, size, **kwargs)
344 kw["asynchronous"] = self.asynchronous
345 kw.update(kwargs)
--> 346 size = size or self.info(path, **kwargs)["size"]
347 session = sync(self.loop, self.set_session)
348 if block_size and size:
File ~/venv/lib/python3.9/site-packages/fsspec/asyn.py:113, in sync_wrapper.<locals>.wrapper(*args, **kwargs)
110 @functools.wraps(func)
111 def wrapper(*args, **kwargs):
112 self = obj or args[0]
--> 113 return sync(self.loop, func, *args, **kwargs)
File ~/venv/lib/python3.9/site-packages/fsspec/asyn.py:98, in sync(loop, func, timeout, *args, **kwargs)
96 raise FSTimeoutError from return_result
97 elif isinstance(return_result, BaseException):
---> 98 raise return_result
99 else:
100 return return_result
File ~/venv/lib/python3.9/site-packages/fsspec/asyn.py:53, in _runner(event, coro, result, timeout)
51 coro = asyncio.wait_for(coro, timeout=timeout)
52 try:
---> 53 result[0] = await coro
54 except Exception as ex:
55 result[0] = ex
File ~/venv/lib/python3.9/site-packages/fsspec/implementations/http.py:420, in HTTPFileSystem._info(self, url, **kwargs)
417 except Exception as exc:
418 if policy == "get":
419 # If get failed, then raise a FileNotFoundError
--> 420 raise FileNotFoundError(url) from exc
421 logger.debug(str(exc))
423 return {"name": url, "size": None, **info, "type": "file"}
FileNotFoundError: https://huggingface.co/datasets/kensho/spgispeech/resolve/main/data/meta/dev.csv
```
</details> | ### Describe the bug
Loading the `c4` dataset in streaming mode with `load_dataset("c4", "en", split="validation", streaming=True)` and then using it fails with a `FileNotFoundException`.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("c4", "en", split="train", streaming=True)
next(iter(dataset))
```
causes a
```
FileNotFoundError: https://huggingface.co/datasets/allenai/c4/resolve/1ddc917116b730e1859edef32896ec5c16be51d0/en/c4-train.00000-of-01024.json.gz
```
I can download this file manually though e.g. by entering this URL in a browser.
There is an underlying HTTP 403 status code:
```
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('https://cdn-lfs.huggingface.co/datasets/allenai/c4/8ef8d75b0e045dec4aa5123a671b4564466b0707086a7ed1ba8721626dfffbc9?response-content-disposition=attachment%3B+filename*%3DUTF-8''c4-train.00000-of-01024.json.gz%3B+filename%3D%22c4-train.00000-of-01024.json.gz%22%3B&response-content-type=application/gzip&Expires=1677483770&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL2RhdGFzZXRzL2FsbGVuYWkvYzQvOGVmOGQ3NWIwZTA0NWRlYzRhYTUxMjNhNjcxYjQ1NjQ0NjZiMDcwNzA4NmE3ZWQxYmE4NzIxNjI2ZGZmZmJjOT9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSomcmVzcG9uc2UtY29udGVudC10eXBlPWFwcGxpY2F0aW9uJTJGZ3ppcCIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY3NzQ4Mzc3MH19fV19&Signature=yjL3UeY72cf2xpnvPvD68eAYOEe2qtaUJV55sB-jnPskBJEMwpMJcBZvg2~GqXZdM3O-GWV-Z3CI~d4u5VCb4YZ-HlmOjr3VBYkvox2EKiXnBIhjMecf2UVUPtxhTa9kBVlWjqu4qKzB9gKXZF2Cwpp5ctLzapEaT2nnqF84RAL-rsqMA3I~M8vWWfivQsbBK63hMfgZqqKMgdWM0iKMaItveDl0ufQ29azMFmsR7qd8V7sU2Z-F1fAeohS8HpN9OOnClW34yi~YJ2AbgZJJBXA~qsylfVA0Qp7Q~yX~q4P8JF1vmJ2BjkiSbGrj3bAXOGugpOVU5msI52DT88yMdA__&Key-Pair-Id=KVTP0A1DKRTAX')
```
### Expected behavior
This should retrieve the first example from the C4 validation set. This worked a few days ago but stopped working now.
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.15.0-60-generic-x86_64-with-glibc2.31
- Python version: 3.9.16
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
| 655 | c4 dataset streaming fails with `FileNotFoundError`
### Describe the bug
Loading the `c4` dataset in streaming mode with `load_dataset("c4", "en", split="validation", streaming=True)` and then using it fails with a `FileNotFoundException`.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("c4", "en", split="train", streaming=True)
next(iter(dataset))
```
causes a
```
FileNotFoundError: https://huggingface.co/datasets/allenai/c4/resolve/1ddc917116b730e1859edef32896ec5c16be51d0/en/c4-train.00000-of-01024.json.gz
```
I can download this file manually though e.g. by entering this URL in a browser.
There is an underlying HTTP 403 status code:
```
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('https://cdn-lfs.huggingface.co/datasets/allenai/c4/8ef8d75b0e045dec4aa5123a671b4564466b0707086a7ed1ba8721626dfffbc9?response-content-disposition=attachment%3B+filename*%3DUTF-8''c4-train.00000-of-01024.json.gz%3B+filename%3D%22c4-train.00000-of-01024.json.gz%22%3B&response-content-type=application/gzip&Expires=1677483770&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL2RhdGFzZXRzL2FsbGVuYWkvYzQvOGVmOGQ3NWIwZTA0NWRlYzRhYTUxMjNhNjcxYjQ1NjQ0NjZiMDcwNzA4NmE3ZWQxYmE4NzIxNjI2ZGZmZmJjOT9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSomcmVzcG9uc2UtY29udGVudC10eXBlPWFwcGxpY2F0aW9uJTJGZ3ppcCIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY3NzQ4Mzc3MH19fV19&Signature=yjL3UeY72cf2xpnvPvD68eAYOEe2qtaUJV55sB-jnPskBJEMwpMJcBZvg2~GqXZdM3O-GWV-Z3CI~d4u5VCb4YZ-HlmOjr3VBYkvox2EKiXnBIhjMecf2UVUPtxhTa9kBVlWjqu4qKzB9gKXZF2Cwpp5ctLzapEaT2nnqF84RAL-rsqMA3I~M8vWWfivQsbBK63hMfgZqqKMgdWM0iKMaItveDl0ufQ29azMFmsR7qd8V7sU2Z-F1fAeohS8HpN9OOnClW34yi~YJ2AbgZJJBXA~qsylfVA0Qp7Q~yX~q4P8JF1vmJ2BjkiSbGrj3bAXOGugpOVU5msI52DT88yMdA__&Key-Pair-Id=KVTP0A1DKRTAX')
```
### Expected behavior
This should retrieve the first example from the C4 validation set. This worked a few days ago but stopped working now.
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.15.0-60-generic-x86_64-with-glibc2.31
- Python version: 3.9.16
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
Also encountering this issue for every dataset I try to stream! Installed datasets from main:
```
- `datasets` version: 2.10.1.dev0
- Platform: macOS-13.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 10.0.1
- Pandas version: 1.5.2
```
Repro:
```python
from datasets import load_dataset
spigi = load_dataset("kensho/spgispeech", "dev", split="validation", streaming=True, use_auth_token=True)
sample = next(iter(spigi))
```
<details>
<summary> Traceback </summary>
```python
---------------------------------------------------------------------------
ClientResponseError Traceback (most recent call last)
File ~/venv/lib/python3.9/site-packages/fsspec/implementations/http.py:407, in HTTPFileSystem._info(self, url, **kwargs)
405 try:
406 info.update(
--> 407 await _file_info(
408 self.encode_url(url),
409 size_policy=policy,
410 session=session,
411 **self.kwargs,
412 **kwargs,
413 )
414 )
415 if info.get("size") is not None:
File ~/venv/lib/python3.9/site-packages/fsspec/implementations/http.py:792, in _file_info(url, session, size_policy, **kwargs)
791 async with r:
--> 792 r.raise_for_status()
794 # TODO:
795 # recognise lack of 'Accept-Ranges',
796 # or 'Accept-Ranges': 'none' (not 'bytes')
797 # to mean streaming only, no random access => return None
File ~/venv/lib/python3.9/site-packages/aiohttp/client_reqrep.py:1005, in ClientResponse.raise_for_status(self)
1004 self.release()
-> 1005 raise ClientResponseError(
1006 self.request_info,
1007 self.history,
1008 status=self.status,
1009 message=self.reason,
1010 headers=self.headers,
1011 )
ClientResponseError: 403, message='Forbidden', url=URL('[https://cdn-lfs.huggingface.co/repos/e2/89/e28905247d6f48bb4edad5baf9b1bb4158e897a13fdf18bf3b8ee89ff8387ab8/46eca7431a7b6bad344bf451800e5b10cea1dd168f26d1027a6d9eb374b7fac3?response-content-disposition=attachment%3B+filename*%3DUTF-8''dev.csv%3B+filename%3D%22dev.csv%22%3B&response-content-type=text/csv&Expires=1677494732&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL3JlcG9zL2UyLzg5L2UyODkwNTI0N2Q2ZjQ4YmI0ZWRhZDViYWY5YjFiYjQxNThlODk3YTEzZmRmMThiZjNiOGVlODlmZjgzODdhYjgvNDZlY2E3NDMxYTdiNmJhZDM0NGJmNDUxODAwZTViMTBjZWExZGQxNjhmMjZkMTAyN2E2ZDllYjM3NGI3ZmFjMz9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSomcmVzcG9uc2UtY29udGVudC10eXBlPXRleHQlMkZjc3YiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE2Nzc0OTQ3MzJ9fX1dfQ__&Signature=EzQB9f7xPckvqfFB6LzcyR-wzTnQCqtPDdWtQUzZ3QJ-gY-IHG5mxQITJgMr1nVTbJZrPmGAaDngMcPFUfSQa8RmCqYH~dZl-UGE8CO4neKNUT1DvA2WEvLDS4WaAJ3SN-9rX0uFb03~c1QS78cIgIRboYvf6ugKiJz86Bd7Vs~tcp201JFR0A6jIMseqApOnkb9d8dHMP3Ny~F6gO3Qf2QpEWM-QsDIyw2Kz2QV55nq8TsDpRYZCZo50~WwD~73Hej0PoDhEA1K37d19pa0CQhkaN-gjCrbT9xLabbvhJWa~ZkWcMdD0teCgjYqv1wKyvFXDAxukxLGEc7OBXVbYw__&Key-Pair-Id=KVTP0A1DKRTAX](https://cdn-lfs.huggingface.co/repos/e2/89/e28905247d6f48bb4edad5baf9b1bb4158e897a13fdf18bf3b8ee89ff8387ab8/46eca7431a7b6bad344bf451800e5b10cea1dd168f26d1027a6d9eb374b7fac3?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%27dev.csv%3B+filename%3D%22dev.csv%22%3B&response-content-type=text/csv&Expires=1677494732&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL3JlcG9zL2UyLzg5L2UyODkwNTI0N2Q2ZjQ4YmI0ZWRhZDViYWY5YjFiYjQxNThlODk3YTEzZmRmMThiZjNiOGVlODlmZjgzODdhYjgvNDZlY2E3NDMxYTdiNmJhZDM0NGJmNDUxODAwZTViMTBjZWExZGQxNjhmMjZkMTAyN2E2ZDllYjM3NGI3ZmFjMz9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSomcmVzcG9uc2UtY29udGVudC10eXBlPXRleHQlMkZjc3YiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE2Nzc0OTQ3MzJ9fX1dfQ__&Signature=EzQB9f7xPckvqfFB6LzcyR-wzTnQCqtPDdWtQUzZ3QJ-gY-IHG5mxQITJgMr1nVTbJZrPmGAaDngMcPFUfSQa8RmCqYH~dZl-UGE8CO4neKNUT1DvA2WEvLDS4WaAJ3SN-9rX0uFb03~c1QS78cIgIRboYvf6ugKiJz86Bd7Vs~tcp201JFR0A6jIMseqApOnkb9d8dHMP3Ny~F6gO3Qf2QpEWM-QsDIyw2Kz2QV55nq8TsDpRYZCZo50~WwD~73Hej0PoDhEA1K37d19pa0CQhkaN-gjCrbT9xLabbvhJWa~ZkWcMdD0teCgjYqv1wKyvFXDAxukxLGEc7OBXVbYw__&Key-Pair-Id=KVTP0A1DKRTAX)')
The above exception was the direct cause of the following exception:
FileNotFoundError Traceback (most recent call last)
Cell In[5], line 4
1 from datasets import load_dataset
3 spigi = load_dataset("kensho/spgispeech", "dev", split="validation", streaming=True)
----> 4 sample = next(iter(spigi))
File ~/datasets/src/datasets/iterable_dataset.py:937, in IterableDataset.__iter__(self)
934 yield from self._iter_pytorch(ex_iterable)
935 return
--> 937 for key, example in ex_iterable:
938 if self.features:
939 # `IterableDataset` automatically fills missing columns with None.
940 # This is done with `_apply_feature_types_on_example`.
941 yield _apply_feature_types_on_example(
942 example, self.features, token_per_repo_id=self._token_per_repo_id
943 )
File ~/datasets/src/datasets/iterable_dataset.py:113, in ExamplesIterable.__iter__(self)
112 def __iter__(self):
--> 113 yield from self.generate_examples_fn(**self.kwargs)
File ~/.cache/huggingface/modules/datasets_modules/datasets/kensho--spgispeech/5fbf75dd9ef795a9b5a673457d2cbaf0b8fa0de8fb62acbd1da338d83a41e2f0/spgispeech.py:186, in Spgispeech._generate_examples(self, local_extracted_archive_paths, archives, meta_path)
183 dict_keys = ["wav_filename", "wav_filesize", "transcript"]
185 logging.info("Reading metadata...")
--> 186 with open(meta_path, encoding="utf-8") as f:
187 csvreader = csv.DictReader(f, delimiter="|")
188 metadata = {x["wav_filename"]: dict((k, x[k]) for k in dict_keys) for x in csvreader}
File ~/datasets/src/datasets/streaming.py:70, in extend_module_for_streaming.<locals>.wrap_auth.<locals>.wrapper(*args, **kwargs)
68 @wraps(function)
69 def wrapper(*args, **kwargs):
---> 70 return function(*args, use_auth_token=use_auth_token, **kwargs)
File ~/datasets/src/datasets/download/streaming_download_manager.py:495, in xopen(file, mode, use_auth_token, *args, **kwargs)
493 kwargs = {**kwargs, **new_kwargs}
494 try:
--> 495 file_obj = fsspec.open(file, mode=mode, *args, **kwargs).open()
496 except ValueError as e:
497 if str(e) == "Cannot seek streaming HTTP file":
File ~/venv/lib/python3.9/site-packages/fsspec/core.py:135, in OpenFile.open(self)
128 def open(self):
129 """Materialise this as a real open file without context
130
131 The OpenFile object should be explicitly closed to avoid enclosed file
132 instances persisting. You must, therefore, keep a reference to the OpenFile
133 during the life of the file-like it generates.
134 """
--> 135 return self.__enter__()
File ~/venv/lib/python3.9/site-packages/fsspec/core.py:103, in OpenFile.__enter__(self)
100 def __enter__(self):
101 mode = self.mode.replace("t", "").replace("b", "") + "b"
--> 103 f = self.fs.open(self.path, mode=mode)
105 self.fobjects = [f]
107 if self.compression is not None:
File ~/venv/lib/python3.9/site-packages/fsspec/spec.py:1106, in AbstractFileSystem.open(self, path, mode, block_size, cache_options, compression, **kwargs)
1104 else:
1105 ac = kwargs.pop("autocommit", not self._intrans)
-> 1106 f = self._open(
1107 path,
1108 mode=mode,
1109 block_size=block_size,
1110 autocommit=ac,
1111 cache_options=cache_options,
1112 **kwargs,
1113 )
1114 if compression is not None:
1115 from fsspec.compression import compr
File ~/venv/lib/python3.9/site-packages/fsspec/implementations/http.py:346, in HTTPFileSystem._open(self, path, mode, block_size, autocommit, cache_type, cache_options, size, **kwargs)
344 kw["asynchronous"] = self.asynchronous
345 kw.update(kwargs)
--> 346 size = size or self.info(path, **kwargs)["size"]
347 session = sync(self.loop, self.set_session)
348 if block_size and size:
File ~/venv/lib/python3.9/site-packages/fsspec/asyn.py:113, in sync_wrapper.<locals>.wrapper(*args, **kwargs)
110 @functools.wraps(func)
111 def wrapper(*args, **kwargs):
112 self = obj or args[0]
--> 113 return sync(self.loop, func, *args, **kwargs)
File ~/venv/lib/python3.9/site-packages/fsspec/asyn.py:98, in sync(loop, func, timeout, *args, **kwargs)
96 raise FSTimeoutError from return_result
97 elif isinstance(return_result, BaseException):
---> 98 raise return_result
99 else:
100 return return_result
File ~/venv/lib/python3.9/site-packages/fsspec/asyn.py:53, in _runner(event, coro, result, timeout)
51 coro = asyncio.wait_for(coro, timeout=timeout)
52 try:
---> 53 result[0] = await coro
54 except Exception as ex:
55 result[0] = ex
File ~/venv/lib/python3.9/site-packages/fsspec/implementations/http.py:420, in HTTPFileSystem._info(self, url, **kwargs)
417 except Exception as exc:
418 if policy == "get":
419 # If get failed, then raise a FileNotFoundError
--> 420 raise FileNotFoundError(url) from exc
421 logger.debug(str(exc))
423 return {"name": url, "size": None, **info, "type": "file"}
FileNotFoundError: https://huggingface.co/datasets/kensho/spgispeech/resolve/main/data/meta/dev.csv
```
</details> | [
-0.2467462718486786,
0.13279876112937927,
0.04004215821623802,
0.32442140579223633,
0.1723441779613495,
0.11456891149282455,
0.14179404079914093,
0.2780021131038666,
-0.08522557467222214,
0.06967808306217194,
-0.07468783855438232,
-0.08705097436904907,
-0.0888633131980896,
0.10009647160768509,
0.06160719692707062,
0.027806324884295464,
-0.09655933827161789,
0.19019505381584167,
0.0317605696618557,
0.15858441591262817,
-0.010184548795223236,
0.09507511556148529,
-0.24832436442375183,
-0.0538179874420166,
-0.1898794323205948,
-0.13213948905467987,
0.04076565057039261,
0.31705448031425476,
-0.11375867575407028,
-0.3029356002807617,
0.35685497522354126,
-0.09025917947292328,
0.22927512228488922,
0.5055244565010071,
-0.00011665172496577725,
0.13374163210391998,
0.309661865234375,
-0.1642947643995285,
-0.20611059665679932,
-0.25145959854125977,
-0.4731822609901428,
-0.043023817241191864,
-0.24912941455841064,
-0.09240736812353134,
-0.04734421148896217,
-0.057319726794958115,
0.17451418936252594,
-0.41000881791114807,
0.3812444806098938,
0.5148968696594238,
0.10202870517969131,
0.22239011526107788,
-0.12849010527133942,
0.15287506580352783,
-0.18233045935630798,
-0.21428288519382477,
-0.0802147388458252,
0.28004834055900574,
-0.0665721744298935,
0.1667594164609909,
-0.05099412053823471,
0.18356040120124817,
-0.10023258626461029,
-0.08552347123622894,
0.2082856297492981,
-0.03638123348355293,
-0.0864815041422844,
-0.2673667073249817,
0.16529986262321472,
0.31590551137924194,
0.740833580493927,
-0.3290979266166687,
-0.4362660348415375,
-0.02088863030076027,
0.24007682502269745,
-0.29473093152046204,
0.27932122349739075,
0.28932997584342957,
-0.06849834322929382,
0.20271843671798706,
-0.2132507711648941,
-0.04583487659692764,
-0.3832428455352783,
0.14923974871635437,
-0.042087867856025696,
-0.057114213705062866,
-0.03317325562238693,
-0.04581177979707718,
-0.06490056216716766,
0.03733082860708237,
-0.028729934245347977,
-0.43308302760124207,
-0.2817257344722748,
0.2850091755390167,
-0.24725447595119476,
-0.016068149358034134,
-0.04550222307443619,
0.26849374175071716,
0.012613829225301743,
0.1411409229040146,
0.33579757809638977,
-0.042412810027599335,
-0.27079153060913086,
0.12728652358055115,
0.042364299297332764,
0.1877596229314804,
0.09706982970237732,
-0.09918445348739624,
0.3607012629508972,
0.3305165469646454,
-0.043022580444812775,
-0.299225389957428,
0.08175912499427795,
-0.12616084516048431,
-0.28382280468940735,
-0.060332462191581726,
0.29677170515060425,
-0.3114683926105499,
-0.5887150168418884,
0.21859018504619598,
-0.701935350894928,
-0.001417564693838358,
-0.021332066506147385,
0.506765604019165,
-0.23274073004722595,
0.10391108691692352,
0.07359717041254044,
0.20150282979011536,
0.001089358702301979,
-0.38615506887435913,
-0.127083420753479,
-0.15283173322677612,
-0.03059784322977066,
0.1986517757177353,
0.1966625154018402,
-0.32446348667144775,
0.2735462784767151,
0.03848418965935707,
0.21742673218250275,
0.09323553740978241,
-0.013154305517673492,
-0.05733771622180939,
-0.12895923852920532,
0.195569708943367,
-0.043529022485017776,
0.09557364881038666,
0.1676395833492279,
-0.3185003995895386,
0.04763498157262802,
-0.09468837827444077,
-0.015874050557613373,
-0.10598913580179214,
0.04231127351522446,
0.10096142441034317,
-0.3069586157798767,
-0.0727614015340805,
-0.19828787446022034,
-0.05068235471844673,
-0.26952606439590454,
-0.3888101875782013,
0.1626984030008316,
-0.055219314992427826,
0.11192630231380463,
-0.22574912011623383,
0.23529458045959473,
0.7646635174751282,
-0.2802044749259949,
-0.1846485286951065,
-0.11372776329517365,
-0.16401898860931396,
0.3409588038921356,
0.27698296308517456,
-0.10479753464460373,
0.01931150257587433,
-0.26778340339660645,
0.40866750478744507,
0.21925535798072815,
-0.19311381876468658,
-0.6291771531105042,
0.5631681084632874,
-0.19646494090557098,
0.6119543313980103,
0.2093448042869568,
0.06432729959487915,
-0.0595216304063797,
-0.18049634993076324,
0.1653538942337036,
0.25187960267066956,
-0.0273370910435915,
-0.03522312268614769,
-0.2284655123949051,
-0.10355506092309952,
0.34119659662246704,
0.03135211393237114,
-0.021206539124250412,
0.14884987473487854,
0.32728931307792664,
-0.02599778212606907,
0.41606247425079346,
-0.2120276689529419,
-0.0012862831354141235,
-0.007101666182279587,
0.47636035084724426,
-0.036758773028850555,
-0.16989751160144806,
0.10066860169172287,
-0.607447624206543,
0.23923105001449585,
0.1632545292377472,
-0.17657506465911865,
-0.03365790843963623,
-0.09012711048126221,
-0.0279281847178936,
-0.13434557616710663,
-0.33751973509788513,
-0.3689330220222473,
0.08227864652872086,
0.2043687403202057,
0.006775926798582077,
0.21912585198879242,
-0.1947854608297348,
0.8216492533683777,
-0.42222344875335693,
0.010109343566000462,
-0.03835589438676834,
0.2734583616256714,
0.027525464072823524,
-0.06141076236963272,
0.04907625913619995,
-0.06341006606817245,
0.23409846425056458,
-0.13357433676719666,
-0.08236509561538696,
0.5615682005882263,
-0.05533430725336075,
0.295086145401001,
-0.10691533237695694,
0.08125246316194534,
0.4368551969528198,
-0.2516922056674957,
0.007443314418196678,
0.5023471117019653,
0.23382879793643951,
0.02167937159538269,
0.04421984776854515,
0.3587788939476013,
0.07097887247800827,
0.08141403645277023,
0.2847810387611389,
-0.003402218222618103,
0.20224960148334503,
0.08997105062007904,
-0.23544280230998993,
0.09405019879341125,
0.4511280357837677,
-0.38557836413383484,
0.32700058817863464,
-0.17344869673252106,
-0.4125608205795288,
-0.045385994017124176,
0.2711707651615143,
-0.086728036403656,
-0.21076464653015137,
-0.06281088292598724,
-0.2558002769947052,
0.09161128848791122,
0.467567503452301,
0.3024212718009949,
0.43926066160202026,
0.06820511817932129,
-0.13268417119979858,
0.1980845183134079,
-0.10682034492492676,
-0.18183402717113495,
0.16543179750442505,
-0.21031241118907928,
-0.1176859512925148,
0.2709534168243408,
-0.05011561140418053,
0.06094174087047577,
-0.26872342824935913,
-0.44717922806739807,
-0.06406036019325256,
0.0006428882479667664,
-0.4872424900531769,
0.21120157837867737,
-0.36426493525505066,
-0.22301757335662842,
-0.07438651472330093,
-0.06230941042304039,
-0.16031686961650848,
-0.11078377068042755,
-0.18558762967586517,
0.3693574368953705,
-0.10465750098228455,
0.02522594854235649,
-0.8260208964347839,
0.02523478865623474,
-0.01327403262257576,
-0.31963685154914856,
-0.17091074585914612,
0.16814208030700684,
-0.22076234221458435,
0.06438340246677399,
0.47011512517929077,
-0.1355893611907959,
0.21940530836582184,
-0.2175547182559967,
-0.09454120695590973,
-0.38990432024002075,
-0.17627979815006256,
0.09338358044624329,
-0.0761294737458229,
0.17922888696193695,
-0.23388555645942688,
0.3725619912147522,
-0.16186849772930145,
-0.35431599617004395,
-0.007720916997641325,
-0.13874037563800812,
-0.10681159794330597,
0.12521858513355255,
-0.01400883961468935,
-0.09701523929834366,
-0.11198844015598297,
-0.3995073139667511,
-0.14540664851665497,
-0.3510515093803406,
0.2642711400985718,
-0.1719008982181549,
0.01036936417222023,
0.4008120000362396,
0.11057275533676147,
0.29947400093078613,
0.1075277104973793,
-0.173945352435112,
-0.007569999434053898,
-0.24086622893810272,
0.4674313962459564,
-0.022617556154727936,
-0.36916548013687134,
0.20961883664131165,
0.08432953804731369,
-0.06399405002593994,
0.37871766090393066,
-0.3669458031654358,
0.2902870774269104,
-0.11964832246303558,
0.2584117352962494,
-0.07022438198328018,
-0.20720434188842773,
0.1946023404598236,
-0.2807164788246155,
0.08727731555700302,
-0.253869891166687,
0.10635335743427277,
-0.068071149289608,
0.28173863887786865,
0.4405917525291443,
-0.06615250557661057,
0.37335941195487976,
0.18214388191699982,
0.5030514597892761,
0.33333873748779297,
-0.1447412371635437,
0.49497711658477783,
-0.04692456126213074,
0.48988044261932373,
0.09671000391244888,
-0.021917054429650307,
0.21092338860034943,
-0.07143810391426086,
-0.23888611793518066,
0.1857145130634308,
-0.05955946445465088,
-0.1173391118645668,
-0.3247036039829254,
0.05678357556462288,
-0.3353002071380615,
-0.15100382268428802,
0.0470120832324028,
-0.04628527909517288,
0.13905155658721924,
0.10295809805393219,
0.20392337441444397,
0.2588067352771759,
-0.18477711081504822,
0.10135670006275177,
0.6303920745849609,
0.34443399310112,
0.1472344547510147,
-0.09011538326740265,
-0.32927224040031433,
-0.4260959327220917,
0.404471218585968,
0.2784533202648163,
0.3510306477546692,
-0.13401074707508087,
-0.14684903621673584,
-0.08164574205875397,
-0.18911698460578918,
0.5461317300796509,
-0.20066425204277039,
0.14058023691177368,
0.12941516935825348,
0.20293691754341125,
0.003830930218100548,
-0.1206861287355423,
-0.044159408658742905,
0.2406240701675415,
0.4243500232696533,
0.20681512355804443,
-0.1926030069589615,
0.009018734097480774,
-0.22709301114082336,
-0.015158829279243946,
0.1268855482339859,
0.03617442026734352,
-0.15880940854549408,
-0.12921872735023499,
-0.1440446823835373,
-0.06087259203195572,
-0.0431312695145607,
0.0795368179678917,
-0.20847325026988983,
0.19558954238891602,
0.023120349273085594,
0.06246577203273773,
0.2545427083969116,
0.23770852386951447,
0.19763469696044922,
0.0004946620902046561,
0.13283419609069824,
0.2977561950683594,
0.11113382875919342,
0.5374557971954346,
0.5015861988067627,
0.3258613049983978,
-0.32760339975357056,
-0.05168347805738449,
0.18064171075820923,
0.06356197595596313,
0.3620198965072632,
0.03963249549269676,
-0.11139494925737381,
0.3632160425186157,
0.00010451674461364746,
-0.060506317764520645,
0.21385736763477325,
0.3125086724758148,
-0.20250427722930908,
-0.4594510495662689,
-0.4426804482936859,
0.42595407366752625,
-0.19747550785541534,
0.08712536096572876,
0.5395447015762329,
0.37628114223480225,
-0.14481261372566223,
-0.04598533362150192,
-0.19865241646766663,
0.667384684085846,
0.21085840463638306,
0.16781212389469147,
0.4115624725818634,
-0.0649867057800293,
0.2511211335659027,
-0.5093109011650085,
0.27916330099105835,
-0.07036405801773071,
-0.2707407474517822,
-0.18096566200256348,
-0.1309647113084793,
0.3981797695159912,
0.0845387876033783,
-0.14743323624134064,
0.2973511517047882,
0.07149368524551392,
0.37954163551330566,
0.22432971000671387,
-0.13453055918216705,
-0.5341125130653381,
0.05241091549396515,
-0.4589904546737671,
0.11229412257671356,
-0.11275619268417358,
0.22009262442588806,
-0.10963410139083862,
-0.3131343722343445,
-0.22502021491527557,
-0.14201796054840088,
-0.33201080560684204,
0.43670129776000977,
-0.38070622086524963,
-0.09972655028104782,
-0.18795587122440338,
-0.2686605453491211,
0.200131356716156,
0.20896729826927185,
-0.21232305467128754,
0.02170472964644432,
-0.3878672420978546,
0.23930421471595764,
-0.1301875114440918,
-0.04679088294506073,
-0.00015840958803892136,
-0.02171594649553299,
0.20118363201618195,
-0.053342461585998535,
-0.0857122540473938,
0.26706650853157043,
-0.102055624127388,
-0.48515576124191284,
0.3996991515159607,
-0.05655097961425781,
-0.1914409101009369,
0.08738954365253448,
-0.17117072641849518,
0.11444327235221863,
0.03464251384139061,
-0.08096607029438019,
0.07494854927062988,
-0.21587873995304108,
-0.1691908836364746,
-0.2220706045627594,
0.01904905028641224,
-0.11564958840608597,
-0.12492163479328156,
0.4945385158061981,
-0.24813735485076904,
0.02179068699479103,
0.3826908469200134,
0.04467107728123665,
-0.12983696162700653,
-0.19934412837028503,
-0.02080734446644783,
-0.045450594276189804,
-0.009270958602428436,
-0.058942247182130814,
-0.1137520894408226,
0.2521287798881531,
-0.336117148399353,
0.1370440572500229,
0.12176722288131714,
-0.13819652795791626,
0.04927675798535347,
-0.4791684150695801,
-0.1921573132276535,
0.11659444868564606,
-0.14037343859672546,
0.16629934310913086,
-0.05385206639766693,
0.2869292199611664,
0.06458761543035507,
-0.181953564286232,
-0.20829012989997864,
0.011290643364191055,
-0.05162833631038666,
-0.09221816807985306,
0.2739124596118927,
0.315157026052475,
0.5544472932815552,
-0.07922890782356262,
0.09241879731416702,
0.21152763068675995,
-0.21628478169441223,
-0.12283258140087128,
-0.1155698150396347,
0.20164692401885986,
0.3467756509780884,
-0.2658436894416809,
0.013455464504659176,
-0.21983373165130615,
-0.10459935665130615,
-0.06739997863769531,
0.1867254674434662,
0.2010076940059662,
-0.03919239342212677,
-0.03182293102145195,
0.15561091899871826,
0.11428071558475494,
-0.322509229183197,
-0.0017664991319179535,
-0.06647394597530365,
0.3725152611732483,
0.1587136685848236,
0.08929252624511719,
-0.12892375886440277,
0.11799585819244385,
-0.09783141314983368,
-0.020757921040058136,
-0.03301742672920227,
0.21228119730949402,
0.3940547704696655,
-0.4751180410385132,
0.09361019730567932,
-0.05096206068992615,
0.08167851716279984,
0.4724428653717041,
-0.20521433651447296,
0.008502459153532982,
0.27819257974624634,
0.11942251026630402,
-0.031318988651037216,
0.04302022606134415,
0.18230856955051422,
-0.041301824152469635,
-0.05989336222410202,
-0.09673383086919785,
-0.05834892392158508,
-0.2807615101337433,
-0.06959812343120575,
0.060273826122283936,
0.24833840131759644,
0.08516094088554382,
0.18966081738471985,
0.4448513686656952,
0.03794010356068611,
0.19667908549308777,
-0.10223310440778732,
-0.06512556970119476,
0.1837368905544281,
0.26998305320739746,
-0.256096214056015,
-0.22846297919750214,
-0.15082955360412598,
0.11247733980417252,
-0.21081578731536865,
-0.5837599635124207,
-0.37412533164024353,
0.13675177097320557,
-0.244267076253891,
0.39939168095588684,
0.19652143120765686,
0.0742519423365593,
-0.1614338755607605,
0.055769577622413635,
-0.3243415355682373,
-0.1624024659395218,
-0.022397123277187347,
0.22725114226341248,
-0.13990339636802673,
-0.2984611392021179,
0.028203003108501434,
0.15969981253147125,
0.00852937251329422,
-0.05497431010007858,
0.10398159176111221,
0.21661140024662018,
-0.17479963600635529,
-0.17565596103668213,
0.038966745138168335,
0.14087720215320587,
0.24339023232460022,
-0.27268004417419434,
0.13330963253974915,
0.18458500504493713,
-0.044360093772411346,
0.18305766582489014,
-0.07467889040708542,
0.42534512281417847,
0.23506006598472595,
0.039257027208805084,
0.15417467057704926,
0.185539111495018,
-0.09270988404750824,
0.14326544106006622,
0.3272568881511688,
0.20650522410869598,
-0.214337557554245,
0.25183454155921936,
0.09707736223936081,
-0.11720587313175201,
0.21091048419475555,
-0.14883646368980408,
0.2876206338405609,
-0.46881017088890076,
0.30672118067741394,
-0.4334767162799835,
0.10325699299573898,
-0.1471916139125824,
-0.17319774627685547,
-0.20473214983940125,
0.2916693389415741,
0.09842155873775482,
-0.12995165586471558,
0.13238796591758728,
0.12089074403047562,
0.023868821561336517,
-0.11856125295162201,
0.15571199357509613,
0.34970030188560486,
0.10535278916358948,
-0.24232438206672668,
-0.19692377746105194,
-0.6438881158828735,
0.1382269263267517,
-0.0963667631149292,
0.16455979645252228,
-0.19771301746368408,
0.16293375194072723,
-0.03372672200202942,
0.08452653884887695,
0.2139347493648529,
0.09984846413135529,
0.21732474863529205,
0.26532089710235596,
-0.11745861172676086,
-0.2823593318462372,
0.026598159223794937,
0.11500189453363419,
-0.24666129052639008,
-0.4413094222545624,
0.07846689969301224,
-0.22740676999092102,
0.04725667089223862,
0.11268853396177292,
-0.12910765409469604,
-0.12330006062984467,
-0.2741156816482544,
0.6556937098503113,
0.12865066528320312,
0.4314830005168915,
-0.14341869950294495,
-0.28353211283683777,
-0.4107500910758972,
-0.03240230306982994,
-0.06375692784786224,
-0.21496421098709106,
-0.1453426331281662,
0.6507197618484497,
-0.13838259875774384,
-0.004225652664899826,
-0.28873008489608765,
0.6345019936561584,
0.2397419959306717,
-0.010852216742932796,
-0.25875890254974365,
0.020687444135546684,
-0.5742632150650024,
0.20704682171344757,
-0.10696203261613846,
0.1641438603401184,
-0.15547531843185425,
0.01403714157640934,
-0.1726662516593933,
-0.17264895141124725,
0.6431175470352173,
-0.8920931816101074,
-0.05727548897266388,
0.11844656616449356,
0.2540162205696106,
0.15828993916511536,
-0.03740879148244858,
-0.2273479700088501,
0.29581642150878906,
0.2916668653488159,
-0.16808098554611206,
-0.2898517847061157,
0.014135900884866714,
-0.006068415939807892,
-0.04722468927502632,
0.06299485266208649,
0.4249376952648163,
0.10371994972229004,
-0.35971251130104065,
0.29650989174842834,
-0.3112955093383789
] |
https://github.com/huggingface/datasets/issues/5574 | c4 dataset streaming fails with `FileNotFoundError` | This problem now appears again, this time with an underlying HTTP 502 status code:
```
aiohttp.client_exceptions.ClientResponseError: 502, message='Bad Gateway', url=URL('https://huggingface.co/datasets/allenai/c4/resolve/1ddc917116b730e1859edef32896ec5c16be51d0/en/c4-validation.00002-of-00008.json.gz')
``` | ### Describe the bug
Loading the `c4` dataset in streaming mode with `load_dataset("c4", "en", split="validation", streaming=True)` and then using it fails with a `FileNotFoundException`.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("c4", "en", split="train", streaming=True)
next(iter(dataset))
```
causes a
```
FileNotFoundError: https://huggingface.co/datasets/allenai/c4/resolve/1ddc917116b730e1859edef32896ec5c16be51d0/en/c4-train.00000-of-01024.json.gz
```
I can download this file manually though e.g. by entering this URL in a browser.
There is an underlying HTTP 403 status code:
```
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('https://cdn-lfs.huggingface.co/datasets/allenai/c4/8ef8d75b0e045dec4aa5123a671b4564466b0707086a7ed1ba8721626dfffbc9?response-content-disposition=attachment%3B+filename*%3DUTF-8''c4-train.00000-of-01024.json.gz%3B+filename%3D%22c4-train.00000-of-01024.json.gz%22%3B&response-content-type=application/gzip&Expires=1677483770&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL2RhdGFzZXRzL2FsbGVuYWkvYzQvOGVmOGQ3NWIwZTA0NWRlYzRhYTUxMjNhNjcxYjQ1NjQ0NjZiMDcwNzA4NmE3ZWQxYmE4NzIxNjI2ZGZmZmJjOT9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSomcmVzcG9uc2UtY29udGVudC10eXBlPWFwcGxpY2F0aW9uJTJGZ3ppcCIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY3NzQ4Mzc3MH19fV19&Signature=yjL3UeY72cf2xpnvPvD68eAYOEe2qtaUJV55sB-jnPskBJEMwpMJcBZvg2~GqXZdM3O-GWV-Z3CI~d4u5VCb4YZ-HlmOjr3VBYkvox2EKiXnBIhjMecf2UVUPtxhTa9kBVlWjqu4qKzB9gKXZF2Cwpp5ctLzapEaT2nnqF84RAL-rsqMA3I~M8vWWfivQsbBK63hMfgZqqKMgdWM0iKMaItveDl0ufQ29azMFmsR7qd8V7sU2Z-F1fAeohS8HpN9OOnClW34yi~YJ2AbgZJJBXA~qsylfVA0Qp7Q~yX~q4P8JF1vmJ2BjkiSbGrj3bAXOGugpOVU5msI52DT88yMdA__&Key-Pair-Id=KVTP0A1DKRTAX')
```
### Expected behavior
This should retrieve the first example from the C4 validation set. This worked a few days ago but stopped working now.
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.15.0-60-generic-x86_64-with-glibc2.31
- Python version: 3.9.16
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
| 21 | c4 dataset streaming fails with `FileNotFoundError`
### Describe the bug
Loading the `c4` dataset in streaming mode with `load_dataset("c4", "en", split="validation", streaming=True)` and then using it fails with a `FileNotFoundException`.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("c4", "en", split="train", streaming=True)
next(iter(dataset))
```
causes a
```
FileNotFoundError: https://huggingface.co/datasets/allenai/c4/resolve/1ddc917116b730e1859edef32896ec5c16be51d0/en/c4-train.00000-of-01024.json.gz
```
I can download this file manually though e.g. by entering this URL in a browser.
There is an underlying HTTP 403 status code:
```
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('https://cdn-lfs.huggingface.co/datasets/allenai/c4/8ef8d75b0e045dec4aa5123a671b4564466b0707086a7ed1ba8721626dfffbc9?response-content-disposition=attachment%3B+filename*%3DUTF-8''c4-train.00000-of-01024.json.gz%3B+filename%3D%22c4-train.00000-of-01024.json.gz%22%3B&response-content-type=application/gzip&Expires=1677483770&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL2RhdGFzZXRzL2FsbGVuYWkvYzQvOGVmOGQ3NWIwZTA0NWRlYzRhYTUxMjNhNjcxYjQ1NjQ0NjZiMDcwNzA4NmE3ZWQxYmE4NzIxNjI2ZGZmZmJjOT9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSomcmVzcG9uc2UtY29udGVudC10eXBlPWFwcGxpY2F0aW9uJTJGZ3ppcCIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY3NzQ4Mzc3MH19fV19&Signature=yjL3UeY72cf2xpnvPvD68eAYOEe2qtaUJV55sB-jnPskBJEMwpMJcBZvg2~GqXZdM3O-GWV-Z3CI~d4u5VCb4YZ-HlmOjr3VBYkvox2EKiXnBIhjMecf2UVUPtxhTa9kBVlWjqu4qKzB9gKXZF2Cwpp5ctLzapEaT2nnqF84RAL-rsqMA3I~M8vWWfivQsbBK63hMfgZqqKMgdWM0iKMaItveDl0ufQ29azMFmsR7qd8V7sU2Z-F1fAeohS8HpN9OOnClW34yi~YJ2AbgZJJBXA~qsylfVA0Qp7Q~yX~q4P8JF1vmJ2BjkiSbGrj3bAXOGugpOVU5msI52DT88yMdA__&Key-Pair-Id=KVTP0A1DKRTAX')
```
### Expected behavior
This should retrieve the first example from the C4 validation set. This worked a few days ago but stopped working now.
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.15.0-60-generic-x86_64-with-glibc2.31
- Python version: 3.9.16
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
This problem now appears again, this time with an underlying HTTP 502 status code:
```
aiohttp.client_exceptions.ClientResponseError: 502, message='Bad Gateway', url=URL('https://huggingface.co/datasets/allenai/c4/resolve/1ddc917116b730e1859edef32896ec5c16be51d0/en/c4-validation.00002-of-00008.json.gz')
``` | [
-0.2467462718486786,
0.13279876112937927,
0.04004215821623802,
0.32442140579223633,
0.1723441779613495,
0.11456891149282455,
0.14179404079914093,
0.2780021131038666,
-0.08522557467222214,
0.06967808306217194,
-0.07468783855438232,
-0.08705097436904907,
-0.0888633131980896,
0.10009647160768509,
0.06160719692707062,
0.027806324884295464,
-0.09655933827161789,
0.19019505381584167,
0.0317605696618557,
0.15858441591262817,
-0.010184548795223236,
0.09507511556148529,
-0.24832436442375183,
-0.0538179874420166,
-0.1898794323205948,
-0.13213948905467987,
0.04076565057039261,
0.31705448031425476,
-0.11375867575407028,
-0.3029356002807617,
0.35685497522354126,
-0.09025917947292328,
0.22927512228488922,
0.5055244565010071,
-0.00011665172496577725,
0.13374163210391998,
0.309661865234375,
-0.1642947643995285,
-0.20611059665679932,
-0.25145959854125977,
-0.4731822609901428,
-0.043023817241191864,
-0.24912941455841064,
-0.09240736812353134,
-0.04734421148896217,
-0.057319726794958115,
0.17451418936252594,
-0.41000881791114807,
0.3812444806098938,
0.5148968696594238,
0.10202870517969131,
0.22239011526107788,
-0.12849010527133942,
0.15287506580352783,
-0.18233045935630798,
-0.21428288519382477,
-0.0802147388458252,
0.28004834055900574,
-0.0665721744298935,
0.1667594164609909,
-0.05099412053823471,
0.18356040120124817,
-0.10023258626461029,
-0.08552347123622894,
0.2082856297492981,
-0.03638123348355293,
-0.0864815041422844,
-0.2673667073249817,
0.16529986262321472,
0.31590551137924194,
0.740833580493927,
-0.3290979266166687,
-0.4362660348415375,
-0.02088863030076027,
0.24007682502269745,
-0.29473093152046204,
0.27932122349739075,
0.28932997584342957,
-0.06849834322929382,
0.20271843671798706,
-0.2132507711648941,
-0.04583487659692764,
-0.3832428455352783,
0.14923974871635437,
-0.042087867856025696,
-0.057114213705062866,
-0.03317325562238693,
-0.04581177979707718,
-0.06490056216716766,
0.03733082860708237,
-0.028729934245347977,
-0.43308302760124207,
-0.2817257344722748,
0.2850091755390167,
-0.24725447595119476,
-0.016068149358034134,
-0.04550222307443619,
0.26849374175071716,
0.012613829225301743,
0.1411409229040146,
0.33579757809638977,
-0.042412810027599335,
-0.27079153060913086,
0.12728652358055115,
0.042364299297332764,
0.1877596229314804,
0.09706982970237732,
-0.09918445348739624,
0.3607012629508972,
0.3305165469646454,
-0.043022580444812775,
-0.299225389957428,
0.08175912499427795,
-0.12616084516048431,
-0.28382280468940735,
-0.060332462191581726,
0.29677170515060425,
-0.3114683926105499,
-0.5887150168418884,
0.21859018504619598,
-0.701935350894928,
-0.001417564693838358,
-0.021332066506147385,
0.506765604019165,
-0.23274073004722595,
0.10391108691692352,
0.07359717041254044,
0.20150282979011536,
0.001089358702301979,
-0.38615506887435913,
-0.127083420753479,
-0.15283173322677612,
-0.03059784322977066,
0.1986517757177353,
0.1966625154018402,
-0.32446348667144775,
0.2735462784767151,
0.03848418965935707,
0.21742673218250275,
0.09323553740978241,
-0.013154305517673492,
-0.05733771622180939,
-0.12895923852920532,
0.195569708943367,
-0.043529022485017776,
0.09557364881038666,
0.1676395833492279,
-0.3185003995895386,
0.04763498157262802,
-0.09468837827444077,
-0.015874050557613373,
-0.10598913580179214,
0.04231127351522446,
0.10096142441034317,
-0.3069586157798767,
-0.0727614015340805,
-0.19828787446022034,
-0.05068235471844673,
-0.26952606439590454,
-0.3888101875782013,
0.1626984030008316,
-0.055219314992427826,
0.11192630231380463,
-0.22574912011623383,
0.23529458045959473,
0.7646635174751282,
-0.2802044749259949,
-0.1846485286951065,
-0.11372776329517365,
-0.16401898860931396,
0.3409588038921356,
0.27698296308517456,
-0.10479753464460373,
0.01931150257587433,
-0.26778340339660645,
0.40866750478744507,
0.21925535798072815,
-0.19311381876468658,
-0.6291771531105042,
0.5631681084632874,
-0.19646494090557098,
0.6119543313980103,
0.2093448042869568,
0.06432729959487915,
-0.0595216304063797,
-0.18049634993076324,
0.1653538942337036,
0.25187960267066956,
-0.0273370910435915,
-0.03522312268614769,
-0.2284655123949051,
-0.10355506092309952,
0.34119659662246704,
0.03135211393237114,
-0.021206539124250412,
0.14884987473487854,
0.32728931307792664,
-0.02599778212606907,
0.41606247425079346,
-0.2120276689529419,
-0.0012862831354141235,
-0.007101666182279587,
0.47636035084724426,
-0.036758773028850555,
-0.16989751160144806,
0.10066860169172287,
-0.607447624206543,
0.23923105001449585,
0.1632545292377472,
-0.17657506465911865,
-0.03365790843963623,
-0.09012711048126221,
-0.0279281847178936,
-0.13434557616710663,
-0.33751973509788513,
-0.3689330220222473,
0.08227864652872086,
0.2043687403202057,
0.006775926798582077,
0.21912585198879242,
-0.1947854608297348,
0.8216492533683777,
-0.42222344875335693,
0.010109343566000462,
-0.03835589438676834,
0.2734583616256714,
0.027525464072823524,
-0.06141076236963272,
0.04907625913619995,
-0.06341006606817245,
0.23409846425056458,
-0.13357433676719666,
-0.08236509561538696,
0.5615682005882263,
-0.05533430725336075,
0.295086145401001,
-0.10691533237695694,
0.08125246316194534,
0.4368551969528198,
-0.2516922056674957,
0.007443314418196678,
0.5023471117019653,
0.23382879793643951,
0.02167937159538269,
0.04421984776854515,
0.3587788939476013,
0.07097887247800827,
0.08141403645277023,
0.2847810387611389,
-0.003402218222618103,
0.20224960148334503,
0.08997105062007904,
-0.23544280230998993,
0.09405019879341125,
0.4511280357837677,
-0.38557836413383484,
0.32700058817863464,
-0.17344869673252106,
-0.4125608205795288,
-0.045385994017124176,
0.2711707651615143,
-0.086728036403656,
-0.21076464653015137,
-0.06281088292598724,
-0.2558002769947052,
0.09161128848791122,
0.467567503452301,
0.3024212718009949,
0.43926066160202026,
0.06820511817932129,
-0.13268417119979858,
0.1980845183134079,
-0.10682034492492676,
-0.18183402717113495,
0.16543179750442505,
-0.21031241118907928,
-0.1176859512925148,
0.2709534168243408,
-0.05011561140418053,
0.06094174087047577,
-0.26872342824935913,
-0.44717922806739807,
-0.06406036019325256,
0.0006428882479667664,
-0.4872424900531769,
0.21120157837867737,
-0.36426493525505066,
-0.22301757335662842,
-0.07438651472330093,
-0.06230941042304039,
-0.16031686961650848,
-0.11078377068042755,
-0.18558762967586517,
0.3693574368953705,
-0.10465750098228455,
0.02522594854235649,
-0.8260208964347839,
0.02523478865623474,
-0.01327403262257576,
-0.31963685154914856,
-0.17091074585914612,
0.16814208030700684,
-0.22076234221458435,
0.06438340246677399,
0.47011512517929077,
-0.1355893611907959,
0.21940530836582184,
-0.2175547182559967,
-0.09454120695590973,
-0.38990432024002075,
-0.17627979815006256,
0.09338358044624329,
-0.0761294737458229,
0.17922888696193695,
-0.23388555645942688,
0.3725619912147522,
-0.16186849772930145,
-0.35431599617004395,
-0.007720916997641325,
-0.13874037563800812,
-0.10681159794330597,
0.12521858513355255,
-0.01400883961468935,
-0.09701523929834366,
-0.11198844015598297,
-0.3995073139667511,
-0.14540664851665497,
-0.3510515093803406,
0.2642711400985718,
-0.1719008982181549,
0.01036936417222023,
0.4008120000362396,
0.11057275533676147,
0.29947400093078613,
0.1075277104973793,
-0.173945352435112,
-0.007569999434053898,
-0.24086622893810272,
0.4674313962459564,
-0.022617556154727936,
-0.36916548013687134,
0.20961883664131165,
0.08432953804731369,
-0.06399405002593994,
0.37871766090393066,
-0.3669458031654358,
0.2902870774269104,
-0.11964832246303558,
0.2584117352962494,
-0.07022438198328018,
-0.20720434188842773,
0.1946023404598236,
-0.2807164788246155,
0.08727731555700302,
-0.253869891166687,
0.10635335743427277,
-0.068071149289608,
0.28173863887786865,
0.4405917525291443,
-0.06615250557661057,
0.37335941195487976,
0.18214388191699982,
0.5030514597892761,
0.33333873748779297,
-0.1447412371635437,
0.49497711658477783,
-0.04692456126213074,
0.48988044261932373,
0.09671000391244888,
-0.021917054429650307,
0.21092338860034943,
-0.07143810391426086,
-0.23888611793518066,
0.1857145130634308,
-0.05955946445465088,
-0.1173391118645668,
-0.3247036039829254,
0.05678357556462288,
-0.3353002071380615,
-0.15100382268428802,
0.0470120832324028,
-0.04628527909517288,
0.13905155658721924,
0.10295809805393219,
0.20392337441444397,
0.2588067352771759,
-0.18477711081504822,
0.10135670006275177,
0.6303920745849609,
0.34443399310112,
0.1472344547510147,
-0.09011538326740265,
-0.32927224040031433,
-0.4260959327220917,
0.404471218585968,
0.2784533202648163,
0.3510306477546692,
-0.13401074707508087,
-0.14684903621673584,
-0.08164574205875397,
-0.18911698460578918,
0.5461317300796509,
-0.20066425204277039,
0.14058023691177368,
0.12941516935825348,
0.20293691754341125,
0.003830930218100548,
-0.1206861287355423,
-0.044159408658742905,
0.2406240701675415,
0.4243500232696533,
0.20681512355804443,
-0.1926030069589615,
0.009018734097480774,
-0.22709301114082336,
-0.015158829279243946,
0.1268855482339859,
0.03617442026734352,
-0.15880940854549408,
-0.12921872735023499,
-0.1440446823835373,
-0.06087259203195572,
-0.0431312695145607,
0.0795368179678917,
-0.20847325026988983,
0.19558954238891602,
0.023120349273085594,
0.06246577203273773,
0.2545427083969116,
0.23770852386951447,
0.19763469696044922,
0.0004946620902046561,
0.13283419609069824,
0.2977561950683594,
0.11113382875919342,
0.5374557971954346,
0.5015861988067627,
0.3258613049983978,
-0.32760339975357056,
-0.05168347805738449,
0.18064171075820923,
0.06356197595596313,
0.3620198965072632,
0.03963249549269676,
-0.11139494925737381,
0.3632160425186157,
0.00010451674461364746,
-0.060506317764520645,
0.21385736763477325,
0.3125086724758148,
-0.20250427722930908,
-0.4594510495662689,
-0.4426804482936859,
0.42595407366752625,
-0.19747550785541534,
0.08712536096572876,
0.5395447015762329,
0.37628114223480225,
-0.14481261372566223,
-0.04598533362150192,
-0.19865241646766663,
0.667384684085846,
0.21085840463638306,
0.16781212389469147,
0.4115624725818634,
-0.0649867057800293,
0.2511211335659027,
-0.5093109011650085,
0.27916330099105835,
-0.07036405801773071,
-0.2707407474517822,
-0.18096566200256348,
-0.1309647113084793,
0.3981797695159912,
0.0845387876033783,
-0.14743323624134064,
0.2973511517047882,
0.07149368524551392,
0.37954163551330566,
0.22432971000671387,
-0.13453055918216705,
-0.5341125130653381,
0.05241091549396515,
-0.4589904546737671,
0.11229412257671356,
-0.11275619268417358,
0.22009262442588806,
-0.10963410139083862,
-0.3131343722343445,
-0.22502021491527557,
-0.14201796054840088,
-0.33201080560684204,
0.43670129776000977,
-0.38070622086524963,
-0.09972655028104782,
-0.18795587122440338,
-0.2686605453491211,
0.200131356716156,
0.20896729826927185,
-0.21232305467128754,
0.02170472964644432,
-0.3878672420978546,
0.23930421471595764,
-0.1301875114440918,
-0.04679088294506073,
-0.00015840958803892136,
-0.02171594649553299,
0.20118363201618195,
-0.053342461585998535,
-0.0857122540473938,
0.26706650853157043,
-0.102055624127388,
-0.48515576124191284,
0.3996991515159607,
-0.05655097961425781,
-0.1914409101009369,
0.08738954365253448,
-0.17117072641849518,
0.11444327235221863,
0.03464251384139061,
-0.08096607029438019,
0.07494854927062988,
-0.21587873995304108,
-0.1691908836364746,
-0.2220706045627594,
0.01904905028641224,
-0.11564958840608597,
-0.12492163479328156,
0.4945385158061981,
-0.24813735485076904,
0.02179068699479103,
0.3826908469200134,
0.04467107728123665,
-0.12983696162700653,
-0.19934412837028503,
-0.02080734446644783,
-0.045450594276189804,
-0.009270958602428436,
-0.058942247182130814,
-0.1137520894408226,
0.2521287798881531,
-0.336117148399353,
0.1370440572500229,
0.12176722288131714,
-0.13819652795791626,
0.04927675798535347,
-0.4791684150695801,
-0.1921573132276535,
0.11659444868564606,
-0.14037343859672546,
0.16629934310913086,
-0.05385206639766693,
0.2869292199611664,
0.06458761543035507,
-0.181953564286232,
-0.20829012989997864,
0.011290643364191055,
-0.05162833631038666,
-0.09221816807985306,
0.2739124596118927,
0.315157026052475,
0.5544472932815552,
-0.07922890782356262,
0.09241879731416702,
0.21152763068675995,
-0.21628478169441223,
-0.12283258140087128,
-0.1155698150396347,
0.20164692401885986,
0.3467756509780884,
-0.2658436894416809,
0.013455464504659176,
-0.21983373165130615,
-0.10459935665130615,
-0.06739997863769531,
0.1867254674434662,
0.2010076940059662,
-0.03919239342212677,
-0.03182293102145195,
0.15561091899871826,
0.11428071558475494,
-0.322509229183197,
-0.0017664991319179535,
-0.06647394597530365,
0.3725152611732483,
0.1587136685848236,
0.08929252624511719,
-0.12892375886440277,
0.11799585819244385,
-0.09783141314983368,
-0.020757921040058136,
-0.03301742672920227,
0.21228119730949402,
0.3940547704696655,
-0.4751180410385132,
0.09361019730567932,
-0.05096206068992615,
0.08167851716279984,
0.4724428653717041,
-0.20521433651447296,
0.008502459153532982,
0.27819257974624634,
0.11942251026630402,
-0.031318988651037216,
0.04302022606134415,
0.18230856955051422,
-0.041301824152469635,
-0.05989336222410202,
-0.09673383086919785,
-0.05834892392158508,
-0.2807615101337433,
-0.06959812343120575,
0.060273826122283936,
0.24833840131759644,
0.08516094088554382,
0.18966081738471985,
0.4448513686656952,
0.03794010356068611,
0.19667908549308777,
-0.10223310440778732,
-0.06512556970119476,
0.1837368905544281,
0.26998305320739746,
-0.256096214056015,
-0.22846297919750214,
-0.15082955360412598,
0.11247733980417252,
-0.21081578731536865,
-0.5837599635124207,
-0.37412533164024353,
0.13675177097320557,
-0.244267076253891,
0.39939168095588684,
0.19652143120765686,
0.0742519423365593,
-0.1614338755607605,
0.055769577622413635,
-0.3243415355682373,
-0.1624024659395218,
-0.022397123277187347,
0.22725114226341248,
-0.13990339636802673,
-0.2984611392021179,
0.028203003108501434,
0.15969981253147125,
0.00852937251329422,
-0.05497431010007858,
0.10398159176111221,
0.21661140024662018,
-0.17479963600635529,
-0.17565596103668213,
0.038966745138168335,
0.14087720215320587,
0.24339023232460022,
-0.27268004417419434,
0.13330963253974915,
0.18458500504493713,
-0.044360093772411346,
0.18305766582489014,
-0.07467889040708542,
0.42534512281417847,
0.23506006598472595,
0.039257027208805084,
0.15417467057704926,
0.185539111495018,
-0.09270988404750824,
0.14326544106006622,
0.3272568881511688,
0.20650522410869598,
-0.214337557554245,
0.25183454155921936,
0.09707736223936081,
-0.11720587313175201,
0.21091048419475555,
-0.14883646368980408,
0.2876206338405609,
-0.46881017088890076,
0.30672118067741394,
-0.4334767162799835,
0.10325699299573898,
-0.1471916139125824,
-0.17319774627685547,
-0.20473214983940125,
0.2916693389415741,
0.09842155873775482,
-0.12995165586471558,
0.13238796591758728,
0.12089074403047562,
0.023868821561336517,
-0.11856125295162201,
0.15571199357509613,
0.34970030188560486,
0.10535278916358948,
-0.24232438206672668,
-0.19692377746105194,
-0.6438881158828735,
0.1382269263267517,
-0.0963667631149292,
0.16455979645252228,
-0.19771301746368408,
0.16293375194072723,
-0.03372672200202942,
0.08452653884887695,
0.2139347493648529,
0.09984846413135529,
0.21732474863529205,
0.26532089710235596,
-0.11745861172676086,
-0.2823593318462372,
0.026598159223794937,
0.11500189453363419,
-0.24666129052639008,
-0.4413094222545624,
0.07846689969301224,
-0.22740676999092102,
0.04725667089223862,
0.11268853396177292,
-0.12910765409469604,
-0.12330006062984467,
-0.2741156816482544,
0.6556937098503113,
0.12865066528320312,
0.4314830005168915,
-0.14341869950294495,
-0.28353211283683777,
-0.4107500910758972,
-0.03240230306982994,
-0.06375692784786224,
-0.21496421098709106,
-0.1453426331281662,
0.6507197618484497,
-0.13838259875774384,
-0.004225652664899826,
-0.28873008489608765,
0.6345019936561584,
0.2397419959306717,
-0.010852216742932796,
-0.25875890254974365,
0.020687444135546684,
-0.5742632150650024,
0.20704682171344757,
-0.10696203261613846,
0.1641438603401184,
-0.15547531843185425,
0.01403714157640934,
-0.1726662516593933,
-0.17264895141124725,
0.6431175470352173,
-0.8920931816101074,
-0.05727548897266388,
0.11844656616449356,
0.2540162205696106,
0.15828993916511536,
-0.03740879148244858,
-0.2273479700088501,
0.29581642150878906,
0.2916668653488159,
-0.16808098554611206,
-0.2898517847061157,
0.014135900884866714,
-0.006068415939807892,
-0.04722468927502632,
0.06299485266208649,
0.4249376952648163,
0.10371994972229004,
-0.35971251130104065,
0.29650989174842834,
-0.3112955093383789
] |
https://github.com/huggingface/datasets/issues/5574 | c4 dataset streaming fails with `FileNotFoundError` | Re-executing a minute later, the underlying cause is an HTTP 403 status code, as reported yesterday:
```
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('https://cdn-lfs.huggingface.co/datasets/allenai/c4/4bf6b248b0f910dcde2cdf2118d6369d8208c8f9515ec29ab73e531f380b18e2?response-content-disposition=attachment%3B+filename*%3DUTF-8''c4-validation.00002-of-00008.json.gz%3B+filename%3D%22c4-validation.00002-of-00008.json.gz%22%3B&response-content-type=application/gzip&Expires=1677571273&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL2RhdGFzZXRzL2FsbGVuYWkvYzQvNGJmNmIyNDhiMGY5MTBkY2RlMmNkZjIxMThkNjM2OWQ4MjA4YzhmOTUxNWVjMjlhYjczZTUzMWYzODBiMThlMj9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSomcmVzcG9uc2UtY29udGVudC10eXBlPWFwcGxpY2F0aW9uJTJGZ3ppcCIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY3NzU3MTI3M319fV19&Signature=WW42NOKkLuX~xVB1QfbkqzdvGo2AOXpgbF3PjTXy6iKd~ffilr1N9ScPXfvTXqy5yvdhJg1G0xJy1zYtUjGAL8GEx3Av-0vIhpWMGYTM8XKEU5gYA9qt30oVtNph6TkTYSABrsYTaj-hzQL9WCgyapmjvG69ETMh4wj44r2rcbk4T3j0l6l4u76Gh~lyRSll3aK4qycdUwcyL7FECDu~0W1mJIJwKkCrWHhSpHJSshb-0ElwG71pq4eyQ5g2uxHdK6JbRF7loxUpRQQJ1vlk0EHXdw0wTMaQ9tqHy6xcrQd8Ep0Yvx3tUD8MR0vWOcbQKnL6LwPQByc8tkChlpjnig__&Key-Pair-Id=KVTP0A1DKRTAX')
``` | ### Describe the bug
Loading the `c4` dataset in streaming mode with `load_dataset("c4", "en", split="validation", streaming=True)` and then using it fails with a `FileNotFoundException`.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("c4", "en", split="train", streaming=True)
next(iter(dataset))
```
causes a
```
FileNotFoundError: https://huggingface.co/datasets/allenai/c4/resolve/1ddc917116b730e1859edef32896ec5c16be51d0/en/c4-train.00000-of-01024.json.gz
```
I can download this file manually though e.g. by entering this URL in a browser.
There is an underlying HTTP 403 status code:
```
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('https://cdn-lfs.huggingface.co/datasets/allenai/c4/8ef8d75b0e045dec4aa5123a671b4564466b0707086a7ed1ba8721626dfffbc9?response-content-disposition=attachment%3B+filename*%3DUTF-8''c4-train.00000-of-01024.json.gz%3B+filename%3D%22c4-train.00000-of-01024.json.gz%22%3B&response-content-type=application/gzip&Expires=1677483770&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL2RhdGFzZXRzL2FsbGVuYWkvYzQvOGVmOGQ3NWIwZTA0NWRlYzRhYTUxMjNhNjcxYjQ1NjQ0NjZiMDcwNzA4NmE3ZWQxYmE4NzIxNjI2ZGZmZmJjOT9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSomcmVzcG9uc2UtY29udGVudC10eXBlPWFwcGxpY2F0aW9uJTJGZ3ppcCIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY3NzQ4Mzc3MH19fV19&Signature=yjL3UeY72cf2xpnvPvD68eAYOEe2qtaUJV55sB-jnPskBJEMwpMJcBZvg2~GqXZdM3O-GWV-Z3CI~d4u5VCb4YZ-HlmOjr3VBYkvox2EKiXnBIhjMecf2UVUPtxhTa9kBVlWjqu4qKzB9gKXZF2Cwpp5ctLzapEaT2nnqF84RAL-rsqMA3I~M8vWWfivQsbBK63hMfgZqqKMgdWM0iKMaItveDl0ufQ29azMFmsR7qd8V7sU2Z-F1fAeohS8HpN9OOnClW34yi~YJ2AbgZJJBXA~qsylfVA0Qp7Q~yX~q4P8JF1vmJ2BjkiSbGrj3bAXOGugpOVU5msI52DT88yMdA__&Key-Pair-Id=KVTP0A1DKRTAX')
```
### Expected behavior
This should retrieve the first example from the C4 validation set. This worked a few days ago but stopped working now.
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.15.0-60-generic-x86_64-with-glibc2.31
- Python version: 3.9.16
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
| 22 | c4 dataset streaming fails with `FileNotFoundError`
### Describe the bug
Loading the `c4` dataset in streaming mode with `load_dataset("c4", "en", split="validation", streaming=True)` and then using it fails with a `FileNotFoundException`.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("c4", "en", split="train", streaming=True)
next(iter(dataset))
```
causes a
```
FileNotFoundError: https://huggingface.co/datasets/allenai/c4/resolve/1ddc917116b730e1859edef32896ec5c16be51d0/en/c4-train.00000-of-01024.json.gz
```
I can download this file manually though e.g. by entering this URL in a browser.
There is an underlying HTTP 403 status code:
```
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('https://cdn-lfs.huggingface.co/datasets/allenai/c4/8ef8d75b0e045dec4aa5123a671b4564466b0707086a7ed1ba8721626dfffbc9?response-content-disposition=attachment%3B+filename*%3DUTF-8''c4-train.00000-of-01024.json.gz%3B+filename%3D%22c4-train.00000-of-01024.json.gz%22%3B&response-content-type=application/gzip&Expires=1677483770&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL2RhdGFzZXRzL2FsbGVuYWkvYzQvOGVmOGQ3NWIwZTA0NWRlYzRhYTUxMjNhNjcxYjQ1NjQ0NjZiMDcwNzA4NmE3ZWQxYmE4NzIxNjI2ZGZmZmJjOT9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSomcmVzcG9uc2UtY29udGVudC10eXBlPWFwcGxpY2F0aW9uJTJGZ3ppcCIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY3NzQ4Mzc3MH19fV19&Signature=yjL3UeY72cf2xpnvPvD68eAYOEe2qtaUJV55sB-jnPskBJEMwpMJcBZvg2~GqXZdM3O-GWV-Z3CI~d4u5VCb4YZ-HlmOjr3VBYkvox2EKiXnBIhjMecf2UVUPtxhTa9kBVlWjqu4qKzB9gKXZF2Cwpp5ctLzapEaT2nnqF84RAL-rsqMA3I~M8vWWfivQsbBK63hMfgZqqKMgdWM0iKMaItveDl0ufQ29azMFmsR7qd8V7sU2Z-F1fAeohS8HpN9OOnClW34yi~YJ2AbgZJJBXA~qsylfVA0Qp7Q~yX~q4P8JF1vmJ2BjkiSbGrj3bAXOGugpOVU5msI52DT88yMdA__&Key-Pair-Id=KVTP0A1DKRTAX')
```
### Expected behavior
This should retrieve the first example from the C4 validation set. This worked a few days ago but stopped working now.
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.15.0-60-generic-x86_64-with-glibc2.31
- Python version: 3.9.16
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
Re-executing a minute later, the underlying cause is an HTTP 403 status code, as reported yesterday:
```
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('https://cdn-lfs.huggingface.co/datasets/allenai/c4/4bf6b248b0f910dcde2cdf2118d6369d8208c8f9515ec29ab73e531f380b18e2?response-content-disposition=attachment%3B+filename*%3DUTF-8''c4-validation.00002-of-00008.json.gz%3B+filename%3D%22c4-validation.00002-of-00008.json.gz%22%3B&response-content-type=application/gzip&Expires=1677571273&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL2RhdGFzZXRzL2FsbGVuYWkvYzQvNGJmNmIyNDhiMGY5MTBkY2RlMmNkZjIxMThkNjM2OWQ4MjA4YzhmOTUxNWVjMjlhYjczZTUzMWYzODBiMThlMj9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSomcmVzcG9uc2UtY29udGVudC10eXBlPWFwcGxpY2F0aW9uJTJGZ3ppcCIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY3NzU3MTI3M319fV19&Signature=WW42NOKkLuX~xVB1QfbkqzdvGo2AOXpgbF3PjTXy6iKd~ffilr1N9ScPXfvTXqy5yvdhJg1G0xJy1zYtUjGAL8GEx3Av-0vIhpWMGYTM8XKEU5gYA9qt30oVtNph6TkTYSABrsYTaj-hzQL9WCgyapmjvG69ETMh4wj44r2rcbk4T3j0l6l4u76Gh~lyRSll3aK4qycdUwcyL7FECDu~0W1mJIJwKkCrWHhSpHJSshb-0ElwG71pq4eyQ5g2uxHdK6JbRF7loxUpRQQJ1vlk0EHXdw0wTMaQ9tqHy6xcrQd8Ep0Yvx3tUD8MR0vWOcbQKnL6LwPQByc8tkChlpjnig__&Key-Pair-Id=KVTP0A1DKRTAX')
``` | [
-0.2467462718486786,
0.13279876112937927,
0.04004215821623802,
0.32442140579223633,
0.1723441779613495,
0.11456891149282455,
0.14179404079914093,
0.2780021131038666,
-0.08522557467222214,
0.06967808306217194,
-0.07468783855438232,
-0.08705097436904907,
-0.0888633131980896,
0.10009647160768509,
0.06160719692707062,
0.027806324884295464,
-0.09655933827161789,
0.19019505381584167,
0.0317605696618557,
0.15858441591262817,
-0.010184548795223236,
0.09507511556148529,
-0.24832436442375183,
-0.0538179874420166,
-0.1898794323205948,
-0.13213948905467987,
0.04076565057039261,
0.31705448031425476,
-0.11375867575407028,
-0.3029356002807617,
0.35685497522354126,
-0.09025917947292328,
0.22927512228488922,
0.5055244565010071,
-0.00011665172496577725,
0.13374163210391998,
0.309661865234375,
-0.1642947643995285,
-0.20611059665679932,
-0.25145959854125977,
-0.4731822609901428,
-0.043023817241191864,
-0.24912941455841064,
-0.09240736812353134,
-0.04734421148896217,
-0.057319726794958115,
0.17451418936252594,
-0.41000881791114807,
0.3812444806098938,
0.5148968696594238,
0.10202870517969131,
0.22239011526107788,
-0.12849010527133942,
0.15287506580352783,
-0.18233045935630798,
-0.21428288519382477,
-0.0802147388458252,
0.28004834055900574,
-0.0665721744298935,
0.1667594164609909,
-0.05099412053823471,
0.18356040120124817,
-0.10023258626461029,
-0.08552347123622894,
0.2082856297492981,
-0.03638123348355293,
-0.0864815041422844,
-0.2673667073249817,
0.16529986262321472,
0.31590551137924194,
0.740833580493927,
-0.3290979266166687,
-0.4362660348415375,
-0.02088863030076027,
0.24007682502269745,
-0.29473093152046204,
0.27932122349739075,
0.28932997584342957,
-0.06849834322929382,
0.20271843671798706,
-0.2132507711648941,
-0.04583487659692764,
-0.3832428455352783,
0.14923974871635437,
-0.042087867856025696,
-0.057114213705062866,
-0.03317325562238693,
-0.04581177979707718,
-0.06490056216716766,
0.03733082860708237,
-0.028729934245347977,
-0.43308302760124207,
-0.2817257344722748,
0.2850091755390167,
-0.24725447595119476,
-0.016068149358034134,
-0.04550222307443619,
0.26849374175071716,
0.012613829225301743,
0.1411409229040146,
0.33579757809638977,
-0.042412810027599335,
-0.27079153060913086,
0.12728652358055115,
0.042364299297332764,
0.1877596229314804,
0.09706982970237732,
-0.09918445348739624,
0.3607012629508972,
0.3305165469646454,
-0.043022580444812775,
-0.299225389957428,
0.08175912499427795,
-0.12616084516048431,
-0.28382280468940735,
-0.060332462191581726,
0.29677170515060425,
-0.3114683926105499,
-0.5887150168418884,
0.21859018504619598,
-0.701935350894928,
-0.001417564693838358,
-0.021332066506147385,
0.506765604019165,
-0.23274073004722595,
0.10391108691692352,
0.07359717041254044,
0.20150282979011536,
0.001089358702301979,
-0.38615506887435913,
-0.127083420753479,
-0.15283173322677612,
-0.03059784322977066,
0.1986517757177353,
0.1966625154018402,
-0.32446348667144775,
0.2735462784767151,
0.03848418965935707,
0.21742673218250275,
0.09323553740978241,
-0.013154305517673492,
-0.05733771622180939,
-0.12895923852920532,
0.195569708943367,
-0.043529022485017776,
0.09557364881038666,
0.1676395833492279,
-0.3185003995895386,
0.04763498157262802,
-0.09468837827444077,
-0.015874050557613373,
-0.10598913580179214,
0.04231127351522446,
0.10096142441034317,
-0.3069586157798767,
-0.0727614015340805,
-0.19828787446022034,
-0.05068235471844673,
-0.26952606439590454,
-0.3888101875782013,
0.1626984030008316,
-0.055219314992427826,
0.11192630231380463,
-0.22574912011623383,
0.23529458045959473,
0.7646635174751282,
-0.2802044749259949,
-0.1846485286951065,
-0.11372776329517365,
-0.16401898860931396,
0.3409588038921356,
0.27698296308517456,
-0.10479753464460373,
0.01931150257587433,
-0.26778340339660645,
0.40866750478744507,
0.21925535798072815,
-0.19311381876468658,
-0.6291771531105042,
0.5631681084632874,
-0.19646494090557098,
0.6119543313980103,
0.2093448042869568,
0.06432729959487915,
-0.0595216304063797,
-0.18049634993076324,
0.1653538942337036,
0.25187960267066956,
-0.0273370910435915,
-0.03522312268614769,
-0.2284655123949051,
-0.10355506092309952,
0.34119659662246704,
0.03135211393237114,
-0.021206539124250412,
0.14884987473487854,
0.32728931307792664,
-0.02599778212606907,
0.41606247425079346,
-0.2120276689529419,
-0.0012862831354141235,
-0.007101666182279587,
0.47636035084724426,
-0.036758773028850555,
-0.16989751160144806,
0.10066860169172287,
-0.607447624206543,
0.23923105001449585,
0.1632545292377472,
-0.17657506465911865,
-0.03365790843963623,
-0.09012711048126221,
-0.0279281847178936,
-0.13434557616710663,
-0.33751973509788513,
-0.3689330220222473,
0.08227864652872086,
0.2043687403202057,
0.006775926798582077,
0.21912585198879242,
-0.1947854608297348,
0.8216492533683777,
-0.42222344875335693,
0.010109343566000462,
-0.03835589438676834,
0.2734583616256714,
0.027525464072823524,
-0.06141076236963272,
0.04907625913619995,
-0.06341006606817245,
0.23409846425056458,
-0.13357433676719666,
-0.08236509561538696,
0.5615682005882263,
-0.05533430725336075,
0.295086145401001,
-0.10691533237695694,
0.08125246316194534,
0.4368551969528198,
-0.2516922056674957,
0.007443314418196678,
0.5023471117019653,
0.23382879793643951,
0.02167937159538269,
0.04421984776854515,
0.3587788939476013,
0.07097887247800827,
0.08141403645277023,
0.2847810387611389,
-0.003402218222618103,
0.20224960148334503,
0.08997105062007904,
-0.23544280230998993,
0.09405019879341125,
0.4511280357837677,
-0.38557836413383484,
0.32700058817863464,
-0.17344869673252106,
-0.4125608205795288,
-0.045385994017124176,
0.2711707651615143,
-0.086728036403656,
-0.21076464653015137,
-0.06281088292598724,
-0.2558002769947052,
0.09161128848791122,
0.467567503452301,
0.3024212718009949,
0.43926066160202026,
0.06820511817932129,
-0.13268417119979858,
0.1980845183134079,
-0.10682034492492676,
-0.18183402717113495,
0.16543179750442505,
-0.21031241118907928,
-0.1176859512925148,
0.2709534168243408,
-0.05011561140418053,
0.06094174087047577,
-0.26872342824935913,
-0.44717922806739807,
-0.06406036019325256,
0.0006428882479667664,
-0.4872424900531769,
0.21120157837867737,
-0.36426493525505066,
-0.22301757335662842,
-0.07438651472330093,
-0.06230941042304039,
-0.16031686961650848,
-0.11078377068042755,
-0.18558762967586517,
0.3693574368953705,
-0.10465750098228455,
0.02522594854235649,
-0.8260208964347839,
0.02523478865623474,
-0.01327403262257576,
-0.31963685154914856,
-0.17091074585914612,
0.16814208030700684,
-0.22076234221458435,
0.06438340246677399,
0.47011512517929077,
-0.1355893611907959,
0.21940530836582184,
-0.2175547182559967,
-0.09454120695590973,
-0.38990432024002075,
-0.17627979815006256,
0.09338358044624329,
-0.0761294737458229,
0.17922888696193695,
-0.23388555645942688,
0.3725619912147522,
-0.16186849772930145,
-0.35431599617004395,
-0.007720916997641325,
-0.13874037563800812,
-0.10681159794330597,
0.12521858513355255,
-0.01400883961468935,
-0.09701523929834366,
-0.11198844015598297,
-0.3995073139667511,
-0.14540664851665497,
-0.3510515093803406,
0.2642711400985718,
-0.1719008982181549,
0.01036936417222023,
0.4008120000362396,
0.11057275533676147,
0.29947400093078613,
0.1075277104973793,
-0.173945352435112,
-0.007569999434053898,
-0.24086622893810272,
0.4674313962459564,
-0.022617556154727936,
-0.36916548013687134,
0.20961883664131165,
0.08432953804731369,
-0.06399405002593994,
0.37871766090393066,
-0.3669458031654358,
0.2902870774269104,
-0.11964832246303558,
0.2584117352962494,
-0.07022438198328018,
-0.20720434188842773,
0.1946023404598236,
-0.2807164788246155,
0.08727731555700302,
-0.253869891166687,
0.10635335743427277,
-0.068071149289608,
0.28173863887786865,
0.4405917525291443,
-0.06615250557661057,
0.37335941195487976,
0.18214388191699982,
0.5030514597892761,
0.33333873748779297,
-0.1447412371635437,
0.49497711658477783,
-0.04692456126213074,
0.48988044261932373,
0.09671000391244888,
-0.021917054429650307,
0.21092338860034943,
-0.07143810391426086,
-0.23888611793518066,
0.1857145130634308,
-0.05955946445465088,
-0.1173391118645668,
-0.3247036039829254,
0.05678357556462288,
-0.3353002071380615,
-0.15100382268428802,
0.0470120832324028,
-0.04628527909517288,
0.13905155658721924,
0.10295809805393219,
0.20392337441444397,
0.2588067352771759,
-0.18477711081504822,
0.10135670006275177,
0.6303920745849609,
0.34443399310112,
0.1472344547510147,
-0.09011538326740265,
-0.32927224040031433,
-0.4260959327220917,
0.404471218585968,
0.2784533202648163,
0.3510306477546692,
-0.13401074707508087,
-0.14684903621673584,
-0.08164574205875397,
-0.18911698460578918,
0.5461317300796509,
-0.20066425204277039,
0.14058023691177368,
0.12941516935825348,
0.20293691754341125,
0.003830930218100548,
-0.1206861287355423,
-0.044159408658742905,
0.2406240701675415,
0.4243500232696533,
0.20681512355804443,
-0.1926030069589615,
0.009018734097480774,
-0.22709301114082336,
-0.015158829279243946,
0.1268855482339859,
0.03617442026734352,
-0.15880940854549408,
-0.12921872735023499,
-0.1440446823835373,
-0.06087259203195572,
-0.0431312695145607,
0.0795368179678917,
-0.20847325026988983,
0.19558954238891602,
0.023120349273085594,
0.06246577203273773,
0.2545427083969116,
0.23770852386951447,
0.19763469696044922,
0.0004946620902046561,
0.13283419609069824,
0.2977561950683594,
0.11113382875919342,
0.5374557971954346,
0.5015861988067627,
0.3258613049983978,
-0.32760339975357056,
-0.05168347805738449,
0.18064171075820923,
0.06356197595596313,
0.3620198965072632,
0.03963249549269676,
-0.11139494925737381,
0.3632160425186157,
0.00010451674461364746,
-0.060506317764520645,
0.21385736763477325,
0.3125086724758148,
-0.20250427722930908,
-0.4594510495662689,
-0.4426804482936859,
0.42595407366752625,
-0.19747550785541534,
0.08712536096572876,
0.5395447015762329,
0.37628114223480225,
-0.14481261372566223,
-0.04598533362150192,
-0.19865241646766663,
0.667384684085846,
0.21085840463638306,
0.16781212389469147,
0.4115624725818634,
-0.0649867057800293,
0.2511211335659027,
-0.5093109011650085,
0.27916330099105835,
-0.07036405801773071,
-0.2707407474517822,
-0.18096566200256348,
-0.1309647113084793,
0.3981797695159912,
0.0845387876033783,
-0.14743323624134064,
0.2973511517047882,
0.07149368524551392,
0.37954163551330566,
0.22432971000671387,
-0.13453055918216705,
-0.5341125130653381,
0.05241091549396515,
-0.4589904546737671,
0.11229412257671356,
-0.11275619268417358,
0.22009262442588806,
-0.10963410139083862,
-0.3131343722343445,
-0.22502021491527557,
-0.14201796054840088,
-0.33201080560684204,
0.43670129776000977,
-0.38070622086524963,
-0.09972655028104782,
-0.18795587122440338,
-0.2686605453491211,
0.200131356716156,
0.20896729826927185,
-0.21232305467128754,
0.02170472964644432,
-0.3878672420978546,
0.23930421471595764,
-0.1301875114440918,
-0.04679088294506073,
-0.00015840958803892136,
-0.02171594649553299,
0.20118363201618195,
-0.053342461585998535,
-0.0857122540473938,
0.26706650853157043,
-0.102055624127388,
-0.48515576124191284,
0.3996991515159607,
-0.05655097961425781,
-0.1914409101009369,
0.08738954365253448,
-0.17117072641849518,
0.11444327235221863,
0.03464251384139061,
-0.08096607029438019,
0.07494854927062988,
-0.21587873995304108,
-0.1691908836364746,
-0.2220706045627594,
0.01904905028641224,
-0.11564958840608597,
-0.12492163479328156,
0.4945385158061981,
-0.24813735485076904,
0.02179068699479103,
0.3826908469200134,
0.04467107728123665,
-0.12983696162700653,
-0.19934412837028503,
-0.02080734446644783,
-0.045450594276189804,
-0.009270958602428436,
-0.058942247182130814,
-0.1137520894408226,
0.2521287798881531,
-0.336117148399353,
0.1370440572500229,
0.12176722288131714,
-0.13819652795791626,
0.04927675798535347,
-0.4791684150695801,
-0.1921573132276535,
0.11659444868564606,
-0.14037343859672546,
0.16629934310913086,
-0.05385206639766693,
0.2869292199611664,
0.06458761543035507,
-0.181953564286232,
-0.20829012989997864,
0.011290643364191055,
-0.05162833631038666,
-0.09221816807985306,
0.2739124596118927,
0.315157026052475,
0.5544472932815552,
-0.07922890782356262,
0.09241879731416702,
0.21152763068675995,
-0.21628478169441223,
-0.12283258140087128,
-0.1155698150396347,
0.20164692401885986,
0.3467756509780884,
-0.2658436894416809,
0.013455464504659176,
-0.21983373165130615,
-0.10459935665130615,
-0.06739997863769531,
0.1867254674434662,
0.2010076940059662,
-0.03919239342212677,
-0.03182293102145195,
0.15561091899871826,
0.11428071558475494,
-0.322509229183197,
-0.0017664991319179535,
-0.06647394597530365,
0.3725152611732483,
0.1587136685848236,
0.08929252624511719,
-0.12892375886440277,
0.11799585819244385,
-0.09783141314983368,
-0.020757921040058136,
-0.03301742672920227,
0.21228119730949402,
0.3940547704696655,
-0.4751180410385132,
0.09361019730567932,
-0.05096206068992615,
0.08167851716279984,
0.4724428653717041,
-0.20521433651447296,
0.008502459153532982,
0.27819257974624634,
0.11942251026630402,
-0.031318988651037216,
0.04302022606134415,
0.18230856955051422,
-0.041301824152469635,
-0.05989336222410202,
-0.09673383086919785,
-0.05834892392158508,
-0.2807615101337433,
-0.06959812343120575,
0.060273826122283936,
0.24833840131759644,
0.08516094088554382,
0.18966081738471985,
0.4448513686656952,
0.03794010356068611,
0.19667908549308777,
-0.10223310440778732,
-0.06512556970119476,
0.1837368905544281,
0.26998305320739746,
-0.256096214056015,
-0.22846297919750214,
-0.15082955360412598,
0.11247733980417252,
-0.21081578731536865,
-0.5837599635124207,
-0.37412533164024353,
0.13675177097320557,
-0.244267076253891,
0.39939168095588684,
0.19652143120765686,
0.0742519423365593,
-0.1614338755607605,
0.055769577622413635,
-0.3243415355682373,
-0.1624024659395218,
-0.022397123277187347,
0.22725114226341248,
-0.13990339636802673,
-0.2984611392021179,
0.028203003108501434,
0.15969981253147125,
0.00852937251329422,
-0.05497431010007858,
0.10398159176111221,
0.21661140024662018,
-0.17479963600635529,
-0.17565596103668213,
0.038966745138168335,
0.14087720215320587,
0.24339023232460022,
-0.27268004417419434,
0.13330963253974915,
0.18458500504493713,
-0.044360093772411346,
0.18305766582489014,
-0.07467889040708542,
0.42534512281417847,
0.23506006598472595,
0.039257027208805084,
0.15417467057704926,
0.185539111495018,
-0.09270988404750824,
0.14326544106006622,
0.3272568881511688,
0.20650522410869598,
-0.214337557554245,
0.25183454155921936,
0.09707736223936081,
-0.11720587313175201,
0.21091048419475555,
-0.14883646368980408,
0.2876206338405609,
-0.46881017088890076,
0.30672118067741394,
-0.4334767162799835,
0.10325699299573898,
-0.1471916139125824,
-0.17319774627685547,
-0.20473214983940125,
0.2916693389415741,
0.09842155873775482,
-0.12995165586471558,
0.13238796591758728,
0.12089074403047562,
0.023868821561336517,
-0.11856125295162201,
0.15571199357509613,
0.34970030188560486,
0.10535278916358948,
-0.24232438206672668,
-0.19692377746105194,
-0.6438881158828735,
0.1382269263267517,
-0.0963667631149292,
0.16455979645252228,
-0.19771301746368408,
0.16293375194072723,
-0.03372672200202942,
0.08452653884887695,
0.2139347493648529,
0.09984846413135529,
0.21732474863529205,
0.26532089710235596,
-0.11745861172676086,
-0.2823593318462372,
0.026598159223794937,
0.11500189453363419,
-0.24666129052639008,
-0.4413094222545624,
0.07846689969301224,
-0.22740676999092102,
0.04725667089223862,
0.11268853396177292,
-0.12910765409469604,
-0.12330006062984467,
-0.2741156816482544,
0.6556937098503113,
0.12865066528320312,
0.4314830005168915,
-0.14341869950294495,
-0.28353211283683777,
-0.4107500910758972,
-0.03240230306982994,
-0.06375692784786224,
-0.21496421098709106,
-0.1453426331281662,
0.6507197618484497,
-0.13838259875774384,
-0.004225652664899826,
-0.28873008489608765,
0.6345019936561584,
0.2397419959306717,
-0.010852216742932796,
-0.25875890254974365,
0.020687444135546684,
-0.5742632150650024,
0.20704682171344757,
-0.10696203261613846,
0.1641438603401184,
-0.15547531843185425,
0.01403714157640934,
-0.1726662516593933,
-0.17264895141124725,
0.6431175470352173,
-0.8920931816101074,
-0.05727548897266388,
0.11844656616449356,
0.2540162205696106,
0.15828993916511536,
-0.03740879148244858,
-0.2273479700088501,
0.29581642150878906,
0.2916668653488159,
-0.16808098554611206,
-0.2898517847061157,
0.014135900884866714,
-0.006068415939807892,
-0.04722468927502632,
0.06299485266208649,
0.4249376952648163,
0.10371994972229004,
-0.35971251130104065,
0.29650989174842834,
-0.3112955093383789
] |
https://github.com/huggingface/datasets/issues/5574 | c4 dataset streaming fails with `FileNotFoundError` | > It's been resolved again ;)
I'm experiencing the same issue when trying to load this dataset, `FileNotFoundError: https://huggingface.co/datasets/allenai/c4/resolve/1ddc917116b730e1859edef32896ec5c16be51d0/realnewslike/c4-train.00000-of-00512.json.gz` | ### Describe the bug
Loading the `c4` dataset in streaming mode with `load_dataset("c4", "en", split="validation", streaming=True)` and then using it fails with a `FileNotFoundException`.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("c4", "en", split="train", streaming=True)
next(iter(dataset))
```
causes a
```
FileNotFoundError: https://huggingface.co/datasets/allenai/c4/resolve/1ddc917116b730e1859edef32896ec5c16be51d0/en/c4-train.00000-of-01024.json.gz
```
I can download this file manually though e.g. by entering this URL in a browser.
There is an underlying HTTP 403 status code:
```
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('https://cdn-lfs.huggingface.co/datasets/allenai/c4/8ef8d75b0e045dec4aa5123a671b4564466b0707086a7ed1ba8721626dfffbc9?response-content-disposition=attachment%3B+filename*%3DUTF-8''c4-train.00000-of-01024.json.gz%3B+filename%3D%22c4-train.00000-of-01024.json.gz%22%3B&response-content-type=application/gzip&Expires=1677483770&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL2RhdGFzZXRzL2FsbGVuYWkvYzQvOGVmOGQ3NWIwZTA0NWRlYzRhYTUxMjNhNjcxYjQ1NjQ0NjZiMDcwNzA4NmE3ZWQxYmE4NzIxNjI2ZGZmZmJjOT9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSomcmVzcG9uc2UtY29udGVudC10eXBlPWFwcGxpY2F0aW9uJTJGZ3ppcCIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY3NzQ4Mzc3MH19fV19&Signature=yjL3UeY72cf2xpnvPvD68eAYOEe2qtaUJV55sB-jnPskBJEMwpMJcBZvg2~GqXZdM3O-GWV-Z3CI~d4u5VCb4YZ-HlmOjr3VBYkvox2EKiXnBIhjMecf2UVUPtxhTa9kBVlWjqu4qKzB9gKXZF2Cwpp5ctLzapEaT2nnqF84RAL-rsqMA3I~M8vWWfivQsbBK63hMfgZqqKMgdWM0iKMaItveDl0ufQ29azMFmsR7qd8V7sU2Z-F1fAeohS8HpN9OOnClW34yi~YJ2AbgZJJBXA~qsylfVA0Qp7Q~yX~q4P8JF1vmJ2BjkiSbGrj3bAXOGugpOVU5msI52DT88yMdA__&Key-Pair-Id=KVTP0A1DKRTAX')
```
### Expected behavior
This should retrieve the first example from the C4 validation set. This worked a few days ago but stopped working now.
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.15.0-60-generic-x86_64-with-glibc2.31
- Python version: 3.9.16
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
| 19 | c4 dataset streaming fails with `FileNotFoundError`
### Describe the bug
Loading the `c4` dataset in streaming mode with `load_dataset("c4", "en", split="validation", streaming=True)` and then using it fails with a `FileNotFoundException`.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("c4", "en", split="train", streaming=True)
next(iter(dataset))
```
causes a
```
FileNotFoundError: https://huggingface.co/datasets/allenai/c4/resolve/1ddc917116b730e1859edef32896ec5c16be51d0/en/c4-train.00000-of-01024.json.gz
```
I can download this file manually though e.g. by entering this URL in a browser.
There is an underlying HTTP 403 status code:
```
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('https://cdn-lfs.huggingface.co/datasets/allenai/c4/8ef8d75b0e045dec4aa5123a671b4564466b0707086a7ed1ba8721626dfffbc9?response-content-disposition=attachment%3B+filename*%3DUTF-8''c4-train.00000-of-01024.json.gz%3B+filename%3D%22c4-train.00000-of-01024.json.gz%22%3B&response-content-type=application/gzip&Expires=1677483770&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL2RhdGFzZXRzL2FsbGVuYWkvYzQvOGVmOGQ3NWIwZTA0NWRlYzRhYTUxMjNhNjcxYjQ1NjQ0NjZiMDcwNzA4NmE3ZWQxYmE4NzIxNjI2ZGZmZmJjOT9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSomcmVzcG9uc2UtY29udGVudC10eXBlPWFwcGxpY2F0aW9uJTJGZ3ppcCIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY3NzQ4Mzc3MH19fV19&Signature=yjL3UeY72cf2xpnvPvD68eAYOEe2qtaUJV55sB-jnPskBJEMwpMJcBZvg2~GqXZdM3O-GWV-Z3CI~d4u5VCb4YZ-HlmOjr3VBYkvox2EKiXnBIhjMecf2UVUPtxhTa9kBVlWjqu4qKzB9gKXZF2Cwpp5ctLzapEaT2nnqF84RAL-rsqMA3I~M8vWWfivQsbBK63hMfgZqqKMgdWM0iKMaItveDl0ufQ29azMFmsR7qd8V7sU2Z-F1fAeohS8HpN9OOnClW34yi~YJ2AbgZJJBXA~qsylfVA0Qp7Q~yX~q4P8JF1vmJ2BjkiSbGrj3bAXOGugpOVU5msI52DT88yMdA__&Key-Pair-Id=KVTP0A1DKRTAX')
```
### Expected behavior
This should retrieve the first example from the C4 validation set. This worked a few days ago but stopped working now.
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.15.0-60-generic-x86_64-with-glibc2.31
- Python version: 3.9.16
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
> It's been resolved again ;)
I'm experiencing the same issue when trying to load this dataset, `FileNotFoundError: https://huggingface.co/datasets/allenai/c4/resolve/1ddc917116b730e1859edef32896ec5c16be51d0/realnewslike/c4-train.00000-of-00512.json.gz` | [
-0.2467462718486786,
0.13279876112937927,
0.04004215821623802,
0.32442140579223633,
0.1723441779613495,
0.11456891149282455,
0.14179404079914093,
0.2780021131038666,
-0.08522557467222214,
0.06967808306217194,
-0.07468783855438232,
-0.08705097436904907,
-0.0888633131980896,
0.10009647160768509,
0.06160719692707062,
0.027806324884295464,
-0.09655933827161789,
0.19019505381584167,
0.0317605696618557,
0.15858441591262817,
-0.010184548795223236,
0.09507511556148529,
-0.24832436442375183,
-0.0538179874420166,
-0.1898794323205948,
-0.13213948905467987,
0.04076565057039261,
0.31705448031425476,
-0.11375867575407028,
-0.3029356002807617,
0.35685497522354126,
-0.09025917947292328,
0.22927512228488922,
0.5055244565010071,
-0.00011665172496577725,
0.13374163210391998,
0.309661865234375,
-0.1642947643995285,
-0.20611059665679932,
-0.25145959854125977,
-0.4731822609901428,
-0.043023817241191864,
-0.24912941455841064,
-0.09240736812353134,
-0.04734421148896217,
-0.057319726794958115,
0.17451418936252594,
-0.41000881791114807,
0.3812444806098938,
0.5148968696594238,
0.10202870517969131,
0.22239011526107788,
-0.12849010527133942,
0.15287506580352783,
-0.18233045935630798,
-0.21428288519382477,
-0.0802147388458252,
0.28004834055900574,
-0.0665721744298935,
0.1667594164609909,
-0.05099412053823471,
0.18356040120124817,
-0.10023258626461029,
-0.08552347123622894,
0.2082856297492981,
-0.03638123348355293,
-0.0864815041422844,
-0.2673667073249817,
0.16529986262321472,
0.31590551137924194,
0.740833580493927,
-0.3290979266166687,
-0.4362660348415375,
-0.02088863030076027,
0.24007682502269745,
-0.29473093152046204,
0.27932122349739075,
0.28932997584342957,
-0.06849834322929382,
0.20271843671798706,
-0.2132507711648941,
-0.04583487659692764,
-0.3832428455352783,
0.14923974871635437,
-0.042087867856025696,
-0.057114213705062866,
-0.03317325562238693,
-0.04581177979707718,
-0.06490056216716766,
0.03733082860708237,
-0.028729934245347977,
-0.43308302760124207,
-0.2817257344722748,
0.2850091755390167,
-0.24725447595119476,
-0.016068149358034134,
-0.04550222307443619,
0.26849374175071716,
0.012613829225301743,
0.1411409229040146,
0.33579757809638977,
-0.042412810027599335,
-0.27079153060913086,
0.12728652358055115,
0.042364299297332764,
0.1877596229314804,
0.09706982970237732,
-0.09918445348739624,
0.3607012629508972,
0.3305165469646454,
-0.043022580444812775,
-0.299225389957428,
0.08175912499427795,
-0.12616084516048431,
-0.28382280468940735,
-0.060332462191581726,
0.29677170515060425,
-0.3114683926105499,
-0.5887150168418884,
0.21859018504619598,
-0.701935350894928,
-0.001417564693838358,
-0.021332066506147385,
0.506765604019165,
-0.23274073004722595,
0.10391108691692352,
0.07359717041254044,
0.20150282979011536,
0.001089358702301979,
-0.38615506887435913,
-0.127083420753479,
-0.15283173322677612,
-0.03059784322977066,
0.1986517757177353,
0.1966625154018402,
-0.32446348667144775,
0.2735462784767151,
0.03848418965935707,
0.21742673218250275,
0.09323553740978241,
-0.013154305517673492,
-0.05733771622180939,
-0.12895923852920532,
0.195569708943367,
-0.043529022485017776,
0.09557364881038666,
0.1676395833492279,
-0.3185003995895386,
0.04763498157262802,
-0.09468837827444077,
-0.015874050557613373,
-0.10598913580179214,
0.04231127351522446,
0.10096142441034317,
-0.3069586157798767,
-0.0727614015340805,
-0.19828787446022034,
-0.05068235471844673,
-0.26952606439590454,
-0.3888101875782013,
0.1626984030008316,
-0.055219314992427826,
0.11192630231380463,
-0.22574912011623383,
0.23529458045959473,
0.7646635174751282,
-0.2802044749259949,
-0.1846485286951065,
-0.11372776329517365,
-0.16401898860931396,
0.3409588038921356,
0.27698296308517456,
-0.10479753464460373,
0.01931150257587433,
-0.26778340339660645,
0.40866750478744507,
0.21925535798072815,
-0.19311381876468658,
-0.6291771531105042,
0.5631681084632874,
-0.19646494090557098,
0.6119543313980103,
0.2093448042869568,
0.06432729959487915,
-0.0595216304063797,
-0.18049634993076324,
0.1653538942337036,
0.25187960267066956,
-0.0273370910435915,
-0.03522312268614769,
-0.2284655123949051,
-0.10355506092309952,
0.34119659662246704,
0.03135211393237114,
-0.021206539124250412,
0.14884987473487854,
0.32728931307792664,
-0.02599778212606907,
0.41606247425079346,
-0.2120276689529419,
-0.0012862831354141235,
-0.007101666182279587,
0.47636035084724426,
-0.036758773028850555,
-0.16989751160144806,
0.10066860169172287,
-0.607447624206543,
0.23923105001449585,
0.1632545292377472,
-0.17657506465911865,
-0.03365790843963623,
-0.09012711048126221,
-0.0279281847178936,
-0.13434557616710663,
-0.33751973509788513,
-0.3689330220222473,
0.08227864652872086,
0.2043687403202057,
0.006775926798582077,
0.21912585198879242,
-0.1947854608297348,
0.8216492533683777,
-0.42222344875335693,
0.010109343566000462,
-0.03835589438676834,
0.2734583616256714,
0.027525464072823524,
-0.06141076236963272,
0.04907625913619995,
-0.06341006606817245,
0.23409846425056458,
-0.13357433676719666,
-0.08236509561538696,
0.5615682005882263,
-0.05533430725336075,
0.295086145401001,
-0.10691533237695694,
0.08125246316194534,
0.4368551969528198,
-0.2516922056674957,
0.007443314418196678,
0.5023471117019653,
0.23382879793643951,
0.02167937159538269,
0.04421984776854515,
0.3587788939476013,
0.07097887247800827,
0.08141403645277023,
0.2847810387611389,
-0.003402218222618103,
0.20224960148334503,
0.08997105062007904,
-0.23544280230998993,
0.09405019879341125,
0.4511280357837677,
-0.38557836413383484,
0.32700058817863464,
-0.17344869673252106,
-0.4125608205795288,
-0.045385994017124176,
0.2711707651615143,
-0.086728036403656,
-0.21076464653015137,
-0.06281088292598724,
-0.2558002769947052,
0.09161128848791122,
0.467567503452301,
0.3024212718009949,
0.43926066160202026,
0.06820511817932129,
-0.13268417119979858,
0.1980845183134079,
-0.10682034492492676,
-0.18183402717113495,
0.16543179750442505,
-0.21031241118907928,
-0.1176859512925148,
0.2709534168243408,
-0.05011561140418053,
0.06094174087047577,
-0.26872342824935913,
-0.44717922806739807,
-0.06406036019325256,
0.0006428882479667664,
-0.4872424900531769,
0.21120157837867737,
-0.36426493525505066,
-0.22301757335662842,
-0.07438651472330093,
-0.06230941042304039,
-0.16031686961650848,
-0.11078377068042755,
-0.18558762967586517,
0.3693574368953705,
-0.10465750098228455,
0.02522594854235649,
-0.8260208964347839,
0.02523478865623474,
-0.01327403262257576,
-0.31963685154914856,
-0.17091074585914612,
0.16814208030700684,
-0.22076234221458435,
0.06438340246677399,
0.47011512517929077,
-0.1355893611907959,
0.21940530836582184,
-0.2175547182559967,
-0.09454120695590973,
-0.38990432024002075,
-0.17627979815006256,
0.09338358044624329,
-0.0761294737458229,
0.17922888696193695,
-0.23388555645942688,
0.3725619912147522,
-0.16186849772930145,
-0.35431599617004395,
-0.007720916997641325,
-0.13874037563800812,
-0.10681159794330597,
0.12521858513355255,
-0.01400883961468935,
-0.09701523929834366,
-0.11198844015598297,
-0.3995073139667511,
-0.14540664851665497,
-0.3510515093803406,
0.2642711400985718,
-0.1719008982181549,
0.01036936417222023,
0.4008120000362396,
0.11057275533676147,
0.29947400093078613,
0.1075277104973793,
-0.173945352435112,
-0.007569999434053898,
-0.24086622893810272,
0.4674313962459564,
-0.022617556154727936,
-0.36916548013687134,
0.20961883664131165,
0.08432953804731369,
-0.06399405002593994,
0.37871766090393066,
-0.3669458031654358,
0.2902870774269104,
-0.11964832246303558,
0.2584117352962494,
-0.07022438198328018,
-0.20720434188842773,
0.1946023404598236,
-0.2807164788246155,
0.08727731555700302,
-0.253869891166687,
0.10635335743427277,
-0.068071149289608,
0.28173863887786865,
0.4405917525291443,
-0.06615250557661057,
0.37335941195487976,
0.18214388191699982,
0.5030514597892761,
0.33333873748779297,
-0.1447412371635437,
0.49497711658477783,
-0.04692456126213074,
0.48988044261932373,
0.09671000391244888,
-0.021917054429650307,
0.21092338860034943,
-0.07143810391426086,
-0.23888611793518066,
0.1857145130634308,
-0.05955946445465088,
-0.1173391118645668,
-0.3247036039829254,
0.05678357556462288,
-0.3353002071380615,
-0.15100382268428802,
0.0470120832324028,
-0.04628527909517288,
0.13905155658721924,
0.10295809805393219,
0.20392337441444397,
0.2588067352771759,
-0.18477711081504822,
0.10135670006275177,
0.6303920745849609,
0.34443399310112,
0.1472344547510147,
-0.09011538326740265,
-0.32927224040031433,
-0.4260959327220917,
0.404471218585968,
0.2784533202648163,
0.3510306477546692,
-0.13401074707508087,
-0.14684903621673584,
-0.08164574205875397,
-0.18911698460578918,
0.5461317300796509,
-0.20066425204277039,
0.14058023691177368,
0.12941516935825348,
0.20293691754341125,
0.003830930218100548,
-0.1206861287355423,
-0.044159408658742905,
0.2406240701675415,
0.4243500232696533,
0.20681512355804443,
-0.1926030069589615,
0.009018734097480774,
-0.22709301114082336,
-0.015158829279243946,
0.1268855482339859,
0.03617442026734352,
-0.15880940854549408,
-0.12921872735023499,
-0.1440446823835373,
-0.06087259203195572,
-0.0431312695145607,
0.0795368179678917,
-0.20847325026988983,
0.19558954238891602,
0.023120349273085594,
0.06246577203273773,
0.2545427083969116,
0.23770852386951447,
0.19763469696044922,
0.0004946620902046561,
0.13283419609069824,
0.2977561950683594,
0.11113382875919342,
0.5374557971954346,
0.5015861988067627,
0.3258613049983978,
-0.32760339975357056,
-0.05168347805738449,
0.18064171075820923,
0.06356197595596313,
0.3620198965072632,
0.03963249549269676,
-0.11139494925737381,
0.3632160425186157,
0.00010451674461364746,
-0.060506317764520645,
0.21385736763477325,
0.3125086724758148,
-0.20250427722930908,
-0.4594510495662689,
-0.4426804482936859,
0.42595407366752625,
-0.19747550785541534,
0.08712536096572876,
0.5395447015762329,
0.37628114223480225,
-0.14481261372566223,
-0.04598533362150192,
-0.19865241646766663,
0.667384684085846,
0.21085840463638306,
0.16781212389469147,
0.4115624725818634,
-0.0649867057800293,
0.2511211335659027,
-0.5093109011650085,
0.27916330099105835,
-0.07036405801773071,
-0.2707407474517822,
-0.18096566200256348,
-0.1309647113084793,
0.3981797695159912,
0.0845387876033783,
-0.14743323624134064,
0.2973511517047882,
0.07149368524551392,
0.37954163551330566,
0.22432971000671387,
-0.13453055918216705,
-0.5341125130653381,
0.05241091549396515,
-0.4589904546737671,
0.11229412257671356,
-0.11275619268417358,
0.22009262442588806,
-0.10963410139083862,
-0.3131343722343445,
-0.22502021491527557,
-0.14201796054840088,
-0.33201080560684204,
0.43670129776000977,
-0.38070622086524963,
-0.09972655028104782,
-0.18795587122440338,
-0.2686605453491211,
0.200131356716156,
0.20896729826927185,
-0.21232305467128754,
0.02170472964644432,
-0.3878672420978546,
0.23930421471595764,
-0.1301875114440918,
-0.04679088294506073,
-0.00015840958803892136,
-0.02171594649553299,
0.20118363201618195,
-0.053342461585998535,
-0.0857122540473938,
0.26706650853157043,
-0.102055624127388,
-0.48515576124191284,
0.3996991515159607,
-0.05655097961425781,
-0.1914409101009369,
0.08738954365253448,
-0.17117072641849518,
0.11444327235221863,
0.03464251384139061,
-0.08096607029438019,
0.07494854927062988,
-0.21587873995304108,
-0.1691908836364746,
-0.2220706045627594,
0.01904905028641224,
-0.11564958840608597,
-0.12492163479328156,
0.4945385158061981,
-0.24813735485076904,
0.02179068699479103,
0.3826908469200134,
0.04467107728123665,
-0.12983696162700653,
-0.19934412837028503,
-0.02080734446644783,
-0.045450594276189804,
-0.009270958602428436,
-0.058942247182130814,
-0.1137520894408226,
0.2521287798881531,
-0.336117148399353,
0.1370440572500229,
0.12176722288131714,
-0.13819652795791626,
0.04927675798535347,
-0.4791684150695801,
-0.1921573132276535,
0.11659444868564606,
-0.14037343859672546,
0.16629934310913086,
-0.05385206639766693,
0.2869292199611664,
0.06458761543035507,
-0.181953564286232,
-0.20829012989997864,
0.011290643364191055,
-0.05162833631038666,
-0.09221816807985306,
0.2739124596118927,
0.315157026052475,
0.5544472932815552,
-0.07922890782356262,
0.09241879731416702,
0.21152763068675995,
-0.21628478169441223,
-0.12283258140087128,
-0.1155698150396347,
0.20164692401885986,
0.3467756509780884,
-0.2658436894416809,
0.013455464504659176,
-0.21983373165130615,
-0.10459935665130615,
-0.06739997863769531,
0.1867254674434662,
0.2010076940059662,
-0.03919239342212677,
-0.03182293102145195,
0.15561091899871826,
0.11428071558475494,
-0.322509229183197,
-0.0017664991319179535,
-0.06647394597530365,
0.3725152611732483,
0.1587136685848236,
0.08929252624511719,
-0.12892375886440277,
0.11799585819244385,
-0.09783141314983368,
-0.020757921040058136,
-0.03301742672920227,
0.21228119730949402,
0.3940547704696655,
-0.4751180410385132,
0.09361019730567932,
-0.05096206068992615,
0.08167851716279984,
0.4724428653717041,
-0.20521433651447296,
0.008502459153532982,
0.27819257974624634,
0.11942251026630402,
-0.031318988651037216,
0.04302022606134415,
0.18230856955051422,
-0.041301824152469635,
-0.05989336222410202,
-0.09673383086919785,
-0.05834892392158508,
-0.2807615101337433,
-0.06959812343120575,
0.060273826122283936,
0.24833840131759644,
0.08516094088554382,
0.18966081738471985,
0.4448513686656952,
0.03794010356068611,
0.19667908549308777,
-0.10223310440778732,
-0.06512556970119476,
0.1837368905544281,
0.26998305320739746,
-0.256096214056015,
-0.22846297919750214,
-0.15082955360412598,
0.11247733980417252,
-0.21081578731536865,
-0.5837599635124207,
-0.37412533164024353,
0.13675177097320557,
-0.244267076253891,
0.39939168095588684,
0.19652143120765686,
0.0742519423365593,
-0.1614338755607605,
0.055769577622413635,
-0.3243415355682373,
-0.1624024659395218,
-0.022397123277187347,
0.22725114226341248,
-0.13990339636802673,
-0.2984611392021179,
0.028203003108501434,
0.15969981253147125,
0.00852937251329422,
-0.05497431010007858,
0.10398159176111221,
0.21661140024662018,
-0.17479963600635529,
-0.17565596103668213,
0.038966745138168335,
0.14087720215320587,
0.24339023232460022,
-0.27268004417419434,
0.13330963253974915,
0.18458500504493713,
-0.044360093772411346,
0.18305766582489014,
-0.07467889040708542,
0.42534512281417847,
0.23506006598472595,
0.039257027208805084,
0.15417467057704926,
0.185539111495018,
-0.09270988404750824,
0.14326544106006622,
0.3272568881511688,
0.20650522410869598,
-0.214337557554245,
0.25183454155921936,
0.09707736223936081,
-0.11720587313175201,
0.21091048419475555,
-0.14883646368980408,
0.2876206338405609,
-0.46881017088890076,
0.30672118067741394,
-0.4334767162799835,
0.10325699299573898,
-0.1471916139125824,
-0.17319774627685547,
-0.20473214983940125,
0.2916693389415741,
0.09842155873775482,
-0.12995165586471558,
0.13238796591758728,
0.12089074403047562,
0.023868821561336517,
-0.11856125295162201,
0.15571199357509613,
0.34970030188560486,
0.10535278916358948,
-0.24232438206672668,
-0.19692377746105194,
-0.6438881158828735,
0.1382269263267517,
-0.0963667631149292,
0.16455979645252228,
-0.19771301746368408,
0.16293375194072723,
-0.03372672200202942,
0.08452653884887695,
0.2139347493648529,
0.09984846413135529,
0.21732474863529205,
0.26532089710235596,
-0.11745861172676086,
-0.2823593318462372,
0.026598159223794937,
0.11500189453363419,
-0.24666129052639008,
-0.4413094222545624,
0.07846689969301224,
-0.22740676999092102,
0.04725667089223862,
0.11268853396177292,
-0.12910765409469604,
-0.12330006062984467,
-0.2741156816482544,
0.6556937098503113,
0.12865066528320312,
0.4314830005168915,
-0.14341869950294495,
-0.28353211283683777,
-0.4107500910758972,
-0.03240230306982994,
-0.06375692784786224,
-0.21496421098709106,
-0.1453426331281662,
0.6507197618484497,
-0.13838259875774384,
-0.004225652664899826,
-0.28873008489608765,
0.6345019936561584,
0.2397419959306717,
-0.010852216742932796,
-0.25875890254974365,
0.020687444135546684,
-0.5742632150650024,
0.20704682171344757,
-0.10696203261613846,
0.1641438603401184,
-0.15547531843185425,
0.01403714157640934,
-0.1726662516593933,
-0.17264895141124725,
0.6431175470352173,
-0.8920931816101074,
-0.05727548897266388,
0.11844656616449356,
0.2540162205696106,
0.15828993916511536,
-0.03740879148244858,
-0.2273479700088501,
0.29581642150878906,
0.2916668653488159,
-0.16808098554611206,
-0.2898517847061157,
0.014135900884866714,
-0.006068415939807892,
-0.04722468927502632,
0.06299485266208649,
0.4249376952648163,
0.10371994972229004,
-0.35971251130104065,
0.29650989174842834,
-0.3112955093383789
] |
https://github.com/huggingface/datasets/issues/5574 | c4 dataset streaming fails with `FileNotFoundError` | Experiencing the same issues as above : `FileNotFoundError: https://huggingface.co/datasets/allenai/c4/resolve/1ddc917116b730e1859edef32896ec5c16be51d0/en/c4-train.00000-of-01024.json.gz
If the repo is private or gated, make sure to log in with `huggingface-cli login`.`
Have made sure to login as well, issue persists. | ### Describe the bug
Loading the `c4` dataset in streaming mode with `load_dataset("c4", "en", split="validation", streaming=True)` and then using it fails with a `FileNotFoundException`.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("c4", "en", split="train", streaming=True)
next(iter(dataset))
```
causes a
```
FileNotFoundError: https://huggingface.co/datasets/allenai/c4/resolve/1ddc917116b730e1859edef32896ec5c16be51d0/en/c4-train.00000-of-01024.json.gz
```
I can download this file manually though e.g. by entering this URL in a browser.
There is an underlying HTTP 403 status code:
```
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('https://cdn-lfs.huggingface.co/datasets/allenai/c4/8ef8d75b0e045dec4aa5123a671b4564466b0707086a7ed1ba8721626dfffbc9?response-content-disposition=attachment%3B+filename*%3DUTF-8''c4-train.00000-of-01024.json.gz%3B+filename%3D%22c4-train.00000-of-01024.json.gz%22%3B&response-content-type=application/gzip&Expires=1677483770&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL2RhdGFzZXRzL2FsbGVuYWkvYzQvOGVmOGQ3NWIwZTA0NWRlYzRhYTUxMjNhNjcxYjQ1NjQ0NjZiMDcwNzA4NmE3ZWQxYmE4NzIxNjI2ZGZmZmJjOT9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSomcmVzcG9uc2UtY29udGVudC10eXBlPWFwcGxpY2F0aW9uJTJGZ3ppcCIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY3NzQ4Mzc3MH19fV19&Signature=yjL3UeY72cf2xpnvPvD68eAYOEe2qtaUJV55sB-jnPskBJEMwpMJcBZvg2~GqXZdM3O-GWV-Z3CI~d4u5VCb4YZ-HlmOjr3VBYkvox2EKiXnBIhjMecf2UVUPtxhTa9kBVlWjqu4qKzB9gKXZF2Cwpp5ctLzapEaT2nnqF84RAL-rsqMA3I~M8vWWfivQsbBK63hMfgZqqKMgdWM0iKMaItveDl0ufQ29azMFmsR7qd8V7sU2Z-F1fAeohS8HpN9OOnClW34yi~YJ2AbgZJJBXA~qsylfVA0Qp7Q~yX~q4P8JF1vmJ2BjkiSbGrj3bAXOGugpOVU5msI52DT88yMdA__&Key-Pair-Id=KVTP0A1DKRTAX')
```
### Expected behavior
This should retrieve the first example from the C4 validation set. This worked a few days ago but stopped working now.
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.15.0-60-generic-x86_64-with-glibc2.31
- Python version: 3.9.16
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
| 33 | c4 dataset streaming fails with `FileNotFoundError`
### Describe the bug
Loading the `c4` dataset in streaming mode with `load_dataset("c4", "en", split="validation", streaming=True)` and then using it fails with a `FileNotFoundException`.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("c4", "en", split="train", streaming=True)
next(iter(dataset))
```
causes a
```
FileNotFoundError: https://huggingface.co/datasets/allenai/c4/resolve/1ddc917116b730e1859edef32896ec5c16be51d0/en/c4-train.00000-of-01024.json.gz
```
I can download this file manually though e.g. by entering this URL in a browser.
There is an underlying HTTP 403 status code:
```
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('https://cdn-lfs.huggingface.co/datasets/allenai/c4/8ef8d75b0e045dec4aa5123a671b4564466b0707086a7ed1ba8721626dfffbc9?response-content-disposition=attachment%3B+filename*%3DUTF-8''c4-train.00000-of-01024.json.gz%3B+filename%3D%22c4-train.00000-of-01024.json.gz%22%3B&response-content-type=application/gzip&Expires=1677483770&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL2RhdGFzZXRzL2FsbGVuYWkvYzQvOGVmOGQ3NWIwZTA0NWRlYzRhYTUxMjNhNjcxYjQ1NjQ0NjZiMDcwNzA4NmE3ZWQxYmE4NzIxNjI2ZGZmZmJjOT9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSomcmVzcG9uc2UtY29udGVudC10eXBlPWFwcGxpY2F0aW9uJTJGZ3ppcCIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY3NzQ4Mzc3MH19fV19&Signature=yjL3UeY72cf2xpnvPvD68eAYOEe2qtaUJV55sB-jnPskBJEMwpMJcBZvg2~GqXZdM3O-GWV-Z3CI~d4u5VCb4YZ-HlmOjr3VBYkvox2EKiXnBIhjMecf2UVUPtxhTa9kBVlWjqu4qKzB9gKXZF2Cwpp5ctLzapEaT2nnqF84RAL-rsqMA3I~M8vWWfivQsbBK63hMfgZqqKMgdWM0iKMaItveDl0ufQ29azMFmsR7qd8V7sU2Z-F1fAeohS8HpN9OOnClW34yi~YJ2AbgZJJBXA~qsylfVA0Qp7Q~yX~q4P8JF1vmJ2BjkiSbGrj3bAXOGugpOVU5msI52DT88yMdA__&Key-Pair-Id=KVTP0A1DKRTAX')
```
### Expected behavior
This should retrieve the first example from the C4 validation set. This worked a few days ago but stopped working now.
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.15.0-60-generic-x86_64-with-glibc2.31
- Python version: 3.9.16
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
Experiencing the same issues as above : `FileNotFoundError: https://huggingface.co/datasets/allenai/c4/resolve/1ddc917116b730e1859edef32896ec5c16be51d0/en/c4-train.00000-of-01024.json.gz
If the repo is private or gated, make sure to log in with `huggingface-cli login`.`
Have made sure to login as well, issue persists. | [
-0.2467462718486786,
0.13279876112937927,
0.04004215821623802,
0.32442140579223633,
0.1723441779613495,
0.11456891149282455,
0.14179404079914093,
0.2780021131038666,
-0.08522557467222214,
0.06967808306217194,
-0.07468783855438232,
-0.08705097436904907,
-0.0888633131980896,
0.10009647160768509,
0.06160719692707062,
0.027806324884295464,
-0.09655933827161789,
0.19019505381584167,
0.0317605696618557,
0.15858441591262817,
-0.010184548795223236,
0.09507511556148529,
-0.24832436442375183,
-0.0538179874420166,
-0.1898794323205948,
-0.13213948905467987,
0.04076565057039261,
0.31705448031425476,
-0.11375867575407028,
-0.3029356002807617,
0.35685497522354126,
-0.09025917947292328,
0.22927512228488922,
0.5055244565010071,
-0.00011665172496577725,
0.13374163210391998,
0.309661865234375,
-0.1642947643995285,
-0.20611059665679932,
-0.25145959854125977,
-0.4731822609901428,
-0.043023817241191864,
-0.24912941455841064,
-0.09240736812353134,
-0.04734421148896217,
-0.057319726794958115,
0.17451418936252594,
-0.41000881791114807,
0.3812444806098938,
0.5148968696594238,
0.10202870517969131,
0.22239011526107788,
-0.12849010527133942,
0.15287506580352783,
-0.18233045935630798,
-0.21428288519382477,
-0.0802147388458252,
0.28004834055900574,
-0.0665721744298935,
0.1667594164609909,
-0.05099412053823471,
0.18356040120124817,
-0.10023258626461029,
-0.08552347123622894,
0.2082856297492981,
-0.03638123348355293,
-0.0864815041422844,
-0.2673667073249817,
0.16529986262321472,
0.31590551137924194,
0.740833580493927,
-0.3290979266166687,
-0.4362660348415375,
-0.02088863030076027,
0.24007682502269745,
-0.29473093152046204,
0.27932122349739075,
0.28932997584342957,
-0.06849834322929382,
0.20271843671798706,
-0.2132507711648941,
-0.04583487659692764,
-0.3832428455352783,
0.14923974871635437,
-0.042087867856025696,
-0.057114213705062866,
-0.03317325562238693,
-0.04581177979707718,
-0.06490056216716766,
0.03733082860708237,
-0.028729934245347977,
-0.43308302760124207,
-0.2817257344722748,
0.2850091755390167,
-0.24725447595119476,
-0.016068149358034134,
-0.04550222307443619,
0.26849374175071716,
0.012613829225301743,
0.1411409229040146,
0.33579757809638977,
-0.042412810027599335,
-0.27079153060913086,
0.12728652358055115,
0.042364299297332764,
0.1877596229314804,
0.09706982970237732,
-0.09918445348739624,
0.3607012629508972,
0.3305165469646454,
-0.043022580444812775,
-0.299225389957428,
0.08175912499427795,
-0.12616084516048431,
-0.28382280468940735,
-0.060332462191581726,
0.29677170515060425,
-0.3114683926105499,
-0.5887150168418884,
0.21859018504619598,
-0.701935350894928,
-0.001417564693838358,
-0.021332066506147385,
0.506765604019165,
-0.23274073004722595,
0.10391108691692352,
0.07359717041254044,
0.20150282979011536,
0.001089358702301979,
-0.38615506887435913,
-0.127083420753479,
-0.15283173322677612,
-0.03059784322977066,
0.1986517757177353,
0.1966625154018402,
-0.32446348667144775,
0.2735462784767151,
0.03848418965935707,
0.21742673218250275,
0.09323553740978241,
-0.013154305517673492,
-0.05733771622180939,
-0.12895923852920532,
0.195569708943367,
-0.043529022485017776,
0.09557364881038666,
0.1676395833492279,
-0.3185003995895386,
0.04763498157262802,
-0.09468837827444077,
-0.015874050557613373,
-0.10598913580179214,
0.04231127351522446,
0.10096142441034317,
-0.3069586157798767,
-0.0727614015340805,
-0.19828787446022034,
-0.05068235471844673,
-0.26952606439590454,
-0.3888101875782013,
0.1626984030008316,
-0.055219314992427826,
0.11192630231380463,
-0.22574912011623383,
0.23529458045959473,
0.7646635174751282,
-0.2802044749259949,
-0.1846485286951065,
-0.11372776329517365,
-0.16401898860931396,
0.3409588038921356,
0.27698296308517456,
-0.10479753464460373,
0.01931150257587433,
-0.26778340339660645,
0.40866750478744507,
0.21925535798072815,
-0.19311381876468658,
-0.6291771531105042,
0.5631681084632874,
-0.19646494090557098,
0.6119543313980103,
0.2093448042869568,
0.06432729959487915,
-0.0595216304063797,
-0.18049634993076324,
0.1653538942337036,
0.25187960267066956,
-0.0273370910435915,
-0.03522312268614769,
-0.2284655123949051,
-0.10355506092309952,
0.34119659662246704,
0.03135211393237114,
-0.021206539124250412,
0.14884987473487854,
0.32728931307792664,
-0.02599778212606907,
0.41606247425079346,
-0.2120276689529419,
-0.0012862831354141235,
-0.007101666182279587,
0.47636035084724426,
-0.036758773028850555,
-0.16989751160144806,
0.10066860169172287,
-0.607447624206543,
0.23923105001449585,
0.1632545292377472,
-0.17657506465911865,
-0.03365790843963623,
-0.09012711048126221,
-0.0279281847178936,
-0.13434557616710663,
-0.33751973509788513,
-0.3689330220222473,
0.08227864652872086,
0.2043687403202057,
0.006775926798582077,
0.21912585198879242,
-0.1947854608297348,
0.8216492533683777,
-0.42222344875335693,
0.010109343566000462,
-0.03835589438676834,
0.2734583616256714,
0.027525464072823524,
-0.06141076236963272,
0.04907625913619995,
-0.06341006606817245,
0.23409846425056458,
-0.13357433676719666,
-0.08236509561538696,
0.5615682005882263,
-0.05533430725336075,
0.295086145401001,
-0.10691533237695694,
0.08125246316194534,
0.4368551969528198,
-0.2516922056674957,
0.007443314418196678,
0.5023471117019653,
0.23382879793643951,
0.02167937159538269,
0.04421984776854515,
0.3587788939476013,
0.07097887247800827,
0.08141403645277023,
0.2847810387611389,
-0.003402218222618103,
0.20224960148334503,
0.08997105062007904,
-0.23544280230998993,
0.09405019879341125,
0.4511280357837677,
-0.38557836413383484,
0.32700058817863464,
-0.17344869673252106,
-0.4125608205795288,
-0.045385994017124176,
0.2711707651615143,
-0.086728036403656,
-0.21076464653015137,
-0.06281088292598724,
-0.2558002769947052,
0.09161128848791122,
0.467567503452301,
0.3024212718009949,
0.43926066160202026,
0.06820511817932129,
-0.13268417119979858,
0.1980845183134079,
-0.10682034492492676,
-0.18183402717113495,
0.16543179750442505,
-0.21031241118907928,
-0.1176859512925148,
0.2709534168243408,
-0.05011561140418053,
0.06094174087047577,
-0.26872342824935913,
-0.44717922806739807,
-0.06406036019325256,
0.0006428882479667664,
-0.4872424900531769,
0.21120157837867737,
-0.36426493525505066,
-0.22301757335662842,
-0.07438651472330093,
-0.06230941042304039,
-0.16031686961650848,
-0.11078377068042755,
-0.18558762967586517,
0.3693574368953705,
-0.10465750098228455,
0.02522594854235649,
-0.8260208964347839,
0.02523478865623474,
-0.01327403262257576,
-0.31963685154914856,
-0.17091074585914612,
0.16814208030700684,
-0.22076234221458435,
0.06438340246677399,
0.47011512517929077,
-0.1355893611907959,
0.21940530836582184,
-0.2175547182559967,
-0.09454120695590973,
-0.38990432024002075,
-0.17627979815006256,
0.09338358044624329,
-0.0761294737458229,
0.17922888696193695,
-0.23388555645942688,
0.3725619912147522,
-0.16186849772930145,
-0.35431599617004395,
-0.007720916997641325,
-0.13874037563800812,
-0.10681159794330597,
0.12521858513355255,
-0.01400883961468935,
-0.09701523929834366,
-0.11198844015598297,
-0.3995073139667511,
-0.14540664851665497,
-0.3510515093803406,
0.2642711400985718,
-0.1719008982181549,
0.01036936417222023,
0.4008120000362396,
0.11057275533676147,
0.29947400093078613,
0.1075277104973793,
-0.173945352435112,
-0.007569999434053898,
-0.24086622893810272,
0.4674313962459564,
-0.022617556154727936,
-0.36916548013687134,
0.20961883664131165,
0.08432953804731369,
-0.06399405002593994,
0.37871766090393066,
-0.3669458031654358,
0.2902870774269104,
-0.11964832246303558,
0.2584117352962494,
-0.07022438198328018,
-0.20720434188842773,
0.1946023404598236,
-0.2807164788246155,
0.08727731555700302,
-0.253869891166687,
0.10635335743427277,
-0.068071149289608,
0.28173863887786865,
0.4405917525291443,
-0.06615250557661057,
0.37335941195487976,
0.18214388191699982,
0.5030514597892761,
0.33333873748779297,
-0.1447412371635437,
0.49497711658477783,
-0.04692456126213074,
0.48988044261932373,
0.09671000391244888,
-0.021917054429650307,
0.21092338860034943,
-0.07143810391426086,
-0.23888611793518066,
0.1857145130634308,
-0.05955946445465088,
-0.1173391118645668,
-0.3247036039829254,
0.05678357556462288,
-0.3353002071380615,
-0.15100382268428802,
0.0470120832324028,
-0.04628527909517288,
0.13905155658721924,
0.10295809805393219,
0.20392337441444397,
0.2588067352771759,
-0.18477711081504822,
0.10135670006275177,
0.6303920745849609,
0.34443399310112,
0.1472344547510147,
-0.09011538326740265,
-0.32927224040031433,
-0.4260959327220917,
0.404471218585968,
0.2784533202648163,
0.3510306477546692,
-0.13401074707508087,
-0.14684903621673584,
-0.08164574205875397,
-0.18911698460578918,
0.5461317300796509,
-0.20066425204277039,
0.14058023691177368,
0.12941516935825348,
0.20293691754341125,
0.003830930218100548,
-0.1206861287355423,
-0.044159408658742905,
0.2406240701675415,
0.4243500232696533,
0.20681512355804443,
-0.1926030069589615,
0.009018734097480774,
-0.22709301114082336,
-0.015158829279243946,
0.1268855482339859,
0.03617442026734352,
-0.15880940854549408,
-0.12921872735023499,
-0.1440446823835373,
-0.06087259203195572,
-0.0431312695145607,
0.0795368179678917,
-0.20847325026988983,
0.19558954238891602,
0.023120349273085594,
0.06246577203273773,
0.2545427083969116,
0.23770852386951447,
0.19763469696044922,
0.0004946620902046561,
0.13283419609069824,
0.2977561950683594,
0.11113382875919342,
0.5374557971954346,
0.5015861988067627,
0.3258613049983978,
-0.32760339975357056,
-0.05168347805738449,
0.18064171075820923,
0.06356197595596313,
0.3620198965072632,
0.03963249549269676,
-0.11139494925737381,
0.3632160425186157,
0.00010451674461364746,
-0.060506317764520645,
0.21385736763477325,
0.3125086724758148,
-0.20250427722930908,
-0.4594510495662689,
-0.4426804482936859,
0.42595407366752625,
-0.19747550785541534,
0.08712536096572876,
0.5395447015762329,
0.37628114223480225,
-0.14481261372566223,
-0.04598533362150192,
-0.19865241646766663,
0.667384684085846,
0.21085840463638306,
0.16781212389469147,
0.4115624725818634,
-0.0649867057800293,
0.2511211335659027,
-0.5093109011650085,
0.27916330099105835,
-0.07036405801773071,
-0.2707407474517822,
-0.18096566200256348,
-0.1309647113084793,
0.3981797695159912,
0.0845387876033783,
-0.14743323624134064,
0.2973511517047882,
0.07149368524551392,
0.37954163551330566,
0.22432971000671387,
-0.13453055918216705,
-0.5341125130653381,
0.05241091549396515,
-0.4589904546737671,
0.11229412257671356,
-0.11275619268417358,
0.22009262442588806,
-0.10963410139083862,
-0.3131343722343445,
-0.22502021491527557,
-0.14201796054840088,
-0.33201080560684204,
0.43670129776000977,
-0.38070622086524963,
-0.09972655028104782,
-0.18795587122440338,
-0.2686605453491211,
0.200131356716156,
0.20896729826927185,
-0.21232305467128754,
0.02170472964644432,
-0.3878672420978546,
0.23930421471595764,
-0.1301875114440918,
-0.04679088294506073,
-0.00015840958803892136,
-0.02171594649553299,
0.20118363201618195,
-0.053342461585998535,
-0.0857122540473938,
0.26706650853157043,
-0.102055624127388,
-0.48515576124191284,
0.3996991515159607,
-0.05655097961425781,
-0.1914409101009369,
0.08738954365253448,
-0.17117072641849518,
0.11444327235221863,
0.03464251384139061,
-0.08096607029438019,
0.07494854927062988,
-0.21587873995304108,
-0.1691908836364746,
-0.2220706045627594,
0.01904905028641224,
-0.11564958840608597,
-0.12492163479328156,
0.4945385158061981,
-0.24813735485076904,
0.02179068699479103,
0.3826908469200134,
0.04467107728123665,
-0.12983696162700653,
-0.19934412837028503,
-0.02080734446644783,
-0.045450594276189804,
-0.009270958602428436,
-0.058942247182130814,
-0.1137520894408226,
0.2521287798881531,
-0.336117148399353,
0.1370440572500229,
0.12176722288131714,
-0.13819652795791626,
0.04927675798535347,
-0.4791684150695801,
-0.1921573132276535,
0.11659444868564606,
-0.14037343859672546,
0.16629934310913086,
-0.05385206639766693,
0.2869292199611664,
0.06458761543035507,
-0.181953564286232,
-0.20829012989997864,
0.011290643364191055,
-0.05162833631038666,
-0.09221816807985306,
0.2739124596118927,
0.315157026052475,
0.5544472932815552,
-0.07922890782356262,
0.09241879731416702,
0.21152763068675995,
-0.21628478169441223,
-0.12283258140087128,
-0.1155698150396347,
0.20164692401885986,
0.3467756509780884,
-0.2658436894416809,
0.013455464504659176,
-0.21983373165130615,
-0.10459935665130615,
-0.06739997863769531,
0.1867254674434662,
0.2010076940059662,
-0.03919239342212677,
-0.03182293102145195,
0.15561091899871826,
0.11428071558475494,
-0.322509229183197,
-0.0017664991319179535,
-0.06647394597530365,
0.3725152611732483,
0.1587136685848236,
0.08929252624511719,
-0.12892375886440277,
0.11799585819244385,
-0.09783141314983368,
-0.020757921040058136,
-0.03301742672920227,
0.21228119730949402,
0.3940547704696655,
-0.4751180410385132,
0.09361019730567932,
-0.05096206068992615,
0.08167851716279984,
0.4724428653717041,
-0.20521433651447296,
0.008502459153532982,
0.27819257974624634,
0.11942251026630402,
-0.031318988651037216,
0.04302022606134415,
0.18230856955051422,
-0.041301824152469635,
-0.05989336222410202,
-0.09673383086919785,
-0.05834892392158508,
-0.2807615101337433,
-0.06959812343120575,
0.060273826122283936,
0.24833840131759644,
0.08516094088554382,
0.18966081738471985,
0.4448513686656952,
0.03794010356068611,
0.19667908549308777,
-0.10223310440778732,
-0.06512556970119476,
0.1837368905544281,
0.26998305320739746,
-0.256096214056015,
-0.22846297919750214,
-0.15082955360412598,
0.11247733980417252,
-0.21081578731536865,
-0.5837599635124207,
-0.37412533164024353,
0.13675177097320557,
-0.244267076253891,
0.39939168095588684,
0.19652143120765686,
0.0742519423365593,
-0.1614338755607605,
0.055769577622413635,
-0.3243415355682373,
-0.1624024659395218,
-0.022397123277187347,
0.22725114226341248,
-0.13990339636802673,
-0.2984611392021179,
0.028203003108501434,
0.15969981253147125,
0.00852937251329422,
-0.05497431010007858,
0.10398159176111221,
0.21661140024662018,
-0.17479963600635529,
-0.17565596103668213,
0.038966745138168335,
0.14087720215320587,
0.24339023232460022,
-0.27268004417419434,
0.13330963253974915,
0.18458500504493713,
-0.044360093772411346,
0.18305766582489014,
-0.07467889040708542,
0.42534512281417847,
0.23506006598472595,
0.039257027208805084,
0.15417467057704926,
0.185539111495018,
-0.09270988404750824,
0.14326544106006622,
0.3272568881511688,
0.20650522410869598,
-0.214337557554245,
0.25183454155921936,
0.09707736223936081,
-0.11720587313175201,
0.21091048419475555,
-0.14883646368980408,
0.2876206338405609,
-0.46881017088890076,
0.30672118067741394,
-0.4334767162799835,
0.10325699299573898,
-0.1471916139125824,
-0.17319774627685547,
-0.20473214983940125,
0.2916693389415741,
0.09842155873775482,
-0.12995165586471558,
0.13238796591758728,
0.12089074403047562,
0.023868821561336517,
-0.11856125295162201,
0.15571199357509613,
0.34970030188560486,
0.10535278916358948,
-0.24232438206672668,
-0.19692377746105194,
-0.6438881158828735,
0.1382269263267517,
-0.0963667631149292,
0.16455979645252228,
-0.19771301746368408,
0.16293375194072723,
-0.03372672200202942,
0.08452653884887695,
0.2139347493648529,
0.09984846413135529,
0.21732474863529205,
0.26532089710235596,
-0.11745861172676086,
-0.2823593318462372,
0.026598159223794937,
0.11500189453363419,
-0.24666129052639008,
-0.4413094222545624,
0.07846689969301224,
-0.22740676999092102,
0.04725667089223862,
0.11268853396177292,
-0.12910765409469604,
-0.12330006062984467,
-0.2741156816482544,
0.6556937098503113,
0.12865066528320312,
0.4314830005168915,
-0.14341869950294495,
-0.28353211283683777,
-0.4107500910758972,
-0.03240230306982994,
-0.06375692784786224,
-0.21496421098709106,
-0.1453426331281662,
0.6507197618484497,
-0.13838259875774384,
-0.004225652664899826,
-0.28873008489608765,
0.6345019936561584,
0.2397419959306717,
-0.010852216742932796,
-0.25875890254974365,
0.020687444135546684,
-0.5742632150650024,
0.20704682171344757,
-0.10696203261613846,
0.1641438603401184,
-0.15547531843185425,
0.01403714157640934,
-0.1726662516593933,
-0.17264895141124725,
0.6431175470352173,
-0.8920931816101074,
-0.05727548897266388,
0.11844656616449356,
0.2540162205696106,
0.15828993916511536,
-0.03740879148244858,
-0.2273479700088501,
0.29581642150878906,
0.2916668653488159,
-0.16808098554611206,
-0.2898517847061157,
0.014135900884866714,
-0.006068415939807892,
-0.04722468927502632,
0.06299485266208649,
0.4249376952648163,
0.10371994972229004,
-0.35971251130104065,
0.29650989174842834,
-0.3112955093383789
] |
https://github.com/huggingface/datasets/issues/5574 | c4 dataset streaming fails with `FileNotFoundError` | > Experiencing the same issues as above : `FileNotFoundError: https://huggingface.co/datasets/allenai/c4/resolve/1ddc917116b730e1859edef32896ec5c16be51d0/en/c4-train.00000-of-01024.json.gz If the repo is private or gated, make sure to log in with `huggingface-cli login`.`
>
> Have made sure to login as well, issue persists.
I meet the same issue | ### Describe the bug
Loading the `c4` dataset in streaming mode with `load_dataset("c4", "en", split="validation", streaming=True)` and then using it fails with a `FileNotFoundException`.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("c4", "en", split="train", streaming=True)
next(iter(dataset))
```
causes a
```
FileNotFoundError: https://huggingface.co/datasets/allenai/c4/resolve/1ddc917116b730e1859edef32896ec5c16be51d0/en/c4-train.00000-of-01024.json.gz
```
I can download this file manually though e.g. by entering this URL in a browser.
There is an underlying HTTP 403 status code:
```
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('https://cdn-lfs.huggingface.co/datasets/allenai/c4/8ef8d75b0e045dec4aa5123a671b4564466b0707086a7ed1ba8721626dfffbc9?response-content-disposition=attachment%3B+filename*%3DUTF-8''c4-train.00000-of-01024.json.gz%3B+filename%3D%22c4-train.00000-of-01024.json.gz%22%3B&response-content-type=application/gzip&Expires=1677483770&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL2RhdGFzZXRzL2FsbGVuYWkvYzQvOGVmOGQ3NWIwZTA0NWRlYzRhYTUxMjNhNjcxYjQ1NjQ0NjZiMDcwNzA4NmE3ZWQxYmE4NzIxNjI2ZGZmZmJjOT9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSomcmVzcG9uc2UtY29udGVudC10eXBlPWFwcGxpY2F0aW9uJTJGZ3ppcCIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY3NzQ4Mzc3MH19fV19&Signature=yjL3UeY72cf2xpnvPvD68eAYOEe2qtaUJV55sB-jnPskBJEMwpMJcBZvg2~GqXZdM3O-GWV-Z3CI~d4u5VCb4YZ-HlmOjr3VBYkvox2EKiXnBIhjMecf2UVUPtxhTa9kBVlWjqu4qKzB9gKXZF2Cwpp5ctLzapEaT2nnqF84RAL-rsqMA3I~M8vWWfivQsbBK63hMfgZqqKMgdWM0iKMaItveDl0ufQ29azMFmsR7qd8V7sU2Z-F1fAeohS8HpN9OOnClW34yi~YJ2AbgZJJBXA~qsylfVA0Qp7Q~yX~q4P8JF1vmJ2BjkiSbGrj3bAXOGugpOVU5msI52DT88yMdA__&Key-Pair-Id=KVTP0A1DKRTAX')
```
### Expected behavior
This should retrieve the first example from the C4 validation set. This worked a few days ago but stopped working now.
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.15.0-60-generic-x86_64-with-glibc2.31
- Python version: 3.9.16
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
| 41 | c4 dataset streaming fails with `FileNotFoundError`
### Describe the bug
Loading the `c4` dataset in streaming mode with `load_dataset("c4", "en", split="validation", streaming=True)` and then using it fails with a `FileNotFoundException`.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("c4", "en", split="train", streaming=True)
next(iter(dataset))
```
causes a
```
FileNotFoundError: https://huggingface.co/datasets/allenai/c4/resolve/1ddc917116b730e1859edef32896ec5c16be51d0/en/c4-train.00000-of-01024.json.gz
```
I can download this file manually though e.g. by entering this URL in a browser.
There is an underlying HTTP 403 status code:
```
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('https://cdn-lfs.huggingface.co/datasets/allenai/c4/8ef8d75b0e045dec4aa5123a671b4564466b0707086a7ed1ba8721626dfffbc9?response-content-disposition=attachment%3B+filename*%3DUTF-8''c4-train.00000-of-01024.json.gz%3B+filename%3D%22c4-train.00000-of-01024.json.gz%22%3B&response-content-type=application/gzip&Expires=1677483770&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL2RhdGFzZXRzL2FsbGVuYWkvYzQvOGVmOGQ3NWIwZTA0NWRlYzRhYTUxMjNhNjcxYjQ1NjQ0NjZiMDcwNzA4NmE3ZWQxYmE4NzIxNjI2ZGZmZmJjOT9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSomcmVzcG9uc2UtY29udGVudC10eXBlPWFwcGxpY2F0aW9uJTJGZ3ppcCIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY3NzQ4Mzc3MH19fV19&Signature=yjL3UeY72cf2xpnvPvD68eAYOEe2qtaUJV55sB-jnPskBJEMwpMJcBZvg2~GqXZdM3O-GWV-Z3CI~d4u5VCb4YZ-HlmOjr3VBYkvox2EKiXnBIhjMecf2UVUPtxhTa9kBVlWjqu4qKzB9gKXZF2Cwpp5ctLzapEaT2nnqF84RAL-rsqMA3I~M8vWWfivQsbBK63hMfgZqqKMgdWM0iKMaItveDl0ufQ29azMFmsR7qd8V7sU2Z-F1fAeohS8HpN9OOnClW34yi~YJ2AbgZJJBXA~qsylfVA0Qp7Q~yX~q4P8JF1vmJ2BjkiSbGrj3bAXOGugpOVU5msI52DT88yMdA__&Key-Pair-Id=KVTP0A1DKRTAX')
```
### Expected behavior
This should retrieve the first example from the C4 validation set. This worked a few days ago but stopped working now.
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.15.0-60-generic-x86_64-with-glibc2.31
- Python version: 3.9.16
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
> Experiencing the same issues as above : `FileNotFoundError: https://huggingface.co/datasets/allenai/c4/resolve/1ddc917116b730e1859edef32896ec5c16be51d0/en/c4-train.00000-of-01024.json.gz If the repo is private or gated, make sure to log in with `huggingface-cli login`.`
>
> Have made sure to login as well, issue persists.
I meet the same issue | [
-0.2467462718486786,
0.13279876112937927,
0.04004215821623802,
0.32442140579223633,
0.1723441779613495,
0.11456891149282455,
0.14179404079914093,
0.2780021131038666,
-0.08522557467222214,
0.06967808306217194,
-0.07468783855438232,
-0.08705097436904907,
-0.0888633131980896,
0.10009647160768509,
0.06160719692707062,
0.027806324884295464,
-0.09655933827161789,
0.19019505381584167,
0.0317605696618557,
0.15858441591262817,
-0.010184548795223236,
0.09507511556148529,
-0.24832436442375183,
-0.0538179874420166,
-0.1898794323205948,
-0.13213948905467987,
0.04076565057039261,
0.31705448031425476,
-0.11375867575407028,
-0.3029356002807617,
0.35685497522354126,
-0.09025917947292328,
0.22927512228488922,
0.5055244565010071,
-0.00011665172496577725,
0.13374163210391998,
0.309661865234375,
-0.1642947643995285,
-0.20611059665679932,
-0.25145959854125977,
-0.4731822609901428,
-0.043023817241191864,
-0.24912941455841064,
-0.09240736812353134,
-0.04734421148896217,
-0.057319726794958115,
0.17451418936252594,
-0.41000881791114807,
0.3812444806098938,
0.5148968696594238,
0.10202870517969131,
0.22239011526107788,
-0.12849010527133942,
0.15287506580352783,
-0.18233045935630798,
-0.21428288519382477,
-0.0802147388458252,
0.28004834055900574,
-0.0665721744298935,
0.1667594164609909,
-0.05099412053823471,
0.18356040120124817,
-0.10023258626461029,
-0.08552347123622894,
0.2082856297492981,
-0.03638123348355293,
-0.0864815041422844,
-0.2673667073249817,
0.16529986262321472,
0.31590551137924194,
0.740833580493927,
-0.3290979266166687,
-0.4362660348415375,
-0.02088863030076027,
0.24007682502269745,
-0.29473093152046204,
0.27932122349739075,
0.28932997584342957,
-0.06849834322929382,
0.20271843671798706,
-0.2132507711648941,
-0.04583487659692764,
-0.3832428455352783,
0.14923974871635437,
-0.042087867856025696,
-0.057114213705062866,
-0.03317325562238693,
-0.04581177979707718,
-0.06490056216716766,
0.03733082860708237,
-0.028729934245347977,
-0.43308302760124207,
-0.2817257344722748,
0.2850091755390167,
-0.24725447595119476,
-0.016068149358034134,
-0.04550222307443619,
0.26849374175071716,
0.012613829225301743,
0.1411409229040146,
0.33579757809638977,
-0.042412810027599335,
-0.27079153060913086,
0.12728652358055115,
0.042364299297332764,
0.1877596229314804,
0.09706982970237732,
-0.09918445348739624,
0.3607012629508972,
0.3305165469646454,
-0.043022580444812775,
-0.299225389957428,
0.08175912499427795,
-0.12616084516048431,
-0.28382280468940735,
-0.060332462191581726,
0.29677170515060425,
-0.3114683926105499,
-0.5887150168418884,
0.21859018504619598,
-0.701935350894928,
-0.001417564693838358,
-0.021332066506147385,
0.506765604019165,
-0.23274073004722595,
0.10391108691692352,
0.07359717041254044,
0.20150282979011536,
0.001089358702301979,
-0.38615506887435913,
-0.127083420753479,
-0.15283173322677612,
-0.03059784322977066,
0.1986517757177353,
0.1966625154018402,
-0.32446348667144775,
0.2735462784767151,
0.03848418965935707,
0.21742673218250275,
0.09323553740978241,
-0.013154305517673492,
-0.05733771622180939,
-0.12895923852920532,
0.195569708943367,
-0.043529022485017776,
0.09557364881038666,
0.1676395833492279,
-0.3185003995895386,
0.04763498157262802,
-0.09468837827444077,
-0.015874050557613373,
-0.10598913580179214,
0.04231127351522446,
0.10096142441034317,
-0.3069586157798767,
-0.0727614015340805,
-0.19828787446022034,
-0.05068235471844673,
-0.26952606439590454,
-0.3888101875782013,
0.1626984030008316,
-0.055219314992427826,
0.11192630231380463,
-0.22574912011623383,
0.23529458045959473,
0.7646635174751282,
-0.2802044749259949,
-0.1846485286951065,
-0.11372776329517365,
-0.16401898860931396,
0.3409588038921356,
0.27698296308517456,
-0.10479753464460373,
0.01931150257587433,
-0.26778340339660645,
0.40866750478744507,
0.21925535798072815,
-0.19311381876468658,
-0.6291771531105042,
0.5631681084632874,
-0.19646494090557098,
0.6119543313980103,
0.2093448042869568,
0.06432729959487915,
-0.0595216304063797,
-0.18049634993076324,
0.1653538942337036,
0.25187960267066956,
-0.0273370910435915,
-0.03522312268614769,
-0.2284655123949051,
-0.10355506092309952,
0.34119659662246704,
0.03135211393237114,
-0.021206539124250412,
0.14884987473487854,
0.32728931307792664,
-0.02599778212606907,
0.41606247425079346,
-0.2120276689529419,
-0.0012862831354141235,
-0.007101666182279587,
0.47636035084724426,
-0.036758773028850555,
-0.16989751160144806,
0.10066860169172287,
-0.607447624206543,
0.23923105001449585,
0.1632545292377472,
-0.17657506465911865,
-0.03365790843963623,
-0.09012711048126221,
-0.0279281847178936,
-0.13434557616710663,
-0.33751973509788513,
-0.3689330220222473,
0.08227864652872086,
0.2043687403202057,
0.006775926798582077,
0.21912585198879242,
-0.1947854608297348,
0.8216492533683777,
-0.42222344875335693,
0.010109343566000462,
-0.03835589438676834,
0.2734583616256714,
0.027525464072823524,
-0.06141076236963272,
0.04907625913619995,
-0.06341006606817245,
0.23409846425056458,
-0.13357433676719666,
-0.08236509561538696,
0.5615682005882263,
-0.05533430725336075,
0.295086145401001,
-0.10691533237695694,
0.08125246316194534,
0.4368551969528198,
-0.2516922056674957,
0.007443314418196678,
0.5023471117019653,
0.23382879793643951,
0.02167937159538269,
0.04421984776854515,
0.3587788939476013,
0.07097887247800827,
0.08141403645277023,
0.2847810387611389,
-0.003402218222618103,
0.20224960148334503,
0.08997105062007904,
-0.23544280230998993,
0.09405019879341125,
0.4511280357837677,
-0.38557836413383484,
0.32700058817863464,
-0.17344869673252106,
-0.4125608205795288,
-0.045385994017124176,
0.2711707651615143,
-0.086728036403656,
-0.21076464653015137,
-0.06281088292598724,
-0.2558002769947052,
0.09161128848791122,
0.467567503452301,
0.3024212718009949,
0.43926066160202026,
0.06820511817932129,
-0.13268417119979858,
0.1980845183134079,
-0.10682034492492676,
-0.18183402717113495,
0.16543179750442505,
-0.21031241118907928,
-0.1176859512925148,
0.2709534168243408,
-0.05011561140418053,
0.06094174087047577,
-0.26872342824935913,
-0.44717922806739807,
-0.06406036019325256,
0.0006428882479667664,
-0.4872424900531769,
0.21120157837867737,
-0.36426493525505066,
-0.22301757335662842,
-0.07438651472330093,
-0.06230941042304039,
-0.16031686961650848,
-0.11078377068042755,
-0.18558762967586517,
0.3693574368953705,
-0.10465750098228455,
0.02522594854235649,
-0.8260208964347839,
0.02523478865623474,
-0.01327403262257576,
-0.31963685154914856,
-0.17091074585914612,
0.16814208030700684,
-0.22076234221458435,
0.06438340246677399,
0.47011512517929077,
-0.1355893611907959,
0.21940530836582184,
-0.2175547182559967,
-0.09454120695590973,
-0.38990432024002075,
-0.17627979815006256,
0.09338358044624329,
-0.0761294737458229,
0.17922888696193695,
-0.23388555645942688,
0.3725619912147522,
-0.16186849772930145,
-0.35431599617004395,
-0.007720916997641325,
-0.13874037563800812,
-0.10681159794330597,
0.12521858513355255,
-0.01400883961468935,
-0.09701523929834366,
-0.11198844015598297,
-0.3995073139667511,
-0.14540664851665497,
-0.3510515093803406,
0.2642711400985718,
-0.1719008982181549,
0.01036936417222023,
0.4008120000362396,
0.11057275533676147,
0.29947400093078613,
0.1075277104973793,
-0.173945352435112,
-0.007569999434053898,
-0.24086622893810272,
0.4674313962459564,
-0.022617556154727936,
-0.36916548013687134,
0.20961883664131165,
0.08432953804731369,
-0.06399405002593994,
0.37871766090393066,
-0.3669458031654358,
0.2902870774269104,
-0.11964832246303558,
0.2584117352962494,
-0.07022438198328018,
-0.20720434188842773,
0.1946023404598236,
-0.2807164788246155,
0.08727731555700302,
-0.253869891166687,
0.10635335743427277,
-0.068071149289608,
0.28173863887786865,
0.4405917525291443,
-0.06615250557661057,
0.37335941195487976,
0.18214388191699982,
0.5030514597892761,
0.33333873748779297,
-0.1447412371635437,
0.49497711658477783,
-0.04692456126213074,
0.48988044261932373,
0.09671000391244888,
-0.021917054429650307,
0.21092338860034943,
-0.07143810391426086,
-0.23888611793518066,
0.1857145130634308,
-0.05955946445465088,
-0.1173391118645668,
-0.3247036039829254,
0.05678357556462288,
-0.3353002071380615,
-0.15100382268428802,
0.0470120832324028,
-0.04628527909517288,
0.13905155658721924,
0.10295809805393219,
0.20392337441444397,
0.2588067352771759,
-0.18477711081504822,
0.10135670006275177,
0.6303920745849609,
0.34443399310112,
0.1472344547510147,
-0.09011538326740265,
-0.32927224040031433,
-0.4260959327220917,
0.404471218585968,
0.2784533202648163,
0.3510306477546692,
-0.13401074707508087,
-0.14684903621673584,
-0.08164574205875397,
-0.18911698460578918,
0.5461317300796509,
-0.20066425204277039,
0.14058023691177368,
0.12941516935825348,
0.20293691754341125,
0.003830930218100548,
-0.1206861287355423,
-0.044159408658742905,
0.2406240701675415,
0.4243500232696533,
0.20681512355804443,
-0.1926030069589615,
0.009018734097480774,
-0.22709301114082336,
-0.015158829279243946,
0.1268855482339859,
0.03617442026734352,
-0.15880940854549408,
-0.12921872735023499,
-0.1440446823835373,
-0.06087259203195572,
-0.0431312695145607,
0.0795368179678917,
-0.20847325026988983,
0.19558954238891602,
0.023120349273085594,
0.06246577203273773,
0.2545427083969116,
0.23770852386951447,
0.19763469696044922,
0.0004946620902046561,
0.13283419609069824,
0.2977561950683594,
0.11113382875919342,
0.5374557971954346,
0.5015861988067627,
0.3258613049983978,
-0.32760339975357056,
-0.05168347805738449,
0.18064171075820923,
0.06356197595596313,
0.3620198965072632,
0.03963249549269676,
-0.11139494925737381,
0.3632160425186157,
0.00010451674461364746,
-0.060506317764520645,
0.21385736763477325,
0.3125086724758148,
-0.20250427722930908,
-0.4594510495662689,
-0.4426804482936859,
0.42595407366752625,
-0.19747550785541534,
0.08712536096572876,
0.5395447015762329,
0.37628114223480225,
-0.14481261372566223,
-0.04598533362150192,
-0.19865241646766663,
0.667384684085846,
0.21085840463638306,
0.16781212389469147,
0.4115624725818634,
-0.0649867057800293,
0.2511211335659027,
-0.5093109011650085,
0.27916330099105835,
-0.07036405801773071,
-0.2707407474517822,
-0.18096566200256348,
-0.1309647113084793,
0.3981797695159912,
0.0845387876033783,
-0.14743323624134064,
0.2973511517047882,
0.07149368524551392,
0.37954163551330566,
0.22432971000671387,
-0.13453055918216705,
-0.5341125130653381,
0.05241091549396515,
-0.4589904546737671,
0.11229412257671356,
-0.11275619268417358,
0.22009262442588806,
-0.10963410139083862,
-0.3131343722343445,
-0.22502021491527557,
-0.14201796054840088,
-0.33201080560684204,
0.43670129776000977,
-0.38070622086524963,
-0.09972655028104782,
-0.18795587122440338,
-0.2686605453491211,
0.200131356716156,
0.20896729826927185,
-0.21232305467128754,
0.02170472964644432,
-0.3878672420978546,
0.23930421471595764,
-0.1301875114440918,
-0.04679088294506073,
-0.00015840958803892136,
-0.02171594649553299,
0.20118363201618195,
-0.053342461585998535,
-0.0857122540473938,
0.26706650853157043,
-0.102055624127388,
-0.48515576124191284,
0.3996991515159607,
-0.05655097961425781,
-0.1914409101009369,
0.08738954365253448,
-0.17117072641849518,
0.11444327235221863,
0.03464251384139061,
-0.08096607029438019,
0.07494854927062988,
-0.21587873995304108,
-0.1691908836364746,
-0.2220706045627594,
0.01904905028641224,
-0.11564958840608597,
-0.12492163479328156,
0.4945385158061981,
-0.24813735485076904,
0.02179068699479103,
0.3826908469200134,
0.04467107728123665,
-0.12983696162700653,
-0.19934412837028503,
-0.02080734446644783,
-0.045450594276189804,
-0.009270958602428436,
-0.058942247182130814,
-0.1137520894408226,
0.2521287798881531,
-0.336117148399353,
0.1370440572500229,
0.12176722288131714,
-0.13819652795791626,
0.04927675798535347,
-0.4791684150695801,
-0.1921573132276535,
0.11659444868564606,
-0.14037343859672546,
0.16629934310913086,
-0.05385206639766693,
0.2869292199611664,
0.06458761543035507,
-0.181953564286232,
-0.20829012989997864,
0.011290643364191055,
-0.05162833631038666,
-0.09221816807985306,
0.2739124596118927,
0.315157026052475,
0.5544472932815552,
-0.07922890782356262,
0.09241879731416702,
0.21152763068675995,
-0.21628478169441223,
-0.12283258140087128,
-0.1155698150396347,
0.20164692401885986,
0.3467756509780884,
-0.2658436894416809,
0.013455464504659176,
-0.21983373165130615,
-0.10459935665130615,
-0.06739997863769531,
0.1867254674434662,
0.2010076940059662,
-0.03919239342212677,
-0.03182293102145195,
0.15561091899871826,
0.11428071558475494,
-0.322509229183197,
-0.0017664991319179535,
-0.06647394597530365,
0.3725152611732483,
0.1587136685848236,
0.08929252624511719,
-0.12892375886440277,
0.11799585819244385,
-0.09783141314983368,
-0.020757921040058136,
-0.03301742672920227,
0.21228119730949402,
0.3940547704696655,
-0.4751180410385132,
0.09361019730567932,
-0.05096206068992615,
0.08167851716279984,
0.4724428653717041,
-0.20521433651447296,
0.008502459153532982,
0.27819257974624634,
0.11942251026630402,
-0.031318988651037216,
0.04302022606134415,
0.18230856955051422,
-0.041301824152469635,
-0.05989336222410202,
-0.09673383086919785,
-0.05834892392158508,
-0.2807615101337433,
-0.06959812343120575,
0.060273826122283936,
0.24833840131759644,
0.08516094088554382,
0.18966081738471985,
0.4448513686656952,
0.03794010356068611,
0.19667908549308777,
-0.10223310440778732,
-0.06512556970119476,
0.1837368905544281,
0.26998305320739746,
-0.256096214056015,
-0.22846297919750214,
-0.15082955360412598,
0.11247733980417252,
-0.21081578731536865,
-0.5837599635124207,
-0.37412533164024353,
0.13675177097320557,
-0.244267076253891,
0.39939168095588684,
0.19652143120765686,
0.0742519423365593,
-0.1614338755607605,
0.055769577622413635,
-0.3243415355682373,
-0.1624024659395218,
-0.022397123277187347,
0.22725114226341248,
-0.13990339636802673,
-0.2984611392021179,
0.028203003108501434,
0.15969981253147125,
0.00852937251329422,
-0.05497431010007858,
0.10398159176111221,
0.21661140024662018,
-0.17479963600635529,
-0.17565596103668213,
0.038966745138168335,
0.14087720215320587,
0.24339023232460022,
-0.27268004417419434,
0.13330963253974915,
0.18458500504493713,
-0.044360093772411346,
0.18305766582489014,
-0.07467889040708542,
0.42534512281417847,
0.23506006598472595,
0.039257027208805084,
0.15417467057704926,
0.185539111495018,
-0.09270988404750824,
0.14326544106006622,
0.3272568881511688,
0.20650522410869598,
-0.214337557554245,
0.25183454155921936,
0.09707736223936081,
-0.11720587313175201,
0.21091048419475555,
-0.14883646368980408,
0.2876206338405609,
-0.46881017088890076,
0.30672118067741394,
-0.4334767162799835,
0.10325699299573898,
-0.1471916139125824,
-0.17319774627685547,
-0.20473214983940125,
0.2916693389415741,
0.09842155873775482,
-0.12995165586471558,
0.13238796591758728,
0.12089074403047562,
0.023868821561336517,
-0.11856125295162201,
0.15571199357509613,
0.34970030188560486,
0.10535278916358948,
-0.24232438206672668,
-0.19692377746105194,
-0.6438881158828735,
0.1382269263267517,
-0.0963667631149292,
0.16455979645252228,
-0.19771301746368408,
0.16293375194072723,
-0.03372672200202942,
0.08452653884887695,
0.2139347493648529,
0.09984846413135529,
0.21732474863529205,
0.26532089710235596,
-0.11745861172676086,
-0.2823593318462372,
0.026598159223794937,
0.11500189453363419,
-0.24666129052639008,
-0.4413094222545624,
0.07846689969301224,
-0.22740676999092102,
0.04725667089223862,
0.11268853396177292,
-0.12910765409469604,
-0.12330006062984467,
-0.2741156816482544,
0.6556937098503113,
0.12865066528320312,
0.4314830005168915,
-0.14341869950294495,
-0.28353211283683777,
-0.4107500910758972,
-0.03240230306982994,
-0.06375692784786224,
-0.21496421098709106,
-0.1453426331281662,
0.6507197618484497,
-0.13838259875774384,
-0.004225652664899826,
-0.28873008489608765,
0.6345019936561584,
0.2397419959306717,
-0.010852216742932796,
-0.25875890254974365,
0.020687444135546684,
-0.5742632150650024,
0.20704682171344757,
-0.10696203261613846,
0.1641438603401184,
-0.15547531843185425,
0.01403714157640934,
-0.1726662516593933,
-0.17264895141124725,
0.6431175470352173,
-0.8920931816101074,
-0.05727548897266388,
0.11844656616449356,
0.2540162205696106,
0.15828993916511536,
-0.03740879148244858,
-0.2273479700088501,
0.29581642150878906,
0.2916668653488159,
-0.16808098554611206,
-0.2898517847061157,
0.014135900884866714,
-0.006068415939807892,
-0.04722468927502632,
0.06299485266208649,
0.4249376952648163,
0.10371994972229004,
-0.35971251130104065,
0.29650989174842834,
-0.3112955093383789
] |
https://github.com/huggingface/datasets/issues/5571 | load_dataset fails for JSON in windows | Hi!
You need to pass an input json file explicitly as `data_files` to `load_dataset` to avoid this error:
```python
ds = load_dataset("json", data_files=args.input_json)
```
| ### Describe the bug
Steps:
1. Created a dataset in a Linux VM and created a small sample using dataset.to_json() method.
2. Downloaded the JSON file to my local Windows machine for working and saved in say - r"C:\Users\name\file.json"
3. I am reading the file in my local PyCharm - the location of python file is different than the location of the JSON.
4. When I read using load_dataset("json",args.input_json), it throws and error from builder.py.
raise InvalidConfigName(
f"Bad characters from black list '{invalid_windows_characters}' found in '{self.name}'. "
f"They could create issues when creating a directory for this config on Windows filesystem."
6. When I bring the data to the current directory, it works fine.
### Steps to reproduce the bug
Steps:
1. Created a dataset in a Linux VM and created a small sample using dataset.to_json() method.
2. Downloaded the JSON file to my local Windows machine for working and saved in say - r"C:\Users\name\file.json"
3. I am reading the file in my local PyCharm - the location of python file is different than the location of the JSON.
4. When I read using load_dataset("json",args.input_json), it throws and error from builder.py.
raise InvalidConfigName(
f"Bad characters from black list '{invalid_windows_characters}' found in '{self.name}'. "
f"They could create issues when creating a directory for this config on Windows filesystem."
6. When I bring the data to the current directory, it works fine.
### Expected behavior
Should be able to read from a path different than current directory in Windows machine.
### Environment info
datasets version: 2.3.1
python version: 3.8
Windows OS | 24 | load_dataset fails for JSON in windows
### Describe the bug
Steps:
1. Created a dataset in a Linux VM and created a small sample using dataset.to_json() method.
2. Downloaded the JSON file to my local Windows machine for working and saved in say - r"C:\Users\name\file.json"
3. I am reading the file in my local PyCharm - the location of python file is different than the location of the JSON.
4. When I read using load_dataset("json",args.input_json), it throws and error from builder.py.
raise InvalidConfigName(
f"Bad characters from black list '{invalid_windows_characters}' found in '{self.name}'. "
f"They could create issues when creating a directory for this config on Windows filesystem."
6. When I bring the data to the current directory, it works fine.
### Steps to reproduce the bug
Steps:
1. Created a dataset in a Linux VM and created a small sample using dataset.to_json() method.
2. Downloaded the JSON file to my local Windows machine for working and saved in say - r"C:\Users\name\file.json"
3. I am reading the file in my local PyCharm - the location of python file is different than the location of the JSON.
4. When I read using load_dataset("json",args.input_json), it throws and error from builder.py.
raise InvalidConfigName(
f"Bad characters from black list '{invalid_windows_characters}' found in '{self.name}'. "
f"They could create issues when creating a directory for this config on Windows filesystem."
6. When I bring the data to the current directory, it works fine.
### Expected behavior
Should be able to read from a path different than current directory in Windows machine.
### Environment info
datasets version: 2.3.1
python version: 3.8
Windows OS
Hi!
You need to pass an input json file explicitly as `data_files` to `load_dataset` to avoid this error:
```python
ds = load_dataset("json", data_files=args.input_json)
```
| [
-0.21141701936721802,
0.4925994873046875,
-0.033018454909324646,
0.34813082218170166,
0.32010191679000854,
0.13950246572494507,
0.3737618625164032,
0.19964182376861572,
0.5069835782051086,
0.07556141167879105,
0.21943451464176178,
0.2802491784095764,
0.029631007462739944,
-0.10699496418237686,
0.13115017116069794,
-0.12328363955020905,
0.06983234733343124,
0.08920060843229294,
0.04922490194439888,
-0.1289374828338623,
-0.3979223668575287,
0.23341481387615204,
-0.1934228092432022,
0.0899982824921608,
-0.035620491951704025,
-0.20858821272850037,
-0.06279663741588593,
0.44842687249183655,
0.02345847897231579,
-0.42790040373802185,
0.09239762276411057,
-0.3707647919654846,
0.1210443526506424,
0.583243191242218,
-0.0001163575507234782,
0.2777714729309082,
0.3161770701408386,
0.030852334573864937,
-0.1711055040359497,
-0.46435850858688354,
-0.4391423463821411,
-0.23228882253170013,
-0.0021924336906522512,
-0.17023266851902008,
0.03411548584699631,
-0.33412572741508484,
-0.10318198800086975,
-0.22774355113506317,
0.3568563163280487,
0.4583231210708618,
0.1571364402770996,
0.1815788298845291,
-0.02613280713558197,
0.27139467000961304,
0.16183483600616455,
0.4932161569595337,
-0.06470739841461182,
0.38291075825691223,
0.2375279664993286,
-0.04298482835292816,
-0.0561656579375267,
-0.09535467624664307,
-0.21372811496257782,
0.10105045139789581,
0.044172197580337524,
0.1416742205619812,
-0.03374183923006058,
0.013237230479717255,
-0.10699883848428726,
0.1494470238685608,
0.4270065724849701,
-0.2487267553806305,
-0.20237751305103302,
-0.12369896471500397,
-0.07919643074274063,
-0.12992317974567413,
0.5280369520187378,
0.41759440302848816,
-0.3727484345436096,
0.17530228197574615,
-0.1966416835784912,
-0.08458214998245239,
-0.25584378838539124,
0.2506238520145416,
0.17643724381923676,
0.0038214772939682007,
0.029665980488061905,
0.15528401732444763,
-0.04582701995968819,
-0.022162675857543945,
0.1979295015335083,
-0.4004781246185303,
-0.223676860332489,
0.014332395046949387,
-0.41606345772743225,
0.05593132972717285,
-0.1731741726398468,
0.21743983030319214,
0.11913677304983139,
0.05040036141872406,
0.2275099903345108,
-0.05641525238752365,
0.17121975123882294,
0.29269692301750183,
0.20876355469226837,
0.1365061104297638,
-0.08709491044282913,
0.16312171518802643,
0.3345944285392761,
0.12296527624130249,
-0.03835005313158035,
-0.04397585242986679,
-0.3397411108016968,
-0.6542077660560608,
0.16316112875938416,
0.12299267202615738,
0.33462733030319214,
-0.19706308841705322,
-0.322738915681839,
-0.029978174716234207,
-0.1912326216697693,
-0.06374108791351318,
0.2749467194080353,
0.2866045832633972,
0.012790030799806118,
0.007746953517198563,
0.19457240402698517,
0.39450591802597046,
-0.11158707737922668,
0.2978420853614807,
0.06921424716711044,
-0.04605865105986595,
-0.22539348900318146,
-0.10880308598279953,
0.4133143723011017,
-0.04697128012776375,
0.4204639494419098,
0.08425921946763992,
-0.04430580139160156,
-0.16648422181606293,
0.061164408922195435,
-0.06776584684848785,
-0.012722000479698181,
0.1795201599597931,
0.04470877721905708,
0.2627444565296173,
0.03702617436647415,
-0.27291983366012573,
-0.17169612646102905,
0.30957552790641785,
-0.4577884078025818,
-0.05575203523039818,
-0.008563129231333733,
0.11810657382011414,
-0.011229532770812511,
-0.02744397521018982,
-0.4201602041721344,
-0.1495416909456253,
0.03254290670156479,
-0.009884502738714218,
0.014434203505516052,
-0.2456454187631607,
-0.08723995089530945,
-0.20599156618118286,
0.008527016267180443,
0.2305879294872284,
-0.4215759336948395,
-0.008310079574584961,
0.2182961106300354,
-0.07769781351089478,
-0.11803726106882095,
0.3088814616203308,
-0.22634361684322357,
0.35538211464881897,
-0.3229891061782837,
0.12709112465381622,
0.20060031116008759,
-0.3741860091686249,
-0.4100382626056671,
0.4292701184749603,
-0.13704046607017517,
-0.10993361473083496,
0.11404266953468323,
-0.07214866578578949,
0.1828233003616333,
0.05883331224322319,
0.18257448077201843,
0.3758704662322998,
0.12889216840267181,
0.2500271499156952,
-0.07738611102104187,
-0.2703652083873749,
0.25746408104896545,
0.18922759592533112,
-0.49620071053504944,
-0.10315189510583878,
0.397475004196167,
0.13003213703632355,
0.31179481744766235,
-0.15372663736343384,
-0.011615030467510223,
0.5377258658409119,
-0.10632506012916565,
-0.14133857190608978,
0.07958515733480453,
0.012552395462989807,
-0.22433316707611084,
0.05811379849910736,
-0.030031314119696617,
-0.051141269505023956,
-0.21335141360759735,
0.07638148963451385,
-0.10393379628658295,
0.1407971829175949,
-0.4733681380748749,
-0.0332651250064373,
0.0740639716386795,
0.3166472017765045,
0.09887717664241791,
-0.09368393570184708,
0.06583911180496216,
0.11982439458370209,
-0.11028483510017395,
0.03922444209456444,
-0.04670209810137749,
0.2973610460758209,
-0.12764568626880646,
-0.055471792817115784,
0.15744337439537048,
0.0785069465637207,
0.31709256768226624,
-0.08232949674129486,
-0.2895640730857849,
0.174579918384552,
0.1217823401093483,
0.21147802472114563,
-0.0019244737923145294,
-0.020823314785957336,
0.21550516784191132,
-0.18365760147571564,
0.26283055543899536,
0.7178277373313904,
0.21921725571155548,
-0.1037064790725708,
-0.21805721521377563,
0.21138975024223328,
-0.22698651254177094,
0.38245272636413574,
-0.1195584237575531,
-0.0036086179316043854,
0.2447134256362915,
-0.12312468886375427,
-0.04983720928430557,
-0.011487647891044617,
0.4447470009326935,
0.4086190164089203,
0.03855619207024574,
-0.03506159782409668,
-0.2706112265586853,
-0.2513357698917389,
0.6141877770423889,
-0.16265274584293365,
0.24341315031051636,
0.09979110956192017,
-0.22015118598937988,
0.1715153157711029,
0.1940593719482422,
0.013700548559427261,
0.6532478332519531,
0.09153424948453903,
-0.3015555441379547,
0.1287352591753006,
-0.1422470510005951,
-0.2230745553970337,
0.23822546005249023,
0.007085531949996948,
0.1440242975950241,
0.39499223232269287,
0.14654512703418732,
-0.06939633190631866,
-0.31213292479515076,
-0.12201794981956482,
0.026904242113232613,
-0.06831096112728119,
-0.5234647989273071,
0.19426824152469635,
-0.3655652105808258,
0.22427141666412354,
-0.49539774656295776,
-0.35029536485671997,
-0.1678292155265808,
0.04330067336559296,
-0.04605867713689804,
0.12092365324497223,
0.015745539218187332,
0.07073386758565903,
-0.08717960864305496,
0.03569991886615753,
0.11026434600353241,
-0.5568511486053467,
-0.2062319964170456,
0.12683579325675964,
-0.38276028633117676,
-0.019273623824119568,
0.4699167013168335,
0.15546925365924835,
0.1313481330871582,
-0.28920868039131165,
-0.10194877535104752,
-0.038012757897377014,
0.0021104514598846436,
0.006922494620084763,
0.013552697375416756,
0.6341336369514465,
0.18377681076526642,
0.20143961906433105,
0.13734957575798035,
-0.27326783537864685,
0.22225040197372437,
-0.09105287492275238,
-0.3952738046646118,
0.08500924706459045,
0.10049236565828323,
-0.3158860504627228,
0.010083507746458054,
-0.2983912527561188,
-0.2145296335220337,
-0.3174745738506317,
0.1672167181968689,
0.20916292071342468,
0.09735094010829926,
-0.0007497649639844894,
0.10376295447349548,
0.0708894208073616,
0.17378133535385132,
0.11880206316709518,
0.02109628915786743,
-0.26579779386520386,
0.31479862332344055,
-0.16552311182022095,
-0.3422142565250397,
0.20205092430114746,
0.07330402731895447,
-0.1635390967130661,
-0.036859989166259766,
-0.6214588284492493,
0.11637134104967117,
0.02209574356675148,
0.3733289837837219,
0.04842642322182655,
0.076614148914814,
0.07680545002222061,
0.13049964606761932,
0.07086072117090225,
-0.24004843831062317,
-0.5432387590408325,
-0.030081234872341156,
0.0031374990940093994,
0.31686875224113464,
0.35882166028022766,
0.39699307084083557,
-0.2942633628845215,
0.08693991601467133,
0.25715526938438416,
0.09368237853050232,
0.25174957513809204,
-0.23872902989387512,
0.13062432408332825,
-0.06805586069822311,
-0.28768986463546753,
0.36397024989128113,
0.019534289836883545,
-0.12266147881746292,
0.10812845081090927,
0.1919492483139038,
-0.0065572429448366165,
-0.0266703013330698,
-0.29927265644073486,
-0.37275785207748413,
-0.15422742068767548,
0.20712603628635406,
-0.036121293902397156,
0.0319533534348011,
-0.12032489478588104,
0.1766703724861145,
0.04282509535551071,
-0.21458330750465393,
0.14118258655071259,
0.5038252472877502,
-0.20378878712654114,
0.18439123034477234,
-0.4970129430294037,
-0.3267664313316345,
-0.23869290947914124,
0.038683660328388214,
0.01842198334634304,
0.593096911907196,
-0.14247970283031464,
0.3216935992240906,
-0.04353420436382294,
-0.22649505734443665,
0.5769917964935303,
-0.11102493852376938,
0.21654236316680908,
0.18167656660079956,
0.24089226126670837,
-0.33799198269844055,
-0.00965460017323494,
-0.10521285235881805,
0.40054839849472046,
-0.379777193069458,
0.34248822927474976,
0.09921600669622421,
-0.2510327398777008,
-0.05847220867872238,
0.5610350966453552,
-0.32188138365745544,
-0.23559309542179108,
-0.22887100279331207,
-0.6186150312423706,
-0.4879264533519745,
-0.13803136348724365,
-0.004572300240397453,
0.12493506819009781,
-0.1281820684671402,
-0.08368764072656631,
0.01470378041267395,
0.18854928016662598,
-0.041568830609321594,
0.0424887090921402,
0.3301357924938202,
-0.13845963776111603,
0.10527960956096649,
0.15299293398857117,
0.5667576789855957,
0.37260106205940247,
0.6522643566131592,
0.09020024538040161,
-0.17251050472259521,
0.06005549430847168,
-0.3147195279598236,
0.09057320654392242,
0.16875487565994263,
-0.2549600899219513,
-0.16238433122634888,
0.16634245216846466,
-0.0897742360830307,
-0.38351741433143616,
-0.18298324942588806,
0.453961044549942,
0.3029293119907379,
-0.0351848341524601,
-0.3382868766784668,
0.34917303919792175,
-0.16985845565795898,
-0.020114682614803314,
0.16407901048660278,
-0.1910644918680191,
-0.5342184901237488,
0.33478212356567383,
0.1287136673927307,
0.6406644582748413,
0.2255944162607193,
0.31890374422073364,
0.3593944311141968,
-0.4509829878807068,
-0.04942253977060318,
-0.0654204785823822,
0.07651516795158386,
-0.36822065711021423,
0.12424353510141373,
-0.09764501452445984,
-0.29805052280426025,
0.31822168827056885,
0.43527233600616455,
-0.22776539623737335,
0.18350748717784882,
0.1205514520406723,
-0.13412506878376007,
0.018205460160970688,
0.23999372124671936,
-0.19028614461421967,
-0.2736060917377472,
-0.4926503896713257,
0.07957243919372559,
0.10296273231506348,
0.08470471948385239,
-0.02488238736987114,
-0.10125162452459335,
-0.09017618000507355,
-0.2595195770263672,
-0.2825034260749817,
0.21649625897407532,
-0.4703900218009949,
0.09189321100711823,
0.11867760121822357,
-0.028638970106840134,
0.22287122905254364,
0.10741531103849411,
0.21255289018154144,
0.17229163646697998,
-0.15807364881038666,
0.18829210102558136,
0.02771034836769104,
0.22738218307495117,
0.10414694994688034,
-0.13738738000392914,
0.1339673399925232,
-0.11002865433692932,
-0.4945448935031891,
-0.10980469733476639,
-0.2670827805995941,
-0.30423516035079956,
-0.21825982630252838,
0.04930753633379936,
0.010309446603059769,
-0.2878607511520386,
-0.3043385148048401,
-0.27224794030189514,
0.08494944870471954,
-0.17589709162712097,
0.10492104291915894,
0.03467684984207153,
0.0788828432559967,
0.3192405700683594,
-0.11821915209293365,
-0.16880670189857483,
0.003699813038110733,
0.017758049070835114,
-0.22319680452346802,
-0.0081016905605793,
0.5137461423873901,
0.15416568517684937,
-0.10078167915344238,
-0.30442285537719727,
0.5018637180328369,
0.1463502049446106,
-0.11804406344890594,
-0.1275368183851242,
-0.01717502623796463,
0.0716342180967331,
-0.042300377041101456,
0.2890990376472473,
0.10201950371265411,
-0.07108251005411148,
0.04201008751988411,
-0.7766289114952087,
-0.18770508468151093,
0.21928615868091583,
0.20890499651432037,
-0.013685088604688644,
0.27929413318634033,
-0.08851516246795654,
0.011676998808979988,
-0.3550180196762085,
-0.22622624039649963,
-0.03116360493004322,
-0.10039667785167694,
0.023951519280672073,
0.021224573254585266,
0.12960296869277954,
0.28667572140693665,
0.007708871737122536,
0.10638847947120667,
-0.0911446064710617,
0.21221497654914856,
-0.12152311950922012,
-0.2360115945339203,
0.10864578932523727,
0.04640701413154602,
-0.14174999296665192,
0.00048815179616212845,
-0.5105923414230347,
0.04184276983141899,
0.027014480903744698,
0.09550178050994873,
0.09494895488023758,
-0.14625710248947144,
0.2832198739051819,
-0.05035145953297615,
-0.13195931911468506,
-0.2556941509246826,
0.18904033303260803,
-0.350926011800766,
0.33476078510284424,
-0.07303284853696823,
0.2882363200187683,
0.13230083882808685,
0.14933784306049347,
-0.3761410117149353,
0.18592053651809692,
-0.19505919516086578,
0.36777985095977783,
0.30616042017936707,
-0.519695520401001,
0.15057112276554108,
0.030095597729086876,
0.2896028161048889,
0.3621617555618286,
-0.47021105885505676,
0.2537900507450104,
0.17559030652046204,
0.16709190607070923,
-0.18822255730628967,
-0.199508935213089,
0.1612505316734314,
-0.31326767802238464,
-0.0633607804775238,
0.09122803807258606,
0.012077253311872482,
-0.40125101804733276,
-0.3289681077003479,
-0.13780438899993896,
0.3195767104625702,
0.08342437446117401,
-0.22492241859436035,
0.6576082706451416,
-0.14474351704120636,
0.19397032260894775,
0.15242642164230347,
0.21698369085788727,
0.10348145663738251,
0.41456425189971924,
0.10096441954374313,
0.09870503842830658,
0.19169333577156067,
0.1828119307756424,
-0.31892040371894836,
-0.23009653389453888,
0.27947109937667847,
-0.1482851207256317,
0.12230619788169861,
0.10449234396219254,
0.08255304396152496,
0.051867470145225525,
-0.3003723621368408,
0.010645908303558826,
-0.11707533895969391,
-0.034541551023721695,
-0.07426436245441437,
-0.30898821353912354,
-0.5302314758300781,
-0.0766003429889679,
-0.01693057268857956,
0.0029965080320835114,
-0.05554710701107979,
-0.13927489519119263,
-0.029646530747413635,
0.24013744294643402,
-0.1573762744665146,
-0.4428810775279999,
0.18828228116035461,
0.21269267797470093,
-0.28171858191490173,
-0.23865577578544617,
0.4174189865589142,
0.17904752492904663,
0.19402723014354706,
0.10592828691005707,
0.1955041140317917,
0.5411964058876038,
0.36420223116874695,
-0.1644451767206192,
-0.1088213175535202,
-0.15207059681415558,
-0.023643173277378082,
-0.030664198100566864,
0.37474626302719116,
-0.0620449036359787,
0.0305788516998291,
0.33051013946533203,
0.128513365983963,
0.011545433662831783,
0.2161218523979187,
0.23092229664325714,
-0.11273908615112305,
0.07398879528045654,
0.11349047720432281,
-0.0325530469417572,
-0.06583725661039352,
-0.27136969566345215,
-0.17153921723365784,
-0.20209795236587524,
-0.26620709896087646,
0.5955986976623535,
-0.025875957682728767,
0.28706803917884827,
-0.21072053909301758,
0.05094185471534729,
0.048989079892635345,
0.2984481453895569,
0.2792166471481323,
0.20838144421577454,
-0.16929446160793304,
0.07379259169101715,
-0.43148571252822876,
0.12544068694114685,
-0.01164235919713974,
-0.24243997037410736,
0.06963680684566498,
-0.08289901167154312,
-0.06337947398424149,
0.12111745029687881,
0.19853074848651886,
0.23836839199066162,
-0.05962362140417099,
0.2166416198015213,
-0.27748703956604004,
-0.14569872617721558,
0.4216323494911194,
0.4409942924976349,
-0.05862367898225784,
-0.6124241352081299,
0.2659594714641571,
0.1853533536195755,
0.011921901255846024,
-0.3440956473350525,
0.15911513566970825,
-0.007310565561056137,
0.11946018785238266,
0.206119567155838,
0.1100432276725769,
0.2893129885196686,
-0.16923144459724426,
-0.10275084525346756,
-0.2522965967655182,
-0.24706552922725677,
-0.3957732021808624,
0.3313950300216675,
-0.03715823218226433,
0.36614280939102173,
-0.13222387433052063,
-0.02763059362769127,
-0.3368488550186157,
-0.37742888927459717,
-0.16641449928283691,
-0.3505201041698456,
-0.20227059721946716,
0.21966932713985443,
-0.11659249663352966,
0.07894773036241531,
0.1671520620584488,
0.151166632771492,
-0.16410213708877563,
0.1772230714559555,
-0.12296980619430542,
-0.09035875648260117,
0.12699884176254272,
-0.3591873049736023,
-0.2297145426273346,
0.30018681287765503,
0.09357200562953949,
-0.6091475486755371,
0.11705122888088226,
-0.2588259279727936,
0.1158372238278389,
0.38433223962783813,
-0.07350122928619385,
-0.10550375282764435,
0.07165392488241196,
-0.0038072653114795685,
0.07369838654994965,
0.046621356159448624,
0.09446797519922256,
0.058016594499349594,
-0.31613221764564514,
0.07467879354953766,
-0.19083917140960693
] |
https://github.com/huggingface/datasets/issues/5570 | load_dataset gives FileNotFoundError on imagenet-1k if license is not accepted on the hub | Hi, thanks for the feedback! Would it help to add a tip or note saying the dataset is gated and you need to accept the license before downloading it? | ### Describe the bug
When calling ```load_dataset('imagenet-1k')``` FileNotFoundError is raised, if not logged in and if logged in with huggingface-cli but not having accepted the licence on the hub. There is no error once accepting.
### Steps to reproduce the bug
```
from datasets import load_dataset
imagenet = load_dataset("imagenet-1k", split="train", streaming=True)
FileNotFoundError: Couldn't find a dataset script at /content/imagenet-1k/imagenet-1k.py or any data file in the same directory. Couldn't find 'imagenet-1k' on the Hugging Face Hub either: FileNotFoundError: Dataset 'imagenet-1k' doesn't exist on the Hub
```
tested on a colab notebook.
### Expected behavior
I would expect a specific error indicating that I have to login then accept the dataset licence.
I find this bug very relevant as this code is on a guide on the [Huggingface documentation for Datasets](https://huggingface.co/docs/datasets/about_mapstyle_vs_iterable)
### Environment info
google colab cpu-only instance | 29 | load_dataset gives FileNotFoundError on imagenet-1k if license is not accepted on the hub
### Describe the bug
When calling ```load_dataset('imagenet-1k')``` FileNotFoundError is raised, if not logged in and if logged in with huggingface-cli but not having accepted the licence on the hub. There is no error once accepting.
### Steps to reproduce the bug
```
from datasets import load_dataset
imagenet = load_dataset("imagenet-1k", split="train", streaming=True)
FileNotFoundError: Couldn't find a dataset script at /content/imagenet-1k/imagenet-1k.py or any data file in the same directory. Couldn't find 'imagenet-1k' on the Hugging Face Hub either: FileNotFoundError: Dataset 'imagenet-1k' doesn't exist on the Hub
```
tested on a colab notebook.
### Expected behavior
I would expect a specific error indicating that I have to login then accept the dataset licence.
I find this bug very relevant as this code is on a guide on the [Huggingface documentation for Datasets](https://huggingface.co/docs/datasets/about_mapstyle_vs_iterable)
### Environment info
google colab cpu-only instance
Hi, thanks for the feedback! Would it help to add a tip or note saying the dataset is gated and you need to accept the license before downloading it? | [
-0.3552643060684204,
-0.32136839628219604,
0.09918798506259918,
0.2748079001903534,
0.020837703719735146,
0.08795274049043655,
0.5258960723876953,
0.011118516325950623,
0.4931468367576599,
0.20048955082893372,
-0.11338060349225998,
0.16971591114997864,
-0.22929267585277557,
0.19727246463298798,
0.04249291494488716,
0.17294588685035706,
0.07574918121099472,
-0.026328295469284058,
-0.10490338504314423,
-0.1664848029613495,
-0.29550570249557495,
0.42422446608543396,
-0.37241435050964355,
-0.06022109091281891,
-0.5462599396705627,
-0.07781241834163666,
-0.1488051861524582,
0.4094102382659912,
-0.0024882424622774124,
-0.050683941692113876,
0.4273897409439087,
0.1603608876466751,
0.19290000200271606,
0.47985613346099854,
-0.00012514006812125444,
-0.060561079531908035,
0.2666827440261841,
-0.055935997515916824,
-0.1902894228696823,
-0.26849329471588135,
-0.3428286612033844,
-0.0732293650507927,
-0.004621550906449556,
-0.10047103464603424,
-0.11219176650047302,
0.20767980813980103,
0.29824694991111755,
0.13784487545490265,
0.4726986885070801,
0.14867950975894928,
0.0539446622133255,
0.0933728739619255,
-0.022478021681308746,
-0.18060949444770813,
-0.10961995273828506,
0.16038599610328674,
-0.039456017315387726,
0.5585569739341736,
0.027210097759962082,
-0.14857004582881927,
0.028360828757286072,
0.4069027900695801,
-0.16264131665229797,
-0.24656356871128082,
0.6137467622756958,
0.03652029484510422,
-0.3018608093261719,
-0.4851568639278412,
-0.007543493062257767,
0.2766231298446655,
0.10373472422361374,
-0.3008594214916229,
-0.3246646225452423,
-0.5083264112472534,
0.23884591460227966,
-0.04231700301170349,
0.388571560382843,
0.18302661180496216,
0.01768120750784874,
0.33314207196235657,
-0.31684792041778564,
-0.36852359771728516,
-0.18095067143440247,
0.007080741226673126,
-0.1739065945148468,
0.11707881838083267,
-0.09920951724052429,
0.17311975359916687,
0.10155810415744781,
0.025467611849308014,
-0.18481437861919403,
-0.21737292408943176,
-0.13601598143577576,
0.2610667943954468,
-0.08622455596923828,
0.019408121705055237,
0.04809212312102318,
0.7139819860458374,
0.22252285480499268,
0.22356218099594116,
-0.21506476402282715,
-0.17903351783752441,
-0.3483796715736389,
0.28792572021484375,
0.2034025937318802,
-0.05374245345592499,
0.08906077593564987,
0.10486387461423874,
0.39053720235824585,
0.25625208020210266,
0.14590230584144592,
0.03810598701238632,
-0.08829919248819351,
-0.14015690982341766,
-0.14730268716812134,
-0.17831268906593323,
0.43289047479629517,
-0.12365232408046722,
-0.3933566212654114,
-0.08297600597143173,
-0.06621389836072922,
0.22884775698184967,
0.3619387745857239,
0.4395168125629425,
-0.17671926319599152,
-0.39400312304496765,
0.11227676272392273,
0.1671542376279831,
-0.12696266174316406,
-0.20474903285503387,
-0.22919327020645142,
0.07397148013114929,
-0.04915454983711243,
0.27601224184036255,
0.17052404582500458,
-0.30294257402420044,
0.2548183500766754,
0.06317894160747528,
0.14159667491912842,
0.07684940099716187,
-0.15434156358242035,
0.03387969359755516,
0.012639828026294708,
0.36102041602134705,
-0.039026353508234024,
0.007801851257681847,
0.016062268987298012,
-0.18705281615257263,
-0.12032680958509445,
0.16389387845993042,
-0.44800257682800293,
-0.24865612387657166,
0.042168743908405304,
-0.051483627408742905,
-0.6383727192878723,
-0.04048899561166763,
-0.31307607889175415,
0.2031996250152588,
-0.19273078441619873,
-0.3896397352218628,
0.02575431764125824,
0.011122245341539383,
-0.40290185809135437,
-0.07584760338068008,
0.33922141790390015,
0.9185906648635864,
-0.024167271330952644,
-0.4391394257545471,
-0.0001401323825120926,
-0.25650691986083984,
-0.0681130662560463,
0.17047229409217834,
-0.12862679362297058,
0.2321295142173767,
-0.5539725422859192,
0.1368708312511444,
0.05285859853029251,
-0.6280088424682617,
-0.6574586629867554,
0.16042321920394897,
-0.2981615662574768,
0.10545740276575089,
0.05667811259627342,
0.17386826872825623,
-0.020423343405127525,
-0.03936854377388954,
0.010717913508415222,
0.10087662190198898,
0.020206961780786514,
0.02693295292556286,
-0.09604905545711517,
-0.11788565665483475,
0.04275912046432495,
0.2127678543329239,
0.044443026185035706,
0.25421905517578125,
0.13921228051185608,
0.14360220730304718,
0.3089594542980194,
-0.0027258917689323425,
-0.07368132472038269,
0.134284108877182,
0.3947008550167084,
0.027942035347223282,
-0.05860792472958565,
0.018959011882543564,
-0.4376344680786133,
0.32471373677253723,
0.10475566983222961,
0.22384296357631683,
-0.14802122116088867,
-0.25782814621925354,
-0.18521934747695923,
-0.06087806075811386,
-0.2289375513792038,
-0.09186209738254547,
-0.08529837429523468,
-0.08003738522529602,
-0.11028270423412323,
0.04812951758503914,
-0.17311987280845642,
0.9723629355430603,
-0.22725215554237366,
0.327118843793869,
-0.4441470205783844,
0.14813846349716187,
0.09426966309547424,
-0.1498757004737854,
-0.017862487584352493,
0.028423909097909927,
0.11792993545532227,
-0.12813004851341248,
0.12195492535829544,
0.44514891505241394,
0.1336992383003235,
0.2804390788078308,
0.01105690747499466,
-0.14589615166187286,
0.4368603825569153,
-0.3046515882015228,
-0.20341113209724426,
-0.18241778016090393,
0.1775617152452469,
-0.004000715911388397,
-0.2733861804008484,
0.418088436126709,
-0.04101075604557991,
0.03947877883911133,
-0.13604092597961426,
0.06265510618686676,
-0.14596253633499146,
0.02368953451514244,
-0.34340956807136536,
-0.07597789168357849,
0.030325638130307198,
0.18531015515327454,
0.12097619473934174,
-0.02241712622344494,
-0.0745541974902153,
-0.06269513815641403,
0.18212348222732544,
0.03316805139183998,
0.012758336961269379,
-0.06413331627845764,
-0.11701595038175583,
0.19320270419120789,
0.5823221802711487,
0.1803072988986969,
0.4062178134918213,
0.06565512716770172,
-0.32885220646858215,
0.2247770130634308,
-0.20661307871341705,
-0.11456821858882904,
-0.028825543820858,
0.08826755732297897,
0.18471631407737732,
0.014573518186807632,
-0.05409277230501175,
0.03354852646589279,
-0.31564420461654663,
-0.4848087430000305,
-0.08186817169189453,
0.03749836981296539,
-0.46432822942733765,
0.03422761708498001,
-0.22562994062900543,
-0.19954568147659302,
0.03363554924726486,
0.30127406120300293,
-0.4277510643005371,
-0.09889770299196243,
-0.16302740573883057,
0.5961767435073853,
0.18716637790203094,
0.02246030978858471,
-0.09126147627830505,
0.4310603141784668,
-0.19601407647132874,
-0.20730556547641754,
-0.17817315459251404,
-0.0548836775124073,
-0.19803398847579956,
-0.12807665765285492,
0.4037902355194092,
-0.08310315012931824,
0.25403422117233276,
-0.3889900743961334,
0.0036184415221214294,
-0.2176438421010971,
-0.31659725308418274,
0.30374979972839355,
-0.25700849294662476,
0.28881773352622986,
0.15365752577781677,
0.19251573085784912,
-0.43216460943222046,
0.13407869637012482,
0.0697944387793541,
0.09746681153774261,
-0.20965509116649628,
-0.15580102801322937,
-0.03981037437915802,
-0.0029496261849999428,
-0.1789938509464264,
0.03674905002117157,
-0.10390040278434753,
-0.14188115298748016,
0.42041391134262085,
0.11052122712135315,
0.0838831439614296,
0.5433372259140015,
0.17877943813800812,
0.3334875702857971,
-0.1849522888660431,
0.021887624636292458,
-0.10447683930397034,
-0.21571917831897736,
0.23743048310279846,
0.004992373753339052,
-0.31416231393814087,
0.30199211835861206,
-0.011053916998207569,
0.06862573325634003,
0.05177490413188934,
-0.3831726908683777,
-0.31294015049934387,
0.09018123149871826,
0.3630530536174774,
-0.11164665222167969,
-0.06685048341751099,
0.3790051341056824,
-0.053551919758319855,
0.2714724540710449,
-0.1799047887325287,
-0.15608617663383484,
0.027571871876716614,
0.08012539893388748,
0.2213585525751114,
0.08958122879266739,
0.15421026945114136,
-0.2601360082626343,
0.3471028208732605,
0.25406619906425476,
0.18683089315891266,
0.3027198612689972,
-0.18084633350372314,
0.5431643724441528,
-0.015013150870800018,
-0.12921710312366486,
0.05416983738541603,
0.3782932758331299,
-0.17944234609603882,
0.15057078003883362,
0.08604363352060318,
0.3285163342952728,
-0.3637372553348541,
-0.2608729898929596,
-0.21271592378616333,
-0.2826809883117676,
-0.21402673423290253,
0.23118577897548676,
-0.022563554346561432,
0.16326217353343964,
0.24114897847175598,
-0.08417467772960663,
-0.1839887797832489,
0.21104131639003754,
0.750694990158081,
0.49656417965888977,
0.11374358832836151,
0.01969258114695549,
-0.15585988759994507,
-0.4124542474746704,
0.11206337064504623,
-0.0493018813431263,
-0.03119175136089325,
-0.22858577966690063,
-0.10047651827335358,
0.16897398233413696,
0.09790801256895065,
0.7162107229232788,
-0.1785241961479187,
0.01928197592496872,
-0.22966989874839783,
0.06074672192335129,
-0.354062020778656,
-0.13791491091251373,
-0.19854213297367096,
0.15987101197242737,
0.1146947592496872,
0.6558490991592407,
-0.20458711683750153,
-0.06393931806087494,
0.16283001005649567,
-0.01352921687066555,
-0.10098539292812347,
-0.25229769945144653,
-0.3195972442626953,
-0.34588557481765747,
-0.4819333255290985,
0.07580642402172089,
0.2801479995250702,
0.0707366019487381,
-0.013021470978856087,
0.14493797719478607,
-0.1436866968870163,
-0.10910779982805252,
0.18776267766952515,
0.31236007809638977,
0.3650207817554474,
0.14074963331222534,
0.2143210917711258,
0.26604926586151123,
-0.018051430583000183,
0.2098364233970642,
0.6444061398506165,
0.19176821410655975,
-0.39788928627967834,
0.23374012112617493,
0.05271739140152931,
0.12604454159736633,
0.49977734684944153,
-0.17291294038295746,
-0.1931512951850891,
0.2543182969093323,
-0.003727361559867859,
-0.37024185061454773,
0.12048056721687317,
0.10550859570503235,
0.02374766394495964,
-0.15229187905788422,
-0.1590641736984253,
0.39473119378089905,
0.2482166737318039,
-0.16986888647079468,
0.3738469183444977,
0.4390656352043152,
-0.25441595911979675,
0.19062665104866028,
-0.0949452742934227,
1.063158631324768,
0.09879651665687561,
0.1549537628889084,
0.3763495087623596,
0.10691976547241211,
0.6814651489257812,
0.1516377478837967,
0.18431678414344788,
-0.2695201337337494,
-0.2793429493904114,
-0.14497502148151398,
-0.06307055056095123,
0.11865471303462982,
0.03692431375384331,
-0.112437903881073,
0.2192714810371399,
0.16094839572906494,
0.3242489993572235,
-0.03747168928384781,
0.03742087632417679,
-0.5242584347724915,
-0.19075803458690643,
-0.1685338020324707,
-0.011973613873124123,
0.11889138072729111,
0.8307413458824158,
-0.27212172746658325,
-0.14061975479125977,
-0.4052913188934326,
-0.09131024777889252,
-0.2842175364494324,
0.10739801079034805,
-0.25924152135849,
-0.03754637762904167,
0.08143647015094757,
-0.09411989152431488,
0.13247309625148773,
0.5355004072189331,
0.2695072889328003,
0.01128409430384636,
-0.5172329545021057,
0.143092080950737,
-0.2271813452243805,
-0.11511974036693573,
-0.25819653272628784,
-0.0923791229724884,
0.48867329955101013,
-0.036029182374477386,
-0.2021779865026474,
-0.24351534247398376,
-0.058376848697662354,
-0.03176254406571388,
-0.060155339539051056,
0.20248666405677795,
-0.16453151404857635,
-0.0993620827794075,
-0.2529808282852173,
0.06808865815401077,
0.1239410936832428,
-0.0317850261926651,
-0.01356181874871254,
0.08095508813858032,
0.03772325441241264,
-0.13631337881088257,
0.243509441614151,
-0.34676533937454224,
-0.05257389321923256,
0.5896739959716797,
-0.1472591757774353,
-0.0005502812564373016,
0.27646470069885254,
-0.05379318818449974,
0.07690313458442688,
-0.09630398452281952,
-0.07229332625865936,
0.2220316231250763,
-0.6449505686759949,
0.07550043612718582,
0.19729278981685638,
0.2239392250776291,
-0.2475920021533966,
0.2233334630727768,
0.29618096351623535,
-0.21656790375709534,
0.11268270015716553,
-0.3660898208618164,
-0.2772996425628662,
0.293698787689209,
-0.24846072494983673,
0.017845895141363144,
0.27278369665145874,
0.08403977751731873,
0.20211492478847504,
-0.409501314163208,
-0.15855136513710022,
-0.07852664589881897,
-0.009182576090097427,
-0.20676052570343018,
0.3160112500190735,
0.29920312762260437,
0.10803940147161484,
-0.27256888151168823,
-0.04645543545484543,
0.2727711796760559,
-0.13473188877105713,
-0.02602171152830124,
-0.13991807401180267,
0.22804047167301178,
0.17075121402740479,
-0.027750952169299126,
-0.23870298266410828,
-0.12534761428833008,
-0.13136224448680878,
-0.13183507323265076,
0.4146576523780823,
0.29289746284484863,
0.10898347198963165,
-0.13508345186710358,
0.1713523268699646,
0.4399731755256653,
-0.23139715194702148,
0.12568891048431396,
0.03784285485744476,
0.08700914680957794,
-0.04499499499797821,
0.12439756095409393,
-0.02523563802242279,
0.11157619953155518,
0.10337181389331818,
0.11880038678646088,
0.05398979410529137,
0.138054758310318,
0.10303102433681488,
-0.12266916036605835,
0.16953431069850922,
-0.013838501647114754,
0.13439275324344635,
0.30226051807403564,
-0.25054681301116943,
-0.12523700296878815,
0.18879294395446777,
0.03821682929992676,
-0.2983030676841736,
0.1546086072921753,
0.24761666357517242,
0.10921447724103928,
0.053600382059812546,
0.3227613866329193,
0.050206709653139114,
0.24173912405967712,
-0.3054960370063782,
0.13940250873565674,
0.414986789226532,
0.17849355936050415,
0.22232209146022797,
0.26501500606536865,
-0.14164429903030396,
0.39168581366539,
0.2679542899131775,
0.12321972846984863,
0.10358759760856628,
0.2046826034784317,
-0.40482649207115173,
0.26572299003601074,
-0.4025246500968933,
0.25403985381126404,
0.3404432237148285,
-0.6765720844268799,
-0.033290471881628036,
0.020257502794265747,
0.024389348924160004,
-0.06284909695386887,
-0.3062724173069,
0.47006955742836,
-0.5500957369804382,
-0.2053021341562271,
-0.18128642439842224,
0.13968832790851593,
-0.30866339802742004,
0.0996595025062561,
-0.22297453880310059,
-0.1822640299797058,
-0.14520177245140076,
0.014930680394172668,
0.027628306299448013,
-0.306260883808136,
0.12673968076705933,
0.09590152651071548,
-0.1518334597349167,
-0.11108437180519104,
-0.39459550380706787,
0.3110617697238922,
0.25003841519355774,
-0.0836678072810173,
0.2638445496559143,
-0.25713491439819336,
0.042867474257946014,
0.31932079792022705,
0.343404084444046,
0.4221210479736328,
0.14087754487991333,
0.3070935010910034,
0.12171592563390732,
0.048282936215400696,
0.03159515559673309,
-0.008059874176979065,
0.18549910187721252,
0.05005468800663948,
0.2923848330974579,
0.1609373837709427,
0.046063534915447235,
0.026515353471040726,
0.10735145211219788,
-0.1615871787071228,
0.008749036118388176,
-0.2620678246021271,
0.25035884976387024,
-0.5802892446517944,
-0.08801360428333282,
-0.2863495945930481,
0.06960170716047287,
-0.12243285775184631,
0.0314309187233448,
0.17269787192344666,
-0.05060529708862305,
0.12803953886032104,
-0.052815552800893784,
-0.045799922198057175,
0.009409438818693161,
0.18810297548770905,
0.3636643588542938,
0.0031661204993724823,
-0.27512216567993164,
-0.13899046182632446,
-0.7475489377975464,
0.25516679883003235,
-0.03064076229929924,
-0.13876160979270935,
-0.14296336472034454,
-0.08862008154392242,
-0.2733602523803711,
-0.01968168467283249,
0.07176525890827179,
-0.05703956261277199,
0.28340378403663635,
-0.09977707266807556,
-0.05834294855594635,
-0.20537562668323517,
-0.1135488748550415,
-0.15385691821575165,
-0.010486127808690071,
-0.13471871614456177,
0.3330147862434387,
-0.11165226995944977,
-0.17416781187057495,
0.06614023447036743,
-0.024400271475315094,
-0.26998695731163025,
-0.33474937081336975,
0.5050147771835327,
-0.008928712457418442,
0.5299228429794312,
-0.08332927525043488,
-0.06296312063932419,
-0.25048524141311646,
-0.05835573747754097,
-0.29104411602020264,
0.18527203798294067,
-0.08543841540813446,
0.21939373016357422,
0.001917501911520958,
-0.11332772672176361,
-0.13433386385440826,
0.45060694217681885,
0.37818777561187744,
-0.0015512430109083652,
-0.2974534332752228,
-0.004477282986044884,
-0.380659818649292,
0.14920037984848022,
0.10731044411659241,
0.02419055625796318,
-0.025134123861789703,
0.09642761945724487,
-0.23369136452674866,
-0.42028212547302246,
0.6822150349617004,
-0.4783692955970764,
0.06029096618294716,
-0.04662540182471275,
0.3183298707008362,
0.2342761754989624,
-0.32730400562286377,
-0.5834221243858337,
0.09608403593301773,
0.13392512500286102,
-0.0462675616145134,
-0.10123991966247559,
0.1590563952922821,
-0.10890057682991028,
-0.020435046404600143,
0.004981394857168198,
0.22382362186908722,
-0.05510575324296951,
-0.3571948707103729,
0.3169598877429962,
-0.1412220299243927
] |
https://github.com/huggingface/datasets/issues/5570 | load_dataset gives FileNotFoundError on imagenet-1k if license is not accepted on the hub | The error is now more informative:
```
FileNotFoundError: Couldn't find a dataset script at /content/imagenet-1k/imagenet-1k.py or any data file in the same directory. Couldn't find 'imagenet-1k' on the Hugging Face Hub either: FileNotFoundError: Dataset 'imagenet-1k' doesn't exist on the Hub. If the repo is private or gated, make sure to log in with `huggingface-cli login`.
```
| ### Describe the bug
When calling ```load_dataset('imagenet-1k')``` FileNotFoundError is raised, if not logged in and if logged in with huggingface-cli but not having accepted the licence on the hub. There is no error once accepting.
### Steps to reproduce the bug
```
from datasets import load_dataset
imagenet = load_dataset("imagenet-1k", split="train", streaming=True)
FileNotFoundError: Couldn't find a dataset script at /content/imagenet-1k/imagenet-1k.py or any data file in the same directory. Couldn't find 'imagenet-1k' on the Hugging Face Hub either: FileNotFoundError: Dataset 'imagenet-1k' doesn't exist on the Hub
```
tested on a colab notebook.
### Expected behavior
I would expect a specific error indicating that I have to login then accept the dataset licence.
I find this bug very relevant as this code is on a guide on the [Huggingface documentation for Datasets](https://huggingface.co/docs/datasets/about_mapstyle_vs_iterable)
### Environment info
google colab cpu-only instance | 56 | load_dataset gives FileNotFoundError on imagenet-1k if license is not accepted on the hub
### Describe the bug
When calling ```load_dataset('imagenet-1k')``` FileNotFoundError is raised, if not logged in and if logged in with huggingface-cli but not having accepted the licence on the hub. There is no error once accepting.
### Steps to reproduce the bug
```
from datasets import load_dataset
imagenet = load_dataset("imagenet-1k", split="train", streaming=True)
FileNotFoundError: Couldn't find a dataset script at /content/imagenet-1k/imagenet-1k.py or any data file in the same directory. Couldn't find 'imagenet-1k' on the Hugging Face Hub either: FileNotFoundError: Dataset 'imagenet-1k' doesn't exist on the Hub
```
tested on a colab notebook.
### Expected behavior
I would expect a specific error indicating that I have to login then accept the dataset licence.
I find this bug very relevant as this code is on a guide on the [Huggingface documentation for Datasets](https://huggingface.co/docs/datasets/about_mapstyle_vs_iterable)
### Environment info
google colab cpu-only instance
The error is now more informative:
```
FileNotFoundError: Couldn't find a dataset script at /content/imagenet-1k/imagenet-1k.py or any data file in the same directory. Couldn't find 'imagenet-1k' on the Hugging Face Hub either: FileNotFoundError: Dataset 'imagenet-1k' doesn't exist on the Hub. If the repo is private or gated, make sure to log in with `huggingface-cli login`.
```
| [
-0.33228379487991333,
-0.2758558988571167,
0.08700472116470337,
0.25952523946762085,
0.05371473729610443,
0.0687185600399971,
0.5406357049942017,
0.06523527204990387,
0.45785632729530334,
0.2602248787879944,
-0.12785670161247253,
0.18132847547531128,
-0.2027093917131424,
0.1491405963897705,
0.0344848595559597,
0.1679266095161438,
0.03951050341129303,
-0.009160727262496948,
-0.078056201338768,
-0.17909973859786987,
-0.28242915868759155,
0.43027463555336,
-0.33858758211135864,
-0.09083792567253113,
-0.5256257653236389,
-0.029603390023112297,
-0.1597602516412735,
0.40650674700737,
0.024231456220149994,
-0.05350164324045181,
0.4448081851005554,
0.11034689843654633,
0.16853627562522888,
0.5365822911262512,
-0.00012298650108277798,
0.01813364028930664,
0.2838771939277649,
-0.02840503863990307,
-0.21273469924926758,
-0.26240140199661255,
-0.31869468092918396,
-0.09584520757198334,
-0.021744340658187866,
-0.1301000714302063,
-0.13664820790290833,
0.29140132665634155,
0.2737305164337158,
0.0915289968252182,
0.46512776613235474,
0.1819257140159607,
0.07449029386043549,
0.08642272651195526,
-0.07604731619358063,
-0.19958044588565826,
-0.05436006933450699,
0.19504079222679138,
-0.0399346686899662,
0.5026540756225586,
-0.001187734305858612,
-0.14292488992214203,
0.04883106052875519,
0.41519126296043396,
-0.18460306525230408,
-0.29534363746643066,
0.5021681189537048,
0.06369268894195557,
-0.19301676750183105,
-0.5124157667160034,
-0.0047475844621658325,
0.3090479373931885,
0.08011417090892792,
-0.3278564512729645,
-0.3150096535682678,
-0.4725809693336487,
0.2662751376628876,
-0.03301582485437393,
0.36624419689178467,
0.16942650079727173,
0.05584190413355827,
0.32120344042778015,
-0.3728105127811432,
-0.34094148874282837,
-0.15000905096530914,
0.006088543683290482,
-0.16640782356262207,
0.11158003658056259,
-0.10438937693834305,
0.16875089704990387,
0.104876309633255,
0.005206696689128876,
-0.3008646070957184,
-0.20506682991981506,
-0.18521757423877716,
0.2668274939060211,
-0.15126557648181915,
0.02142016589641571,
0.026782430708408356,
0.6371594071388245,
0.2165590524673462,
0.2394535094499588,
-0.1540451943874359,
-0.1882588267326355,
-0.38234055042266846,
0.3251524865627289,
0.1433825045824051,
0.00033265165984630585,
0.09491468966007233,
0.1362447738647461,
0.4014471769332886,
0.22172771394252777,
0.17523227632045746,
0.0516396127641201,
-0.10897617042064667,
-0.1686742752790451,
-0.16562999784946442,
-0.1728520393371582,
0.46594810485839844,
-0.09233468770980835,
-0.46312007308006287,
-0.0724068209528923,
-0.1408190131187439,
0.20682011544704437,
0.38493719696998596,
0.4443242847919464,
-0.16047264635562897,
-0.3219749629497528,
0.12820953130722046,
0.16562296450138092,
-0.11911242455244064,
-0.14571690559387207,
-0.24472220242023468,
0.09698039293289185,
-0.05440837889909744,
0.274981826543808,
0.17563576996326447,
-0.37560755014419556,
0.27454543113708496,
0.08396314829587936,
0.21814340353012085,
0.03423859924077988,
-0.1935635507106781,
0.030565202236175537,
-0.027658462524414062,
0.36078205704689026,
-0.0864759087562561,
-0.001667078584432602,
0.010393094271421432,
-0.15992528200149536,
-0.1298454850912094,
0.11212524026632309,
-0.497685968875885,
-0.2242758721113205,
0.058500632643699646,
-0.01724417880177498,
-0.6137703657150269,
-0.03537711501121521,
-0.3918680250644684,
0.1791708916425705,
-0.18907135725021362,
-0.3749585747718811,
0.06382450461387634,
0.006139744073152542,
-0.3970125615596771,
-0.07619890570640564,
0.37119704484939575,
0.8819607496261597,
0.024577420204877853,
-0.44588786363601685,
0.02817198634147644,
-0.2161257565021515,
-0.08962183445692062,
0.16202156245708466,
-0.13332617282867432,
0.1873003989458084,
-0.5504425764083862,
0.028624728322029114,
0.09052228182554245,
-0.7097565531730652,
-0.6464769840240479,
0.1751495748758316,
-0.3186657428741455,
0.09070311486721039,
0.08268288522958755,
0.13772033154964447,
-0.04604548588395119,
-0.07517597824335098,
-0.0010602399706840515,
0.0451064333319664,
0.039590053260326385,
0.03907855600118637,
-0.057657599449157715,
-0.12956617772579193,
0.03693293407559395,
0.2141699492931366,
-0.010787919163703918,
0.17524012923240662,
0.1277180165052414,
0.11288966983556747,
0.2774132490158081,
0.0297754667699337,
-0.09234510362148285,
0.15573981404304504,
0.391667902469635,
-0.00920482724905014,
-0.05712125822901726,
-0.006410572677850723,
-0.4665731191635132,
0.3635293245315552,
0.11860562860965729,
0.2387351542711258,
-0.12914973497390747,
-0.26717013120651245,
-0.1745879352092743,
-0.05701109766960144,
-0.2299557477235794,
-0.13594360649585724,
-0.06279313564300537,
-0.04228267818689346,
-0.09424644708633423,
0.04171555116772652,
-0.19932162761688232,
0.9338833093643188,
-0.19048510491847992,
0.2764010727405548,
-0.46976810693740845,
0.19861900806427002,
0.0924665778875351,
-0.11244401335716248,
-0.017041940242052078,
0.06348311901092529,
0.14232289791107178,
-0.1327035278081894,
0.1520584523677826,
0.4585498571395874,
0.12825268507003784,
0.32632601261138916,
0.079237200319767,
-0.16332827508449554,
0.44785523414611816,
-0.32347372174263,
-0.21951007843017578,
-0.12241153419017792,
0.18203690648078918,
0.008785948157310486,
-0.28976163268089294,
0.39810091257095337,
-0.0014515034854412079,
0.08722759783267975,
-0.14003236591815948,
0.057190753519535065,
-0.12052236497402191,
0.00141056627035141,
-0.3481505811214447,
-0.13929149508476257,
0.03096322901546955,
0.2508367598056793,
0.14636026322841644,
-0.030112305656075478,
-0.05081135779619217,
-0.059714801609516144,
0.23791250586509705,
0.015726614743471146,
0.013005957007408142,
-0.08748326450586319,
-0.14231246709823608,
0.2170884609222412,
0.5137673616409302,
0.14392462372779846,
0.393576979637146,
0.06485919654369354,
-0.37113648653030396,
0.21318012475967407,
-0.22162163257598877,
-0.15125751495361328,
-0.0216384157538414,
0.08316466957330704,
0.2407890260219574,
0.0063772052526474,
0.028014957904815674,
0.07123447954654694,
-0.30484047532081604,
-0.5584956407546997,
-0.0477759912610054,
0.035329435020685196,
-0.4473824203014374,
0.0045003462582826614,
-0.2498369812965393,
-0.12981577217578888,
0.012397443875670433,
0.198650062084198,
-0.44081106781959534,
-0.10227686911821365,
-0.1413280963897705,
0.49821290373802185,
0.17919301986694336,
0.0445399135351181,
-0.062002673745155334,
0.4093804657459259,
-0.18045726418495178,
-0.24461759626865387,
-0.23423273861408234,
-0.08783601969480515,
-0.17142131924629211,
-0.11187756061553955,
0.3893142342567444,
-0.1017436534166336,
0.24542158842086792,
-0.42272594571113586,
-0.0435042530298233,
-0.22968851029872894,
-0.33966323733329773,
0.31282156705856323,
-0.2690948247909546,
0.23367507755756378,
0.14507520198822021,
0.11427296698093414,
-0.3520340919494629,
0.13973379135131836,
0.09264535456895828,
0.10756443440914154,
-0.25695422291755676,
-0.08457056432962418,
-0.019324051216244698,
-0.0090866070240736,
-0.22845469415187836,
0.0010500699281692505,
-0.050787657499313354,
-0.15047526359558105,
0.3906285762786865,
0.12650395929813385,
0.11747109889984131,
0.5108198523521423,
0.14731405675411224,
0.383945494890213,
-0.20469985902309418,
0.05310341715812683,
-0.10836414992809296,
-0.17877039313316345,
0.21794718503952026,
0.006630976218730211,
-0.2766786515712738,
0.3636147677898407,
0.03190382942557335,
0.060851678252220154,
0.0671859085559845,
-0.40286725759506226,
-0.3785969913005829,
0.05389278382062912,
0.3797754645347595,
-0.11126618087291718,
-0.02724296785891056,
0.41646838188171387,
0.009456224739551544,
0.23929671943187714,
-0.16921962797641754,
-0.22313867509365082,
0.020120471715927124,
0.07974416017532349,
0.15199440717697144,
0.06799882650375366,
0.2058989703655243,
-0.3303339183330536,
0.3326908349990845,
0.2812069356441498,
0.159101203083992,
0.2588531970977783,
-0.2352258563041687,
0.5616820454597473,
-0.036879196763038635,
-0.09470205008983612,
0.052733056247234344,
0.4323330819606781,
-0.12639141082763672,
0.17281559109687805,
0.10508779436349869,
0.3355894982814789,
-0.36409810185432434,
-0.27581629157066345,
-0.1846960186958313,
-0.300086110830307,
-0.2657528519630432,
0.14679616689682007,
-0.04022245109081268,
0.10034893453121185,
0.2462742030620575,
-0.07576428353786469,
-0.13676360249519348,
0.23518477380275726,
0.7596397995948792,
0.4667964577674866,
0.09726222604513168,
0.019056398421525955,
-0.1491628736257553,
-0.3969091475009918,
0.12633465230464935,
-0.04106097295880318,
-0.009415813721716404,
-0.22164611518383026,
-0.0865064412355423,
0.1465548276901245,
0.06804978102445602,
0.674723207950592,
-0.15959368646144867,
0.029250938445329666,
-0.2011105716228485,
-0.019188879057765007,
-0.34588778018951416,
-0.14044205844402313,
-0.20606425404548645,
0.16067104041576385,
0.06524256616830826,
0.7716980576515198,
-0.20843903720378876,
-0.11645036935806274,
0.19905728101730347,
-0.01744978129863739,
-0.09592612087726593,
-0.24771733582019806,
-0.32479482889175415,
-0.34535232186317444,
-0.4477282166481018,
0.018434204161167145,
0.24477194249629974,
0.058149900287389755,
-0.05150539427995682,
0.13997980952262878,
-0.14762121438980103,
-0.19658729434013367,
0.21641060709953308,
0.30645552277565,
0.36029142141342163,
0.13765622675418854,
0.21424561738967896,
0.2652508616447449,
-0.006912894546985626,
0.25196000933647156,
0.6998221278190613,
0.19655045866966248,
-0.40465036034584045,
0.21619874238967896,
0.11201118677854538,
0.13549365103244781,
0.4836673140525818,
-0.1610538512468338,
-0.20033970475196838,
0.16262470185756683,
0.017952483147382736,
-0.40289023518562317,
0.07712552696466446,
0.13766837120056152,
0.001696270890533924,
-0.17660175263881683,
-0.17640267312526703,
0.4423188269138336,
0.2285507470369339,
-0.16363543272018433,
0.3154312074184418,
0.42876094579696655,
-0.27809807658195496,
0.15952849388122559,
-0.10370949655771255,
1.0494924783706665,
0.09875838458538055,
0.1237565279006958,
0.4140341281890869,
0.14780652523040771,
0.6889899969100952,
0.1609470695257187,
0.1862940788269043,
-0.26342013478279114,
-0.26010119915008545,
-0.13939057290554047,
-0.04005768895149231,
0.10049036145210266,
0.031011097133159637,
-0.16504132747650146,
0.22334839403629303,
0.17143107950687408,
0.3914412558078766,
-0.021556345745921135,
0.023588217794895172,
-0.5161373019218445,
-0.1698152720928192,
-0.26543429493904114,
0.010489597916603088,
0.1337091624736786,
0.7873561978340149,
-0.254099041223526,
-0.1321132630109787,
-0.39496785402297974,
-0.06932257115840912,
-0.28057563304901123,
0.15681412816047668,
-0.262727826833725,
-0.00854538381099701,
0.13233178853988647,
-0.1061163991689682,
0.12232562899589539,
0.49837422370910645,
0.28579458594322205,
0.06478358060121536,
-0.48881715536117554,
0.1542297899723053,
-0.21642011404037476,
-0.09772608429193497,
-0.26902997493743896,
-0.10791227221488953,
0.4391961693763733,
-0.03418094292283058,
-0.22474892437458038,
-0.1922081708908081,
-0.06667297333478928,
-0.02050989493727684,
-0.0543869212269783,
0.22704286873340607,
-0.13615047931671143,
-0.039893366396427155,
-0.2384709119796753,
0.12062722444534302,
0.10186925530433655,
-0.037745799869298935,
-0.0007570553570985794,
0.07886640727519989,
0.005128450691699982,
-0.18002533912658691,
0.2258576899766922,
-0.3661249577999115,
-0.06258010864257812,
0.5277451872825623,
-0.1218033954501152,
0.008408810943365097,
0.268608033657074,
-0.08220942318439484,
0.11521384119987488,
-0.11824315786361694,
-0.0956072062253952,
0.286766916513443,
-0.6412138938903809,
0.07535208761692047,
0.24514107406139374,
0.20171187818050385,
-0.14096465706825256,
0.2159319669008255,
0.21667324006557465,
-0.2387799322605133,
0.0498589389026165,
-0.3929801881313324,
-0.21127858757972717,
0.3232908546924591,
-0.23044101893901825,
0.04524834454059601,
0.29949286580085754,
0.08646972477436066,
0.14604036509990692,
-0.3926166594028473,
-0.185041606426239,
-0.08449175208806992,
-0.030529607087373734,
-0.17079651355743408,
0.2988567352294922,
0.2967401146888733,
0.14152713119983673,
-0.2318112999200821,
-0.03218764439225197,
0.2568301558494568,
-0.14060400426387787,
-0.03572923690080643,
-0.13468371331691742,
0.21326172351837158,
0.15107300877571106,
0.034084007143974304,
-0.22727881371974945,
-0.08428195118904114,
-0.13039955496788025,
-0.1971817910671234,
0.45860129594802856,
0.31907379627227783,
0.09546126425266266,
-0.13363660871982574,
0.23552609980106354,
0.39688700437545776,
-0.2023315131664276,
0.13863477110862732,
0.0267658494412899,
0.10521553456783295,
-0.0648055300116539,
0.14960211515426636,
-0.0708908885717392,
0.0932512879371643,
0.09086089581251144,
0.15136533975601196,
0.029668346047401428,
0.17582350969314575,
0.0969136655330658,
-0.0976783037185669,
0.15309928357601166,
-0.03206007927656174,
0.10292545706033707,
0.27854079008102417,
-0.2201932966709137,
-0.1322755217552185,
0.2095373570919037,
0.0648212805390358,
-0.29259490966796875,
0.1418919712305069,
0.3014996349811554,
0.11177126318216324,
0.12097182869911194,
0.37079858779907227,
0.04098277911543846,
0.23628148436546326,
-0.28099727630615234,
0.15859287977218628,
0.48351624608039856,
0.12690864503383636,
0.22617554664611816,
0.2728021740913391,
-0.0974152535200119,
0.3700111210346222,
0.23376935720443726,
0.06195497140288353,
0.17467591166496277,
0.12143676728010178,
-0.4286699891090393,
0.3041864335536957,
-0.31037637591362,
0.22192707657814026,
0.39986303448677063,
-0.6289675831794739,
-0.030478019267320633,
0.05065365135669708,
0.021079204976558685,
-0.03348257392644882,
-0.2989349961280823,
0.4851544201374054,
-0.5889782905578613,
-0.11770332604646683,
-0.20082975924015045,
0.18342547118663788,
-0.28514406085014343,
0.1009233295917511,
-0.2231316715478897,
-0.18060554563999176,
-0.17003969848155975,
0.006271760910749435,
0.03964562341570854,
-0.2779608964920044,
0.16762974858283997,
0.07904699444770813,
-0.20160092413425446,
-0.08680635690689087,
-0.3976958692073822,
0.333172082901001,
0.24687978625297546,
-0.09547792375087738,
0.30448320508003235,
-0.1921011060476303,
0.003311462700366974,
0.3029809892177582,
0.4056144058704376,
0.46670588850975037,
0.18016715347766876,
0.3286297619342804,
0.12086828052997589,
0.1313384771347046,
0.04009191691875458,
0.0025519076734781265,
0.16842472553253174,
-0.03819666802883148,
0.2077205926179886,
0.120380699634552,
0.08002077043056488,
0.010589013807475567,
0.06801041960716248,
-0.17725098133087158,
0.07160091400146484,
-0.24965260922908783,
0.2792832851409912,
-0.6367753744125366,
-0.06847258657217026,
-0.3060395121574402,
0.10988723486661911,
-0.14335499703884125,
-0.022289633750915527,
0.16387271881103516,
-0.03729705885052681,
0.12566602230072021,
-0.04651400074362755,
-0.02190031111240387,
0.014439309015870094,
0.19073709845542908,
0.3695644736289978,
-0.08181741088628769,
-0.2501888573169708,
-0.11377650499343872,
-0.6830917000770569,
0.279445081949234,
-0.028922725468873978,
-0.17792567610740662,
-0.165605366230011,
-0.08399924635887146,
-0.2801426649093628,
-0.014044348150491714,
0.13564905524253845,
-0.13249137997627258,
0.28008976578712463,
-0.1514347642660141,
-0.09526878595352173,
-0.19141435623168945,
-0.09585537016391754,
-0.2095368206501007,
0.030666053295135498,
-0.17553681135177612,
0.30986344814300537,
-0.13445407152175903,
-0.1454886496067047,
0.060710612684488297,
0.018493063747882843,
-0.2621857523918152,
-0.3718029856681824,
0.4620027244091034,
0.027316225692629814,
0.439181387424469,
-0.08147250860929489,
-0.054053910076618195,
-0.27333325147628784,
-0.07936330884695053,
-0.28290021419525146,
0.18457016348838806,
-0.10687556862831116,
0.23593005537986755,
0.0021878061816096306,
-0.16065292060375214,
-0.1332898736000061,
0.4122910499572754,
0.3792575001716614,
-0.011774851009249687,
-0.24202311038970947,
0.01403225027024746,
-0.3919502794742584,
0.09652560204267502,
0.1120956540107727,
0.028955744579434395,
0.008922640234231949,
0.07631094008684158,
-0.23188142478466034,
-0.4617093801498413,
0.6533306241035461,
-0.4920896589756012,
0.019847650080919266,
-0.038882065564394,
0.3467860817909241,
0.185566246509552,
-0.31920725107192993,
-0.5895809531211853,
0.14121225476264954,
0.1400679051876068,
0.033253952860832214,
-0.13633958995342255,
0.11029066145420074,
-0.1508668214082718,
-0.05479828268289566,
0.016964949667453766,
0.13997074961662292,
-0.046485982835292816,
-0.3311789333820343,
0.3197847604751587,
-0.14584577083587646
] |
https://github.com/huggingface/datasets/issues/5568 | dataset.to_iterable_dataset() loses useful info like dataset features | Hi ! Oh good catch. I think the features should be passed to `IterableDataset.from_generator()` in `to_iterable_dataset()` indeed.
Setting this as a good first issue if someone would like to contribute, otherwise we can take care of it :) | ### Describe the bug
Hello,
I like the new `to_iterable_dataset` feature but I noticed something that seems to be missing.
When using `to_iterable_dataset` to transform your map style dataset into iterable dataset, you lose valuable metadata like the features.
These metadata are useful if you want to interleave iterable datasets, cast columns etc.
### Steps to reproduce the bug
```python
dataset = load_dataset("lhoestq/demo1")["train"]
print(dataset.features)
# {'id': Value(dtype='string', id=None), 'package_name': Value(dtype='string', id=None), 'review': Value(dtype='string', id=None), 'date': Value(dtype='string', id=None), 'star': Value(dtype='int64', id=None), 'version_id': Value(dtype='int64', id=None)}
dataset = dataset.to_iterable_dataset()
print(dataset.features)
# None
```
### Expected behavior
Keep the relevant information
### Environment info
datasets==2.10.0 | 38 | dataset.to_iterable_dataset() loses useful info like dataset features
### Describe the bug
Hello,
I like the new `to_iterable_dataset` feature but I noticed something that seems to be missing.
When using `to_iterable_dataset` to transform your map style dataset into iterable dataset, you lose valuable metadata like the features.
These metadata are useful if you want to interleave iterable datasets, cast columns etc.
### Steps to reproduce the bug
```python
dataset = load_dataset("lhoestq/demo1")["train"]
print(dataset.features)
# {'id': Value(dtype='string', id=None), 'package_name': Value(dtype='string', id=None), 'review': Value(dtype='string', id=None), 'date': Value(dtype='string', id=None), 'star': Value(dtype='int64', id=None), 'version_id': Value(dtype='int64', id=None)}
dataset = dataset.to_iterable_dataset()
print(dataset.features)
# None
```
### Expected behavior
Keep the relevant information
### Environment info
datasets==2.10.0
Hi ! Oh good catch. I think the features should be passed to `IterableDataset.from_generator()` in `to_iterable_dataset()` indeed.
Setting this as a good first issue if someone would like to contribute, otherwise we can take care of it :) | [
-0.09407901018857956,
0.12064772844314575,
-0.016311202198266983,
0.05076075717806816,
0.4780624508857727,
0.25060218572616577,
0.23195800185203552,
0.5022813677787781,
-0.4413222372531891,
-0.0548122376203537,
-0.02133994735777378,
0.7593236565589905,
-0.18928569555282593,
0.18483558297157288,
0.06465288251638412,
-0.23747608065605164,
0.2922306954860687,
0.036009564995765686,
-0.3082166910171509,
-0.13111241161823273,
-0.3678116202354431,
0.02177184261381626,
-0.24840949475765228,
0.016737937927246094,
0.0927584320306778,
0.21489986777305603,
-0.06659162789583206,
-0.05454079806804657,
0.11685711145401001,
-0.4496043026447296,
-0.17139151692390442,
0.05581660941243172,
-0.03724069893360138,
-0.01953897625207901,
-0.0001142697365139611,
-0.1329372525215149,
0.26646581292152405,
-0.06960151344537735,
-0.1889311969280243,
-0.12386251986026764,
-0.21351280808448792,
-0.324235200881958,
-0.0114476028829813,
-0.2295685112476349,
-0.05529572814702988,
-0.33324915170669556,
-0.052171289920806885,
-0.24940502643585205,
-0.1675286442041397,
0.15295495092868805,
0.24384461343288422,
-0.05689498409628868,
0.12933437526226044,
-0.06527476757764816,
0.5199114680290222,
0.15904884040355682,
-0.31823238730430603,
0.0037798872217535973,
0.40526071190834045,
0.03467196971178055,
0.13762126863002777,
0.5595604777336121,
-0.2029210776090622,
-0.37415099143981934,
0.3741791546344757,
0.09524893015623093,
0.08052723109722137,
-0.18002252280712128,
0.07464979588985443,
0.17745240032672882,
0.7437705993652344,
-0.35471677780151367,
-0.27000001072883606,
-0.3450930416584015,
-0.02158454805612564,
-0.2615991532802582,
-0.0519179031252861,
-0.04944286495447159,
0.09768849611282349,
0.1286512315273285,
-0.24189938604831696,
-0.33704477548599243,
-0.1641850620508194,
0.11148788034915924,
0.12421733140945435,
0.32518577575683594,
-0.25055980682373047,
0.09672282636165619,
-0.04833860322833061,
-0.029835551977157593,
0.049711331725120544,
-0.13627828657627106,
0.03662183880805969,
0.15663161873817444,
0.13732707500457764,
-0.3282836377620697,
0.38367894291877747,
-0.25419434905052185,
0.20294314622879028,
0.19372722506523132,
-0.03282501548528671,
-0.050275154411792755,
-0.15122778713703156,
-0.17414528131484985,
0.3878549635410309,
-0.35347411036491394,
-0.04982616752386093,
0.26252254843711853,
-0.00905715674161911,
-0.16017518937587738,
0.10119415819644928,
-0.22700297832489014,
0.4936542510986328,
0.0905396118760109,
0.5579875707626343,
-0.07314810156822205,
0.7079604268074036,
-0.2076883167028427,
-0.12708789110183716,
0.19709889590740204,
-0.33443257212638855,
0.02684827707707882,
-0.06515878438949585,
-0.03728368878364563,
-0.00947035662829876,
0.020053472369909286,
-0.16044186055660248,
0.21396854519844055,
0.0034151729196310043,
-0.07513861358165741,
-0.19331884384155273,
-0.06942746043205261,
-0.04914166033267975,
0.07457692921161652,
-0.06210128962993622,
0.034395601600408554,
0.11709018051624298,
0.12936492264270782,
-0.3742693066596985,
0.06004435569047928,
0.1384611874818802,
-0.017754390835762024,
0.34122344851493835,
0.03977050632238388,
-0.41048896312713623,
0.30585983395576477,
-0.041267361491918564,
0.05645029991865158,
-0.3956506848335266,
0.10494714975357056,
-0.4154866933822632,
-0.33728328347206116,
-0.10141125321388245,
0.21116644144058228,
-0.06528736650943756,
0.17351900041103363,
-0.10491650551557541,
0.30228590965270996,
0.1632002741098404,
-0.21933315694332123,
0.20275169610977173,
-0.23053361475467682,
-0.2487107217311859,
-0.3493158221244812,
0.04245160520076752,
0.4535022974014282,
-0.15045294165611267,
-0.0004574581980705261,
0.18453729152679443,
0.036701664328575134,
0.3069787919521332,
-0.0027898885309696198,
-0.12384027242660522,
0.4698011577129364,
-0.15562357008457184,
-0.1974998414516449,
0.5490432977676392,
-0.1703348606824875,
-0.35755282640457153,
0.4128357768058777,
-0.0012207329273223877,
0.18430952727794647,
-0.1445411741733551,
0.1824120283126831,
0.15199872851371765,
-0.20466984808444977,
-0.22918319702148438,
0.08373048901557922,
-0.29779568314552307,
-0.026883535087108612,
-0.24738487601280212,
0.027487481012940407,
0.26850080490112305,
-0.11929517984390259,
0.03915689140558243,
0.45079874992370605,
0.04639855772256851,
0.07605794072151184,
0.505138099193573,
0.027512364089488983,
0.294172078371048,
0.28599053621292114,
0.27866435050964355,
-0.0021841898560523987,
0.12778279185295105,
-0.35929110646247864,
-0.21414092183113098,
-0.028832826763391495,
0.2037922739982605,
-0.14278608560562134,
-0.05965356528759003,
-0.10002835839986801,
-0.1210675984621048,
0.08242262899875641,
-0.24299634993076324,
-0.010627642273902893,
0.177704855799675,
-0.20740443468093872,
-0.1279572695493698,
0.13610465824604034,
-0.004350543022155762,
0.054681167006492615,
0.05558411777019501,
0.02107888273894787,
-0.4768592417240143,
0.33826586604118347,
0.32223325967788696,
-0.08878808468580246,
0.009771816432476044,
0.36038801074028015,
0.23408222198486328,
-0.21837078034877777,
-0.2636992931365967,
0.25819411873817444,
0.0003751046024262905,
0.115989550948143,
-0.2669527232646942,
0.6012064814567566,
0.23839357495307922,
-0.27884021401405334,
0.06724556535482407,
0.26777851581573486,
0.21508760750293732,
-0.19762569665908813,
-0.31149202585220337,
0.0977143943309784,
-0.018082797527313232,
0.25295376777648926,
0.10108649730682373,
0.2168869972229004,
0.14540918171405792,
-0.03294835984706879,
-0.18770945072174072,
-0.31942498683929443,
-0.3233368694782257,
-0.05890863761305809,
-0.0008736588060855865,
-0.09316801279783249,
-0.19258370995521545,
0.5328494310379028,
0.5455493927001953,
0.020525623112916946,
-0.10752279311418533,
-0.07289443165063858,
-0.28340259194374084,
-0.13403989374637604,
0.2133994847536087,
-0.1221911609172821,
0.41816627979278564,
0.02331351861357689,
0.24924251437187195,
0.13229160010814667,
0.006685469299554825,
-0.04386075213551521,
0.1940060555934906,
0.09853428602218628,
0.19934795796871185,
0.027554906904697418,
0.056410808116197586,
0.2463427484035492,
-0.061011478304862976,
-0.20914910733699799,
0.05911705642938614,
0.190591961145401,
-0.20645953714847565,
0.21089428663253784,
-0.3940410614013672,
0.11383142322301865,
-0.017724022269248962,
-0.06828784197568893,
0.06504732370376587,
-0.6210636496543884,
-0.033252157270908356,
0.4961894452571869,
-0.1775635927915573,
-0.02883121930062771,
-0.1035090982913971,
-0.036632850766181946,
0.24315913021564484,
-0.23302637040615082,
-0.07783544808626175,
-0.31475022435188293,
-0.17812177538871765,
-0.011480787768959999,
-0.055252306163311005,
-0.10911436378955841,
0.4092414081096649,
-0.09820625931024551,
0.046728283166885376,
-0.7497694492340088,
-0.3878383934497833,
0.16712048649787903,
-0.19753247499465942,
0.07100936770439148,
0.26855579018592834,
-0.013586930930614471,
0.3756135106086731,
0.18960802257061005,
0.15975241363048553,
-0.11701919138431549,
-0.06865613907575607,
0.25013765692710876,
-0.25584107637405396,
-0.16726019978523254,
0.04350462928414345,
-0.5102446675300598,
-0.06039004027843475,
-0.25401735305786133,
0.3167291283607483,
-0.07622499018907547,
0.11211156845092773,
0.5025550723075867,
-0.023773960769176483,
-0.12873530387878418,
0.0580119714140892,
0.033353619277477264,
-0.328655868768692,
-0.04958736151456833,
0.22280210256576538,
-0.37565678358078003,
-0.1478559672832489,
-0.18204981088638306,
0.20565517246723175,
0.2520509362220764,
0.1927889883518219,
-0.3746623396873474,
0.004265568219125271,
-0.10845261812210083,
0.34128502011299133,
-0.31934472918510437,
-0.08804412186145782,
0.4044148623943329,
0.3529805839061737,
0.043914005160331726,
-0.10131359100341797,
-0.06990061700344086,
-0.0778680220246315,
0.1525687277317047,
0.2942366898059845,
0.15199196338653564,
0.22506260871887207,
0.049043793231248856,
0.4146742820739746,
0.11124244332313538,
0.22496967017650604,
0.2565367519855499,
-0.05641724169254303,
0.3814120292663574,
-0.3238646686077118,
-0.5107727646827698,
0.1346590518951416,
-0.24915748834609985,
0.12521938979625702,
0.0621723048388958,
-0.11455071717500687,
-0.26450806856155396,
0.060456402599811554,
0.07329292595386505,
0.06431185454130173,
-0.508777916431427,
0.0069738347083330154,
-0.19782179594039917,
0.2895878851413727,
0.05126705393195152,
0.16689056158065796,
-0.2839297950267792,
-0.23382726311683655,
0.36890095472335815,
0.0230540931224823,
0.2092828005552292,
-0.15555618703365326,
-0.5740966796875,
-0.1395464539527893,
-0.18488547205924988,
-0.02897559106349945,
0.061528198421001434,
0.19963395595550537,
-0.009589552879333496,
-0.4068179130554199,
-0.0787973552942276,
0.3113264739513397,
0.5553519129753113,
-0.1710447371006012,
-0.03748644143342972,
0.36530953645706177,
0.16129982471466064,
0.07405336201190948,
-0.32578152418136597,
-0.2912715673446655,
0.5130129456520081,
0.2509436309337616,
0.5983396768569946,
-0.12100671976804733,
-0.17906014621257782,
0.36240023374557495,
0.21709734201431274,
-0.055056650191545486,
-0.046671025454998016,
0.055106740444898605,
-0.18520087003707886,
-0.026891857385635376,
-0.05350623279809952,
0.037102989852428436,
0.15830102562904358,
-0.3427305817604065,
-0.27337002754211426,
0.09952288120985031,
-0.08879969269037247,
0.030717380344867706,
0.09439176321029663,
0.05525503680109978,
-0.034211061894893646,
0.4457133710384369,
-0.13403062522411346,
0.2175605595111847,
0.16418339312076569,
0.4589473009109497,
0.17879097163677216,
-0.43118011951446533,
-0.07817693799734116,
-0.2327795922756195,
0.3778078854084015,
0.32576969265937805,
-0.09195445477962494,
0.017750583589076996,
-0.37048617005348206,
0.06775239109992981,
-0.4757927358150482,
-0.052530623972415924,
0.2170657217502594,
-0.18071524798870087,
-0.5108715891838074,
-0.2262294739484787,
0.35303226113319397,
-0.1319204717874527,
-0.18550777435302734,
0.24042099714279175,
-0.08995465934276581,
-0.3265235126018524,
0.47900599241256714,
0.06226421892642975,
0.8588127493858337,
0.13609544932842255,
0.10818806290626526,
0.10794299095869064,
0.07943345606327057,
0.43738746643066406,
-0.10162793099880219,
0.013194140046834946,
-0.2933652997016907,
-0.575571596622467,
0.08584219217300415,
0.07070599496364594,
0.08743686228990555,
0.2100435048341751,
-0.15224041044712067,
0.27295127511024475,
-0.012233980000019073,
0.36437538266181946,
-0.07532572001218796,
-0.08810043334960938,
0.13197170197963715,
-0.28256452083587646,
-0.025279678404331207,
0.14192330837249756,
0.13821189105510712,
0.1045370101928711,
0.05072110891342163,
-0.48028552532196045,
0.07241807878017426,
0.1381670981645584,
-0.17441022396087646,
0.09177761524915695,
-0.19700616598129272,
0.12403199821710587,
0.24896268546581268,
-0.44019490480422974,
0.14403732120990753,
0.009001374244689941,
0.5065816640853882,
0.34123265743255615,
-0.29847219586372375,
-0.17266660928726196,
0.16964298486709595,
0.18713587522506714,
0.17357754707336426,
0.11246216297149658,
0.2842910885810852,
0.062043920159339905,
-0.12511515617370605,
0.18868029117584229,
0.004057249054312706,
-0.1208731085062027,
-0.3123898506164551,
-0.2798210382461548,
0.2161300629377365,
-0.46225401759147644,
-0.08112311363220215,
0.13406065106391907,
-0.04416099935770035,
-0.3098932206630707,
0.09863269329071045,
0.2679906189441681,
-0.04442710429430008,
0.3792511522769928,
-0.2350567728281021,
-0.22388508915901184,
-0.13572633266448975,
0.029062163084745407,
-0.0019399970769882202,
0.07630325108766556,
0.20682956278324127,
-0.12851214408874512,
-0.1704641729593277,
-0.09541680663824081,
0.24215909838676453,
0.20854416489601135,
-0.1987030804157257,
0.06836633384227753,
-0.13709242641925812,
0.35732555389404297,
-0.2683722674846649,
0.1556742787361145,
-0.23360849916934967,
-0.01879473775625229,
-0.14760234951972961,
-0.11791089177131653,
-0.3091175854206085,
0.17073117196559906,
0.03549123555421829,
0.06035202369093895,
-0.39488744735717773,
0.09827394783496857,
-0.12149054557085037,
0.1584417223930359,
-0.3048303723335266,
-0.14020003378391266,
0.11432258039712906,
0.2148524969816208,
0.5986781120300293,
0.17427605390548706,
-0.2462567239999771,
-0.09977369010448456,
0.1208125650882721,
-0.05858767777681351,
0.021454576402902603,
-0.20559179782867432,
-0.2299283891916275,
0.15526443719863892,
0.14785081148147583,
-0.06549477577209473,
0.018567662686109543,
-0.09225629270076752,
-0.07672187685966492,
-0.322706937789917,
0.2952304780483246,
0.14395496249198914,
0.20032578706741333,
0.5305446982383728,
-0.14659790694713593,
0.009206157177686691,
0.23336072266101837,
0.1814444363117218,
0.08334565907716751,
0.19507703185081482,
-0.1880096197128296,
0.24875441193580627,
-0.06951642036437988,
-0.17609937489032745,
-0.4544922113418579,
0.11185131967067719,
-0.16453994810581207,
0.019158953800797462,
0.5586037635803223,
-0.052741967141628265,
0.24192622303962708,
0.5694013833999634,
-0.11642098426818848,
0.3346989154815674,
-0.3533044159412384,
0.020726406946778297,
0.13216838240623474,
0.22605407238006592,
-0.14053377509117126,
-0.42445796728134155,
0.11613263189792633,
0.12677784264087677,
0.03358553722500801,
0.2934182584285736,
0.2022322416305542,
0.11550907790660858,
0.17763730883598328,
-0.07621720433235168,
0.06416412442922592,
-0.19445064663887024,
0.12496516108512878,
0.4824312925338745,
0.23688478767871857,
0.19632971286773682,
0.18265986442565918,
0.3593765199184418,
-0.013941794633865356,
0.3425704836845398,
0.2654523253440857,
0.2756366729736328,
0.3863411545753479,
-0.15336276590824127,
0.3306107223033905,
-0.22172807157039642,
-0.3169759511947632,
-0.011587768793106079,
-0.26823630928993225,
0.3374578356742859,
-0.04555709660053253,
-0.10112500935792923,
-0.01070632878690958,
-0.36791419982910156,
0.11790788918733597,
0.0332019180059433,
-0.2675885558128357,
-0.19810070097446442,
0.14976467192173004,
-0.21865051984786987,
-0.12835967540740967,
-0.1685093194246292,
-0.0342094860970974,
-0.23524777591228485,
0.4765781760215759,
-0.17593751847743988,
0.061294928193092346,
-0.35672685503959656,
0.07571572065353394,
-0.00015333667397499084,
0.41055431962013245,
-0.2703273892402649,
-0.10835260897874832,
-0.4462208151817322,
-0.143917977809906,
-0.12388969957828522,
0.12133964151144028,
0.18898050487041473,
0.33485475182533264,
-0.09767802059650421,
0.042431581765413284,
-0.07030841708183289,
-0.2515339255332947,
0.1354675143957138,
0.11228527128696442,
-0.13818317651748657,
-0.20435233414173126,
0.04755299910902977,
-0.006322776898741722,
0.04719868674874306,
0.40947094559669495,
0.31976887583732605,
0.05991817265748978,
-0.5483214855194092,
0.16983026266098022,
0.07196405529975891,
-0.4266289174556732,
0.037921831011772156,
-0.06179843097925186,
-0.038088731467723846,
-0.5284919738769531,
0.6173118948936462,
0.16184288263320923,
0.3147115707397461,
-0.08379407972097397,
0.08535604178905487,
0.02357129007577896,
0.12426620721817017,
0.11624510586261749,
-0.12183860689401627,
-0.3185098469257355,
0.13115470111370087,
-0.2528640031814575,
0.05069001764059067,
0.030725667253136635,
0.11269932985305786,
0.2520323395729065,
0.25431954860687256,
0.07358092814683914,
0.22991237044334412,
-0.19739262759685516,
-0.5136321783065796,
-0.04958445578813553,
0.29408133029937744,
-0.054640404880046844,
-0.47332310676574707,
-0.02250458300113678,
0.17806006968021393,
-0.019519928842782974,
-0.22610238194465637,
0.322619765996933,
-0.13832567632198334,
0.0399695485830307,
-0.2471768707036972,
0.03039134293794632,
0.13793285191059113,
0.3297206163406372,
0.10652792453765869,
0.2167159467935562,
-0.11779791116714478,
-0.11982562392950058,
-0.2524842917919159,
-0.2570584714412689,
-0.11644650995731354,
0.013177054934203625,
0.37370556592941284,
-0.12080514430999756,
0.15063899755477905,
0.05981551110744476,
0.08209560811519623,
-0.16661608219146729,
0.15664424002170563,
0.08054478466510773,
0.017784832045435905,
-0.5453866720199585,
0.2592999041080475,
-0.07026378065347672,
0.2973310053348541,
0.14674434065818787,
0.051959652453660965,
-0.3004363775253296,
0.30511268973350525,
-0.20380082726478577,
-0.4890325963497162,
0.19259390234947205,
-0.1193612739443779,
-0.33315327763557434,
-0.017220014706254005,
0.16308507323265076,
0.05102207511663437,
0.046507276594638824,
-0.4662030339241028,
-0.18886873126029968,
0.5390978455543518,
-0.22187280654907227,
-0.04944329708814621,
0.07450264692306519,
-0.0069274455308914185,
0.06166239455342293,
-0.13695846498012543,
0.5788897275924683,
0.03261891007423401,
-0.12229932099580765,
0.36542126536369324,
-0.0674106627702713
] |
https://github.com/huggingface/datasets/issues/5568 | dataset.to_iterable_dataset() loses useful info like dataset features | seems like the feature parameter is missing from `return IterableDataset.from_generator(Dataset._iter_shards, gen_kwargs={"shards": shards})` hence it defaults to None. | ### Describe the bug
Hello,
I like the new `to_iterable_dataset` feature but I noticed something that seems to be missing.
When using `to_iterable_dataset` to transform your map style dataset into iterable dataset, you lose valuable metadata like the features.
These metadata are useful if you want to interleave iterable datasets, cast columns etc.
### Steps to reproduce the bug
```python
dataset = load_dataset("lhoestq/demo1")["train"]
print(dataset.features)
# {'id': Value(dtype='string', id=None), 'package_name': Value(dtype='string', id=None), 'review': Value(dtype='string', id=None), 'date': Value(dtype='string', id=None), 'star': Value(dtype='int64', id=None), 'version_id': Value(dtype='int64', id=None)}
dataset = dataset.to_iterable_dataset()
print(dataset.features)
# None
```
### Expected behavior
Keep the relevant information
### Environment info
datasets==2.10.0 | 17 | dataset.to_iterable_dataset() loses useful info like dataset features
### Describe the bug
Hello,
I like the new `to_iterable_dataset` feature but I noticed something that seems to be missing.
When using `to_iterable_dataset` to transform your map style dataset into iterable dataset, you lose valuable metadata like the features.
These metadata are useful if you want to interleave iterable datasets, cast columns etc.
### Steps to reproduce the bug
```python
dataset = load_dataset("lhoestq/demo1")["train"]
print(dataset.features)
# {'id': Value(dtype='string', id=None), 'package_name': Value(dtype='string', id=None), 'review': Value(dtype='string', id=None), 'date': Value(dtype='string', id=None), 'star': Value(dtype='int64', id=None), 'version_id': Value(dtype='int64', id=None)}
dataset = dataset.to_iterable_dataset()
print(dataset.features)
# None
```
### Expected behavior
Keep the relevant information
### Environment info
datasets==2.10.0
seems like the feature parameter is missing from `return IterableDataset.from_generator(Dataset._iter_shards, gen_kwargs={"shards": shards})` hence it defaults to None. | [
-0.13188661634922028,
0.10668608546257019,
0.011545903980731964,
-0.00627666711807251,
0.44106054306030273,
0.22829240560531616,
0.29144522547721863,
0.45109689235687256,
-0.48412445187568665,
0.04485110193490982,
0.02956996113061905,
0.7640542387962341,
-0.19561854004859924,
0.13245688378810883,
0.061861712485551834,
-0.20123416185379028,
0.26582157611846924,
0.14226005971431732,
-0.33177685737609863,
-0.17613466084003448,
-0.3859477639198303,
0.10516632348299026,
-0.25704652070999146,
-0.009520120918750763,
0.02445269748568535,
0.301434725522995,
-0.020894277840852737,
0.0024915114045143127,
0.1360420435667038,
-0.5312180519104004,
-0.045475419610738754,
-0.02064165472984314,
-0.11457265168428421,
-0.09252244979143143,
-0.00012060523295076564,
-0.10832564532756805,
0.387708842754364,
-0.12607750296592712,
-0.22630324959754944,
-0.13780300319194794,
-0.2777068018913269,
-0.25764766335487366,
-0.0076309386640787125,
-0.26593437790870667,
-0.06719216704368591,
-0.2716890871524811,
0.020174540579319,
-0.19913674890995026,
-0.30438852310180664,
0.1576695591211319,
0.18553201854228973,
-0.026210937649011612,
0.16817671060562134,
-0.09054231643676758,
0.5263209342956543,
0.20266857743263245,
-0.34709280729293823,
-0.04304634407162666,
0.30951911211013794,
0.07900756597518921,
0.15034380555152893,
0.4615705907344818,
-0.21837519109249115,
-0.3666994869709015,
0.31011468172073364,
0.12541723251342773,
0.0680246651172638,
-0.184980571269989,
0.12198137491941452,
0.139052152633667,
0.6673732995986938,
-0.3346211314201355,
-0.24800342321395874,
-0.3109953999519348,
0.005561038386076689,
-0.25493791699409485,
0.0047819167375564575,
-0.05390574038028717,
0.05358109250664711,
0.13212396204471588,
-0.2617417573928833,
-0.33935829997062683,
-0.20566827058792114,
0.06993649154901505,
0.09613604843616486,
0.4282335638999939,
-0.2175903618335724,
0.1703418493270874,
-0.03616274520754814,
0.023056015372276306,
0.021003343164920807,
-0.19732673466205597,
-0.04238641634583473,
0.1540759950876236,
0.08024924248456955,
-0.30317649245262146,
0.4354056417942047,
-0.16906672716140747,
0.19449445605278015,
0.21297620236873627,
-0.07138411700725555,
-0.027569852769374847,
-0.05300002545118332,
-0.23793086409568787,
0.2317998707294464,
-0.43188345432281494,
0.13358010351657867,
0.22403673827648163,
0.02801085077226162,
-0.22924330830574036,
0.13012412190437317,
-0.158387690782547,
0.46225565671920776,
0.1291029155254364,
0.544115424156189,
-0.06479086726903915,
0.7442283630371094,
-0.19580978155136108,
-0.11617374420166016,
0.14510893821716309,
-0.38794785737991333,
-0.03817429021000862,
-0.1201198473572731,
-0.10377075523138046,
0.07983029633760452,
-0.06476733833551407,
-0.25545692443847656,
0.17128649353981018,
-0.04395841062068939,
-0.1334901601076126,
-0.23360981047153473,
-0.14350643754005432,
-0.022174431011080742,
0.09220196306705475,
0.0026075728237628937,
-0.07303526997566223,
0.11541623622179031,
0.1475800722837448,
-0.4285907745361328,
0.17410333454608917,
0.11226288974285126,
-0.045220911502838135,
0.26853081583976746,
0.1362130045890808,
-0.37068381905555725,
0.31605660915374756,
0.007956605404615402,
-0.06515108048915863,
-0.3482821583747864,
0.1366766095161438,
-0.4534704089164734,
-0.420296847820282,
-0.09508652985095978,
0.1435692310333252,
-0.18078622221946716,
0.22044983506202698,
-0.14372512698173523,
0.25224950909614563,
0.19762271642684937,
-0.1950170397758484,
0.1155305728316307,
-0.26809853315353394,
-0.2825320065021515,
-0.357892781496048,
0.10277602076530457,
0.5556535720825195,
-0.2504822015762329,
-0.03726442903280258,
0.23636549711227417,
0.0006347335875034332,
0.3357829451560974,
-0.0562690831720829,
-0.16625195741653442,
0.3943384289741516,
-0.20478080213069916,
-0.12141504883766174,
0.5309788584709167,
-0.09042724221944809,
-0.39879146218299866,
0.38933396339416504,
-0.011069152504205704,
0.19747821986675262,
-0.0540425106883049,
0.11743474751710892,
0.1843552142381668,
-0.2172008752822876,
-0.2757207453250885,
0.02790611982345581,
-0.19546861946582794,
-0.07705660909414291,
-0.2571565508842468,
0.003247857093811035,
0.2710435390472412,
-0.12276719510555267,
0.13768678903579712,
0.4820217788219452,
0.04485471919178963,
0.06950356811285019,
0.46856918931007385,
0.011875316500663757,
0.30969399213790894,
0.3245832324028015,
0.4316067397594452,
-0.06218153238296509,
0.18930308520793915,
-0.43299663066864014,
-0.16187235713005066,
0.031146831810474396,
0.17476333677768707,
-0.0758248120546341,
-0.057962581515312195,
-0.03744422271847725,
-0.038912899792194366,
0.10562572628259659,
-0.28551405668258667,
0.03686967492103577,
0.10632652044296265,
-0.17068246006965637,
-0.03772461414337158,
0.15929056704044342,
-0.09692028164863586,
0.050109490752220154,
-0.09205194562673569,
0.017849475145339966,
-0.4876914620399475,
0.4479418694972992,
0.3648569881916046,
-0.18688911199569702,
-0.06358161568641663,
0.34030652046203613,
0.22548258304595947,
-0.25091972947120667,
-0.2417883276939392,
0.2787131667137146,
0.0024479313287883997,
0.1057242900133133,
-0.20606207847595215,
0.6104913353919983,
0.22724953293800354,
-0.27241751551628113,
0.10837716609239578,
0.29206642508506775,
0.18605294823646545,
-0.18930339813232422,
-0.2527378797531128,
0.13482381403446198,
-0.0015338733792304993,
0.3487018346786499,
0.07859331369400024,
0.18143504858016968,
0.17811433970928192,
-0.05148901790380478,
-0.24493403732776642,
-0.3276962339878082,
-0.3837600350379944,
-0.1036568433046341,
-0.006186621263623238,
-0.06359628587961197,
-0.12997955083847046,
0.5048232078552246,
0.5389881134033203,
-0.020090214908123016,
-0.13442227244377136,
-0.08522624522447586,
-0.30328866839408875,
-0.18068382143974304,
0.19203998148441315,
-0.0010709166526794434,
0.564531683921814,
0.028392087668180466,
0.2080698162317276,
0.0848359540104866,
-0.12130894511938095,
-0.08134229481220245,
0.2259550839662552,
0.06809382140636444,
0.24581049382686615,
0.1430138647556305,
-0.004641201812773943,
0.2093287855386734,
-0.15849599242210388,
-0.2735083997249603,
0.043088629841804504,
0.2138325423002243,
-0.22969861328601837,
0.1904536783695221,
-0.44144406914711,
0.1752934455871582,
0.01769164204597473,
0.017750687897205353,
-0.00834982842206955,
-0.682029128074646,
-0.0884561687707901,
0.4826330542564392,
-0.14034298062324524,
-0.022958597168326378,
-0.11651185154914856,
-0.05533002316951752,
0.23781485855579376,
-0.24330885708332062,
-0.08519794046878815,
-0.3085968792438507,
-0.17983707785606384,
-0.07349246740341187,
-0.1813308745622635,
-0.15673726797103882,
0.3506694734096527,
-0.1459200382232666,
0.013157809153199196,
-0.7797971367835999,
-0.37976643443107605,
0.20210352540016174,
-0.2120373696088791,
0.12481003254652023,
0.35759949684143066,
0.025456145405769348,
0.3896028995513916,
0.20080119371414185,
0.23863960802555084,
-0.061857834458351135,
-0.0656454935669899,
0.28393179178237915,
-0.37894728779792786,
-0.13526971638202667,
0.08549724519252777,
-0.3772238492965698,
-0.014511866495013237,
-0.2429862916469574,
0.2323577105998993,
-0.05909588932991028,
0.12628117203712463,
0.5565717220306396,
-0.00616637896746397,
-0.1038549542427063,
-0.021083936095237732,
-0.011329535394906998,
-0.27346736192703247,
-0.0823088064789772,
0.32547780871391296,
-0.30638039112091064,
-0.14039072394371033,
-0.07518456876277924,
0.21726444363594055,
0.2728934586048126,
0.29909026622772217,
-0.35593217611312866,
-0.016453709453344345,
-0.11174668371677399,
0.29893094301223755,
-0.3152715563774109,
-0.05340943485498428,
0.4480726718902588,
0.42884349822998047,
0.07880108058452606,
-0.09948834776878357,
-0.03171549737453461,
-0.011678889393806458,
0.1733802855014801,
0.34906551241874695,
0.2594721019268036,
0.3044697940349579,
0.09960626065731049,
0.5355398058891296,
0.18140502274036407,
0.19118578732013702,
0.2374621331691742,
-0.07374574989080429,
0.4109886586666107,
-0.31612563133239746,
-0.498177707195282,
0.11950291693210602,
-0.1753132939338684,
0.16745451092720032,
0.007672995328903198,
-0.11074156314134598,
-0.26378121972084045,
0.07568804174661636,
0.027194611728191376,
0.11952207237482071,
-0.5182628035545349,
0.02377253957092762,
-0.2549167275428772,
0.3572317659854889,
0.013390645384788513,
0.2211337685585022,
-0.28146618604660034,
-0.21798202395439148,
0.3180929720401764,
0.07181660085916519,
0.33891984820365906,
-0.19348667562007904,
-0.6042908430099487,
-0.16232523322105408,
-0.1697944700717926,
-0.03425438702106476,
0.030335282906889915,
0.2170516699552536,
0.043451059609651566,
-0.46157827973365784,
-0.03147581219673157,
0.30488428473472595,
0.6388542652130127,
-0.16576123237609863,
0.016968440264463425,
0.3872288167476654,
0.1835469901561737,
0.004721822217106819,
-0.37626537680625916,
-0.2786064147949219,
0.5941559076309204,
0.11051459610462189,
0.5831731557846069,
-0.08995364606380463,
-0.19050821661949158,
0.3933461308479309,
0.1854630708694458,
-0.06919830292463303,
0.008249104954302311,
-0.005518030375242233,
-0.15989452600479126,
0.012858247384428978,
-0.031686872243881226,
-0.13026417791843414,
0.20729033648967743,
-0.3573875427246094,
-0.23016299307346344,
-0.002942195162177086,
-0.14784160256385803,
0.018564485013484955,
0.031233366578817368,
0.10215837508440018,
-0.06708679348230362,
0.40634483098983765,
-0.1630619913339615,
0.162099227309227,
0.13577912747859955,
0.4045509397983551,
0.22482195496559143,
-0.35563331842422485,
-0.021894067525863647,
-0.18929988145828247,
0.39690089225769043,
0.34042829275131226,
-0.16949163377285004,
0.03860266134142876,
-0.416869193315506,
0.12974956631660461,
-0.47123247385025024,
-0.12866517901420593,
0.22482982277870178,
-0.20169275999069214,
-0.4711793065071106,
-0.1800786256790161,
0.33128687739372253,
-0.2053147554397583,
-0.1054895669221878,
0.2509498596191406,
0.1279488354921341,
-0.31674623489379883,
0.5142269730567932,
0.06436816602945328,
0.858183741569519,
0.19169925153255463,
0.063583604991436,
0.07249727100133896,
0.21466068923473358,
0.4021221697330475,
-0.034175388514995575,
0.0926770493388176,
-0.24432596564292908,
-0.5724470615386963,
0.07825985550880432,
0.05525793507695198,
0.17728224396705627,
0.2513298988342285,
-0.026787441223859787,
0.25799375772476196,
0.03146863728761673,
0.4660928547382355,
-0.04611075669527054,
-0.15517517924308777,
0.07310079038143158,
-0.23178353905677795,
0.034980058670043945,
0.08881933242082596,
0.12169819325208664,
0.14412793517112732,
0.1120249480009079,
-0.42019474506378174,
0.09389291703701019,
0.13108529150485992,
-0.203446626663208,
0.10580780357122421,
-0.07799336314201355,
0.16525159776210785,
0.3010660707950592,
-0.5828656554222107,
0.12191663682460785,
0.07772726565599442,
0.42807602882385254,
0.3411204516887665,
-0.3247607350349426,
-0.17366428673267365,
0.1454063355922699,
0.19637222588062286,
0.15882903337478638,
0.1700218766927719,
0.23639121651649475,
0.08374811708927155,
-0.156073659658432,
0.20738190412521362,
0.003248196095228195,
-0.142869770526886,
-0.3709440231323242,
-0.32715487480163574,
0.19526329636573792,
-0.4087449610233307,
-0.06247967854142189,
0.1450236290693283,
-0.013987990096211433,
-0.2885027229785919,
0.04316498339176178,
0.24636508524417877,
-0.04922819882631302,
0.3945658504962921,
-0.2762829661369324,
-0.2541518807411194,
-0.09267982840538025,
0.11340996623039246,
0.03638160228729248,
0.10024501383304596,
0.21450771391391754,
-0.23889108002185822,
-0.17379868030548096,
-0.04936258867383003,
0.23148399591445923,
0.11961854249238968,
-0.2209910750389099,
0.09289377927780151,
-0.073244608938694,
0.4509528875350952,
-0.20488248765468597,
0.104010209441185,
-0.2660548686981201,
0.0024658218026161194,
-0.2891383171081543,
-0.06096058711409569,
-0.1756068617105484,
0.2335183173418045,
0.03633220121264458,
0.07025271654129028,
-0.44863468408584595,
0.04159433767199516,
-0.07899678498506546,
0.038812194019556046,
-0.24585478007793427,
-0.10994339734315872,
0.14235767722129822,
0.19776380062103271,
0.5906414985656738,
0.15300309658050537,
-0.2545812129974365,
-0.08553867042064667,
0.08154929429292679,
-0.1282648742198944,
0.04214617237448692,
-0.140703484416008,
-0.24699702858924866,
0.1926754117012024,
0.16332125663757324,
-0.00900990515947342,
0.04973761737346649,
-0.10489705950021744,
-0.10926765203475952,
-0.315059095621109,
0.3759138286113739,
0.1354919970035553,
0.14667673408985138,
0.5404688119888306,
-0.009747523814439774,
0.04105568304657936,
0.209591343998909,
0.14661557972431183,
0.033087778836488724,
0.15855497121810913,
-0.16388815641403198,
0.3313090205192566,
-0.09516569972038269,
-0.1913546472787857,
-0.48811835050582886,
0.21277055144309998,
-0.18581514060497284,
-0.0011574551463127136,
0.6071998476982117,
-0.13369855284690857,
0.20526333153247833,
0.4114709794521332,
-0.12425694614648819,
0.30363285541534424,
-0.31641215085983276,
-0.04623859003186226,
0.08304634690284729,
0.17841163277626038,
-0.1373717188835144,
-0.47674134373664856,
0.1378103792667389,
0.22218957543373108,
0.041595350950956345,
0.2653360664844513,
0.19505956768989563,
0.03264298290014267,
0.2388274073600769,
-0.07998356968164444,
0.18738657236099243,
-0.2679893374443054,
0.14345692098140717,
0.5074853897094727,
0.26813846826553345,
0.17796571552753448,
0.17699062824249268,
0.2671014964580536,
-0.03688671439886093,
0.4278808832168579,
0.28076794743537903,
0.383897066116333,
0.346112996339798,
-0.1717521995306015,
0.28012529015541077,
-0.2408912479877472,
-0.3543429374694824,
-0.044617027044296265,
-0.2930806577205658,
0.2843532860279083,
-0.06482023000717163,
-0.052751325070858,
-0.048410456627607346,
-0.27195867896080017,
0.07467580586671829,
0.061913955956697464,
-0.2629894018173218,
-0.2696106433868408,
-0.007427165284752846,
-0.23347821831703186,
-0.10872188210487366,
-0.12607264518737793,
-0.008879557251930237,
-0.24761830270290375,
0.4199886620044708,
-0.20647473633289337,
0.06023099645972252,
-0.30937492847442627,
0.169688880443573,
-0.0003197863698005676,
0.4198712408542633,
-0.24061177670955658,
-0.10100055485963821,
-0.4118068218231201,
-0.11839014291763306,
-0.18263374269008636,
0.07895825058221817,
0.1786661595106125,
0.320927232503891,
0.0031042220070958138,
0.048967961221933365,
-0.011153936386108398,
-0.2948157787322998,
0.14276039600372314,
0.15780003368854523,
-0.20043951272964478,
-0.19065648317337036,
0.012095171958208084,
-0.032833732664585114,
0.06044105440378189,
0.28258439898490906,
0.25699475407600403,
0.11553652584552765,
-0.528263509273529,
0.19608569145202637,
0.10261092334985733,
-0.4527423083782196,
0.1593400239944458,
0.032703083008527756,
-0.1002088338136673,
-0.537450909614563,
0.635241687297821,
0.20381426811218262,
0.27543237805366516,
-0.07142608612775803,
0.05240810662508011,
-0.049374792724847794,
0.07703804969787598,
0.004402421414852142,
-0.12347941845655441,
-0.26395148038864136,
0.0910702645778656,
-0.1683117151260376,
0.024881288409233093,
0.05902893468737602,
0.12730030715465546,
0.22589290142059326,
0.30905023217201233,
0.07309358566999435,
0.18148408830165863,
-0.18292494118213654,
-0.46680235862731934,
-0.09300077706575394,
0.31072983145713806,
0.01807476580142975,
-0.455726683139801,
-0.006125129759311676,
0.12772078812122345,
-0.15494169294834137,
-0.23911330103874207,
0.2610953748226166,
-0.06843005865812302,
-0.01227334514260292,
-0.24589760601520538,
0.036049775779247284,
0.2695044279098511,
0.28683918714523315,
0.06904222816228867,
0.23018968105316162,
-0.06608080863952637,
-0.06271538883447647,
-0.2227795422077179,
-0.3025103211402893,
-0.07690057158470154,
0.024967923760414124,
0.3599897623062134,
-0.1505800485610962,
0.20596835017204285,
0.09315185993909836,
0.019835716113448143,
-0.11918918788433075,
0.1892578899860382,
0.08646270632743835,
0.14153730869293213,
-0.5349896550178528,
0.2474687397480011,
-0.16818302869796753,
0.24329783022403717,
0.14993822574615479,
-0.026561491191387177,
-0.23392921686172485,
0.259841650724411,
-0.16817618906497955,
-0.4596540629863739,
0.09898987412452698,
-0.14643985033035278,
-0.2876954972743988,
-0.07905397564172745,
0.19800680875778198,
-0.033279724419116974,
0.04692656546831131,
-0.4184531569480896,
-0.28702032566070557,
0.5885383486747742,
-0.28320467472076416,
-0.003590209409594536,
0.16051679849624634,
0.048169396817684174,
0.05180896446108818,
-0.15173882246017456,
0.4909161627292633,
0.03983720391988754,
-0.08978365361690521,
0.26467466354370117,
-0.093346007168293
] |
https://github.com/huggingface/datasets/issues/5555 | `.shuffle` throwing error `ValueError: Protocol not known: parent` | Hi ! The indices mapping is written in the same cachedirectory as your dataset.
Can you run this to show your current cache directory ?
```python
print(train_dataset.cache_files)
``` | ### Describe the bug
```
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In [16], line 1
----> 1 train_dataset = train_dataset.shuffle()
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:551, in transmit_format.<locals>.wrapper(*args, **kwargs)
544 self_format = {
545 "type": self._format_type,
546 "format_kwargs": self._format_kwargs,
547 "columns": self._format_columns,
548 "output_all_columns": self._output_all_columns,
549 }
550 # apply actual function
--> 551 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
552 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
553 # re-apply format to the output
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
482 # Update fingerprint of in-place transforms + update in-place history of transforms
484 if inplace: # update after calling func so that the fingerprint doesn't change if the function fails
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:3616, in Dataset.shuffle(self, seed, generator, keep_in_memory, load_from_cache_file, indices_cache_file_name, writer_batch_size, new_fingerprint)
3610 return self._new_dataset_with_indices(
3611 fingerprint=new_fingerprint, indices_cache_file_name=indices_cache_file_name
3612 )
3614 permutation = generator.permutation(len(self))
-> 3616 return self.select(
3617 indices=permutation,
3618 keep_in_memory=keep_in_memory,
3619 indices_cache_file_name=indices_cache_file_name if not keep_in_memory else None,
3620 writer_batch_size=writer_batch_size,
3621 new_fingerprint=new_fingerprint,
3622 )
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:551, in transmit_format.<locals>.wrapper(*args, **kwargs)
544 self_format = {
545 "type": self._format_type,
546 "format_kwargs": self._format_kwargs,
547 "columns": self._format_columns,
548 "output_all_columns": self._output_all_columns,
549 }
550 # apply actual function
--> 551 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
552 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
553 # re-apply format to the output
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
482 # Update fingerprint of in-place transforms + update in-place history of transforms
484 if inplace: # update after calling func so that the fingerprint doesn't change if the function fails
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:3266, in Dataset.select(self, indices, keep_in_memory, indices_cache_file_name, writer_batch_size, new_fingerprint)
3263 return self._select_contiguous(start, length, new_fingerprint=new_fingerprint)
3265 # If not contiguous, we need to create a new indices mapping
-> 3266 return self._select_with_indices_mapping(
3267 indices,
3268 keep_in_memory=keep_in_memory,
3269 indices_cache_file_name=indices_cache_file_name,
3270 writer_batch_size=writer_batch_size,
3271 new_fingerprint=new_fingerprint,
3272 )
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:551, in transmit_format.<locals>.wrapper(*args, **kwargs)
544 self_format = {
545 "type": self._format_type,
546 "format_kwargs": self._format_kwargs,
547 "columns": self._format_columns,
548 "output_all_columns": self._output_all_columns,
549 }
550 # apply actual function
--> 551 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
552 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
553 # re-apply format to the output
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
482 # Update fingerprint of in-place transforms + update in-place history of transforms
484 if inplace: # update after calling func so that the fingerprint doesn't change if the function fails
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:3389, in Dataset._select_with_indices_mapping(self, indices, keep_in_memory, indices_cache_file_name, writer_batch_size, new_fingerprint)
3387 logger.info(f"Caching indices mapping at {indices_cache_file_name}")
3388 tmp_file = tempfile.NamedTemporaryFile("wb", dir=os.path.dirname(indices_cache_file_name), delete=False)
-> 3389 writer = ArrowWriter(
3390 path=tmp_file.name, writer_batch_size=writer_batch_size, fingerprint=new_fingerprint, unit="indices"
3391 )
3393 indices = indices if isinstance(indices, list) else list(indices)
3395 size = len(self)
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_writer.py:315, in ArrowWriter.__init__(self, schema, features, path, stream, fingerprint, writer_batch_size, hash_salt, check_duplicates, disable_nullable, update_features, with_metadata, unit, embed_local_files, storage_options)
312 self._disable_nullable = disable_nullable
314 if stream is None:
--> 315 fs_token_paths = fsspec.get_fs_token_paths(path, storage_options=storage_options)
316 self._fs: fsspec.AbstractFileSystem = fs_token_paths[0]
317 self._path = (
318 fs_token_paths[2][0]
319 if not is_remote_filesystem(self._fs)
320 else self._fs.unstrip_protocol(fs_token_paths[2][0])
321 )
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/fsspec/core.py:593, in get_fs_token_paths(urlpath, mode, num, name_function, storage_options, protocol, expand)
591 else:
592 urlpath = stringify_path(urlpath)
--> 593 chain = _un_chain(urlpath, storage_options or {})
594 if len(chain) > 1:
595 inkwargs = {}
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/fsspec/core.py:330, in _un_chain(path, kwargs)
328 for bit in reversed(bits):
329 protocol = split_protocol(bit)[0] or "file"
--> 330 cls = get_filesystem_class(protocol)
331 extra_kwargs = cls._get_kwargs_from_urls(bit)
332 kws = kwargs.get(protocol, {})
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/fsspec/registry.py:240, in get_filesystem_class(protocol)
238 if protocol not in registry:
239 if protocol not in known_implementations:
--> 240 raise ValueError("Protocol not known: %s" % protocol)
241 bit = known_implementations[protocol]
242 try:
ValueError: Protocol not known: parent
```
This is what the `train_dataset` object looks like
```
Dataset({
features: ['label', 'input_ids', 'attention_mask'],
num_rows: 364166
})
```
### Steps to reproduce the bug
The `train_dataset` obj is created by concatenating two datasets
And then shuffle is called, but it throws the mentioned error.
### Expected behavior
Should shuffle the dataset properly.
### Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.15.0-1022-aws-x86_64-with-glibc2.31
- Python version: 3.9.13
- PyArrow version: 10.0.0
- Pandas version: 1.4.4
| 28 | `.shuffle` throwing error `ValueError: Protocol not known: parent`
### Describe the bug
```
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In [16], line 1
----> 1 train_dataset = train_dataset.shuffle()
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:551, in transmit_format.<locals>.wrapper(*args, **kwargs)
544 self_format = {
545 "type": self._format_type,
546 "format_kwargs": self._format_kwargs,
547 "columns": self._format_columns,
548 "output_all_columns": self._output_all_columns,
549 }
550 # apply actual function
--> 551 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
552 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
553 # re-apply format to the output
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
482 # Update fingerprint of in-place transforms + update in-place history of transforms
484 if inplace: # update after calling func so that the fingerprint doesn't change if the function fails
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:3616, in Dataset.shuffle(self, seed, generator, keep_in_memory, load_from_cache_file, indices_cache_file_name, writer_batch_size, new_fingerprint)
3610 return self._new_dataset_with_indices(
3611 fingerprint=new_fingerprint, indices_cache_file_name=indices_cache_file_name
3612 )
3614 permutation = generator.permutation(len(self))
-> 3616 return self.select(
3617 indices=permutation,
3618 keep_in_memory=keep_in_memory,
3619 indices_cache_file_name=indices_cache_file_name if not keep_in_memory else None,
3620 writer_batch_size=writer_batch_size,
3621 new_fingerprint=new_fingerprint,
3622 )
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:551, in transmit_format.<locals>.wrapper(*args, **kwargs)
544 self_format = {
545 "type": self._format_type,
546 "format_kwargs": self._format_kwargs,
547 "columns": self._format_columns,
548 "output_all_columns": self._output_all_columns,
549 }
550 # apply actual function
--> 551 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
552 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
553 # re-apply format to the output
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
482 # Update fingerprint of in-place transforms + update in-place history of transforms
484 if inplace: # update after calling func so that the fingerprint doesn't change if the function fails
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:3266, in Dataset.select(self, indices, keep_in_memory, indices_cache_file_name, writer_batch_size, new_fingerprint)
3263 return self._select_contiguous(start, length, new_fingerprint=new_fingerprint)
3265 # If not contiguous, we need to create a new indices mapping
-> 3266 return self._select_with_indices_mapping(
3267 indices,
3268 keep_in_memory=keep_in_memory,
3269 indices_cache_file_name=indices_cache_file_name,
3270 writer_batch_size=writer_batch_size,
3271 new_fingerprint=new_fingerprint,
3272 )
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:551, in transmit_format.<locals>.wrapper(*args, **kwargs)
544 self_format = {
545 "type": self._format_type,
546 "format_kwargs": self._format_kwargs,
547 "columns": self._format_columns,
548 "output_all_columns": self._output_all_columns,
549 }
550 # apply actual function
--> 551 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
552 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
553 # re-apply format to the output
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
482 # Update fingerprint of in-place transforms + update in-place history of transforms
484 if inplace: # update after calling func so that the fingerprint doesn't change if the function fails
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:3389, in Dataset._select_with_indices_mapping(self, indices, keep_in_memory, indices_cache_file_name, writer_batch_size, new_fingerprint)
3387 logger.info(f"Caching indices mapping at {indices_cache_file_name}")
3388 tmp_file = tempfile.NamedTemporaryFile("wb", dir=os.path.dirname(indices_cache_file_name), delete=False)
-> 3389 writer = ArrowWriter(
3390 path=tmp_file.name, writer_batch_size=writer_batch_size, fingerprint=new_fingerprint, unit="indices"
3391 )
3393 indices = indices if isinstance(indices, list) else list(indices)
3395 size = len(self)
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_writer.py:315, in ArrowWriter.__init__(self, schema, features, path, stream, fingerprint, writer_batch_size, hash_salt, check_duplicates, disable_nullable, update_features, with_metadata, unit, embed_local_files, storage_options)
312 self._disable_nullable = disable_nullable
314 if stream is None:
--> 315 fs_token_paths = fsspec.get_fs_token_paths(path, storage_options=storage_options)
316 self._fs: fsspec.AbstractFileSystem = fs_token_paths[0]
317 self._path = (
318 fs_token_paths[2][0]
319 if not is_remote_filesystem(self._fs)
320 else self._fs.unstrip_protocol(fs_token_paths[2][0])
321 )
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/fsspec/core.py:593, in get_fs_token_paths(urlpath, mode, num, name_function, storage_options, protocol, expand)
591 else:
592 urlpath = stringify_path(urlpath)
--> 593 chain = _un_chain(urlpath, storage_options or {})
594 if len(chain) > 1:
595 inkwargs = {}
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/fsspec/core.py:330, in _un_chain(path, kwargs)
328 for bit in reversed(bits):
329 protocol = split_protocol(bit)[0] or "file"
--> 330 cls = get_filesystem_class(protocol)
331 extra_kwargs = cls._get_kwargs_from_urls(bit)
332 kws = kwargs.get(protocol, {})
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/fsspec/registry.py:240, in get_filesystem_class(protocol)
238 if protocol not in registry:
239 if protocol not in known_implementations:
--> 240 raise ValueError("Protocol not known: %s" % protocol)
241 bit = known_implementations[protocol]
242 try:
ValueError: Protocol not known: parent
```
This is what the `train_dataset` object looks like
```
Dataset({
features: ['label', 'input_ids', 'attention_mask'],
num_rows: 364166
})
```
### Steps to reproduce the bug
The `train_dataset` obj is created by concatenating two datasets
And then shuffle is called, but it throws the mentioned error.
### Expected behavior
Should shuffle the dataset properly.
### Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.15.0-1022-aws-x86_64-with-glibc2.31
- Python version: 3.9.13
- PyArrow version: 10.0.0
- Pandas version: 1.4.4
Hi ! The indices mapping is written in the same cachedirectory as your dataset.
Can you run this to show your current cache directory ?
```python
print(train_dataset.cache_files)
``` | [
0.047835830599069595,
-0.18612687289714813,
-0.026867803186178207,
0.20817533135414124,
0.3419860005378723,
-0.1306532770395279,
0.331752747297287,
0.4799611270427704,
-0.43398189544677734,
0.29154741764068604,
-0.2698074281215668,
0.4671919643878937,
-0.16841474175453186,
0.0033614952117204666,
-0.23843219876289368,
-0.15227018296718597,
-0.07050479203462601,
-0.008964478969573975,
-0.3150976300239563,
-0.13028158247470856,
-0.17720767855644226,
0.0071923453360795975,
-0.3541567921638489,
0.1923351287841797,
-0.3205759525299072,
-0.18364298343658447,
-0.056595489382743835,
0.21011638641357422,
-0.38363510370254517,
-0.12673735618591309,
0.012439003214240074,
0.1247226744890213,
-0.22799313068389893,
0.6120039224624634,
-0.00011005783744622022,
0.11885330080986023,
0.3035828471183777,
-0.15590673685073853,
-0.05855628103017807,
-0.2341224104166031,
0.1444924771785736,
0.4063204526901245,
-0.22031982243061066,
-0.31340962648391724,
0.0883491188287735,
-0.4563743472099304,
-0.18930058181285858,
-0.03906482458114624,
0.15957391262054443,
0.21781913936138153,
0.2722702622413635,
0.19682499766349792,
0.14161010086536407,
-0.13271474838256836,
0.49035632610321045,
0.029785573482513428,
0.09076996892690659,
0.4237038791179657,
-0.05566532909870148,
-0.0963156446814537,
-0.10683929175138474,
0.1723177134990692,
0.00547281838953495,
-0.2596152722835541,
0.015859872102737427,
-0.2856059968471527,
-0.04943589121103287,
-0.16242429614067078,
0.17355912923812866,
0.23439007997512817,
-0.012229636311531067,
-0.3027251064777374,
-0.21495237946510315,
0.027797624468803406,
-0.006819644942879677,
0.011769259348511696,
0.07042839378118515,
-0.06381341069936752,
-0.016463909298181534,
-0.07062222063541412,
-0.17682547867298126,
0.35790446400642395,
0.006482712924480438,
0.13838404417037964,
0.16435237228870392,
0.8071721792221069,
-0.07630445808172226,
0.138332337141037,
0.2864254117012024,
-0.049938447773456573,
0.609287440776825,
0.09146664291620255,
-0.016641221940517426,
-0.12831072509288788,
-0.19967351853847504,
-0.10649573802947998,
0.13760432600975037,
-0.1705639660358429,
-0.0614066943526268,
0.04803653061389923,
0.006141209974884987,
0.06911012530326843,
0.08100667595863342,
0.2838069796562195,
0.19858503341674805,
0.027514971792697906,
-0.07898714393377304,
0.2644622325897217,
-0.03839471936225891,
0.3138912320137024,
0.005603492259979248,
0.11577333509922028,
-0.03213982656598091,
-0.31357520818710327,
0.06296983361244202,
0.26522156596183777,
0.1793336719274521,
0.04250645264983177,
-0.06495525687932968,
-0.09335120022296906,
-0.2604014575481415,
-0.00514076417312026,
0.409233421087265,
0.4590299129486084,
-0.04615291953086853,
0.2567655146121979,
0.22099794447422028,
-0.065025195479393,
0.04505336284637451,
0.3796689212322235,
-0.36915475130081177,
0.30681103467941284,
-0.17551523447036743,
-0.0931800901889801,
-0.16554953157901764,
-0.266424298286438,
0.2958241403102875,
0.08555663377046585,
0.5256134271621704,
-0.20354978740215302,
-0.02500426396727562,
-0.2146940380334854,
0.36390841007232666,
0.10433786362409592,
-0.33705782890319824,
-0.19641879200935364,
0.21227172017097473,
0.11182591319084167,
-0.024405986070632935,
0.13563501834869385,
-0.38136518001556396,
-0.21923799812793732,
-0.04586195945739746,
0.2614027261734009,
0.08472928404808044,
0.21329054236412048,
-0.05548781901597977,
-0.26444512605667114,
0.2584216296672821,
-0.3082563281059265,
0.1532963216304779,
-0.34059005975723267,
-0.26563549041748047,
-0.2738938331604004,
0.24411535263061523,
-0.047520846128463745,
0.14441171288490295,
-0.05177180841565132,
0.08798976242542267,
0.019411306828260422,
0.28776904940605164,
0.2450418919324875,
-0.1718437522649765,
0.2793523669242859,
-0.2572733759880066,
0.022033430635929108,
0.264233261346817,
-0.13933296501636505,
-0.39881592988967896,
-0.37331604957580566,
-0.3634551167488098,
0.030912576243281364,
0.014338977634906769,
-0.000016237536328844726,
0.17098018527030945,
-0.1049906313419342,
0.4999423623085022,
0.1938161849975586,
0.010078264400362968,
0.1792529970407486,
-0.37079471349716187,
-0.1900002658367157,
-0.0019225142896175385,
0.050974491983652115,
-0.0114661306142807,
-0.0041571855545043945,
0.06259924918413162,
-0.18703937530517578,
0.27577662467956543,
-0.006609681993722916,
-0.008728349581360817,
-0.041968703269958496,
0.23737037181854248,
0.37101006507873535,
0.062059029936790466,
-0.22325864434242249,
0.14431801438331604,
0.008167311549186707,
-0.004871368408203125,
-0.11940489709377289,
-0.3901336193084717,
-0.2835361063480377,
-0.28685542941093445,
-0.18031050264835358,
-0.21307645738124847,
0.008921664208173752,
0.2867489159107208,
0.28267157077789307,
0.0895957499742508,
-0.1604864001274109,
-0.09522765874862671,
-0.20877034962177277,
-0.22031359374523163,
-0.11011488735675812,
-0.32235512137413025,
0.36553773283958435,
-0.22369690239429474,
-0.17150001227855682,
0.09192298352718353,
0.30712276697158813,
0.24502640962600708,
-0.14504271745681763,
-0.14261066913604736,
0.5353970527648926,
0.04933253675699234,
-0.13468502461910248,
-0.30727463960647583,
-0.12600286304950714,
-0.2881995737552643,
0.013915743678808212,
-0.11117018014192581,
-0.09992417693138123,
0.24633896350860596,
0.1061517670750618,
0.2140268087387085,
0.4727247357368469,
-0.3146163523197174,
-0.160023033618927,
0.12728187441825867,
-0.1511080265045166,
-0.08541519939899445,
0.13237330317497253,
0.016210470348596573,
-0.1083991527557373,
0.020435400307178497,
-0.0335795059800148,
0.11285287141799927,
-0.05622025579214096,
-0.05581354349851608,
-0.12579023838043213,
0.5248273015022278,
-0.03999922424554825,
0.14837712049484253,
-0.04251722991466522,
0.08514145761728287,
-0.021478459239006042,
-0.15466807782649994,
0.27875468134880066,
0.43200117349624634,
0.20396780967712402,
-0.017264004796743393,
0.09001930058002472,
0.10763004422187805,
-0.11800071597099304,
0.0684681311249733,
0.16086673736572266,
0.2924173176288605,
0.27479642629623413,
0.28255602717399597,
0.09211510419845581,
-0.34459930658340454,
-0.2485855519771576,
0.06467483192682266,
0.355633407831192,
-0.20300796627998352,
0.1679280400276184,
-0.283917635679245,
0.021640442311763763,
-0.11921671032905579,
-0.3731892704963684,
0.02805287390947342,
-0.17516274750232697,
0.09300558269023895,
0.35867416858673096,
-0.292418897151947,
0.3871227204799652,
0.3050159513950348,
0.10803145915269852,
0.1661432385444641,
-0.0956423431634903,
-0.03986542671918869,
-0.140584334731102,
0.06774149090051651,
0.1548852026462555,
0.137001171708107,
0.13258510828018188,
0.3269866108894348,
-0.11336205899715424,
-0.16057178378105164,
-0.06888578087091446,
-0.4212498962879181,
-0.011537916958332062,
-0.19044822454452515,
-0.18440832197666168,
0.1745770424604416,
0.030497580766677856,
-0.18702775239944458,
-0.6714723706245422,
0.2769984304904938,
-0.3319630026817322,
-0.2845994830131531,
0.24198728799819946,
0.09023568034172058,
-0.055377617478370667,
-0.2136031538248062,
-0.28006595373153687,
-0.31191548705101013,
-0.3620348274707794,
0.2756732702255249,
-0.25600627064704895,
0.2870362102985382,
0.14970722794532776,
0.08922773599624634,
0.07676098495721817,
-0.34905582666397095,
0.21340401470661163,
-0.2890651226043701,
-0.4546765089035034,
0.11702583730220795,
-0.06483510136604309,
-0.14778701961040497,
-0.4498138129711151,
-0.12943434715270996,
0.15502160787582397,
0.2760474681854248,
-0.1792602837085724,
-0.5086156129837036,
-0.1985594779253006,
-0.004664599895477295,
-0.06877455860376358,
0.10428843647241592,
0.6197788715362549,
0.15600299835205078,
-0.20283816754817963,
-0.008428972214460373,
-0.054406218230724335,
-0.10559079796075821,
0.022234883159399033,
0.004851125180721283,
-0.004929251968860626,
0.39048609137535095,
0.14584508538246155,
0.629821240901947,
-0.1856231540441513,
-0.1953442096710205,
0.03417491540312767,
-0.13738003373146057,
0.2570684254169464,
-0.24023666977882385,
-0.3542866110801697,
0.421562522649765,
0.09977584332227707,
0.03506061062216759,
0.12527164816856384,
-0.28723493218421936,
-0.01590132713317871,
-0.1579400897026062,
-0.034198563545942307,
-0.3009127974510193,
-0.24886681139469147,
0.21018940210342407,
0.20936867594718933,
0.051410309970378876,
-0.16517701745033264,
0.23950454592704773,
-0.08269867300987244,
0.04567860811948776,
0.07792569696903229,
0.2438957840204239,
-0.09011200815439224,
-0.18204118311405182,
-0.35850924253463745,
-0.33966708183288574,
0.12227870523929596,
0.20404145121574402,
0.31580284237861633,
0.5323000550270081,
0.021694760769605637,
-0.28514769673347473,
0.025164633989334106,
-0.044832468032836914,
0.4140889644622803,
0.17030000686645508,
0.22903700172901154,
0.2409670054912567,
-0.20190301537513733,
0.02436053566634655,
-0.24257558584213257,
-0.29345762729644775,
0.00022622477263212204,
0.20316681265830994,
0.42585375905036926,
-0.2097901701927185,
-0.018792973831295967,
0.1477457731962204,
-0.004525132477283478,
0.1463996320962906,
-0.19343388080596924,
-0.3849024772644043,
-0.43641769886016846,
-0.29644179344177246,
0.34097498655319214,
0.04703019559383392,
0.0788433626294136,
-0.2111232727766037,
-0.02280700020492077,
0.08125946670770645,
-0.211971253156662,
-0.0947255939245224,
0.14240731298923492,
0.19124552607536316,
0.1355707049369812,
-0.07530432194471359,
0.21516016125679016,
0.21308571100234985,
0.46069714426994324,
0.274954617023468,
0.12525857985019684,
-0.2817019820213318,
-0.01711994782090187,
0.07825803756713867,
0.00928470492362976,
0.26195815205574036,
-0.21311451494693756,
0.09421725571155548,
0.09151308238506317,
0.3543751835823059,
-0.023225702345371246,
-0.0984630212187767,
0.41068071126937866,
-0.2340961992740631,
-0.17465703189373016,
-0.4368714690208435,
0.1325254887342453,
0.053429003804922104,
-0.06960992515087128,
0.22745241224765778,
-0.2588205933570862,
-0.022818760946393013,
0.34238845109939575,
-0.06171946972608566,
1.0220216512680054,
0.0037200823426246643,
0.023582857102155685,
0.41660037636756897,
-0.0650750994682312,
0.37021347880363464,
0.11706814169883728,
0.1730031967163086,
-0.35517948865890503,
-0.6667205691337585,
0.05373653769493103,
-0.11413871496915817,
-0.011634081602096558,
-0.11286626756191254,
-0.32139554619789124,
0.1183953732252121,
-0.2373015284538269,
0.13205857574939728,
-0.11686249077320099,
-0.0814698189496994,
-0.0028520356863737106,
-0.024693530052900314,
-0.20033131539821625,
0.14321087300777435,
0.042284008115530014,
0.031075846403837204,
0.14192727208137512,
-0.15998968482017517,
-0.38843557238578796,
-0.24523212015628815,
0.013423353433609009,
0.1822681725025177,
-0.3210003674030304,
0.35194504261016846,
-0.04899422451853752,
0.1156405508518219,
-0.10829673707485199,
-0.12016625702381134,
0.0291474349796772,
0.24028930068016052,
0.15680000185966492,
0.15012328326702118,
0.48397326469421387,
0.06347719579935074,
0.04807215929031372,
0.05566179007291794,
0.12244588881731033,
-0.020092058926820755,
-0.2671782076358795,
0.1597754955291748,
0.17871002852916718,
-0.48183006048202515,
-0.19176936149597168,
0.09989336133003235,
0.2910398244857788,
-0.18063487112522125,
-0.034661151468753815,
-0.12699678540229797,
-0.2524389326572418,
-0.27941402792930603,
0.2138889878988266,
0.07065702974796295,
-0.2619982957839966,
0.19192105531692505,
0.13935977220535278,
-0.3279809355735779,
-0.005993884056806564,
0.6016950011253357,
0.13964520394802094,
0.1819649636745453,
0.35783156752586365,
-0.07141987979412079,
-0.23443877696990967,
-0.22314125299453735,
-0.005110990256071091,
-0.04900902137160301,
-0.30002298951148987,
0.0260540172457695,
0.08449171483516693,
-0.14361293613910675,
0.029609499499201775,
-0.039642173796892166,
0.05067742243409157,
0.3793732821941376,
-0.27801457047462463,
-0.41341328620910645,
-0.34763962030410767,
0.20339512825012207,
0.10247565060853958,
0.2412840873003006,
0.08489540964365005,
0.45725148916244507,
-0.2814626395702362,
0.16316552460193634,
-0.43070992827415466,
0.08923111110925674,
-0.20589570701122284,
0.28825482726097107,
-0.27525338530540466,
-0.27399516105651855,
-0.013292742893099785,
-0.11814658343791962,
0.2738058567047119,
0.2172648310661316,
-0.19901004433631897,
-0.25153648853302,
-0.07208568602800369,
0.09326532483100891,
0.06125449016690254,
0.03733734041452408,
-0.08802767843008041,
-0.16797074675559998,
-0.3849729597568512,
0.015127583406865597,
0.22310566902160645,
0.266020268201828,
0.06517323851585388,
0.1363770216703415,
0.41784927248954773,
-0.040789030492305756,
0.05482886731624603,
0.020274702459573746,
-0.28328821063041687,
-0.16271091997623444,
-0.16117221117019653,
-0.02017509937286377,
-0.3155484199523926,
-0.09893165528774261,
-0.14601537585258484,
0.06102339178323746,
-0.03340086340904236,
0.018809625878930092,
0.2721635699272156,
-0.07758225500583649,
-0.18526698648929596,
0.01752152293920517,
0.38151440024375916,
0.4930661916732788,
-0.2455110400915146,
-0.3326302468776703,
0.27520835399627686,
0.2593342363834381,
-0.23331697285175323,
-0.09594373404979706,
-0.07503113150596619,
0.24379216134548187,
0.19166184961795807,
0.1456782966852188,
-0.45296433568000793,
-0.2231985479593277,
-0.14964118599891663,
0.023901857435703278,
-0.03439648821949959,
-0.3925691843032837,
0.2763615846633911,
0.3282265365123749,
0.047179508954286575,
-0.23175887763500214,
0.2133137583732605,
-0.0568058080971241,
0.17236223816871643,
0.2291867882013321,
0.19677452743053436,
0.3610997200012207,
-0.023298390209674835,
-0.13340845704078674,
0.1995076835155487,
-0.34186452627182007,
0.06007952615618706,
0.4730905294418335,
-0.08209142088890076,
-0.05295763909816742,
0.09876976162195206,
0.3827473223209381,
-0.16187839210033417,
0.10719805955886841,
-0.02659216895699501,
0.14968737959861755,
-0.19386208057403564,
0.11529912054538727,
-0.04649908095598221,
-0.14177192747592926,
-0.5457470417022705,
-0.23663164675235748,
0.06673029810190201,
0.3558381199836731,
0.25894978642463684,
0.06247508525848389,
-0.30496370792388916,
-0.07485340535640717,
-0.4464350938796997,
0.2783905863761902,
0.298247754573822,
-0.31744715571403503,
0.1155843585729599,
0.5045300722122192,
0.018731147050857544,
0.3136763274669647,
0.3321564197540283,
0.4049181044101715,
0.41384249925613403,
0.07144090533256531,
0.08459534496068954,
-0.18638357520103455,
-0.1089431419968605,
0.07076319307088852,
0.21679313480854034,
0.3375431001186371,
-0.08498391509056091,
0.3205510079860687,
0.28479820489883423,
-0.3207145929336548,
0.022564204409718513,
0.20795799791812897,
0.24157561361789703,
0.010218434035778046,
0.4478912651538849,
-0.039320819079875946,
-0.056976623833179474,
-0.05562490224838257,
0.040614478290081024,
-0.6588220000267029,
-0.11921538412570953,
-0.26436448097229004,
0.21434631943702698,
0.22643879055976868,
-0.009412143379449844,
0.11173437535762787,
0.17122647166252136,
0.4282025396823883,
0.36276817321777344,
-0.19544652104377747,
0.018773874267935753,
-0.24981459975242615,
-0.38730156421661377,
0.32223355770111084,
0.012607801705598831,
-0.005187125876545906,
-0.03289814293384552,
-0.11916279047727585,
0.20055130124092102,
0.1775180846452713,
0.008914895355701447,
0.011593047529459,
-0.08634724467992783,
0.08056168258190155,
-0.3775831162929535,
0.12461386620998383,
-0.15303871035575867,
-0.17333313822746277,
0.25969433784484863,
-0.30602097511291504,
-0.05472125485539436,
-0.002120447810739279,
0.19789648056030273,
0.01054820604622364,
-0.17750221490859985,
-0.3321584165096283,
-0.16325001418590546,
0.2034669816493988,
0.021634839475154877,
0.3695112466812134,
-0.25876525044441223,
-0.057759352028369904,
0.018684275448322296,
-0.15570002794265747,
-0.10280069708824158,
0.2777843177318573,
0.4304589331150055,
0.500277042388916,
0.15229858458042145,
-0.43351414799690247,
-0.3012213706970215,
0.5658541917800903,
-0.28807976841926575,
-0.05282413959503174,
-0.2206488698720932,
0.2563704252243042,
0.07438085228204727,
0.06986445933580399,
-0.2023008167743683,
0.11858845502138138,
-0.0037254691123962402,
0.0927342101931572,
-0.2414751499891281,
-0.4919673502445221,
0.7703267931938171,
-0.17599815130233765,
-0.2825562357902527,
-0.28037604689598083,
0.276391863822937,
-0.07344213873147964,
0.01904640905559063,
-0.05563823878765106,
0.30745774507522583,
0.17877627909183502,
0.22868138551712036,
-0.03576427698135376,
0.1111324280500412,
-0.3340783417224884,
0.08558748662471771,
0.027907583862543106,
0.23245111107826233,
-0.015478312969207764,
-0.14509858191013336,
0.13012076914310455,
-0.13424237072467804
] |
https://github.com/huggingface/datasets/issues/5555 | `.shuffle` throwing error `ValueError: Protocol not known: parent` | ```
[{'filename': '.../train/dataset.arrow'}, {'filename': '.../train/dataset.arrow'}]
```
These are the actual paths where `.hf` files are stored. | ### Describe the bug
```
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In [16], line 1
----> 1 train_dataset = train_dataset.shuffle()
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:551, in transmit_format.<locals>.wrapper(*args, **kwargs)
544 self_format = {
545 "type": self._format_type,
546 "format_kwargs": self._format_kwargs,
547 "columns": self._format_columns,
548 "output_all_columns": self._output_all_columns,
549 }
550 # apply actual function
--> 551 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
552 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
553 # re-apply format to the output
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
482 # Update fingerprint of in-place transforms + update in-place history of transforms
484 if inplace: # update after calling func so that the fingerprint doesn't change if the function fails
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:3616, in Dataset.shuffle(self, seed, generator, keep_in_memory, load_from_cache_file, indices_cache_file_name, writer_batch_size, new_fingerprint)
3610 return self._new_dataset_with_indices(
3611 fingerprint=new_fingerprint, indices_cache_file_name=indices_cache_file_name
3612 )
3614 permutation = generator.permutation(len(self))
-> 3616 return self.select(
3617 indices=permutation,
3618 keep_in_memory=keep_in_memory,
3619 indices_cache_file_name=indices_cache_file_name if not keep_in_memory else None,
3620 writer_batch_size=writer_batch_size,
3621 new_fingerprint=new_fingerprint,
3622 )
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:551, in transmit_format.<locals>.wrapper(*args, **kwargs)
544 self_format = {
545 "type": self._format_type,
546 "format_kwargs": self._format_kwargs,
547 "columns": self._format_columns,
548 "output_all_columns": self._output_all_columns,
549 }
550 # apply actual function
--> 551 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
552 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
553 # re-apply format to the output
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
482 # Update fingerprint of in-place transforms + update in-place history of transforms
484 if inplace: # update after calling func so that the fingerprint doesn't change if the function fails
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:3266, in Dataset.select(self, indices, keep_in_memory, indices_cache_file_name, writer_batch_size, new_fingerprint)
3263 return self._select_contiguous(start, length, new_fingerprint=new_fingerprint)
3265 # If not contiguous, we need to create a new indices mapping
-> 3266 return self._select_with_indices_mapping(
3267 indices,
3268 keep_in_memory=keep_in_memory,
3269 indices_cache_file_name=indices_cache_file_name,
3270 writer_batch_size=writer_batch_size,
3271 new_fingerprint=new_fingerprint,
3272 )
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:551, in transmit_format.<locals>.wrapper(*args, **kwargs)
544 self_format = {
545 "type": self._format_type,
546 "format_kwargs": self._format_kwargs,
547 "columns": self._format_columns,
548 "output_all_columns": self._output_all_columns,
549 }
550 # apply actual function
--> 551 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
552 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
553 # re-apply format to the output
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
482 # Update fingerprint of in-place transforms + update in-place history of transforms
484 if inplace: # update after calling func so that the fingerprint doesn't change if the function fails
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:3389, in Dataset._select_with_indices_mapping(self, indices, keep_in_memory, indices_cache_file_name, writer_batch_size, new_fingerprint)
3387 logger.info(f"Caching indices mapping at {indices_cache_file_name}")
3388 tmp_file = tempfile.NamedTemporaryFile("wb", dir=os.path.dirname(indices_cache_file_name), delete=False)
-> 3389 writer = ArrowWriter(
3390 path=tmp_file.name, writer_batch_size=writer_batch_size, fingerprint=new_fingerprint, unit="indices"
3391 )
3393 indices = indices if isinstance(indices, list) else list(indices)
3395 size = len(self)
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_writer.py:315, in ArrowWriter.__init__(self, schema, features, path, stream, fingerprint, writer_batch_size, hash_salt, check_duplicates, disable_nullable, update_features, with_metadata, unit, embed_local_files, storage_options)
312 self._disable_nullable = disable_nullable
314 if stream is None:
--> 315 fs_token_paths = fsspec.get_fs_token_paths(path, storage_options=storage_options)
316 self._fs: fsspec.AbstractFileSystem = fs_token_paths[0]
317 self._path = (
318 fs_token_paths[2][0]
319 if not is_remote_filesystem(self._fs)
320 else self._fs.unstrip_protocol(fs_token_paths[2][0])
321 )
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/fsspec/core.py:593, in get_fs_token_paths(urlpath, mode, num, name_function, storage_options, protocol, expand)
591 else:
592 urlpath = stringify_path(urlpath)
--> 593 chain = _un_chain(urlpath, storage_options or {})
594 if len(chain) > 1:
595 inkwargs = {}
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/fsspec/core.py:330, in _un_chain(path, kwargs)
328 for bit in reversed(bits):
329 protocol = split_protocol(bit)[0] or "file"
--> 330 cls = get_filesystem_class(protocol)
331 extra_kwargs = cls._get_kwargs_from_urls(bit)
332 kws = kwargs.get(protocol, {})
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/fsspec/registry.py:240, in get_filesystem_class(protocol)
238 if protocol not in registry:
239 if protocol not in known_implementations:
--> 240 raise ValueError("Protocol not known: %s" % protocol)
241 bit = known_implementations[protocol]
242 try:
ValueError: Protocol not known: parent
```
This is what the `train_dataset` object looks like
```
Dataset({
features: ['label', 'input_ids', 'attention_mask'],
num_rows: 364166
})
```
### Steps to reproduce the bug
The `train_dataset` obj is created by concatenating two datasets
And then shuffle is called, but it throws the mentioned error.
### Expected behavior
Should shuffle the dataset properly.
### Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.15.0-1022-aws-x86_64-with-glibc2.31
- Python version: 3.9.13
- PyArrow version: 10.0.0
- Pandas version: 1.4.4
| 16 | `.shuffle` throwing error `ValueError: Protocol not known: parent`
### Describe the bug
```
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In [16], line 1
----> 1 train_dataset = train_dataset.shuffle()
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:551, in transmit_format.<locals>.wrapper(*args, **kwargs)
544 self_format = {
545 "type": self._format_type,
546 "format_kwargs": self._format_kwargs,
547 "columns": self._format_columns,
548 "output_all_columns": self._output_all_columns,
549 }
550 # apply actual function
--> 551 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
552 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
553 # re-apply format to the output
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
482 # Update fingerprint of in-place transforms + update in-place history of transforms
484 if inplace: # update after calling func so that the fingerprint doesn't change if the function fails
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:3616, in Dataset.shuffle(self, seed, generator, keep_in_memory, load_from_cache_file, indices_cache_file_name, writer_batch_size, new_fingerprint)
3610 return self._new_dataset_with_indices(
3611 fingerprint=new_fingerprint, indices_cache_file_name=indices_cache_file_name
3612 )
3614 permutation = generator.permutation(len(self))
-> 3616 return self.select(
3617 indices=permutation,
3618 keep_in_memory=keep_in_memory,
3619 indices_cache_file_name=indices_cache_file_name if not keep_in_memory else None,
3620 writer_batch_size=writer_batch_size,
3621 new_fingerprint=new_fingerprint,
3622 )
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:551, in transmit_format.<locals>.wrapper(*args, **kwargs)
544 self_format = {
545 "type": self._format_type,
546 "format_kwargs": self._format_kwargs,
547 "columns": self._format_columns,
548 "output_all_columns": self._output_all_columns,
549 }
550 # apply actual function
--> 551 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
552 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
553 # re-apply format to the output
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
482 # Update fingerprint of in-place transforms + update in-place history of transforms
484 if inplace: # update after calling func so that the fingerprint doesn't change if the function fails
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:3266, in Dataset.select(self, indices, keep_in_memory, indices_cache_file_name, writer_batch_size, new_fingerprint)
3263 return self._select_contiguous(start, length, new_fingerprint=new_fingerprint)
3265 # If not contiguous, we need to create a new indices mapping
-> 3266 return self._select_with_indices_mapping(
3267 indices,
3268 keep_in_memory=keep_in_memory,
3269 indices_cache_file_name=indices_cache_file_name,
3270 writer_batch_size=writer_batch_size,
3271 new_fingerprint=new_fingerprint,
3272 )
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:551, in transmit_format.<locals>.wrapper(*args, **kwargs)
544 self_format = {
545 "type": self._format_type,
546 "format_kwargs": self._format_kwargs,
547 "columns": self._format_columns,
548 "output_all_columns": self._output_all_columns,
549 }
550 # apply actual function
--> 551 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
552 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
553 # re-apply format to the output
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
482 # Update fingerprint of in-place transforms + update in-place history of transforms
484 if inplace: # update after calling func so that the fingerprint doesn't change if the function fails
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:3389, in Dataset._select_with_indices_mapping(self, indices, keep_in_memory, indices_cache_file_name, writer_batch_size, new_fingerprint)
3387 logger.info(f"Caching indices mapping at {indices_cache_file_name}")
3388 tmp_file = tempfile.NamedTemporaryFile("wb", dir=os.path.dirname(indices_cache_file_name), delete=False)
-> 3389 writer = ArrowWriter(
3390 path=tmp_file.name, writer_batch_size=writer_batch_size, fingerprint=new_fingerprint, unit="indices"
3391 )
3393 indices = indices if isinstance(indices, list) else list(indices)
3395 size = len(self)
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_writer.py:315, in ArrowWriter.__init__(self, schema, features, path, stream, fingerprint, writer_batch_size, hash_salt, check_duplicates, disable_nullable, update_features, with_metadata, unit, embed_local_files, storage_options)
312 self._disable_nullable = disable_nullable
314 if stream is None:
--> 315 fs_token_paths = fsspec.get_fs_token_paths(path, storage_options=storage_options)
316 self._fs: fsspec.AbstractFileSystem = fs_token_paths[0]
317 self._path = (
318 fs_token_paths[2][0]
319 if not is_remote_filesystem(self._fs)
320 else self._fs.unstrip_protocol(fs_token_paths[2][0])
321 )
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/fsspec/core.py:593, in get_fs_token_paths(urlpath, mode, num, name_function, storage_options, protocol, expand)
591 else:
592 urlpath = stringify_path(urlpath)
--> 593 chain = _un_chain(urlpath, storage_options or {})
594 if len(chain) > 1:
595 inkwargs = {}
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/fsspec/core.py:330, in _un_chain(path, kwargs)
328 for bit in reversed(bits):
329 protocol = split_protocol(bit)[0] or "file"
--> 330 cls = get_filesystem_class(protocol)
331 extra_kwargs = cls._get_kwargs_from_urls(bit)
332 kws = kwargs.get(protocol, {})
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/fsspec/registry.py:240, in get_filesystem_class(protocol)
238 if protocol not in registry:
239 if protocol not in known_implementations:
--> 240 raise ValueError("Protocol not known: %s" % protocol)
241 bit = known_implementations[protocol]
242 try:
ValueError: Protocol not known: parent
```
This is what the `train_dataset` object looks like
```
Dataset({
features: ['label', 'input_ids', 'attention_mask'],
num_rows: 364166
})
```
### Steps to reproduce the bug
The `train_dataset` obj is created by concatenating two datasets
And then shuffle is called, but it throws the mentioned error.
### Expected behavior
Should shuffle the dataset properly.
### Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.15.0-1022-aws-x86_64-with-glibc2.31
- Python version: 3.9.13
- PyArrow version: 10.0.0
- Pandas version: 1.4.4
```
[{'filename': '.../train/dataset.arrow'}, {'filename': '.../train/dataset.arrow'}]
```
These are the actual paths where `.hf` files are stored. | [
0.047835830599069595,
-0.18612687289714813,
-0.026867803186178207,
0.20817533135414124,
0.3419860005378723,
-0.1306532770395279,
0.331752747297287,
0.4799611270427704,
-0.43398189544677734,
0.29154741764068604,
-0.2698074281215668,
0.4671919643878937,
-0.16841474175453186,
0.0033614952117204666,
-0.23843219876289368,
-0.15227018296718597,
-0.07050479203462601,
-0.008964478969573975,
-0.3150976300239563,
-0.13028158247470856,
-0.17720767855644226,
0.0071923453360795975,
-0.3541567921638489,
0.1923351287841797,
-0.3205759525299072,
-0.18364298343658447,
-0.056595489382743835,
0.21011638641357422,
-0.38363510370254517,
-0.12673735618591309,
0.012439003214240074,
0.1247226744890213,
-0.22799313068389893,
0.6120039224624634,
-0.00011005783744622022,
0.11885330080986023,
0.3035828471183777,
-0.15590673685073853,
-0.05855628103017807,
-0.2341224104166031,
0.1444924771785736,
0.4063204526901245,
-0.22031982243061066,
-0.31340962648391724,
0.0883491188287735,
-0.4563743472099304,
-0.18930058181285858,
-0.03906482458114624,
0.15957391262054443,
0.21781913936138153,
0.2722702622413635,
0.19682499766349792,
0.14161010086536407,
-0.13271474838256836,
0.49035632610321045,
0.029785573482513428,
0.09076996892690659,
0.4237038791179657,
-0.05566532909870148,
-0.0963156446814537,
-0.10683929175138474,
0.1723177134990692,
0.00547281838953495,
-0.2596152722835541,
0.015859872102737427,
-0.2856059968471527,
-0.04943589121103287,
-0.16242429614067078,
0.17355912923812866,
0.23439007997512817,
-0.012229636311531067,
-0.3027251064777374,
-0.21495237946510315,
0.027797624468803406,
-0.006819644942879677,
0.011769259348511696,
0.07042839378118515,
-0.06381341069936752,
-0.016463909298181534,
-0.07062222063541412,
-0.17682547867298126,
0.35790446400642395,
0.006482712924480438,
0.13838404417037964,
0.16435237228870392,
0.8071721792221069,
-0.07630445808172226,
0.138332337141037,
0.2864254117012024,
-0.049938447773456573,
0.609287440776825,
0.09146664291620255,
-0.016641221940517426,
-0.12831072509288788,
-0.19967351853847504,
-0.10649573802947998,
0.13760432600975037,
-0.1705639660358429,
-0.0614066943526268,
0.04803653061389923,
0.006141209974884987,
0.06911012530326843,
0.08100667595863342,
0.2838069796562195,
0.19858503341674805,
0.027514971792697906,
-0.07898714393377304,
0.2644622325897217,
-0.03839471936225891,
0.3138912320137024,
0.005603492259979248,
0.11577333509922028,
-0.03213982656598091,
-0.31357520818710327,
0.06296983361244202,
0.26522156596183777,
0.1793336719274521,
0.04250645264983177,
-0.06495525687932968,
-0.09335120022296906,
-0.2604014575481415,
-0.00514076417312026,
0.409233421087265,
0.4590299129486084,
-0.04615291953086853,
0.2567655146121979,
0.22099794447422028,
-0.065025195479393,
0.04505336284637451,
0.3796689212322235,
-0.36915475130081177,
0.30681103467941284,
-0.17551523447036743,
-0.0931800901889801,
-0.16554953157901764,
-0.266424298286438,
0.2958241403102875,
0.08555663377046585,
0.5256134271621704,
-0.20354978740215302,
-0.02500426396727562,
-0.2146940380334854,
0.36390841007232666,
0.10433786362409592,
-0.33705782890319824,
-0.19641879200935364,
0.21227172017097473,
0.11182591319084167,
-0.024405986070632935,
0.13563501834869385,
-0.38136518001556396,
-0.21923799812793732,
-0.04586195945739746,
0.2614027261734009,
0.08472928404808044,
0.21329054236412048,
-0.05548781901597977,
-0.26444512605667114,
0.2584216296672821,
-0.3082563281059265,
0.1532963216304779,
-0.34059005975723267,
-0.26563549041748047,
-0.2738938331604004,
0.24411535263061523,
-0.047520846128463745,
0.14441171288490295,
-0.05177180841565132,
0.08798976242542267,
0.019411306828260422,
0.28776904940605164,
0.2450418919324875,
-0.1718437522649765,
0.2793523669242859,
-0.2572733759880066,
0.022033430635929108,
0.264233261346817,
-0.13933296501636505,
-0.39881592988967896,
-0.37331604957580566,
-0.3634551167488098,
0.030912576243281364,
0.014338977634906769,
-0.000016237536328844726,
0.17098018527030945,
-0.1049906313419342,
0.4999423623085022,
0.1938161849975586,
0.010078264400362968,
0.1792529970407486,
-0.37079471349716187,
-0.1900002658367157,
-0.0019225142896175385,
0.050974491983652115,
-0.0114661306142807,
-0.0041571855545043945,
0.06259924918413162,
-0.18703937530517578,
0.27577662467956543,
-0.006609681993722916,
-0.008728349581360817,
-0.041968703269958496,
0.23737037181854248,
0.37101006507873535,
0.062059029936790466,
-0.22325864434242249,
0.14431801438331604,
0.008167311549186707,
-0.004871368408203125,
-0.11940489709377289,
-0.3901336193084717,
-0.2835361063480377,
-0.28685542941093445,
-0.18031050264835358,
-0.21307645738124847,
0.008921664208173752,
0.2867489159107208,
0.28267157077789307,
0.0895957499742508,
-0.1604864001274109,
-0.09522765874862671,
-0.20877034962177277,
-0.22031359374523163,
-0.11011488735675812,
-0.32235512137413025,
0.36553773283958435,
-0.22369690239429474,
-0.17150001227855682,
0.09192298352718353,
0.30712276697158813,
0.24502640962600708,
-0.14504271745681763,
-0.14261066913604736,
0.5353970527648926,
0.04933253675699234,
-0.13468502461910248,
-0.30727463960647583,
-0.12600286304950714,
-0.2881995737552643,
0.013915743678808212,
-0.11117018014192581,
-0.09992417693138123,
0.24633896350860596,
0.1061517670750618,
0.2140268087387085,
0.4727247357368469,
-0.3146163523197174,
-0.160023033618927,
0.12728187441825867,
-0.1511080265045166,
-0.08541519939899445,
0.13237330317497253,
0.016210470348596573,
-0.1083991527557373,
0.020435400307178497,
-0.0335795059800148,
0.11285287141799927,
-0.05622025579214096,
-0.05581354349851608,
-0.12579023838043213,
0.5248273015022278,
-0.03999922424554825,
0.14837712049484253,
-0.04251722991466522,
0.08514145761728287,
-0.021478459239006042,
-0.15466807782649994,
0.27875468134880066,
0.43200117349624634,
0.20396780967712402,
-0.017264004796743393,
0.09001930058002472,
0.10763004422187805,
-0.11800071597099304,
0.0684681311249733,
0.16086673736572266,
0.2924173176288605,
0.27479642629623413,
0.28255602717399597,
0.09211510419845581,
-0.34459930658340454,
-0.2485855519771576,
0.06467483192682266,
0.355633407831192,
-0.20300796627998352,
0.1679280400276184,
-0.283917635679245,
0.021640442311763763,
-0.11921671032905579,
-0.3731892704963684,
0.02805287390947342,
-0.17516274750232697,
0.09300558269023895,
0.35867416858673096,
-0.292418897151947,
0.3871227204799652,
0.3050159513950348,
0.10803145915269852,
0.1661432385444641,
-0.0956423431634903,
-0.03986542671918869,
-0.140584334731102,
0.06774149090051651,
0.1548852026462555,
0.137001171708107,
0.13258510828018188,
0.3269866108894348,
-0.11336205899715424,
-0.16057178378105164,
-0.06888578087091446,
-0.4212498962879181,
-0.011537916958332062,
-0.19044822454452515,
-0.18440832197666168,
0.1745770424604416,
0.030497580766677856,
-0.18702775239944458,
-0.6714723706245422,
0.2769984304904938,
-0.3319630026817322,
-0.2845994830131531,
0.24198728799819946,
0.09023568034172058,
-0.055377617478370667,
-0.2136031538248062,
-0.28006595373153687,
-0.31191548705101013,
-0.3620348274707794,
0.2756732702255249,
-0.25600627064704895,
0.2870362102985382,
0.14970722794532776,
0.08922773599624634,
0.07676098495721817,
-0.34905582666397095,
0.21340401470661163,
-0.2890651226043701,
-0.4546765089035034,
0.11702583730220795,
-0.06483510136604309,
-0.14778701961040497,
-0.4498138129711151,
-0.12943434715270996,
0.15502160787582397,
0.2760474681854248,
-0.1792602837085724,
-0.5086156129837036,
-0.1985594779253006,
-0.004664599895477295,
-0.06877455860376358,
0.10428843647241592,
0.6197788715362549,
0.15600299835205078,
-0.20283816754817963,
-0.008428972214460373,
-0.054406218230724335,
-0.10559079796075821,
0.022234883159399033,
0.004851125180721283,
-0.004929251968860626,
0.39048609137535095,
0.14584508538246155,
0.629821240901947,
-0.1856231540441513,
-0.1953442096710205,
0.03417491540312767,
-0.13738003373146057,
0.2570684254169464,
-0.24023666977882385,
-0.3542866110801697,
0.421562522649765,
0.09977584332227707,
0.03506061062216759,
0.12527164816856384,
-0.28723493218421936,
-0.01590132713317871,
-0.1579400897026062,
-0.034198563545942307,
-0.3009127974510193,
-0.24886681139469147,
0.21018940210342407,
0.20936867594718933,
0.051410309970378876,
-0.16517701745033264,
0.23950454592704773,
-0.08269867300987244,
0.04567860811948776,
0.07792569696903229,
0.2438957840204239,
-0.09011200815439224,
-0.18204118311405182,
-0.35850924253463745,
-0.33966708183288574,
0.12227870523929596,
0.20404145121574402,
0.31580284237861633,
0.5323000550270081,
0.021694760769605637,
-0.28514769673347473,
0.025164633989334106,
-0.044832468032836914,
0.4140889644622803,
0.17030000686645508,
0.22903700172901154,
0.2409670054912567,
-0.20190301537513733,
0.02436053566634655,
-0.24257558584213257,
-0.29345762729644775,
0.00022622477263212204,
0.20316681265830994,
0.42585375905036926,
-0.2097901701927185,
-0.018792973831295967,
0.1477457731962204,
-0.004525132477283478,
0.1463996320962906,
-0.19343388080596924,
-0.3849024772644043,
-0.43641769886016846,
-0.29644179344177246,
0.34097498655319214,
0.04703019559383392,
0.0788433626294136,
-0.2111232727766037,
-0.02280700020492077,
0.08125946670770645,
-0.211971253156662,
-0.0947255939245224,
0.14240731298923492,
0.19124552607536316,
0.1355707049369812,
-0.07530432194471359,
0.21516016125679016,
0.21308571100234985,
0.46069714426994324,
0.274954617023468,
0.12525857985019684,
-0.2817019820213318,
-0.01711994782090187,
0.07825803756713867,
0.00928470492362976,
0.26195815205574036,
-0.21311451494693756,
0.09421725571155548,
0.09151308238506317,
0.3543751835823059,
-0.023225702345371246,
-0.0984630212187767,
0.41068071126937866,
-0.2340961992740631,
-0.17465703189373016,
-0.4368714690208435,
0.1325254887342453,
0.053429003804922104,
-0.06960992515087128,
0.22745241224765778,
-0.2588205933570862,
-0.022818760946393013,
0.34238845109939575,
-0.06171946972608566,
1.0220216512680054,
0.0037200823426246643,
0.023582857102155685,
0.41660037636756897,
-0.0650750994682312,
0.37021347880363464,
0.11706814169883728,
0.1730031967163086,
-0.35517948865890503,
-0.6667205691337585,
0.05373653769493103,
-0.11413871496915817,
-0.011634081602096558,
-0.11286626756191254,
-0.32139554619789124,
0.1183953732252121,
-0.2373015284538269,
0.13205857574939728,
-0.11686249077320099,
-0.0814698189496994,
-0.0028520356863737106,
-0.024693530052900314,
-0.20033131539821625,
0.14321087300777435,
0.042284008115530014,
0.031075846403837204,
0.14192727208137512,
-0.15998968482017517,
-0.38843557238578796,
-0.24523212015628815,
0.013423353433609009,
0.1822681725025177,
-0.3210003674030304,
0.35194504261016846,
-0.04899422451853752,
0.1156405508518219,
-0.10829673707485199,
-0.12016625702381134,
0.0291474349796772,
0.24028930068016052,
0.15680000185966492,
0.15012328326702118,
0.48397326469421387,
0.06347719579935074,
0.04807215929031372,
0.05566179007291794,
0.12244588881731033,
-0.020092058926820755,
-0.2671782076358795,
0.1597754955291748,
0.17871002852916718,
-0.48183006048202515,
-0.19176936149597168,
0.09989336133003235,
0.2910398244857788,
-0.18063487112522125,
-0.034661151468753815,
-0.12699678540229797,
-0.2524389326572418,
-0.27941402792930603,
0.2138889878988266,
0.07065702974796295,
-0.2619982957839966,
0.19192105531692505,
0.13935977220535278,
-0.3279809355735779,
-0.005993884056806564,
0.6016950011253357,
0.13964520394802094,
0.1819649636745453,
0.35783156752586365,
-0.07141987979412079,
-0.23443877696990967,
-0.22314125299453735,
-0.005110990256071091,
-0.04900902137160301,
-0.30002298951148987,
0.0260540172457695,
0.08449171483516693,
-0.14361293613910675,
0.029609499499201775,
-0.039642173796892166,
0.05067742243409157,
0.3793732821941376,
-0.27801457047462463,
-0.41341328620910645,
-0.34763962030410767,
0.20339512825012207,
0.10247565060853958,
0.2412840873003006,
0.08489540964365005,
0.45725148916244507,
-0.2814626395702362,
0.16316552460193634,
-0.43070992827415466,
0.08923111110925674,
-0.20589570701122284,
0.28825482726097107,
-0.27525338530540466,
-0.27399516105651855,
-0.013292742893099785,
-0.11814658343791962,
0.2738058567047119,
0.2172648310661316,
-0.19901004433631897,
-0.25153648853302,
-0.07208568602800369,
0.09326532483100891,
0.06125449016690254,
0.03733734041452408,
-0.08802767843008041,
-0.16797074675559998,
-0.3849729597568512,
0.015127583406865597,
0.22310566902160645,
0.266020268201828,
0.06517323851585388,
0.1363770216703415,
0.41784927248954773,
-0.040789030492305756,
0.05482886731624603,
0.020274702459573746,
-0.28328821063041687,
-0.16271091997623444,
-0.16117221117019653,
-0.02017509937286377,
-0.3155484199523926,
-0.09893165528774261,
-0.14601537585258484,
0.06102339178323746,
-0.03340086340904236,
0.018809625878930092,
0.2721635699272156,
-0.07758225500583649,
-0.18526698648929596,
0.01752152293920517,
0.38151440024375916,
0.4930661916732788,
-0.2455110400915146,
-0.3326302468776703,
0.27520835399627686,
0.2593342363834381,
-0.23331697285175323,
-0.09594373404979706,
-0.07503113150596619,
0.24379216134548187,
0.19166184961795807,
0.1456782966852188,
-0.45296433568000793,
-0.2231985479593277,
-0.14964118599891663,
0.023901857435703278,
-0.03439648821949959,
-0.3925691843032837,
0.2763615846633911,
0.3282265365123749,
0.047179508954286575,
-0.23175887763500214,
0.2133137583732605,
-0.0568058080971241,
0.17236223816871643,
0.2291867882013321,
0.19677452743053436,
0.3610997200012207,
-0.023298390209674835,
-0.13340845704078674,
0.1995076835155487,
-0.34186452627182007,
0.06007952615618706,
0.4730905294418335,
-0.08209142088890076,
-0.05295763909816742,
0.09876976162195206,
0.3827473223209381,
-0.16187839210033417,
0.10719805955886841,
-0.02659216895699501,
0.14968737959861755,
-0.19386208057403564,
0.11529912054538727,
-0.04649908095598221,
-0.14177192747592926,
-0.5457470417022705,
-0.23663164675235748,
0.06673029810190201,
0.3558381199836731,
0.25894978642463684,
0.06247508525848389,
-0.30496370792388916,
-0.07485340535640717,
-0.4464350938796997,
0.2783905863761902,
0.298247754573822,
-0.31744715571403503,
0.1155843585729599,
0.5045300722122192,
0.018731147050857544,
0.3136763274669647,
0.3321564197540283,
0.4049181044101715,
0.41384249925613403,
0.07144090533256531,
0.08459534496068954,
-0.18638357520103455,
-0.1089431419968605,
0.07076319307088852,
0.21679313480854034,
0.3375431001186371,
-0.08498391509056091,
0.3205510079860687,
0.28479820489883423,
-0.3207145929336548,
0.022564204409718513,
0.20795799791812897,
0.24157561361789703,
0.010218434035778046,
0.4478912651538849,
-0.039320819079875946,
-0.056976623833179474,
-0.05562490224838257,
0.040614478290081024,
-0.6588220000267029,
-0.11921538412570953,
-0.26436448097229004,
0.21434631943702698,
0.22643879055976868,
-0.009412143379449844,
0.11173437535762787,
0.17122647166252136,
0.4282025396823883,
0.36276817321777344,
-0.19544652104377747,
0.018773874267935753,
-0.24981459975242615,
-0.38730156421661377,
0.32223355770111084,
0.012607801705598831,
-0.005187125876545906,
-0.03289814293384552,
-0.11916279047727585,
0.20055130124092102,
0.1775180846452713,
0.008914895355701447,
0.011593047529459,
-0.08634724467992783,
0.08056168258190155,
-0.3775831162929535,
0.12461386620998383,
-0.15303871035575867,
-0.17333313822746277,
0.25969433784484863,
-0.30602097511291504,
-0.05472125485539436,
-0.002120447810739279,
0.19789648056030273,
0.01054820604622364,
-0.17750221490859985,
-0.3321584165096283,
-0.16325001418590546,
0.2034669816493988,
0.021634839475154877,
0.3695112466812134,
-0.25876525044441223,
-0.057759352028369904,
0.018684275448322296,
-0.15570002794265747,
-0.10280069708824158,
0.2777843177318573,
0.4304589331150055,
0.500277042388916,
0.15229858458042145,
-0.43351414799690247,
-0.3012213706970215,
0.5658541917800903,
-0.28807976841926575,
-0.05282413959503174,
-0.2206488698720932,
0.2563704252243042,
0.07438085228204727,
0.06986445933580399,
-0.2023008167743683,
0.11858845502138138,
-0.0037254691123962402,
0.0927342101931572,
-0.2414751499891281,
-0.4919673502445221,
0.7703267931938171,
-0.17599815130233765,
-0.2825562357902527,
-0.28037604689598083,
0.276391863822937,
-0.07344213873147964,
0.01904640905559063,
-0.05563823878765106,
0.30745774507522583,
0.17877627909183502,
0.22868138551712036,
-0.03576427698135376,
0.1111324280500412,
-0.3340783417224884,
0.08558748662471771,
0.027907583862543106,
0.23245111107826233,
-0.015478312969207764,
-0.14509858191013336,
0.13012076914310455,
-0.13424237072467804
] |
https://github.com/huggingface/datasets/issues/5555 | `.shuffle` throwing error `ValueError: Protocol not known: parent` | I'm not aware of any `.hf` file ? What are you referring to ?
Also the error says "Protocol unknown: parent". Is there a chance you may have ended up with a path that contains this string `parent://` ? | ### Describe the bug
```
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In [16], line 1
----> 1 train_dataset = train_dataset.shuffle()
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:551, in transmit_format.<locals>.wrapper(*args, **kwargs)
544 self_format = {
545 "type": self._format_type,
546 "format_kwargs": self._format_kwargs,
547 "columns": self._format_columns,
548 "output_all_columns": self._output_all_columns,
549 }
550 # apply actual function
--> 551 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
552 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
553 # re-apply format to the output
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
482 # Update fingerprint of in-place transforms + update in-place history of transforms
484 if inplace: # update after calling func so that the fingerprint doesn't change if the function fails
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:3616, in Dataset.shuffle(self, seed, generator, keep_in_memory, load_from_cache_file, indices_cache_file_name, writer_batch_size, new_fingerprint)
3610 return self._new_dataset_with_indices(
3611 fingerprint=new_fingerprint, indices_cache_file_name=indices_cache_file_name
3612 )
3614 permutation = generator.permutation(len(self))
-> 3616 return self.select(
3617 indices=permutation,
3618 keep_in_memory=keep_in_memory,
3619 indices_cache_file_name=indices_cache_file_name if not keep_in_memory else None,
3620 writer_batch_size=writer_batch_size,
3621 new_fingerprint=new_fingerprint,
3622 )
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:551, in transmit_format.<locals>.wrapper(*args, **kwargs)
544 self_format = {
545 "type": self._format_type,
546 "format_kwargs": self._format_kwargs,
547 "columns": self._format_columns,
548 "output_all_columns": self._output_all_columns,
549 }
550 # apply actual function
--> 551 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
552 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
553 # re-apply format to the output
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
482 # Update fingerprint of in-place transforms + update in-place history of transforms
484 if inplace: # update after calling func so that the fingerprint doesn't change if the function fails
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:3266, in Dataset.select(self, indices, keep_in_memory, indices_cache_file_name, writer_batch_size, new_fingerprint)
3263 return self._select_contiguous(start, length, new_fingerprint=new_fingerprint)
3265 # If not contiguous, we need to create a new indices mapping
-> 3266 return self._select_with_indices_mapping(
3267 indices,
3268 keep_in_memory=keep_in_memory,
3269 indices_cache_file_name=indices_cache_file_name,
3270 writer_batch_size=writer_batch_size,
3271 new_fingerprint=new_fingerprint,
3272 )
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:551, in transmit_format.<locals>.wrapper(*args, **kwargs)
544 self_format = {
545 "type": self._format_type,
546 "format_kwargs": self._format_kwargs,
547 "columns": self._format_columns,
548 "output_all_columns": self._output_all_columns,
549 }
550 # apply actual function
--> 551 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
552 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
553 # re-apply format to the output
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
482 # Update fingerprint of in-place transforms + update in-place history of transforms
484 if inplace: # update after calling func so that the fingerprint doesn't change if the function fails
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:3389, in Dataset._select_with_indices_mapping(self, indices, keep_in_memory, indices_cache_file_name, writer_batch_size, new_fingerprint)
3387 logger.info(f"Caching indices mapping at {indices_cache_file_name}")
3388 tmp_file = tempfile.NamedTemporaryFile("wb", dir=os.path.dirname(indices_cache_file_name), delete=False)
-> 3389 writer = ArrowWriter(
3390 path=tmp_file.name, writer_batch_size=writer_batch_size, fingerprint=new_fingerprint, unit="indices"
3391 )
3393 indices = indices if isinstance(indices, list) else list(indices)
3395 size = len(self)
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_writer.py:315, in ArrowWriter.__init__(self, schema, features, path, stream, fingerprint, writer_batch_size, hash_salt, check_duplicates, disable_nullable, update_features, with_metadata, unit, embed_local_files, storage_options)
312 self._disable_nullable = disable_nullable
314 if stream is None:
--> 315 fs_token_paths = fsspec.get_fs_token_paths(path, storage_options=storage_options)
316 self._fs: fsspec.AbstractFileSystem = fs_token_paths[0]
317 self._path = (
318 fs_token_paths[2][0]
319 if not is_remote_filesystem(self._fs)
320 else self._fs.unstrip_protocol(fs_token_paths[2][0])
321 )
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/fsspec/core.py:593, in get_fs_token_paths(urlpath, mode, num, name_function, storage_options, protocol, expand)
591 else:
592 urlpath = stringify_path(urlpath)
--> 593 chain = _un_chain(urlpath, storage_options or {})
594 if len(chain) > 1:
595 inkwargs = {}
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/fsspec/core.py:330, in _un_chain(path, kwargs)
328 for bit in reversed(bits):
329 protocol = split_protocol(bit)[0] or "file"
--> 330 cls = get_filesystem_class(protocol)
331 extra_kwargs = cls._get_kwargs_from_urls(bit)
332 kws = kwargs.get(protocol, {})
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/fsspec/registry.py:240, in get_filesystem_class(protocol)
238 if protocol not in registry:
239 if protocol not in known_implementations:
--> 240 raise ValueError("Protocol not known: %s" % protocol)
241 bit = known_implementations[protocol]
242 try:
ValueError: Protocol not known: parent
```
This is what the `train_dataset` object looks like
```
Dataset({
features: ['label', 'input_ids', 'attention_mask'],
num_rows: 364166
})
```
### Steps to reproduce the bug
The `train_dataset` obj is created by concatenating two datasets
And then shuffle is called, but it throws the mentioned error.
### Expected behavior
Should shuffle the dataset properly.
### Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.15.0-1022-aws-x86_64-with-glibc2.31
- Python version: 3.9.13
- PyArrow version: 10.0.0
- Pandas version: 1.4.4
| 39 | `.shuffle` throwing error `ValueError: Protocol not known: parent`
### Describe the bug
```
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In [16], line 1
----> 1 train_dataset = train_dataset.shuffle()
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:551, in transmit_format.<locals>.wrapper(*args, **kwargs)
544 self_format = {
545 "type": self._format_type,
546 "format_kwargs": self._format_kwargs,
547 "columns": self._format_columns,
548 "output_all_columns": self._output_all_columns,
549 }
550 # apply actual function
--> 551 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
552 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
553 # re-apply format to the output
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
482 # Update fingerprint of in-place transforms + update in-place history of transforms
484 if inplace: # update after calling func so that the fingerprint doesn't change if the function fails
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:3616, in Dataset.shuffle(self, seed, generator, keep_in_memory, load_from_cache_file, indices_cache_file_name, writer_batch_size, new_fingerprint)
3610 return self._new_dataset_with_indices(
3611 fingerprint=new_fingerprint, indices_cache_file_name=indices_cache_file_name
3612 )
3614 permutation = generator.permutation(len(self))
-> 3616 return self.select(
3617 indices=permutation,
3618 keep_in_memory=keep_in_memory,
3619 indices_cache_file_name=indices_cache_file_name if not keep_in_memory else None,
3620 writer_batch_size=writer_batch_size,
3621 new_fingerprint=new_fingerprint,
3622 )
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:551, in transmit_format.<locals>.wrapper(*args, **kwargs)
544 self_format = {
545 "type": self._format_type,
546 "format_kwargs": self._format_kwargs,
547 "columns": self._format_columns,
548 "output_all_columns": self._output_all_columns,
549 }
550 # apply actual function
--> 551 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
552 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
553 # re-apply format to the output
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
482 # Update fingerprint of in-place transforms + update in-place history of transforms
484 if inplace: # update after calling func so that the fingerprint doesn't change if the function fails
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:3266, in Dataset.select(self, indices, keep_in_memory, indices_cache_file_name, writer_batch_size, new_fingerprint)
3263 return self._select_contiguous(start, length, new_fingerprint=new_fingerprint)
3265 # If not contiguous, we need to create a new indices mapping
-> 3266 return self._select_with_indices_mapping(
3267 indices,
3268 keep_in_memory=keep_in_memory,
3269 indices_cache_file_name=indices_cache_file_name,
3270 writer_batch_size=writer_batch_size,
3271 new_fingerprint=new_fingerprint,
3272 )
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:551, in transmit_format.<locals>.wrapper(*args, **kwargs)
544 self_format = {
545 "type": self._format_type,
546 "format_kwargs": self._format_kwargs,
547 "columns": self._format_columns,
548 "output_all_columns": self._output_all_columns,
549 }
550 # apply actual function
--> 551 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
552 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
553 # re-apply format to the output
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
482 # Update fingerprint of in-place transforms + update in-place history of transforms
484 if inplace: # update after calling func so that the fingerprint doesn't change if the function fails
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:3389, in Dataset._select_with_indices_mapping(self, indices, keep_in_memory, indices_cache_file_name, writer_batch_size, new_fingerprint)
3387 logger.info(f"Caching indices mapping at {indices_cache_file_name}")
3388 tmp_file = tempfile.NamedTemporaryFile("wb", dir=os.path.dirname(indices_cache_file_name), delete=False)
-> 3389 writer = ArrowWriter(
3390 path=tmp_file.name, writer_batch_size=writer_batch_size, fingerprint=new_fingerprint, unit="indices"
3391 )
3393 indices = indices if isinstance(indices, list) else list(indices)
3395 size = len(self)
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_writer.py:315, in ArrowWriter.__init__(self, schema, features, path, stream, fingerprint, writer_batch_size, hash_salt, check_duplicates, disable_nullable, update_features, with_metadata, unit, embed_local_files, storage_options)
312 self._disable_nullable = disable_nullable
314 if stream is None:
--> 315 fs_token_paths = fsspec.get_fs_token_paths(path, storage_options=storage_options)
316 self._fs: fsspec.AbstractFileSystem = fs_token_paths[0]
317 self._path = (
318 fs_token_paths[2][0]
319 if not is_remote_filesystem(self._fs)
320 else self._fs.unstrip_protocol(fs_token_paths[2][0])
321 )
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/fsspec/core.py:593, in get_fs_token_paths(urlpath, mode, num, name_function, storage_options, protocol, expand)
591 else:
592 urlpath = stringify_path(urlpath)
--> 593 chain = _un_chain(urlpath, storage_options or {})
594 if len(chain) > 1:
595 inkwargs = {}
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/fsspec/core.py:330, in _un_chain(path, kwargs)
328 for bit in reversed(bits):
329 protocol = split_protocol(bit)[0] or "file"
--> 330 cls = get_filesystem_class(protocol)
331 extra_kwargs = cls._get_kwargs_from_urls(bit)
332 kws = kwargs.get(protocol, {})
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/fsspec/registry.py:240, in get_filesystem_class(protocol)
238 if protocol not in registry:
239 if protocol not in known_implementations:
--> 240 raise ValueError("Protocol not known: %s" % protocol)
241 bit = known_implementations[protocol]
242 try:
ValueError: Protocol not known: parent
```
This is what the `train_dataset` object looks like
```
Dataset({
features: ['label', 'input_ids', 'attention_mask'],
num_rows: 364166
})
```
### Steps to reproduce the bug
The `train_dataset` obj is created by concatenating two datasets
And then shuffle is called, but it throws the mentioned error.
### Expected behavior
Should shuffle the dataset properly.
### Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.15.0-1022-aws-x86_64-with-glibc2.31
- Python version: 3.9.13
- PyArrow version: 10.0.0
- Pandas version: 1.4.4
I'm not aware of any `.hf` file ? What are you referring to ?
Also the error says "Protocol unknown: parent". Is there a chance you may have ended up with a path that contains this string `parent://` ? | [
0.047835830599069595,
-0.18612687289714813,
-0.026867803186178207,
0.20817533135414124,
0.3419860005378723,
-0.1306532770395279,
0.331752747297287,
0.4799611270427704,
-0.43398189544677734,
0.29154741764068604,
-0.2698074281215668,
0.4671919643878937,
-0.16841474175453186,
0.0033614952117204666,
-0.23843219876289368,
-0.15227018296718597,
-0.07050479203462601,
-0.008964478969573975,
-0.3150976300239563,
-0.13028158247470856,
-0.17720767855644226,
0.0071923453360795975,
-0.3541567921638489,
0.1923351287841797,
-0.3205759525299072,
-0.18364298343658447,
-0.056595489382743835,
0.21011638641357422,
-0.38363510370254517,
-0.12673735618591309,
0.012439003214240074,
0.1247226744890213,
-0.22799313068389893,
0.6120039224624634,
-0.00011005783744622022,
0.11885330080986023,
0.3035828471183777,
-0.15590673685073853,
-0.05855628103017807,
-0.2341224104166031,
0.1444924771785736,
0.4063204526901245,
-0.22031982243061066,
-0.31340962648391724,
0.0883491188287735,
-0.4563743472099304,
-0.18930058181285858,
-0.03906482458114624,
0.15957391262054443,
0.21781913936138153,
0.2722702622413635,
0.19682499766349792,
0.14161010086536407,
-0.13271474838256836,
0.49035632610321045,
0.029785573482513428,
0.09076996892690659,
0.4237038791179657,
-0.05566532909870148,
-0.0963156446814537,
-0.10683929175138474,
0.1723177134990692,
0.00547281838953495,
-0.2596152722835541,
0.015859872102737427,
-0.2856059968471527,
-0.04943589121103287,
-0.16242429614067078,
0.17355912923812866,
0.23439007997512817,
-0.012229636311531067,
-0.3027251064777374,
-0.21495237946510315,
0.027797624468803406,
-0.006819644942879677,
0.011769259348511696,
0.07042839378118515,
-0.06381341069936752,
-0.016463909298181534,
-0.07062222063541412,
-0.17682547867298126,
0.35790446400642395,
0.006482712924480438,
0.13838404417037964,
0.16435237228870392,
0.8071721792221069,
-0.07630445808172226,
0.138332337141037,
0.2864254117012024,
-0.049938447773456573,
0.609287440776825,
0.09146664291620255,
-0.016641221940517426,
-0.12831072509288788,
-0.19967351853847504,
-0.10649573802947998,
0.13760432600975037,
-0.1705639660358429,
-0.0614066943526268,
0.04803653061389923,
0.006141209974884987,
0.06911012530326843,
0.08100667595863342,
0.2838069796562195,
0.19858503341674805,
0.027514971792697906,
-0.07898714393377304,
0.2644622325897217,
-0.03839471936225891,
0.3138912320137024,
0.005603492259979248,
0.11577333509922028,
-0.03213982656598091,
-0.31357520818710327,
0.06296983361244202,
0.26522156596183777,
0.1793336719274521,
0.04250645264983177,
-0.06495525687932968,
-0.09335120022296906,
-0.2604014575481415,
-0.00514076417312026,
0.409233421087265,
0.4590299129486084,
-0.04615291953086853,
0.2567655146121979,
0.22099794447422028,
-0.065025195479393,
0.04505336284637451,
0.3796689212322235,
-0.36915475130081177,
0.30681103467941284,
-0.17551523447036743,
-0.0931800901889801,
-0.16554953157901764,
-0.266424298286438,
0.2958241403102875,
0.08555663377046585,
0.5256134271621704,
-0.20354978740215302,
-0.02500426396727562,
-0.2146940380334854,
0.36390841007232666,
0.10433786362409592,
-0.33705782890319824,
-0.19641879200935364,
0.21227172017097473,
0.11182591319084167,
-0.024405986070632935,
0.13563501834869385,
-0.38136518001556396,
-0.21923799812793732,
-0.04586195945739746,
0.2614027261734009,
0.08472928404808044,
0.21329054236412048,
-0.05548781901597977,
-0.26444512605667114,
0.2584216296672821,
-0.3082563281059265,
0.1532963216304779,
-0.34059005975723267,
-0.26563549041748047,
-0.2738938331604004,
0.24411535263061523,
-0.047520846128463745,
0.14441171288490295,
-0.05177180841565132,
0.08798976242542267,
0.019411306828260422,
0.28776904940605164,
0.2450418919324875,
-0.1718437522649765,
0.2793523669242859,
-0.2572733759880066,
0.022033430635929108,
0.264233261346817,
-0.13933296501636505,
-0.39881592988967896,
-0.37331604957580566,
-0.3634551167488098,
0.030912576243281364,
0.014338977634906769,
-0.000016237536328844726,
0.17098018527030945,
-0.1049906313419342,
0.4999423623085022,
0.1938161849975586,
0.010078264400362968,
0.1792529970407486,
-0.37079471349716187,
-0.1900002658367157,
-0.0019225142896175385,
0.050974491983652115,
-0.0114661306142807,
-0.0041571855545043945,
0.06259924918413162,
-0.18703937530517578,
0.27577662467956543,
-0.006609681993722916,
-0.008728349581360817,
-0.041968703269958496,
0.23737037181854248,
0.37101006507873535,
0.062059029936790466,
-0.22325864434242249,
0.14431801438331604,
0.008167311549186707,
-0.004871368408203125,
-0.11940489709377289,
-0.3901336193084717,
-0.2835361063480377,
-0.28685542941093445,
-0.18031050264835358,
-0.21307645738124847,
0.008921664208173752,
0.2867489159107208,
0.28267157077789307,
0.0895957499742508,
-0.1604864001274109,
-0.09522765874862671,
-0.20877034962177277,
-0.22031359374523163,
-0.11011488735675812,
-0.32235512137413025,
0.36553773283958435,
-0.22369690239429474,
-0.17150001227855682,
0.09192298352718353,
0.30712276697158813,
0.24502640962600708,
-0.14504271745681763,
-0.14261066913604736,
0.5353970527648926,
0.04933253675699234,
-0.13468502461910248,
-0.30727463960647583,
-0.12600286304950714,
-0.2881995737552643,
0.013915743678808212,
-0.11117018014192581,
-0.09992417693138123,
0.24633896350860596,
0.1061517670750618,
0.2140268087387085,
0.4727247357368469,
-0.3146163523197174,
-0.160023033618927,
0.12728187441825867,
-0.1511080265045166,
-0.08541519939899445,
0.13237330317497253,
0.016210470348596573,
-0.1083991527557373,
0.020435400307178497,
-0.0335795059800148,
0.11285287141799927,
-0.05622025579214096,
-0.05581354349851608,
-0.12579023838043213,
0.5248273015022278,
-0.03999922424554825,
0.14837712049484253,
-0.04251722991466522,
0.08514145761728287,
-0.021478459239006042,
-0.15466807782649994,
0.27875468134880066,
0.43200117349624634,
0.20396780967712402,
-0.017264004796743393,
0.09001930058002472,
0.10763004422187805,
-0.11800071597099304,
0.0684681311249733,
0.16086673736572266,
0.2924173176288605,
0.27479642629623413,
0.28255602717399597,
0.09211510419845581,
-0.34459930658340454,
-0.2485855519771576,
0.06467483192682266,
0.355633407831192,
-0.20300796627998352,
0.1679280400276184,
-0.283917635679245,
0.021640442311763763,
-0.11921671032905579,
-0.3731892704963684,
0.02805287390947342,
-0.17516274750232697,
0.09300558269023895,
0.35867416858673096,
-0.292418897151947,
0.3871227204799652,
0.3050159513950348,
0.10803145915269852,
0.1661432385444641,
-0.0956423431634903,
-0.03986542671918869,
-0.140584334731102,
0.06774149090051651,
0.1548852026462555,
0.137001171708107,
0.13258510828018188,
0.3269866108894348,
-0.11336205899715424,
-0.16057178378105164,
-0.06888578087091446,
-0.4212498962879181,
-0.011537916958332062,
-0.19044822454452515,
-0.18440832197666168,
0.1745770424604416,
0.030497580766677856,
-0.18702775239944458,
-0.6714723706245422,
0.2769984304904938,
-0.3319630026817322,
-0.2845994830131531,
0.24198728799819946,
0.09023568034172058,
-0.055377617478370667,
-0.2136031538248062,
-0.28006595373153687,
-0.31191548705101013,
-0.3620348274707794,
0.2756732702255249,
-0.25600627064704895,
0.2870362102985382,
0.14970722794532776,
0.08922773599624634,
0.07676098495721817,
-0.34905582666397095,
0.21340401470661163,
-0.2890651226043701,
-0.4546765089035034,
0.11702583730220795,
-0.06483510136604309,
-0.14778701961040497,
-0.4498138129711151,
-0.12943434715270996,
0.15502160787582397,
0.2760474681854248,
-0.1792602837085724,
-0.5086156129837036,
-0.1985594779253006,
-0.004664599895477295,
-0.06877455860376358,
0.10428843647241592,
0.6197788715362549,
0.15600299835205078,
-0.20283816754817963,
-0.008428972214460373,
-0.054406218230724335,
-0.10559079796075821,
0.022234883159399033,
0.004851125180721283,
-0.004929251968860626,
0.39048609137535095,
0.14584508538246155,
0.629821240901947,
-0.1856231540441513,
-0.1953442096710205,
0.03417491540312767,
-0.13738003373146057,
0.2570684254169464,
-0.24023666977882385,
-0.3542866110801697,
0.421562522649765,
0.09977584332227707,
0.03506061062216759,
0.12527164816856384,
-0.28723493218421936,
-0.01590132713317871,
-0.1579400897026062,
-0.034198563545942307,
-0.3009127974510193,
-0.24886681139469147,
0.21018940210342407,
0.20936867594718933,
0.051410309970378876,
-0.16517701745033264,
0.23950454592704773,
-0.08269867300987244,
0.04567860811948776,
0.07792569696903229,
0.2438957840204239,
-0.09011200815439224,
-0.18204118311405182,
-0.35850924253463745,
-0.33966708183288574,
0.12227870523929596,
0.20404145121574402,
0.31580284237861633,
0.5323000550270081,
0.021694760769605637,
-0.28514769673347473,
0.025164633989334106,
-0.044832468032836914,
0.4140889644622803,
0.17030000686645508,
0.22903700172901154,
0.2409670054912567,
-0.20190301537513733,
0.02436053566634655,
-0.24257558584213257,
-0.29345762729644775,
0.00022622477263212204,
0.20316681265830994,
0.42585375905036926,
-0.2097901701927185,
-0.018792973831295967,
0.1477457731962204,
-0.004525132477283478,
0.1463996320962906,
-0.19343388080596924,
-0.3849024772644043,
-0.43641769886016846,
-0.29644179344177246,
0.34097498655319214,
0.04703019559383392,
0.0788433626294136,
-0.2111232727766037,
-0.02280700020492077,
0.08125946670770645,
-0.211971253156662,
-0.0947255939245224,
0.14240731298923492,
0.19124552607536316,
0.1355707049369812,
-0.07530432194471359,
0.21516016125679016,
0.21308571100234985,
0.46069714426994324,
0.274954617023468,
0.12525857985019684,
-0.2817019820213318,
-0.01711994782090187,
0.07825803756713867,
0.00928470492362976,
0.26195815205574036,
-0.21311451494693756,
0.09421725571155548,
0.09151308238506317,
0.3543751835823059,
-0.023225702345371246,
-0.0984630212187767,
0.41068071126937866,
-0.2340961992740631,
-0.17465703189373016,
-0.4368714690208435,
0.1325254887342453,
0.053429003804922104,
-0.06960992515087128,
0.22745241224765778,
-0.2588205933570862,
-0.022818760946393013,
0.34238845109939575,
-0.06171946972608566,
1.0220216512680054,
0.0037200823426246643,
0.023582857102155685,
0.41660037636756897,
-0.0650750994682312,
0.37021347880363464,
0.11706814169883728,
0.1730031967163086,
-0.35517948865890503,
-0.6667205691337585,
0.05373653769493103,
-0.11413871496915817,
-0.011634081602096558,
-0.11286626756191254,
-0.32139554619789124,
0.1183953732252121,
-0.2373015284538269,
0.13205857574939728,
-0.11686249077320099,
-0.0814698189496994,
-0.0028520356863737106,
-0.024693530052900314,
-0.20033131539821625,
0.14321087300777435,
0.042284008115530014,
0.031075846403837204,
0.14192727208137512,
-0.15998968482017517,
-0.38843557238578796,
-0.24523212015628815,
0.013423353433609009,
0.1822681725025177,
-0.3210003674030304,
0.35194504261016846,
-0.04899422451853752,
0.1156405508518219,
-0.10829673707485199,
-0.12016625702381134,
0.0291474349796772,
0.24028930068016052,
0.15680000185966492,
0.15012328326702118,
0.48397326469421387,
0.06347719579935074,
0.04807215929031372,
0.05566179007291794,
0.12244588881731033,
-0.020092058926820755,
-0.2671782076358795,
0.1597754955291748,
0.17871002852916718,
-0.48183006048202515,
-0.19176936149597168,
0.09989336133003235,
0.2910398244857788,
-0.18063487112522125,
-0.034661151468753815,
-0.12699678540229797,
-0.2524389326572418,
-0.27941402792930603,
0.2138889878988266,
0.07065702974796295,
-0.2619982957839966,
0.19192105531692505,
0.13935977220535278,
-0.3279809355735779,
-0.005993884056806564,
0.6016950011253357,
0.13964520394802094,
0.1819649636745453,
0.35783156752586365,
-0.07141987979412079,
-0.23443877696990967,
-0.22314125299453735,
-0.005110990256071091,
-0.04900902137160301,
-0.30002298951148987,
0.0260540172457695,
0.08449171483516693,
-0.14361293613910675,
0.029609499499201775,
-0.039642173796892166,
0.05067742243409157,
0.3793732821941376,
-0.27801457047462463,
-0.41341328620910645,
-0.34763962030410767,
0.20339512825012207,
0.10247565060853958,
0.2412840873003006,
0.08489540964365005,
0.45725148916244507,
-0.2814626395702362,
0.16316552460193634,
-0.43070992827415466,
0.08923111110925674,
-0.20589570701122284,
0.28825482726097107,
-0.27525338530540466,
-0.27399516105651855,
-0.013292742893099785,
-0.11814658343791962,
0.2738058567047119,
0.2172648310661316,
-0.19901004433631897,
-0.25153648853302,
-0.07208568602800369,
0.09326532483100891,
0.06125449016690254,
0.03733734041452408,
-0.08802767843008041,
-0.16797074675559998,
-0.3849729597568512,
0.015127583406865597,
0.22310566902160645,
0.266020268201828,
0.06517323851585388,
0.1363770216703415,
0.41784927248954773,
-0.040789030492305756,
0.05482886731624603,
0.020274702459573746,
-0.28328821063041687,
-0.16271091997623444,
-0.16117221117019653,
-0.02017509937286377,
-0.3155484199523926,
-0.09893165528774261,
-0.14601537585258484,
0.06102339178323746,
-0.03340086340904236,
0.018809625878930092,
0.2721635699272156,
-0.07758225500583649,
-0.18526698648929596,
0.01752152293920517,
0.38151440024375916,
0.4930661916732788,
-0.2455110400915146,
-0.3326302468776703,
0.27520835399627686,
0.2593342363834381,
-0.23331697285175323,
-0.09594373404979706,
-0.07503113150596619,
0.24379216134548187,
0.19166184961795807,
0.1456782966852188,
-0.45296433568000793,
-0.2231985479593277,
-0.14964118599891663,
0.023901857435703278,
-0.03439648821949959,
-0.3925691843032837,
0.2763615846633911,
0.3282265365123749,
0.047179508954286575,
-0.23175887763500214,
0.2133137583732605,
-0.0568058080971241,
0.17236223816871643,
0.2291867882013321,
0.19677452743053436,
0.3610997200012207,
-0.023298390209674835,
-0.13340845704078674,
0.1995076835155487,
-0.34186452627182007,
0.06007952615618706,
0.4730905294418335,
-0.08209142088890076,
-0.05295763909816742,
0.09876976162195206,
0.3827473223209381,
-0.16187839210033417,
0.10719805955886841,
-0.02659216895699501,
0.14968737959861755,
-0.19386208057403564,
0.11529912054538727,
-0.04649908095598221,
-0.14177192747592926,
-0.5457470417022705,
-0.23663164675235748,
0.06673029810190201,
0.3558381199836731,
0.25894978642463684,
0.06247508525848389,
-0.30496370792388916,
-0.07485340535640717,
-0.4464350938796997,
0.2783905863761902,
0.298247754573822,
-0.31744715571403503,
0.1155843585729599,
0.5045300722122192,
0.018731147050857544,
0.3136763274669647,
0.3321564197540283,
0.4049181044101715,
0.41384249925613403,
0.07144090533256531,
0.08459534496068954,
-0.18638357520103455,
-0.1089431419968605,
0.07076319307088852,
0.21679313480854034,
0.3375431001186371,
-0.08498391509056091,
0.3205510079860687,
0.28479820489883423,
-0.3207145929336548,
0.022564204409718513,
0.20795799791812897,
0.24157561361789703,
0.010218434035778046,
0.4478912651538849,
-0.039320819079875946,
-0.056976623833179474,
-0.05562490224838257,
0.040614478290081024,
-0.6588220000267029,
-0.11921538412570953,
-0.26436448097229004,
0.21434631943702698,
0.22643879055976868,
-0.009412143379449844,
0.11173437535762787,
0.17122647166252136,
0.4282025396823883,
0.36276817321777344,
-0.19544652104377747,
0.018773874267935753,
-0.24981459975242615,
-0.38730156421661377,
0.32223355770111084,
0.012607801705598831,
-0.005187125876545906,
-0.03289814293384552,
-0.11916279047727585,
0.20055130124092102,
0.1775180846452713,
0.008914895355701447,
0.011593047529459,
-0.08634724467992783,
0.08056168258190155,
-0.3775831162929535,
0.12461386620998383,
-0.15303871035575867,
-0.17333313822746277,
0.25969433784484863,
-0.30602097511291504,
-0.05472125485539436,
-0.002120447810739279,
0.19789648056030273,
0.01054820604622364,
-0.17750221490859985,
-0.3321584165096283,
-0.16325001418590546,
0.2034669816493988,
0.021634839475154877,
0.3695112466812134,
-0.25876525044441223,
-0.057759352028369904,
0.018684275448322296,
-0.15570002794265747,
-0.10280069708824158,
0.2777843177318573,
0.4304589331150055,
0.500277042388916,
0.15229858458042145,
-0.43351414799690247,
-0.3012213706970215,
0.5658541917800903,
-0.28807976841926575,
-0.05282413959503174,
-0.2206488698720932,
0.2563704252243042,
0.07438085228204727,
0.06986445933580399,
-0.2023008167743683,
0.11858845502138138,
-0.0037254691123962402,
0.0927342101931572,
-0.2414751499891281,
-0.4919673502445221,
0.7703267931938171,
-0.17599815130233765,
-0.2825562357902527,
-0.28037604689598083,
0.276391863822937,
-0.07344213873147964,
0.01904640905559063,
-0.05563823878765106,
0.30745774507522583,
0.17877627909183502,
0.22868138551712036,
-0.03576427698135376,
0.1111324280500412,
-0.3340783417224884,
0.08558748662471771,
0.027907583862543106,
0.23245111107826233,
-0.015478312969207764,
-0.14509858191013336,
0.13012076914310455,
-0.13424237072467804
] |
https://github.com/huggingface/datasets/issues/5555 | `.shuffle` throwing error `ValueError: Protocol not known: parent` | I figured out why the issue was occuring but don't know the long-term fix.
The dataset I was trying to shuffle was loaded from a saved file which had `::` delimiter in filename. When I try with the exact same file without `::` in filename, it works as expected.
Quick fix is to not use colons in filename. But if this is expected behaviour, this should be clearly stated in the documentation.
Thanks for help @lhoestq | ### Describe the bug
```
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In [16], line 1
----> 1 train_dataset = train_dataset.shuffle()
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:551, in transmit_format.<locals>.wrapper(*args, **kwargs)
544 self_format = {
545 "type": self._format_type,
546 "format_kwargs": self._format_kwargs,
547 "columns": self._format_columns,
548 "output_all_columns": self._output_all_columns,
549 }
550 # apply actual function
--> 551 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
552 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
553 # re-apply format to the output
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
482 # Update fingerprint of in-place transforms + update in-place history of transforms
484 if inplace: # update after calling func so that the fingerprint doesn't change if the function fails
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:3616, in Dataset.shuffle(self, seed, generator, keep_in_memory, load_from_cache_file, indices_cache_file_name, writer_batch_size, new_fingerprint)
3610 return self._new_dataset_with_indices(
3611 fingerprint=new_fingerprint, indices_cache_file_name=indices_cache_file_name
3612 )
3614 permutation = generator.permutation(len(self))
-> 3616 return self.select(
3617 indices=permutation,
3618 keep_in_memory=keep_in_memory,
3619 indices_cache_file_name=indices_cache_file_name if not keep_in_memory else None,
3620 writer_batch_size=writer_batch_size,
3621 new_fingerprint=new_fingerprint,
3622 )
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:551, in transmit_format.<locals>.wrapper(*args, **kwargs)
544 self_format = {
545 "type": self._format_type,
546 "format_kwargs": self._format_kwargs,
547 "columns": self._format_columns,
548 "output_all_columns": self._output_all_columns,
549 }
550 # apply actual function
--> 551 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
552 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
553 # re-apply format to the output
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
482 # Update fingerprint of in-place transforms + update in-place history of transforms
484 if inplace: # update after calling func so that the fingerprint doesn't change if the function fails
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:3266, in Dataset.select(self, indices, keep_in_memory, indices_cache_file_name, writer_batch_size, new_fingerprint)
3263 return self._select_contiguous(start, length, new_fingerprint=new_fingerprint)
3265 # If not contiguous, we need to create a new indices mapping
-> 3266 return self._select_with_indices_mapping(
3267 indices,
3268 keep_in_memory=keep_in_memory,
3269 indices_cache_file_name=indices_cache_file_name,
3270 writer_batch_size=writer_batch_size,
3271 new_fingerprint=new_fingerprint,
3272 )
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:551, in transmit_format.<locals>.wrapper(*args, **kwargs)
544 self_format = {
545 "type": self._format_type,
546 "format_kwargs": self._format_kwargs,
547 "columns": self._format_columns,
548 "output_all_columns": self._output_all_columns,
549 }
550 # apply actual function
--> 551 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
552 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
553 # re-apply format to the output
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
482 # Update fingerprint of in-place transforms + update in-place history of transforms
484 if inplace: # update after calling func so that the fingerprint doesn't change if the function fails
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:3389, in Dataset._select_with_indices_mapping(self, indices, keep_in_memory, indices_cache_file_name, writer_batch_size, new_fingerprint)
3387 logger.info(f"Caching indices mapping at {indices_cache_file_name}")
3388 tmp_file = tempfile.NamedTemporaryFile("wb", dir=os.path.dirname(indices_cache_file_name), delete=False)
-> 3389 writer = ArrowWriter(
3390 path=tmp_file.name, writer_batch_size=writer_batch_size, fingerprint=new_fingerprint, unit="indices"
3391 )
3393 indices = indices if isinstance(indices, list) else list(indices)
3395 size = len(self)
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_writer.py:315, in ArrowWriter.__init__(self, schema, features, path, stream, fingerprint, writer_batch_size, hash_salt, check_duplicates, disable_nullable, update_features, with_metadata, unit, embed_local_files, storage_options)
312 self._disable_nullable = disable_nullable
314 if stream is None:
--> 315 fs_token_paths = fsspec.get_fs_token_paths(path, storage_options=storage_options)
316 self._fs: fsspec.AbstractFileSystem = fs_token_paths[0]
317 self._path = (
318 fs_token_paths[2][0]
319 if not is_remote_filesystem(self._fs)
320 else self._fs.unstrip_protocol(fs_token_paths[2][0])
321 )
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/fsspec/core.py:593, in get_fs_token_paths(urlpath, mode, num, name_function, storage_options, protocol, expand)
591 else:
592 urlpath = stringify_path(urlpath)
--> 593 chain = _un_chain(urlpath, storage_options or {})
594 if len(chain) > 1:
595 inkwargs = {}
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/fsspec/core.py:330, in _un_chain(path, kwargs)
328 for bit in reversed(bits):
329 protocol = split_protocol(bit)[0] or "file"
--> 330 cls = get_filesystem_class(protocol)
331 extra_kwargs = cls._get_kwargs_from_urls(bit)
332 kws = kwargs.get(protocol, {})
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/fsspec/registry.py:240, in get_filesystem_class(protocol)
238 if protocol not in registry:
239 if protocol not in known_implementations:
--> 240 raise ValueError("Protocol not known: %s" % protocol)
241 bit = known_implementations[protocol]
242 try:
ValueError: Protocol not known: parent
```
This is what the `train_dataset` object looks like
```
Dataset({
features: ['label', 'input_ids', 'attention_mask'],
num_rows: 364166
})
```
### Steps to reproduce the bug
The `train_dataset` obj is created by concatenating two datasets
And then shuffle is called, but it throws the mentioned error.
### Expected behavior
Should shuffle the dataset properly.
### Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.15.0-1022-aws-x86_64-with-glibc2.31
- Python version: 3.9.13
- PyArrow version: 10.0.0
- Pandas version: 1.4.4
| 76 | `.shuffle` throwing error `ValueError: Protocol not known: parent`
### Describe the bug
```
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In [16], line 1
----> 1 train_dataset = train_dataset.shuffle()
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:551, in transmit_format.<locals>.wrapper(*args, **kwargs)
544 self_format = {
545 "type": self._format_type,
546 "format_kwargs": self._format_kwargs,
547 "columns": self._format_columns,
548 "output_all_columns": self._output_all_columns,
549 }
550 # apply actual function
--> 551 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
552 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
553 # re-apply format to the output
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
482 # Update fingerprint of in-place transforms + update in-place history of transforms
484 if inplace: # update after calling func so that the fingerprint doesn't change if the function fails
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:3616, in Dataset.shuffle(self, seed, generator, keep_in_memory, load_from_cache_file, indices_cache_file_name, writer_batch_size, new_fingerprint)
3610 return self._new_dataset_with_indices(
3611 fingerprint=new_fingerprint, indices_cache_file_name=indices_cache_file_name
3612 )
3614 permutation = generator.permutation(len(self))
-> 3616 return self.select(
3617 indices=permutation,
3618 keep_in_memory=keep_in_memory,
3619 indices_cache_file_name=indices_cache_file_name if not keep_in_memory else None,
3620 writer_batch_size=writer_batch_size,
3621 new_fingerprint=new_fingerprint,
3622 )
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:551, in transmit_format.<locals>.wrapper(*args, **kwargs)
544 self_format = {
545 "type": self._format_type,
546 "format_kwargs": self._format_kwargs,
547 "columns": self._format_columns,
548 "output_all_columns": self._output_all_columns,
549 }
550 # apply actual function
--> 551 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
552 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
553 # re-apply format to the output
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
482 # Update fingerprint of in-place transforms + update in-place history of transforms
484 if inplace: # update after calling func so that the fingerprint doesn't change if the function fails
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:3266, in Dataset.select(self, indices, keep_in_memory, indices_cache_file_name, writer_batch_size, new_fingerprint)
3263 return self._select_contiguous(start, length, new_fingerprint=new_fingerprint)
3265 # If not contiguous, we need to create a new indices mapping
-> 3266 return self._select_with_indices_mapping(
3267 indices,
3268 keep_in_memory=keep_in_memory,
3269 indices_cache_file_name=indices_cache_file_name,
3270 writer_batch_size=writer_batch_size,
3271 new_fingerprint=new_fingerprint,
3272 )
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:551, in transmit_format.<locals>.wrapper(*args, **kwargs)
544 self_format = {
545 "type": self._format_type,
546 "format_kwargs": self._format_kwargs,
547 "columns": self._format_columns,
548 "output_all_columns": self._output_all_columns,
549 }
550 # apply actual function
--> 551 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
552 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
553 # re-apply format to the output
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
482 # Update fingerprint of in-place transforms + update in-place history of transforms
484 if inplace: # update after calling func so that the fingerprint doesn't change if the function fails
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_dataset.py:3389, in Dataset._select_with_indices_mapping(self, indices, keep_in_memory, indices_cache_file_name, writer_batch_size, new_fingerprint)
3387 logger.info(f"Caching indices mapping at {indices_cache_file_name}")
3388 tmp_file = tempfile.NamedTemporaryFile("wb", dir=os.path.dirname(indices_cache_file_name), delete=False)
-> 3389 writer = ArrowWriter(
3390 path=tmp_file.name, writer_batch_size=writer_batch_size, fingerprint=new_fingerprint, unit="indices"
3391 )
3393 indices = indices if isinstance(indices, list) else list(indices)
3395 size = len(self)
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/datasets/arrow_writer.py:315, in ArrowWriter.__init__(self, schema, features, path, stream, fingerprint, writer_batch_size, hash_salt, check_duplicates, disable_nullable, update_features, with_metadata, unit, embed_local_files, storage_options)
312 self._disable_nullable = disable_nullable
314 if stream is None:
--> 315 fs_token_paths = fsspec.get_fs_token_paths(path, storage_options=storage_options)
316 self._fs: fsspec.AbstractFileSystem = fs_token_paths[0]
317 self._path = (
318 fs_token_paths[2][0]
319 if not is_remote_filesystem(self._fs)
320 else self._fs.unstrip_protocol(fs_token_paths[2][0])
321 )
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/fsspec/core.py:593, in get_fs_token_paths(urlpath, mode, num, name_function, storage_options, protocol, expand)
591 else:
592 urlpath = stringify_path(urlpath)
--> 593 chain = _un_chain(urlpath, storage_options or {})
594 if len(chain) > 1:
595 inkwargs = {}
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/fsspec/core.py:330, in _un_chain(path, kwargs)
328 for bit in reversed(bits):
329 protocol = split_protocol(bit)[0] or "file"
--> 330 cls = get_filesystem_class(protocol)
331 extra_kwargs = cls._get_kwargs_from_urls(bit)
332 kws = kwargs.get(protocol, {})
File /opt/conda/envs/pytorch/lib/python3.9/site-packages/fsspec/registry.py:240, in get_filesystem_class(protocol)
238 if protocol not in registry:
239 if protocol not in known_implementations:
--> 240 raise ValueError("Protocol not known: %s" % protocol)
241 bit = known_implementations[protocol]
242 try:
ValueError: Protocol not known: parent
```
This is what the `train_dataset` object looks like
```
Dataset({
features: ['label', 'input_ids', 'attention_mask'],
num_rows: 364166
})
```
### Steps to reproduce the bug
The `train_dataset` obj is created by concatenating two datasets
And then shuffle is called, but it throws the mentioned error.
### Expected behavior
Should shuffle the dataset properly.
### Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.15.0-1022-aws-x86_64-with-glibc2.31
- Python version: 3.9.13
- PyArrow version: 10.0.0
- Pandas version: 1.4.4
I figured out why the issue was occuring but don't know the long-term fix.
The dataset I was trying to shuffle was loaded from a saved file which had `::` delimiter in filename. When I try with the exact same file without `::` in filename, it works as expected.
Quick fix is to not use colons in filename. But if this is expected behaviour, this should be clearly stated in the documentation.
Thanks for help @lhoestq | [
0.047835830599069595,
-0.18612687289714813,
-0.026867803186178207,
0.20817533135414124,
0.3419860005378723,
-0.1306532770395279,
0.331752747297287,
0.4799611270427704,
-0.43398189544677734,
0.29154741764068604,
-0.2698074281215668,
0.4671919643878937,
-0.16841474175453186,
0.0033614952117204666,
-0.23843219876289368,
-0.15227018296718597,
-0.07050479203462601,
-0.008964478969573975,
-0.3150976300239563,
-0.13028158247470856,
-0.17720767855644226,
0.0071923453360795975,
-0.3541567921638489,
0.1923351287841797,
-0.3205759525299072,
-0.18364298343658447,
-0.056595489382743835,
0.21011638641357422,
-0.38363510370254517,
-0.12673735618591309,
0.012439003214240074,
0.1247226744890213,
-0.22799313068389893,
0.6120039224624634,
-0.00011005783744622022,
0.11885330080986023,
0.3035828471183777,
-0.15590673685073853,
-0.05855628103017807,
-0.2341224104166031,
0.1444924771785736,
0.4063204526901245,
-0.22031982243061066,
-0.31340962648391724,
0.0883491188287735,
-0.4563743472099304,
-0.18930058181285858,
-0.03906482458114624,
0.15957391262054443,
0.21781913936138153,
0.2722702622413635,
0.19682499766349792,
0.14161010086536407,
-0.13271474838256836,
0.49035632610321045,
0.029785573482513428,
0.09076996892690659,
0.4237038791179657,
-0.05566532909870148,
-0.0963156446814537,
-0.10683929175138474,
0.1723177134990692,
0.00547281838953495,
-0.2596152722835541,
0.015859872102737427,
-0.2856059968471527,
-0.04943589121103287,
-0.16242429614067078,
0.17355912923812866,
0.23439007997512817,
-0.012229636311531067,
-0.3027251064777374,
-0.21495237946510315,
0.027797624468803406,
-0.006819644942879677,
0.011769259348511696,
0.07042839378118515,
-0.06381341069936752,
-0.016463909298181534,
-0.07062222063541412,
-0.17682547867298126,
0.35790446400642395,
0.006482712924480438,
0.13838404417037964,
0.16435237228870392,
0.8071721792221069,
-0.07630445808172226,
0.138332337141037,
0.2864254117012024,
-0.049938447773456573,
0.609287440776825,
0.09146664291620255,
-0.016641221940517426,
-0.12831072509288788,
-0.19967351853847504,
-0.10649573802947998,
0.13760432600975037,
-0.1705639660358429,
-0.0614066943526268,
0.04803653061389923,
0.006141209974884987,
0.06911012530326843,
0.08100667595863342,
0.2838069796562195,
0.19858503341674805,
0.027514971792697906,
-0.07898714393377304,
0.2644622325897217,
-0.03839471936225891,
0.3138912320137024,
0.005603492259979248,
0.11577333509922028,
-0.03213982656598091,
-0.31357520818710327,
0.06296983361244202,
0.26522156596183777,
0.1793336719274521,
0.04250645264983177,
-0.06495525687932968,
-0.09335120022296906,
-0.2604014575481415,
-0.00514076417312026,
0.409233421087265,
0.4590299129486084,
-0.04615291953086853,
0.2567655146121979,
0.22099794447422028,
-0.065025195479393,
0.04505336284637451,
0.3796689212322235,
-0.36915475130081177,
0.30681103467941284,
-0.17551523447036743,
-0.0931800901889801,
-0.16554953157901764,
-0.266424298286438,
0.2958241403102875,
0.08555663377046585,
0.5256134271621704,
-0.20354978740215302,
-0.02500426396727562,
-0.2146940380334854,
0.36390841007232666,
0.10433786362409592,
-0.33705782890319824,
-0.19641879200935364,
0.21227172017097473,
0.11182591319084167,
-0.024405986070632935,
0.13563501834869385,
-0.38136518001556396,
-0.21923799812793732,
-0.04586195945739746,
0.2614027261734009,
0.08472928404808044,
0.21329054236412048,
-0.05548781901597977,
-0.26444512605667114,
0.2584216296672821,
-0.3082563281059265,
0.1532963216304779,
-0.34059005975723267,
-0.26563549041748047,
-0.2738938331604004,
0.24411535263061523,
-0.047520846128463745,
0.14441171288490295,
-0.05177180841565132,
0.08798976242542267,
0.019411306828260422,
0.28776904940605164,
0.2450418919324875,
-0.1718437522649765,
0.2793523669242859,
-0.2572733759880066,
0.022033430635929108,
0.264233261346817,
-0.13933296501636505,
-0.39881592988967896,
-0.37331604957580566,
-0.3634551167488098,
0.030912576243281364,
0.014338977634906769,
-0.000016237536328844726,
0.17098018527030945,
-0.1049906313419342,
0.4999423623085022,
0.1938161849975586,
0.010078264400362968,
0.1792529970407486,
-0.37079471349716187,
-0.1900002658367157,
-0.0019225142896175385,
0.050974491983652115,
-0.0114661306142807,
-0.0041571855545043945,
0.06259924918413162,
-0.18703937530517578,
0.27577662467956543,
-0.006609681993722916,
-0.008728349581360817,
-0.041968703269958496,
0.23737037181854248,
0.37101006507873535,
0.062059029936790466,
-0.22325864434242249,
0.14431801438331604,
0.008167311549186707,
-0.004871368408203125,
-0.11940489709377289,
-0.3901336193084717,
-0.2835361063480377,
-0.28685542941093445,
-0.18031050264835358,
-0.21307645738124847,
0.008921664208173752,
0.2867489159107208,
0.28267157077789307,
0.0895957499742508,
-0.1604864001274109,
-0.09522765874862671,
-0.20877034962177277,
-0.22031359374523163,
-0.11011488735675812,
-0.32235512137413025,
0.36553773283958435,
-0.22369690239429474,
-0.17150001227855682,
0.09192298352718353,
0.30712276697158813,
0.24502640962600708,
-0.14504271745681763,
-0.14261066913604736,
0.5353970527648926,
0.04933253675699234,
-0.13468502461910248,
-0.30727463960647583,
-0.12600286304950714,
-0.2881995737552643,
0.013915743678808212,
-0.11117018014192581,
-0.09992417693138123,
0.24633896350860596,
0.1061517670750618,
0.2140268087387085,
0.4727247357368469,
-0.3146163523197174,
-0.160023033618927,
0.12728187441825867,
-0.1511080265045166,
-0.08541519939899445,
0.13237330317497253,
0.016210470348596573,
-0.1083991527557373,
0.020435400307178497,
-0.0335795059800148,
0.11285287141799927,
-0.05622025579214096,
-0.05581354349851608,
-0.12579023838043213,
0.5248273015022278,
-0.03999922424554825,
0.14837712049484253,
-0.04251722991466522,
0.08514145761728287,
-0.021478459239006042,
-0.15466807782649994,
0.27875468134880066,
0.43200117349624634,
0.20396780967712402,
-0.017264004796743393,
0.09001930058002472,
0.10763004422187805,
-0.11800071597099304,
0.0684681311249733,
0.16086673736572266,
0.2924173176288605,
0.27479642629623413,
0.28255602717399597,
0.09211510419845581,
-0.34459930658340454,
-0.2485855519771576,
0.06467483192682266,
0.355633407831192,
-0.20300796627998352,
0.1679280400276184,
-0.283917635679245,
0.021640442311763763,
-0.11921671032905579,
-0.3731892704963684,
0.02805287390947342,
-0.17516274750232697,
0.09300558269023895,
0.35867416858673096,
-0.292418897151947,
0.3871227204799652,
0.3050159513950348,
0.10803145915269852,
0.1661432385444641,
-0.0956423431634903,
-0.03986542671918869,
-0.140584334731102,
0.06774149090051651,
0.1548852026462555,
0.137001171708107,
0.13258510828018188,
0.3269866108894348,
-0.11336205899715424,
-0.16057178378105164,
-0.06888578087091446,
-0.4212498962879181,
-0.011537916958332062,
-0.19044822454452515,
-0.18440832197666168,
0.1745770424604416,
0.030497580766677856,
-0.18702775239944458,
-0.6714723706245422,
0.2769984304904938,
-0.3319630026817322,
-0.2845994830131531,
0.24198728799819946,
0.09023568034172058,
-0.055377617478370667,
-0.2136031538248062,
-0.28006595373153687,
-0.31191548705101013,
-0.3620348274707794,
0.2756732702255249,
-0.25600627064704895,
0.2870362102985382,
0.14970722794532776,
0.08922773599624634,
0.07676098495721817,
-0.34905582666397095,
0.21340401470661163,
-0.2890651226043701,
-0.4546765089035034,
0.11702583730220795,
-0.06483510136604309,
-0.14778701961040497,
-0.4498138129711151,
-0.12943434715270996,
0.15502160787582397,
0.2760474681854248,
-0.1792602837085724,
-0.5086156129837036,
-0.1985594779253006,
-0.004664599895477295,
-0.06877455860376358,
0.10428843647241592,
0.6197788715362549,
0.15600299835205078,
-0.20283816754817963,
-0.008428972214460373,
-0.054406218230724335,
-0.10559079796075821,
0.022234883159399033,
0.004851125180721283,
-0.004929251968860626,
0.39048609137535095,
0.14584508538246155,
0.629821240901947,
-0.1856231540441513,
-0.1953442096710205,
0.03417491540312767,
-0.13738003373146057,
0.2570684254169464,
-0.24023666977882385,
-0.3542866110801697,
0.421562522649765,
0.09977584332227707,
0.03506061062216759,
0.12527164816856384,
-0.28723493218421936,
-0.01590132713317871,
-0.1579400897026062,
-0.034198563545942307,
-0.3009127974510193,
-0.24886681139469147,
0.21018940210342407,
0.20936867594718933,
0.051410309970378876,
-0.16517701745033264,
0.23950454592704773,
-0.08269867300987244,
0.04567860811948776,
0.07792569696903229,
0.2438957840204239,
-0.09011200815439224,
-0.18204118311405182,
-0.35850924253463745,
-0.33966708183288574,
0.12227870523929596,
0.20404145121574402,
0.31580284237861633,
0.5323000550270081,
0.021694760769605637,
-0.28514769673347473,
0.025164633989334106,
-0.044832468032836914,
0.4140889644622803,
0.17030000686645508,
0.22903700172901154,
0.2409670054912567,
-0.20190301537513733,
0.02436053566634655,
-0.24257558584213257,
-0.29345762729644775,
0.00022622477263212204,
0.20316681265830994,
0.42585375905036926,
-0.2097901701927185,
-0.018792973831295967,
0.1477457731962204,
-0.004525132477283478,
0.1463996320962906,
-0.19343388080596924,
-0.3849024772644043,
-0.43641769886016846,
-0.29644179344177246,
0.34097498655319214,
0.04703019559383392,
0.0788433626294136,
-0.2111232727766037,
-0.02280700020492077,
0.08125946670770645,
-0.211971253156662,
-0.0947255939245224,
0.14240731298923492,
0.19124552607536316,
0.1355707049369812,
-0.07530432194471359,
0.21516016125679016,
0.21308571100234985,
0.46069714426994324,
0.274954617023468,
0.12525857985019684,
-0.2817019820213318,
-0.01711994782090187,
0.07825803756713867,
0.00928470492362976,
0.26195815205574036,
-0.21311451494693756,
0.09421725571155548,
0.09151308238506317,
0.3543751835823059,
-0.023225702345371246,
-0.0984630212187767,
0.41068071126937866,
-0.2340961992740631,
-0.17465703189373016,
-0.4368714690208435,
0.1325254887342453,
0.053429003804922104,
-0.06960992515087128,
0.22745241224765778,
-0.2588205933570862,
-0.022818760946393013,
0.34238845109939575,
-0.06171946972608566,
1.0220216512680054,
0.0037200823426246643,
0.023582857102155685,
0.41660037636756897,
-0.0650750994682312,
0.37021347880363464,
0.11706814169883728,
0.1730031967163086,
-0.35517948865890503,
-0.6667205691337585,
0.05373653769493103,
-0.11413871496915817,
-0.011634081602096558,
-0.11286626756191254,
-0.32139554619789124,
0.1183953732252121,
-0.2373015284538269,
0.13205857574939728,
-0.11686249077320099,
-0.0814698189496994,
-0.0028520356863737106,
-0.024693530052900314,
-0.20033131539821625,
0.14321087300777435,
0.042284008115530014,
0.031075846403837204,
0.14192727208137512,
-0.15998968482017517,
-0.38843557238578796,
-0.24523212015628815,
0.013423353433609009,
0.1822681725025177,
-0.3210003674030304,
0.35194504261016846,
-0.04899422451853752,
0.1156405508518219,
-0.10829673707485199,
-0.12016625702381134,
0.0291474349796772,
0.24028930068016052,
0.15680000185966492,
0.15012328326702118,
0.48397326469421387,
0.06347719579935074,
0.04807215929031372,
0.05566179007291794,
0.12244588881731033,
-0.020092058926820755,
-0.2671782076358795,
0.1597754955291748,
0.17871002852916718,
-0.48183006048202515,
-0.19176936149597168,
0.09989336133003235,
0.2910398244857788,
-0.18063487112522125,
-0.034661151468753815,
-0.12699678540229797,
-0.2524389326572418,
-0.27941402792930603,
0.2138889878988266,
0.07065702974796295,
-0.2619982957839966,
0.19192105531692505,
0.13935977220535278,
-0.3279809355735779,
-0.005993884056806564,
0.6016950011253357,
0.13964520394802094,
0.1819649636745453,
0.35783156752586365,
-0.07141987979412079,
-0.23443877696990967,
-0.22314125299453735,
-0.005110990256071091,
-0.04900902137160301,
-0.30002298951148987,
0.0260540172457695,
0.08449171483516693,
-0.14361293613910675,
0.029609499499201775,
-0.039642173796892166,
0.05067742243409157,
0.3793732821941376,
-0.27801457047462463,
-0.41341328620910645,
-0.34763962030410767,
0.20339512825012207,
0.10247565060853958,
0.2412840873003006,
0.08489540964365005,
0.45725148916244507,
-0.2814626395702362,
0.16316552460193634,
-0.43070992827415466,
0.08923111110925674,
-0.20589570701122284,
0.28825482726097107,
-0.27525338530540466,
-0.27399516105651855,
-0.013292742893099785,
-0.11814658343791962,
0.2738058567047119,
0.2172648310661316,
-0.19901004433631897,
-0.25153648853302,
-0.07208568602800369,
0.09326532483100891,
0.06125449016690254,
0.03733734041452408,
-0.08802767843008041,
-0.16797074675559998,
-0.3849729597568512,
0.015127583406865597,
0.22310566902160645,
0.266020268201828,
0.06517323851585388,
0.1363770216703415,
0.41784927248954773,
-0.040789030492305756,
0.05482886731624603,
0.020274702459573746,
-0.28328821063041687,
-0.16271091997623444,
-0.16117221117019653,
-0.02017509937286377,
-0.3155484199523926,
-0.09893165528774261,
-0.14601537585258484,
0.06102339178323746,
-0.03340086340904236,
0.018809625878930092,
0.2721635699272156,
-0.07758225500583649,
-0.18526698648929596,
0.01752152293920517,
0.38151440024375916,
0.4930661916732788,
-0.2455110400915146,
-0.3326302468776703,
0.27520835399627686,
0.2593342363834381,
-0.23331697285175323,
-0.09594373404979706,
-0.07503113150596619,
0.24379216134548187,
0.19166184961795807,
0.1456782966852188,
-0.45296433568000793,
-0.2231985479593277,
-0.14964118599891663,
0.023901857435703278,
-0.03439648821949959,
-0.3925691843032837,
0.2763615846633911,
0.3282265365123749,
0.047179508954286575,
-0.23175887763500214,
0.2133137583732605,
-0.0568058080971241,
0.17236223816871643,
0.2291867882013321,
0.19677452743053436,
0.3610997200012207,
-0.023298390209674835,
-0.13340845704078674,
0.1995076835155487,
-0.34186452627182007,
0.06007952615618706,
0.4730905294418335,
-0.08209142088890076,
-0.05295763909816742,
0.09876976162195206,
0.3827473223209381,
-0.16187839210033417,
0.10719805955886841,
-0.02659216895699501,
0.14968737959861755,
-0.19386208057403564,
0.11529912054538727,
-0.04649908095598221,
-0.14177192747592926,
-0.5457470417022705,
-0.23663164675235748,
0.06673029810190201,
0.3558381199836731,
0.25894978642463684,
0.06247508525848389,
-0.30496370792388916,
-0.07485340535640717,
-0.4464350938796997,
0.2783905863761902,
0.298247754573822,
-0.31744715571403503,
0.1155843585729599,
0.5045300722122192,
0.018731147050857544,
0.3136763274669647,
0.3321564197540283,
0.4049181044101715,
0.41384249925613403,
0.07144090533256531,
0.08459534496068954,
-0.18638357520103455,
-0.1089431419968605,
0.07076319307088852,
0.21679313480854034,
0.3375431001186371,
-0.08498391509056091,
0.3205510079860687,
0.28479820489883423,
-0.3207145929336548,
0.022564204409718513,
0.20795799791812897,
0.24157561361789703,
0.010218434035778046,
0.4478912651538849,
-0.039320819079875946,
-0.056976623833179474,
-0.05562490224838257,
0.040614478290081024,
-0.6588220000267029,
-0.11921538412570953,
-0.26436448097229004,
0.21434631943702698,
0.22643879055976868,
-0.009412143379449844,
0.11173437535762787,
0.17122647166252136,
0.4282025396823883,
0.36276817321777344,
-0.19544652104377747,
0.018773874267935753,
-0.24981459975242615,
-0.38730156421661377,
0.32223355770111084,
0.012607801705598831,
-0.005187125876545906,
-0.03289814293384552,
-0.11916279047727585,
0.20055130124092102,
0.1775180846452713,
0.008914895355701447,
0.011593047529459,
-0.08634724467992783,
0.08056168258190155,
-0.3775831162929535,
0.12461386620998383,
-0.15303871035575867,
-0.17333313822746277,
0.25969433784484863,
-0.30602097511291504,
-0.05472125485539436,
-0.002120447810739279,
0.19789648056030273,
0.01054820604622364,
-0.17750221490859985,
-0.3321584165096283,
-0.16325001418590546,
0.2034669816493988,
0.021634839475154877,
0.3695112466812134,
-0.25876525044441223,
-0.057759352028369904,
0.018684275448322296,
-0.15570002794265747,
-0.10280069708824158,
0.2777843177318573,
0.4304589331150055,
0.500277042388916,
0.15229858458042145,
-0.43351414799690247,
-0.3012213706970215,
0.5658541917800903,
-0.28807976841926575,
-0.05282413959503174,
-0.2206488698720932,
0.2563704252243042,
0.07438085228204727,
0.06986445933580399,
-0.2023008167743683,
0.11858845502138138,
-0.0037254691123962402,
0.0927342101931572,
-0.2414751499891281,
-0.4919673502445221,
0.7703267931938171,
-0.17599815130233765,
-0.2825562357902527,
-0.28037604689598083,
0.276391863822937,
-0.07344213873147964,
0.01904640905559063,
-0.05563823878765106,
0.30745774507522583,
0.17877627909183502,
0.22868138551712036,
-0.03576427698135376,
0.1111324280500412,
-0.3340783417224884,
0.08558748662471771,
0.027907583862543106,
0.23245111107826233,
-0.015478312969207764,
-0.14509858191013336,
0.13012076914310455,
-0.13424237072467804
] |
https://github.com/huggingface/datasets/issues/5546 | Downloaded datasets do not cache at $HF_HOME | Hi ! Can you make sure you set `HF_HOME` before importing `datasets` ?
Then you can print
```python
print(datasets.config.HF_CACHE_HOME)
print(datasets.config.HF_DATASETS_CACHE)
``` | ### Describe the bug
In the huggingface course (https://huggingface.co/course/chapter3/2?fw=pt) it said that if we set HF_HOME, downloaded datasets would be cached at specified address but it does not. downloaded models from checkpoint names are downloaded and cached at HF_HOME but this is not the case for datasets, they are still cached at ~/.cache/huggingface/datasets.
### Steps to reproduce the bug
Run the following code
```
from datasets import load_dataset
raw_datasets = load_dataset("glue", "mrpc")
raw_datasets
```
it downloads and store dataset at ~/.cache/huggingface/datasets
### Expected behavior
to cache dataset at HF_HOME.
### Environment info
python 3.10.6
Kubuntu 22.04
HF_HOME located on a separate partition | 21 | Downloaded datasets do not cache at $HF_HOME
### Describe the bug
In the huggingface course (https://huggingface.co/course/chapter3/2?fw=pt) it said that if we set HF_HOME, downloaded datasets would be cached at specified address but it does not. downloaded models from checkpoint names are downloaded and cached at HF_HOME but this is not the case for datasets, they are still cached at ~/.cache/huggingface/datasets.
### Steps to reproduce the bug
Run the following code
```
from datasets import load_dataset
raw_datasets = load_dataset("glue", "mrpc")
raw_datasets
```
it downloads and store dataset at ~/.cache/huggingface/datasets
### Expected behavior
to cache dataset at HF_HOME.
### Environment info
python 3.10.6
Kubuntu 22.04
HF_HOME located on a separate partition
Hi ! Can you make sure you set `HF_HOME` before importing `datasets` ?
Then you can print
```python
print(datasets.config.HF_CACHE_HOME)
print(datasets.config.HF_DATASETS_CACHE)
``` | [
0.02935585007071495,
-0.2774200439453125,
0.06504884362220764,
0.2512305974960327,
0.2992437481880188,
0.15360045433044434,
0.3081725835800171,
0.13932250440120697,
0.5802940726280212,
0.19665464758872986,
-0.4149155914783478,
-0.22220174968242645,
0.3078145384788513,
-0.018969200551509857,
0.21193598210811615,
-0.1006922721862793,
0.25488606095314026,
-0.09181526303291321,
-0.27560433745384216,
-0.23823286592960358,
-0.1816253662109375,
0.2185046374797821,
0.007870391011238098,
0.030679795891046524,
-0.20735995471477509,
0.07838311791419983,
-0.2656151056289673,
0.21657899022102356,
0.19013769924640656,
-0.25411784648895264,
0.6933286786079407,
0.2129419445991516,
0.014351710677146912,
0.5841816663742065,
-0.00011845555127365515,
0.011815689504146576,
0.15860667824745178,
-0.21354614198207855,
-0.40704670548439026,
-0.04296790063381195,
0.15687209367752075,
-0.08420833945274353,
0.06502189487218857,
-0.09758684039115906,
-0.1955357789993286,
0.2052682787179947,
0.0399145744740963,
-0.21755552291870117,
0.19719934463500977,
0.11134938150644302,
0.17546164989471436,
0.10052058845758438,
0.007028765976428986,
-0.0559481717646122,
0.20606380701065063,
0.31832385063171387,
-0.10693150013685226,
0.15218771994113922,
-0.28507524728775024,
-0.18388882279396057,
-0.007010556757450104,
0.4105924069881439,
0.050101980566978455,
0.16703839600086212,
0.5253538489341736,
0.21591970324516296,
-0.12004803866147995,
-0.12843693792819977,
0.14064326882362366,
-0.003033425658941269,
0.20113736391067505,
-0.3946181833744049,
-0.28333422541618347,
-0.30369582772254944,
-0.19258806109428406,
-0.0525718629360199,
0.4041960835456848,
0.13954968750476837,
-0.18434421718120575,
0.17237770557403564,
-0.08407332003116608,
-0.20037841796875,
-0.06768705695867538,
0.25002360343933105,
0.15780451893806458,
-0.024477697908878326,
-0.16485106945037842,
0.056971050798892975,
-0.07080303132534027,
0.01931600272655487,
-0.07801881432533264,
-0.2765430212020874,
0.06956446170806885,
0.22492265701293945,
-0.11183950304985046,
0.07240349799394608,
0.12640206515789032,
0.5836361646652222,
0.29237282276153564,
-0.184845969080925,
0.07748061418533325,
0.07712067663669586,
0.0858922004699707,
0.07568072527647018,
-0.08570732176303864,
0.18812298774719238,
0.011523701250553131,
0.09768663346767426,
0.2249213010072708,
0.4994318187236786,
-0.351339191198349,
-0.14859867095947266,
0.12239563465118408,
0.0858769565820694,
0.04834207519888878,
-0.04295019060373306,
-0.04324060678482056,
-0.3801800012588501,
0.112639419734478,
0.18042396008968353,
-0.049797967076301575,
0.005085982847958803,
0.10301484167575836,
0.4881202280521393,
-0.2746722102165222,
0.11813120543956757,
-0.23794035613536835,
0.1990801841020584,
-0.27745699882507324,
-0.09006350487470627,
-0.3533194661140442,
0.06883926689624786,
-0.12784996628761292,
0.34019991755485535,
0.35458874702453613,
-0.585537850856781,
0.44543835520744324,
-0.01910863257944584,
0.2069319188594818,
-0.21931339800357819,
-0.09710527211427689,
-0.08105778694152832,
0.34897661209106445,
0.3887125849723816,
-0.11296133697032928,
0.44516557455062866,
0.23572984337806702,
-0.13825048506259918,
-0.2608700692653656,
-0.31948354840278625,
-0.32717958092689514,
-0.2636915147304535,
0.508903443813324,
0.09290183335542679,
-0.17019574344158173,
-0.11085298657417297,
-0.1982164978981018,
-0.05499628558754921,
0.22547224164009094,
-0.0014328733086585999,
0.2225794494152069,
0.12549790740013123,
-0.3240028917789459,
-0.22187374532222748,
0.39075952768325806,
0.7273204326629639,
-0.19580985605716705,
-0.274427592754364,
0.05403731390833855,
-0.008350975811481476,
0.011454664170742035,
-0.025481414049863815,
-0.08839710056781769,
0.07741324603557587,
-0.3327380418777466,
-0.14973056316375732,
0.0420018807053566,
-0.510590136051178,
-0.8019301295280457,
0.10395675897598267,
0.031221643090248108,
0.14262591302394867,
0.11064356565475464,
-0.05807389318943024,
-0.25163644552230835,
0.015394155867397785,
0.06486313045024872,
0.1250414401292801,
0.13109122216701508,
0.02470376528799534,
-0.4128887951374054,
-0.03723694011569023,
-0.09690482914447784,
0.057657573372125626,
-0.038513969630002975,
0.12850163877010345,
0.02825339138507843,
0.023643601685762405,
0.4281090199947357,
0.13135839998722076,
0.0813126489520073,
0.5584436655044556,
0.23451808094978333,
0.2972675561904907,
-0.018089165911078453,
0.06860646605491638,
-0.2421196699142456,
0.2759029269218445,
0.1317438781261444,
-0.2107560634613037,
0.20513203740119934,
-0.21225029230117798,
-0.1990875005722046,
-0.12678299844264984,
-0.26802584528923035,
-0.4505995512008667,
0.015521343797445297,
0.12969274818897247,
0.42252984642982483,
0.016506817191839218,
-0.11152857542037964,
0.816178560256958,
0.17447541654109955,
0.16367346048355103,
-0.1551336944103241,
0.43242862820625305,
-0.01645997352898121,
0.04080253094434738,
-0.3657054901123047,
-0.012076564133167267,
0.420756459236145,
-0.08973793685436249,
-0.1604357361793518,
0.3432255983352661,
0.1385650336742401,
0.17823825776576996,
-0.02364344894886017,
0.07629076391458511,
0.1802930235862732,
0.06682993471622467,
0.02417602203786373,
-0.016217250376939774,
0.06441885977983475,
0.1923760175704956,
-0.12402545660734177,
0.2642955183982849,
0.10448887944221497,
0.1712111532688141,
-0.04655809700489044,
-0.10235204547643661,
0.06505149602890015,
0.11453431844711304,
0.25214818120002747,
-0.32918742299079895,
0.44251030683517456,
-0.32153964042663574,
0.4142419397830963,
0.0191328227519989,
-0.1736995279788971,
0.4327841103076935,
0.22518572211265564,
0.21753083169460297,
-0.0294298455119133,
0.07088103890419006,
-0.30527517199516296,
-0.21550479531288147,
0.3768659234046936,
0.25431591272354126,
0.44731515645980835,
0.14304400980472565,
0.16086967289447784,
0.25794532895088196,
-0.14404281973838806,
-0.1058543473482132,
-0.01193702220916748,
0.009169220924377441,
0.0010637420928105712,
-0.04817638546228409,
0.21554428339004517,
-0.02010359615087509,
-0.22258812189102173,
0.23459655046463013,
-0.07178965210914612,
-0.18227066099643707,
-0.4694150686264038,
0.12823644280433655,
-0.3367660939693451,
-0.1801680028438568,
-0.10662172734737396,
0.08746868371963501,
-0.25910598039627075,
-0.339983731508255,
-0.004022035747766495,
0.2642612159252167,
0.039280328899621964,
-0.0792873203754425,
-0.16239210963249207,
0.23364247381687164,
-0.4409305453300476,
-0.2929963767528534,
-0.38365018367767334,
-0.03556739166378975,
-0.24979549646377563,
-0.1347447633743286,
-0.1631755232810974,
0.04646291956305504,
0.12697073817253113,
-0.04114551842212677,
-0.21653246879577637,
-0.3440820872783661,
-0.25648078322410583,
0.012346841394901276,
0.02247684635221958,
0.24993662536144257,
0.07430680841207504,
0.11617672443389893,
-0.21319714188575745,
-0.1298217922449112,
0.20244550704956055,
-0.30441224575042725,
-0.2945672273635864,
0.07832902669906616,
0.13466089963912964,
0.23533116281032562,
-0.032580602914094925,
0.1616651713848114,
-0.30827972292900085,
-0.2514418363571167,
0.09990378469228745,
-0.028688259422779083,
-0.12007443606853485,
0.2116272896528244,
-0.1457912176847458,
-0.1573636531829834,
-0.29399967193603516,
0.07491890341043472,
-0.4110841751098633,
-0.7929040193557739,
0.2459358274936676,
-0.44830799102783203,
-0.33215028047561646,
-0.033222638070583344,
-0.018962720409035683,
0.012787975370883942,
-0.054011039435863495,
-0.6552013754844666,
-0.3909168839454651,
-0.16133548319339752,
0.20647354423999786,
0.01361718401312828,
0.09564203023910522,
0.15746551752090454,
-0.23089860379695892,
0.0845908522605896,
-0.1904717981815338,
-0.2567795515060425,
0.3199986219406128,
0.08021722733974457,
0.1619972437620163,
-0.33719149231910706,
0.04245743528008461,
-0.09697262197732925,
0.6316003799438477,
0.4833024740219116,
0.20398303866386414,
0.59295654296875,
0.24436286091804504,
0.38448581099510193,
-0.3162616491317749,
-0.37699249386787415,
0.14312463998794556,
-0.017051249742507935,
-0.012111414223909378,
0.14907515048980713,
0.3073718547821045,
0.22953295707702637,
-0.22809314727783203,
-0.15348047018051147,
-0.10947639495134354,
-0.23839141428470612,
-0.42590123414993286,
0.07253698259592056,
0.21492227911949158,
0.3292648494243622,
0.23027721047401428,
-0.34245187044143677,
-0.2986360192298889,
0.3548266887664795,
0.35193967819213867,
0.011398576200008392,
0.43652626872062683,
-0.24394793808460236,
-0.2055560201406479,
-0.5261905789375305,
0.09100370109081268,
0.03186569735407829,
0.01222706027328968,
-0.20675568282604218,
-0.013626787811517715,
0.13066115975379944,
0.03997498378157616,
0.5295122861862183,
-0.12079969793558121,
0.15938863158226013,
-0.14345283806324005,
-0.25173935294151306,
-0.3105906844139099,
-0.2335469126701355,
0.1765090376138687,
-0.12317252904176712,
-0.04128343239426613,
0.5476748943328857,
-0.28135794401168823,
-0.15970876812934875,
-0.06350023299455643,
0.086112841963768,
-0.17905846238136292,
-0.18312610685825348,
-0.30428218841552734,
-0.25347769260406494,
-0.01431051455438137,
-0.0023337900638580322,
-0.08503588289022446,
0.11817357689142227,
0.10540437698364258,
0.1617666333913803,
0.062390051782131195,
0.2233637273311615,
-0.11346827447414398,
-0.07102560251951218,
0.47623181343078613,
0.03225933387875557,
0.37271153926849365,
0.3287993371486664,
0.2930273413658142,
0.17885488271713257,
0.7252205610275269,
-0.2024105042219162,
0.013746105134487152,
-0.013477396219968796,
0.03451329842209816,
-0.010956645011901855,
0.3703539967536926,
-0.15668630599975586,
0.13453185558319092,
0.023066366091370583,
0.15438184142112732,
-0.5325419306755066,
0.26896747946739197,
-0.14822441339492798,
0.16418880224227905,
0.046763863414525986,
-0.20339412987232208,
0.31025969982147217,
-0.0948953777551651,
0.00926893949508667,
0.3207818865776062,
0.33998554944992065,
-0.12060347199440002,
0.2528393268585205,
0.14323340356349945,
0.8025118708610535,
0.05777870491147041,
0.3764459192752838,
-0.013036005198955536,
-0.3100510239601135,
0.5265327095985413,
-0.2443079799413681,
0.12948352098464966,
-0.23505805432796478,
-0.5074870586395264,
-0.12263580411672592,
-0.17471742630004883,
-0.07414772361516953,
-0.15943993628025055,
-0.08246491104364395,
0.3310207724571228,
0.05772389471530914,
0.08343558758497238,
-0.19134117662906647,
-0.07672642916440964,
-0.1173136755824089,
-0.14663353562355042,
-0.3248865604400635,
0.1507079303264618,
0.019629880785942078,
0.8135773539543152,
-0.023055221885442734,
0.1269078254699707,
-0.3058973550796509,
-0.02765372022986412,
-0.1241736114025116,
0.017155401408672333,
-0.29292193055152893,
0.0962088406085968,
0.19016726315021515,
-0.27811115980148315,
-0.20360510051250458,
0.1406174898147583,
0.5189822912216187,
0.07624701410531998,
-0.20914791524410248,
0.08112907409667969,
0.0578833669424057,
0.1006782278418541,
0.043635789304971695,
-0.0027047456242144108,
0.2712849974632263,
-0.10426090657711029,
-0.1338089108467102,
-0.1750650703907013,
-0.1532311886548996,
-0.18254920840263367,
-0.17911584675312042,
-0.1507372111082077,
-0.10826312005519867,
-0.099166139960289,
-0.054435454308986664,
0.027216900140047073,
0.16406694054603577,
-0.23823966085910797,
0.08651240170001984,
0.17276480793952942,
-0.12244152277708054,
-0.12886229157447815,
-0.16502907872200012,
-0.23617388308048248,
-0.277689129114151,
0.8657951354980469,
-0.41078701615333557,
-0.11826071888208389,
0.5053099393844604,
0.08207221329212189,
-0.3457155227661133,
-0.013414911925792694,
-0.05832004174590111,
0.2415764480829239,
-0.4924164116382599,
-0.07759696245193481,
-0.19672536849975586,
-0.025012120604515076,
-0.18071359395980835,
0.04544354975223541,
0.2835061848163605,
-0.46594250202178955,
0.06808066368103027,
-0.18015465140342712,
-0.48453864455223083,
-0.030088350176811218,
-0.2812630832195282,
-0.08931833505630493,
0.3491520285606384,
-0.030461739748716354,
0.1590552181005478,
0.25630199909210205,
-0.2523733377456665,
-0.08073750883340836,
-0.164428249001503,
-0.32085004448890686,
-0.13666772842407227,
0.05124794691801071,
0.2511264979839325,
-0.09710182249546051,
0.04974205046892166,
0.09859620779752731,
-0.23384566605091095,
-0.1763588786125183,
-0.29475611448287964,
0.12753261625766754,
-0.0004370640963315964,
-0.019008804112672806,
0.038015443831682205,
-0.09391750395298004,
-0.0031535085290670395,
-0.18911109864711761,
0.13437519967556,
0.3685089349746704,
0.1347718983888626,
0.15729780495166779,
0.3166286051273346,
-0.026146061718463898,
-0.1754632145166397,
0.06416618824005127,
0.14031074941158295,
-0.08684839308261871,
-0.01661178469657898,
-0.15580159425735474,
-0.1829114854335785,
-0.067691370844841,
-0.06516106426715851,
0.09217197448015213,
-0.20161260664463043,
-0.10811185091733932,
0.3621286153793335,
-0.31303250789642334,
0.028507504612207413,
0.06650963425636292,
0.17753857374191284,
0.09131550043821335,
-0.0022491016425192356,
0.08859126269817352,
0.34955504536628723,
0.10674547404050827,
-0.08703567087650299,
-0.1554371416568756,
0.36926811933517456,
0.23097087442874908,
0.037111397832632065,
0.16468164324760437,
0.20381391048431396,
0.10922297835350037,
0.3166505992412567,
0.23751765489578247,
0.265136182308197,
0.09775169938802719,
0.056266188621520996,
0.35243117809295654,
0.15491244196891785,
0.28906816244125366,
0.21883438527584076,
0.27546361088752747,
0.0028436779975891113,
0.19086770713329315,
0.33535224199295044,
0.17220142483711243,
-0.09862297028303146,
-0.017269577831029892,
0.022660493850708008,
-0.5688886642456055,
-0.0842684656381607,
-0.25390443205833435,
0.0036875158548355103,
0.1599196195602417,
-0.3062514662742615,
0.41909530758857727,
-0.26354461908340454,
-0.19724273681640625,
-0.12658637762069702,
-0.03444698825478554,
-0.1618136763572693,
-0.19885970652103424,
0.2633286714553833,
-0.04216114431619644,
-0.1506199836730957,
0.16185730695724487,
0.07214559614658356,
-0.291290819644928,
0.5371381640434265,
-0.05507798492908478,
-0.10479646921157837,
-0.31899359822273254,
-0.20594298839569092,
0.21869468688964844,
0.34909576177597046,
0.00693749263882637,
0.2777958810329437,
0.06656994670629501,
-0.16151221096515656,
0.039784569293260574,
0.005913125351071358,
0.17738251388072968,
0.12255039066076279,
0.03174211457371712,
0.04916088283061981,
0.2829273045063019,
0.045913808047771454,
-0.13985967636108398,
0.03852527216076851,
-0.010790243744850159,
-0.06260517239570618,
0.38337016105651855,
0.0999467670917511,
-0.10551592707633972,
0.05214859917759895,
-0.11251763999462128,
0.42314234375953674,
-0.3208579123020172,
0.5423027873039246,
-0.33265528082847595,
0.02245086431503296,
-0.08171124756336212,
0.025792114436626434,
-0.3452618420124054,
0.2686917185783386,
0.25995540618896484,
0.02042180858552456,
0.20689329504966736,
-0.35954082012176514,
0.05076998472213745,
-0.0240839421749115,
0.6831972002983093,
0.43934568762779236,
0.08689624071121216,
-0.3210235834121704,
-0.17952600121498108,
-0.4440293312072754,
0.2010071873664856,
-0.20057763159275055,
0.12957137823104858,
0.04997123405337334,
0.06673599779605865,
-0.04826771467924118,
-0.06520222127437592,
0.10795552283525467,
-0.07187327742576599,
0.02369946986436844,
0.253836989402771,
-0.3315991759300232,
-0.06590452790260315,
-0.1433562934398651,
0.053643904626369476,
0.07728810608386993,
-0.31649067997932434,
0.2695397138595581,
0.15707868337631226,
0.011192895472049713,
0.060853950679302216,
-0.030030734837055206,
0.10789129137992859,
-0.2460707128047943,
0.24045267701148987,
-0.030041014775633812,
-0.03208288550376892,
-0.0054159462451934814,
-0.13830898702144623,
-0.30986833572387695,
0.0021386765874922276,
-0.31072989106178284,
-0.3067469298839569,
-0.4051958918571472,
0.5026108026504517,
-0.3064413070678711,
-0.48852965235710144,
-0.22522340714931488,
0.29256176948547363,
0.36409705877304077,
0.07870394736528397,
0.20344416797161102,
0.16453760862350464,
-0.09912455081939697,
0.04899114370346069,
0.6154797673225403,
0.3223857581615448,
-0.11946526169776917,
0.2521288990974426,
-0.19252607226371765,
-0.2559656500816345,
0.5111445188522339,
-0.16957950592041016,
0.06340181827545166,
-0.04624776914715767,
0.35667216777801514,
0.26752519607543945,
-0.47294068336486816,
-0.6048157215118408,
0.030257977545261383,
0.2019871175289154,
-0.07845488935709,
-0.10012446343898773,
0.23422011733055115,
-0.28841039538383484,
0.20338167250156403,
-0.022679347544908524,
0.20945899188518524,
0.06312840431928635,
0.07848010212182999,
0.22349169850349426,
-0.05610902979969978
] |
https://github.com/huggingface/datasets/issues/5543 | the pile datasets url seems to change back | Thanks for reporting, @wjfwzzc.
I am transferring this issue to the corresponding dataset on the Hub: https://huggingface.co/datasets/bookcorpusopen/discussions/1 | ### Describe the bug
in #3627, the host url of the pile dataset became `https://mystic.the-eye.eu`. Now the new url is broken, but `https://the-eye.eu` seems to work again.
### Steps to reproduce the bug
```python3
from datasets import load_dataset
dataset = load_dataset("bookcorpusopen")
```
shows
```python3
ConnectionError: Couldn't reach https://mystic.the-eye.eu/public/AI/pile_preliminary_components/books1.tar.gz (ProxyError(MaxRetryError("HTTPSConnectionPool(host='mystic.the-eye.eu', port=443): Max retries exceeded with url: /public/AI/pile_pr
eliminary_components/books1.tar.gz (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 504 Gateway Timeout')))")))
```
### Expected behavior
Downloading as normal.
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.4.143.bsk.7-amd64-x86_64-with-glibc2.31
- Python version: 3.9.2
- PyArrow version: 6.0.1
- Pandas version: 1.5.3 | 17 | the pile datasets url seems to change back
### Describe the bug
in #3627, the host url of the pile dataset became `https://mystic.the-eye.eu`. Now the new url is broken, but `https://the-eye.eu` seems to work again.
### Steps to reproduce the bug
```python3
from datasets import load_dataset
dataset = load_dataset("bookcorpusopen")
```
shows
```python3
ConnectionError: Couldn't reach https://mystic.the-eye.eu/public/AI/pile_preliminary_components/books1.tar.gz (ProxyError(MaxRetryError("HTTPSConnectionPool(host='mystic.the-eye.eu', port=443): Max retries exceeded with url: /public/AI/pile_pr
eliminary_components/books1.tar.gz (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 504 Gateway Timeout')))")))
```
### Expected behavior
Downloading as normal.
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.4.143.bsk.7-amd64-x86_64-with-glibc2.31
- Python version: 3.9.2
- PyArrow version: 6.0.1
- Pandas version: 1.5.3
Thanks for reporting, @wjfwzzc.
I am transferring this issue to the corresponding dataset on the Hub: https://huggingface.co/datasets/bookcorpusopen/discussions/1 | [
-0.024923846125602722,
0.15067514777183533,
0.0453345961868763,
0.13577064871788025,
-0.02586647868156433,
-0.24235430359840393,
0.2773600220680237,
-0.018846776336431503,
-0.12299036979675293,
-0.10635338723659515,
-0.3565422594547272,
0.2841379642486572,
0.44859084486961365,
-0.03791926056146622,
0.04198082163929939,
0.19878262281417847,
0.10710664838552475,
-0.2522565424442291,
-0.2323901653289795,
-0.06748824566602707,
0.010208513587713242,
0.15765030682086945,
-0.2161199450492859,
-0.16246074438095093,
0.042111460119485855,
0.1747603863477707,
-0.4449291527271271,
0.22836914658546448,
-0.002362741157412529,
-0.21759949624538422,
0.33229565620422363,
0.18395787477493286,
0.2138645201921463,
0.6534194350242615,
-0.0001192323979921639,
0.07458846271038055,
0.2875981330871582,
0.05936436355113983,
-0.17323043942451477,
-0.2465118020772934,
-0.3386569321155548,
-0.24341252446174622,
0.14542467892169952,
-0.11643840372562408,
0.1645883321762085,
0.03504716977477074,
0.03546292334794998,
0.0024305693805217743,
0.08567832410335541,
0.42744261026382446,
0.09829075634479523,
0.5760667324066162,
0.15585775673389435,
0.060377344489097595,
0.23841464519500732,
-0.3076690435409546,
-0.18807955086231232,
0.7631772756576538,
0.09782141447067261,
0.15915673971176147,
0.025507740676403046,
0.2020518034696579,
-0.007730286568403244,
0.18000361323356628,
0.17120960354804993,
0.2372388392686844,
0.14767441153526306,
-0.13496746122837067,
-0.1005268320441246,
0.22596246004104614,
0.4603023827075958,
-0.23022446036338806,
-0.49729469418525696,
-0.030763749033212662,
0.05669156461954117,
0.028700532391667366,
0.2969256639480591,
0.10788965970277786,
0.19072668254375458,
0.22704163193702698,
0.3326388895511627,
-0.15734370052814484,
-0.05814023315906525,
0.3082907497882843,
-0.22861838340759277,
0.4052829444408417,
-0.0693591833114624,
0.18399496376514435,
-0.12648865580558777,
0.030086636543273926,
0.5926325917243958,
-0.06993109732866287,
-0.2061338722705841,
-0.11109451949596405,
-0.33380380272865295,
-0.0366361103951931,
0.021316297352313995,
0.32949185371398926,
-0.011569878086447716,
0.27416348457336426,
0.3673115372657776,
0.10592413693666458,
-0.3705825209617615,
0.1292993724346161,
0.4360852837562561,
-0.0171419158577919,
-0.32479918003082275,
0.06237860769033432,
0.41908490657806396,
0.6380037069320679,
0.10481563210487366,
-0.015146523714065552,
0.1718018800020218,
-0.20035837590694427,
0.06955306231975555,
-0.19460833072662354,
0.31795352697372437,
-0.009693685919046402,
-0.0022255219519138336,
0.13766489923000336,
-0.0589044913649559,
0.11677183210849762,
-0.03079165890812874,
0.21542736887931824,
-0.5015358924865723,
0.4515651762485504,
-0.050903402268886566,
0.019039910286664963,
-0.004519234411418438,
0.05848674103617668,
-0.153763547539711,
-0.013292018324136734,
-0.19283248484134674,
-0.0339987650513649,
0.10133679211139679,
-0.10231120884418488,
0.17970235645771027,
0.15555569529533386,
0.2553607225418091,
-0.1747066229581833,
-0.20246388018131256,
-0.08845970034599304,
0.15803053975105286,
0.19661808013916016,
0.16634772717952728,
0.08227831870317459,
0.07705861330032349,
-0.026240644976496696,
-0.00952928513288498,
-0.020961180329322815,
-0.4642590880393982,
-0.09869973361492157,
-0.2911551892757416,
0.07600419968366623,
-0.2478175312280655,
-0.13945187628269196,
-0.37355363368988037,
-0.19176344573497772,
-0.2668071687221527,
0.12753981351852417,
0.13501958549022675,
-0.26086366176605225,
0.3092277944087982,
-0.16277189552783966,
0.022094668820500374,
0.2611047029495239,
-0.07917363196611404,
-0.039200615137815475,
-0.12434687465429306,
0.20754803717136383,
0.030543692409992218,
0.2731977105140686,
-0.17979338765144348,
-0.34036481380462646,
-0.30677899718284607,
-0.07812990993261337,
0.39009660482406616,
-0.25022658705711365,
-0.6899749040603638,
0.19651930034160614,
-0.2410627156496048,
0.031059758737683296,
-0.19582891464233398,
0.13672715425491333,
0.02736384980380535,
0.0792379230260849,
0.02672869712114334,
0.22883060574531555,
0.261773020029068,
0.038243480026721954,
-0.3026347756385803,
-0.1918565332889557,
-0.22828499972820282,
-0.06685863435268402,
-0.030045296996831894,
0.25695493817329407,
0.06833751499652863,
-0.11960576474666595,
0.5435216426849365,
0.20849113166332245,
0.07791834324598312,
0.20338521897792816,
0.48585790395736694,
0.3714381456375122,
0.33208444714546204,
0.03652925044298172,
-0.15848755836486816,
0.1583733856678009,
-0.311811238527298,
0.18264581263065338,
-0.31067365407943726,
-0.015741396695375443,
-0.33205100893974304,
-0.05492418259382248,
-0.04763888940215111,
-0.19892507791519165,
-0.005618477240204811,
0.21126966178417206,
-0.14324131608009338,
0.16773037612438202,
-0.08529780805110931,
0.0967666432261467,
0.10295604169368744,
0.3217213451862335,
-0.27412721514701843,
0.5893455147743225,
-0.14572061598300934,
-0.07608626782894135,
-0.010803841054439545,
-0.1838882565498352,
0.210296630859375,
-0.2149209976196289,
0.0347159281373024,
0.5180793404579163,
-0.30970361828804016,
0.3952305316925049,
0.14518824219703674,
0.006334707140922546,
0.41071817278862,
-0.2730545103549957,
0.26368358731269836,
0.15278467535972595,
0.24998876452445984,
0.19445013999938965,
0.1465892493724823,
0.18524448573589325,
0.056948043406009674,
0.1523895412683487,
-0.002134747803211212,
0.12579120695590973,
0.34064143896102905,
-0.22969643771648407,
-0.16890473663806915,
0.02335122972726822,
-0.099562868475914,
0.018452361226081848,
-0.10597765445709229,
-0.19878844916820526,
-0.1661319136619568,
0.24486154317855835,
0.14146696031093597,
-0.1267920285463333,
0.15019166469573975,
0.2909635305404663,
-0.18721604347229004,
-0.37787988781929016,
-0.011737527325749397,
0.1351216584444046,
0.2738334536552429,
-0.09368802607059479,
0.13452622294425964,
0.16288195550441742,
-0.1533638834953308,
-0.26539668440818787,
0.21689915657043457,
0.05094780772924423,
-0.09692536294460297,
0.08870844542980194,
0.5101301074028015,
-0.07350169867277145,
-0.36807456612586975,
-0.46475160121917725,
0.07234641164541245,
0.09239563345909119,
-0.28014668822288513,
0.15196362137794495,
-0.37213343381881714,
-0.09766356647014618,
-0.1921529769897461,
-0.14463192224502563,
-0.1990036517381668,
-0.6861081123352051,
-0.4079785943031311,
0.4254869222640991,
-0.10504154860973358,
0.12160602957010269,
-0.1333322823047638,
-0.12856407463550568,
0.045871175825595856,
0.2648114264011383,
-0.22906817495822906,
-0.15962916612625122,
-0.249017596244812,
-0.03484204038977623,
-0.22341255843639374,
-0.09294993430376053,
-0.15731708705425262,
-0.16693083941936493,
-0.2717129588127136,
-0.6921464204788208,
-0.30253705382347107,
0.12020484358072281,
0.07849733531475067,
0.44784796237945557,
0.23856550455093384,
0.3470861315727234,
-0.04470475763082504,
0.03278183192014694,
0.2904980480670929,
-0.0656471773982048,
0.34179267287254333,
0.0003454647958278656,
-0.19750140607357025,
0.06171780079603195,
0.0523223914206028,
-0.22236132621765137,
-0.17902152240276337,
-0.19979806244373322,
0.05074039846658707,
-0.2297591269016266,
0.06094334274530411,
0.024387679994106293,
0.14271432161331177,
0.08481729030609131,
-0.044545892626047134,
-0.09798455983400345,
-0.3077786862850189,
-0.5868250727653503,
0.44767916202545166,
-0.10418783128261566,
-0.367397278547287,
0.018593695014715195,
-0.10336380451917648,
0.1057131215929985,
0.025032203644514084,
-0.6136835217475891,
-0.5172140002250671,
-0.2549268901348114,
0.14998510479927063,
0.16202613711357117,
0.218890979886055,
0.04437793791294098,
-0.35333314538002014,
-0.08135861158370972,
0.041348010301589966,
-0.1908179223537445,
-0.11425866931676865,
0.6307535171508789,
0.3067387342453003,
0.21724525094032288,
0.22065973281860352,
0.20603223145008087,
0.40445512533187866,
-0.11791977286338806,
-0.029640231281518936,
0.5842732191085815,
-0.12504909932613373,
0.4299947917461395,
0.10730400681495667,
-0.12304942309856415,
-0.07664027810096741,
-0.1533149778842926,
0.13449658453464508,
-0.08143657445907593,
0.07496623694896698,
-0.06218118220567703,
-0.10043965280056,
-0.18822674453258514,
-0.20440715551376343,
-0.41165244579315186,
-0.07471273094415665,
-0.21574854850769043,
0.09162816405296326,
0.3184471130371094,
-0.07323097437620163,
-0.16522912681102753,
-0.0770675539970398,
0.20509424805641174,
0.40374261140823364,
-0.007932230830192566,
-0.05769268795847893,
-0.24018040299415588,
0.03876018896698952,
-0.5061667561531067,
0.2541612386703491,
-0.14056041836738586,
0.4968697130680084,
0.2724970579147339,
-0.00027587637305259705,
0.08253180235624313,
-0.08658307790756226,
1.055833339691162,
-0.17308515310287476,
0.29783886671066284,
0.05083434656262398,
0.14488227665424347,
-0.5439345836639404,
-0.1695433109998703,
-0.14825759828090668,
-0.10476221889257431,
0.35789889097213745,
0.42693430185317993,
-0.11047868430614471,
0.11021783947944641,
0.06537843495607376,
-0.19419421255588531,
0.03934908285737038,
0.04354579746723175,
-0.11711376905441284,
-0.5769550204277039,
0.008732033893465996,
0.04196997359395027,
0.03713509440422058,
0.057411495596170425,
-0.01774892956018448,
-0.24997559189796448,
0.08949822187423706,
-0.09845718741416931,
-0.12780609726905823,
-0.0634855255484581,
0.03425911068916321,
0.2933945655822754,
0.01309056207537651,
0.0813419371843338,
0.19078539311885834,
0.11785167455673218,
0.6161060333251953,
-0.06495577096939087,
-0.5756075978279114,
0.14301705360412598,
-0.018385272473096848,
-0.14574337005615234,
0.50726318359375,
0.06152370572090149,
0.10377135127782822,
0.23631548881530762,
0.2671821713447571,
0.011154568754136562,
0.20834070444107056,
0.2215377241373062,
0.1572851687669754,
-0.26631587743759155,
-0.4697326123714447,
0.4267379641532898,
-0.1894870102405548,
-0.14353859424591064,
0.24752241373062134,
0.0323721319437027,
-0.1542864888906479,
0.4174424409866333,
-0.18468722701072693,
0.9159313440322876,
0.13982029259204865,
0.1513104885816574,
0.36840078234672546,
-0.26196789741516113,
0.3547491729259491,
-0.014075063169002533,
0.12969301640987396,
-0.20291242003440857,
-0.14122255146503448,
-0.1604277789592743,
-0.2627105116844177,
0.09749013185501099,
-0.1148064136505127,
-0.02289501763880253,
0.4610971510410309,
-0.18793638050556183,
0.3089236617088318,
0.11705165356397629,
0.06494592130184174,
-0.5114521980285645,
0.038758061826229095,
-0.37260302901268005,
0.1386571228504181,
-0.012361176311969757,
0.2158675491809845,
-0.03429100662469864,
0.016356131061911583,
-0.1483352780342102,
-0.04158482328057289,
-0.34907060861587524,
0.26553091406822205,
-0.02948768250644207,
-0.03768309950828552,
0.07891003787517548,
-0.2517882287502289,
-0.13760055601596832,
0.10544978082180023,
0.1621209681034088,
-0.011253520846366882,
-0.18081611394882202,
0.49422749876976013,
-0.12105721980333328,
0.04663887992501259,
0.39658787846565247,
-0.06964971125125885,
-0.029336998239159584,
0.08957258611917496,
-0.5594042539596558,
0.07938364148139954,
0.11077108234167099,
-0.14882144331932068,
0.047513142228126526,
0.15466901659965515,
0.05146252363920212,
-0.1310485452413559,
0.07629506289958954,
-0.09141460061073303,
0.10295087099075317,
-0.4048137962818146,
0.039324548095464706,
0.15017810463905334,
0.046704187989234924,
-0.0026163458824157715,
-0.12627890706062317,
-0.2747708559036255,
-0.19263209402561188,
0.7417542338371277,
-0.07132155448198318,
0.2111200988292694,
0.17681702971458435,
0.2501361072063446,
-0.024586807936429977,
-0.03156493604183197,
-0.09354481846094131,
-0.4216274917125702,
-0.2698475420475006,
0.2578040659427643,
-0.2192436307668686,
-0.024031102657318115,
-0.1936561018228531,
-0.187955841422081,
0.0071974992752075195,
0.31405627727508545,
-0.1866471767425537,
-0.5387097001075745,
0.3156525194644928,
-0.078518345952034,
-0.04717941954731941,
-0.09051254391670227,
0.04338425397872925,
0.10967741906642914,
0.1190773993730545,
-0.43689900636672974,
-0.21338726580142975,
0.5927841663360596,
-0.20911799371242523,
0.07614786922931671,
-0.49848470091819763,
-0.15838223695755005,
0.2953104078769684,
-0.14705437421798706,
0.060403041541576385,
0.04718867316842079,
0.012734368443489075,
-0.06070384383201599,
-0.5192031264305115,
0.13507847487926483,
0.11469945311546326,
-0.2009802609682083,
-0.12225808203220367,
-0.32240885496139526,
0.01636047102510929,
-0.05723179876804352,
0.15652166306972504,
0.34139594435691833,
-0.01910024881362915,
-0.05354176089167595,
0.3036414682865143,
-0.1480109989643097,
0.11102965474128723,
0.14608508348464966,
-0.023037850856781006,
0.19677692651748657,
0.18832187354564667,
0.2878553867340088,
-0.2575012445449829,
0.02213878184556961,
-0.19532914459705353,
0.0455288402736187,
-0.20222477614879608,
0.19109204411506653,
0.5571963787078857,
-0.06502672284841537,
-0.19960743188858032,
0.04830401763319969,
0.2388170063495636,
0.3470047414302826,
-0.1670420914888382,
-0.2293640822172165,
0.05535294488072395,
0.1063028946518898,
-0.052033040672540665,
-0.2477445751428604,
0.03570089489221573,
0.1610317975282669,
-0.010856568813323975,
-0.20783692598342896,
0.11178088188171387,
-0.23084713518619537,
-0.20396415889263153,
0.18805181980133057,
0.591141939163208,
-0.10637961328029633,
0.257241427898407,
-0.010148253291845322,
-0.13792511820793152,
0.27537864446640015,
0.4610808193683624,
-0.03448775038123131,
0.07954435050487518,
0.2660173177719116,
0.20839285850524902,
-0.10134875774383545,
0.0009933263063430786,
0.3349933326244354,
0.034423958510160446,
-0.2795388102531433,
-0.31511247158050537,
0.11943376809358597,
-0.17390593886375427,
0.1896660327911377,
0.18372824788093567,
0.19006165862083435,
-0.11845306307077408,
0.28374552726745605,
-0.2128080427646637,
0.08732812106609344,
0.11061844974756241,
-0.3465843200683594,
-0.01591111160814762,
-0.1397855281829834,
0.007047988474369049,
0.1699441373348236,
-0.09035228192806244,
-0.24914170801639557,
0.06572180241346359,
0.0826834887266159,
-0.1374601572751999,
-0.7534058094024658,
-0.08892600983381271,
-0.08242454379796982,
0.16544757783412933,
-0.032296858727931976,
0.11052060127258301,
0.2418728619813919,
-0.2681591212749481,
0.08384145051240921,
0.19364912807941437,
0.37725818157196045,
-0.05966636538505554,
0.22912156581878662,
0.22421596944332123,
0.22193723917007446,
-0.09444503486156464,
-0.17714086174964905,
-0.05161140114068985,
0.15076139569282532,
-0.004841744899749756,
0.0874810665845871,
0.20358270406723022,
-0.16869668662548065,
0.1392466127872467,
-0.12133404612541199,
0.6611327528953552,
-0.288993775844574,
0.8026859760284424,
-0.17737163603305817,
0.07610783725976944,
0.00010674446821212769,
-0.01627752184867859,
-0.5251213312149048,
0.05079558864235878,
0.4134760797023773,
-0.22809292376041412,
0.09091313928365707,
-0.21415956318378448,
0.015853922814130783,
-0.06808623671531677,
0.4610435664653778,
0.5204550623893738,
-0.07453238219022751,
-0.09898576140403748,
-0.03718622028827667,
-0.3603076934814453,
0.3023371696472168,
-0.02953839674592018,
-0.03693763166666031,
0.13596338033676147,
0.16681498289108276,
-0.21392416954040527,
-0.019505109637975693,
0.05085399001836777,
0.17528362572193146,
-0.20305097103118896,
0.16299602389335632,
-0.2200966775417328,
-0.2705399692058563,
-0.38127779960632324,
0.49617162346839905,
0.052260883152484894,
-0.15440654754638672,
0.29915329813957214,
0.008059755899012089,
-0.07896620035171509,
-0.13409192860126495,
-0.3576088845729828,
0.12271913886070251,
-0.26405173540115356,
0.6365741491317749,
0.20024460554122925,
-0.141768679022789,
0.020833715796470642,
-0.10779447108507156,
-0.5559110641479492,
-0.5251392126083374,
-0.10455113649368286,
-0.05921392887830734,
-0.16926799714565277,
0.15915653109550476,
-0.06137540191411972,
-0.06493386626243591,
-0.1686515212059021,
0.2601862847805023,
0.04673900455236435,
0.025202276185154915,
0.02175256796181202,
0.13192814588546753,
0.10108108073472977,
-0.04897969216108322,
-0.156005397439003,
0.2967534065246582,
-0.008390307426452637,
0.052063360810279846,
0.003465808928012848,
-0.34613609313964844,
0.4642269015312195,
-0.3178611695766449,
-0.22640705108642578,
-0.11818642914295197,
0.2901604175567627,
-0.3412202000617981,
-0.02404254488646984,
-0.17109185457229614,
0.17650803923606873,
0.32798242568969727,
0.07981960475444794,
-0.48405811190605164,
-0.016825158149003983,
-0.08243697881698608,
0.29271399974823,
-0.16488415002822876,
0.2532351016998291,
0.28255733847618103,
-0.43957963585853577,
0.09425286948680878,
-0.0968780666589737
] |
https://github.com/huggingface/datasets/issues/5543 | the pile datasets url seems to change back | Thank you. All fixes are done:
- [x] https://huggingface.co/datasets/bookcorpusopen/discussions/2
- [x] https://huggingface.co/datasets/the_pile/discussions/1
- [x] https://huggingface.co/datasets/the_pile_books3/discussions/1
- [x] https://huggingface.co/datasets/the_pile_openwebtext2/discussions/2
- [x] https://huggingface.co/datasets/the_pile_stack_exchange/discussions/2 | ### Describe the bug
in #3627, the host url of the pile dataset became `https://mystic.the-eye.eu`. Now the new url is broken, but `https://the-eye.eu` seems to work again.
### Steps to reproduce the bug
```python3
from datasets import load_dataset
dataset = load_dataset("bookcorpusopen")
```
shows
```python3
ConnectionError: Couldn't reach https://mystic.the-eye.eu/public/AI/pile_preliminary_components/books1.tar.gz (ProxyError(MaxRetryError("HTTPSConnectionPool(host='mystic.the-eye.eu', port=443): Max retries exceeded with url: /public/AI/pile_pr
eliminary_components/books1.tar.gz (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 504 Gateway Timeout')))")))
```
### Expected behavior
Downloading as normal.
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.4.143.bsk.7-amd64-x86_64-with-glibc2.31
- Python version: 3.9.2
- PyArrow version: 6.0.1
- Pandas version: 1.5.3 | 21 | the pile datasets url seems to change back
### Describe the bug
in #3627, the host url of the pile dataset became `https://mystic.the-eye.eu`. Now the new url is broken, but `https://the-eye.eu` seems to work again.
### Steps to reproduce the bug
```python3
from datasets import load_dataset
dataset = load_dataset("bookcorpusopen")
```
shows
```python3
ConnectionError: Couldn't reach https://mystic.the-eye.eu/public/AI/pile_preliminary_components/books1.tar.gz (ProxyError(MaxRetryError("HTTPSConnectionPool(host='mystic.the-eye.eu', port=443): Max retries exceeded with url: /public/AI/pile_pr
eliminary_components/books1.tar.gz (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 504 Gateway Timeout')))")))
```
### Expected behavior
Downloading as normal.
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.4.143.bsk.7-amd64-x86_64-with-glibc2.31
- Python version: 3.9.2
- PyArrow version: 6.0.1
- Pandas version: 1.5.3
Thank you. All fixes are done:
- [x] https://huggingface.co/datasets/bookcorpusopen/discussions/2
- [x] https://huggingface.co/datasets/the_pile/discussions/1
- [x] https://huggingface.co/datasets/the_pile_books3/discussions/1
- [x] https://huggingface.co/datasets/the_pile_openwebtext2/discussions/2
- [x] https://huggingface.co/datasets/the_pile_stack_exchange/discussions/2 | [
0.0027176812291145325,
0.14232367277145386,
0.037559155374765396,
0.16497913002967834,
0.006508542224764824,
-0.2241644263267517,
0.22020874917507172,
-0.0392807237803936,
-0.2169613093137741,
-0.11068028211593628,
-0.34006184339523315,
0.23998405039310455,
0.4222784638404846,
-0.07168181240558624,
0.12126346677541733,
0.16714777052402496,
0.10990621149539948,
-0.2771190106868744,
-0.27372774481773376,
-0.03723949193954468,
-0.025352519005537033,
0.18938684463500977,
-0.25039198994636536,
-0.14951345324516296,
0.15948055684566498,
0.1636701375246048,
-0.4648648500442505,
0.2287287712097168,
0.013375879265367985,
-0.24397534132003784,
0.3153783082962036,
0.09810349345207214,
0.1943279206752777,
0.7014138698577881,
-0.00011883227125508711,
0.08724600076675415,
0.28230637311935425,
0.06731951236724854,
-0.23042163252830505,
-0.28186482191085815,
-0.3132002651691437,
-0.25189605355262756,
0.12862183153629303,
-0.10307202488183975,
0.14116409420967102,
-0.07457096129655838,
0.032771993428468704,
-0.0959848016500473,
0.14091603457927704,
0.44926685094833374,
0.11214329302310944,
0.5911680459976196,
0.20537392795085907,
0.05126120150089264,
0.23400527238845825,
-0.24632324278354645,
-0.13941361010074615,
0.7703169584274292,
0.07879709452390671,
0.17104187607765198,
0.07283198833465576,
0.24647606909275055,
0.011651432141661644,
0.09455348551273346,
0.17952555418014526,
0.24598222970962524,
0.10391347110271454,
-0.1449010968208313,
-0.08444138616323471,
0.1694345623254776,
0.4708227217197418,
-0.21152693033218384,
-0.49185481667518616,
-0.03889919072389603,
0.0275406651198864,
0.018309688195586205,
0.258433997631073,
0.12029343098402023,
0.19430679082870483,
0.24416227638721466,
0.2705347537994385,
-0.1060607060790062,
-0.046263352036476135,
0.3483402132987976,
-0.15737026929855347,
0.410033643245697,
-0.1205185055732727,
0.17537152767181396,
-0.08101150393486023,
0.011322937905788422,
0.4710633456707001,
0.0020503252744674683,
-0.2020176202058792,
-0.07044939696788788,
-0.28534314036369324,
-0.0070207379758358,
0.04897034913301468,
0.2924846410751343,
0.034611254930496216,
0.2522081732749939,
0.37856990098953247,
0.07815774530172348,
-0.3510732054710388,
0.08374042809009552,
0.424299955368042,
-0.006780799478292465,
-0.30470994114875793,
0.044175244867801666,
0.36522507667541504,
0.6403945684432983,
0.1400776505470276,
-0.025362633168697357,
0.22163714468479156,
-0.203892782330513,
0.0872296690940857,
-0.22738108038902283,
0.3670654892921448,
-0.022518638521432877,
0.011287970468401909,
0.11805956065654755,
-0.08963730931282043,
0.0683351457118988,
-0.04192151129245758,
0.268466979265213,
-0.48773595690727234,
0.4311080574989319,
-0.01564684510231018,
-0.001233164221048355,
0.014443127438426018,
0.0026537515223026276,
-0.15057891607284546,
-0.06648629903793335,
-0.18802590668201447,
-0.01668175309896469,
0.07156331837177277,
-0.15315887331962585,
0.2447502315044403,
0.1845782846212387,
0.2055366486310959,
-0.21695858240127563,
-0.19536177814006805,
-0.03627600520849228,
0.19247375428676605,
0.14606927335262299,
0.08578687906265259,
0.08704857528209686,
0.13138295710086823,
-0.03656468167901039,
-0.010742150247097015,
-0.03728024661540985,
-0.45034241676330566,
-0.11424688994884491,
-0.3376012146472931,
0.08817406743764877,
-0.14252889156341553,
-0.1388186812400818,
-0.3337874114513397,
-0.16909974813461304,
-0.25465571880340576,
0.11453549563884735,
0.1748385727405548,
-0.24239496886730194,
0.2525964379310608,
-0.14563851058483124,
0.09411825984716415,
0.319833368062973,
-0.08790430426597595,
-0.08098307251930237,
-0.1469072848558426,
0.1430433839559555,
0.049351874738931656,
0.2739986777305603,
-0.15134090185165405,
-0.3419908881187439,
-0.36510419845581055,
-0.16165423393249512,
0.3519522547721863,
-0.20366103947162628,
-0.6402560472488403,
0.25140368938446045,
-0.24880629777908325,
0.06565507501363754,
-0.174978107213974,
0.10975857824087143,
-0.04364165663719177,
0.08428121358156204,
0.010540880262851715,
0.16081200540065765,
0.2602587044239044,
0.058894768357276917,
-0.30127352476119995,
-0.18135522305965424,
-0.18920205533504486,
-0.09844274818897247,
-0.09153850376605988,
0.263452410697937,
0.10104187577962875,
-0.20985209941864014,
0.5583704113960266,
0.20086660981178284,
0.03856223076581955,
0.20439428091049194,
0.5209277868270874,
0.4285150170326233,
0.30505579710006714,
0.02495332807302475,
-0.26178961992263794,
0.10433759540319443,
-0.2833534777164459,
0.15232543647289276,
-0.3042391538619995,
-0.02345295064151287,
-0.3787780702114105,
-0.019445186480879784,
-0.03318401798605919,
-0.2884240448474884,
-0.001027354970574379,
0.26316940784454346,
-0.09264613687992096,
0.19036094844341278,
-0.11179043352603912,
0.05185864120721817,
0.17146539688110352,
0.31901097297668457,
-0.33160200715065,
0.4756469428539276,
-0.1569889634847641,
-0.03310263156890869,
-0.01832406036555767,
-0.15675514936447144,
0.23245558142662048,
-0.22104641795158386,
0.02636200189590454,
0.5861051678657532,
-0.3139607012271881,
0.38646674156188965,
0.09276607632637024,
-0.011788979172706604,
0.3945434093475342,
-0.3134273290634155,
0.22734475135803223,
0.20376425981521606,
0.21854828298091888,
0.1874161660671234,
0.17290586233139038,
0.16079723834991455,
0.051871538162231445,
0.18986281752586365,
-0.0005727671086788177,
0.11833219975233078,
0.30668607354164124,
-0.23244325816631317,
-0.18108730018138885,
-0.030408062040805817,
-0.05112094059586525,
-0.0083148293197155,
-0.003972720354795456,
-0.15795975923538208,
-0.2537829279899597,
0.21576933562755585,
0.062337931245565414,
-0.14546184241771698,
0.10111888498067856,
0.31924641132354736,
-0.20970267057418823,
-0.36781471967697144,
-0.02772982232272625,
0.16350334882736206,
0.2909277677536011,
-0.055706579238176346,
0.1366451233625412,
0.19734331965446472,
-0.07073462754487991,
-0.2756071984767914,
0.26070332527160645,
0.022163156419992447,
-0.08956898748874664,
0.06547877192497253,
0.48176735639572144,
-0.06020507588982582,
-0.31942102313041687,
-0.41936925053596497,
-0.023351747542619705,
0.08799944818019867,
-0.3263899087905884,
0.17199693620204926,
-0.36696672439575195,
-0.18906670808792114,
-0.29680925607681274,
-0.10091658681631088,
-0.22131624817848206,
-0.6445690393447876,
-0.42436349391937256,
0.30451205372810364,
-0.15894563496112823,
0.14202645421028137,
-0.19824673235416412,
-0.12601764500141144,
0.010934101417660713,
0.26306718587875366,
-0.2376590371131897,
-0.14067621529102325,
-0.280354380607605,
-0.04247256740927696,
-0.17234231531620026,
-0.13072653114795685,
-0.09502577781677246,
-0.15129657089710236,
-0.32842105627059937,
-0.7108113169670105,
-0.36148011684417725,
0.07408832758665085,
0.11359544843435287,
0.45209601521492004,
0.26420098543167114,
0.3588792681694031,
-0.04820685833692551,
-0.02615160122513771,
0.31688040494918823,
-0.057572826743125916,
0.2788298726081848,
-0.01978260464966297,
-0.16507190465927124,
0.11171514540910721,
0.01987723633646965,
-0.22798806428909302,
-0.1667519211769104,
-0.1847960203886032,
0.13005532324314117,
-0.2260195016860962,
0.059269972145557404,
0.11263299733400345,
0.16198647022247314,
0.13233248889446259,
-0.12409019470214844,
-0.033356763422489166,
-0.28795126080513,
-0.5962162017822266,
0.4056525230407715,
-0.10283774137496948,
-0.383655846118927,
-0.027853306382894516,
-0.0665837824344635,
0.1088823676109314,
0.016026977449655533,
-0.6369326710700989,
-0.4403266906738281,
-0.2779678404331207,
0.12294721603393555,
0.11286189407110214,
0.2505280673503876,
0.007979273796081543,
-0.2848787307739258,
-0.09667710214853287,
0.04382359981536865,
-0.2358458936214447,
-0.12520557641983032,
0.4917604327201843,
0.3363746404647827,
0.23784270882606506,
0.31563326716423035,
0.1797303408384323,
0.4875331521034241,
-0.07349026203155518,
-0.04850177839398384,
0.5427656173706055,
-0.12855491042137146,
0.48790067434310913,
0.12972666323184967,
-0.2051704227924347,
-0.07889419049024582,
-0.16321906447410583,
0.13052058219909668,
-0.07520438730716705,
0.054537583142519,
-0.0014066528528928757,
-0.13888497650623322,
-0.143014058470726,
-0.24485120177268982,
-0.3674813508987427,
-0.06833630800247192,
-0.224603533744812,
0.14018230140209198,
0.284383088350296,
-0.09863467514514923,
-0.1248110830783844,
-0.08779112994670868,
0.20192381739616394,
0.38353103399276733,
-0.013292871415615082,
-0.052399806678295135,
-0.2989487051963806,
0.11553791165351868,
-0.4879775047302246,
0.29232025146484375,
-0.16690117120742798,
0.5027239918708801,
0.2516017556190491,
-0.05995379388332367,
0.07626277953386307,
-0.03719333931803703,
1.0465142726898193,
-0.014648029580712318,
0.28069305419921875,
0.01731523498892784,
0.11218035221099854,
-0.518354594707489,
-0.12425398826599121,
-0.1334037035703659,
-0.1694880723953247,
0.45951297879219055,
0.45659300684928894,
-0.16719824075698853,
0.12372669577598572,
0.13319936394691467,
-0.16491596400737762,
0.03959478810429573,
0.01555615197867155,
-0.13261042535305023,
-0.5821226239204407,
0.06488437950611115,
0.000054448843002319336,
0.01983668841421604,
0.0309798251837492,
0.04793868958950043,
-0.19332168996334076,
0.1018250584602356,
-0.13198211789131165,
-0.13352632522583008,
-0.12660634517669678,
0.05924854427576065,
0.3002048432826996,
0.004678614437580109,
0.10202227532863617,
0.24885059893131256,
0.14356523752212524,
0.6220570802688599,
-0.11699555814266205,
-0.6340370178222656,
0.0807293951511383,
0.06639373302459717,
-0.034340329468250275,
0.4669348895549774,
0.06030995398759842,
0.11491324752569199,
0.3525617718696594,
0.3428589701652527,
0.018410025164484978,
0.16667166352272034,
0.26859748363494873,
0.15638519823551178,
-0.25643712282180786,
-0.49520084261894226,
0.4352432191371918,
-0.18477079272270203,
-0.09655027836561203,
0.25835174322128296,
0.04167667403817177,
-0.1851893812417984,
0.35770130157470703,
-0.16700351238250732,
0.943206787109375,
0.17797324061393738,
0.15181995928287506,
0.3956319987773895,
-0.3205995559692383,
0.3871089220046997,
0.10143907368183136,
0.07722362130880356,
-0.16367125511169434,
-0.1035148873925209,
-0.1142725870013237,
-0.2802567780017853,
0.09293623268604279,
-0.12017276883125305,
-0.07323028147220612,
0.4568002223968506,
-0.18742635846138,
0.2631891071796417,
0.15299132466316223,
0.10588377714157104,
-0.45685264468193054,
0.06691009551286697,
-0.4221642315387726,
0.1266985833644867,
-0.025526396930217743,
0.23853527009487152,
-0.05494464188814163,
-0.004077780991792679,
-0.11392603069543839,
-0.06526989489793777,
-0.3217248320579529,
0.26455923914909363,
-0.16030289232730865,
-0.0037809330970048904,
0.153975248336792,
-0.29809820652008057,
-0.08819018304347992,
0.17742736637592316,
0.14107519388198853,
0.005286328494548798,
-0.1723126769065857,
0.45796850323677063,
-0.0742451623082161,
0.06956713646650314,
0.4028133451938629,
-0.05662553757429123,
0.02927085943520069,
0.09456757456064224,
-0.5065432190895081,
0.09206105768680573,
0.08211739361286163,
-0.14341315627098083,
0.010683327913284302,
0.1420004963874817,
-0.007216401398181915,
-0.12677158415317535,
0.043497055768966675,
-0.10432571172714233,
0.15959344804286957,
-0.3918111324310303,
0.04155982285737991,
0.15021765232086182,
0.07880131155252457,
-0.09532365947961807,
-0.10014432668685913,
-0.27972421050071716,
-0.21555332839488983,
0.725820779800415,
-0.15138310194015503,
0.15056724846363068,
0.2427293211221695,
0.30948731303215027,
-0.029834408313035965,
-0.015197914093732834,
-0.054014261811971664,
-0.41436082124710083,
-0.2388124167919159,
0.27297985553741455,
-0.20704934000968933,
0.09200777113437653,
-0.19315817952156067,
-0.22252699732780457,
0.020825644955039024,
0.31823864579200745,
-0.1604335457086563,
-0.4703997075557709,
0.2890903353691101,
-0.0883302092552185,
-0.03162270411849022,
-0.11016771197319031,
0.03283314406871796,
0.1381801813840866,
0.11427164077758789,
-0.4117068350315094,
-0.22576174139976501,
0.5794985294342041,
-0.13369834423065186,
0.044939953833818436,
-0.3272581696510315,
-0.11455626040697098,
0.2891573905944824,
-0.1180763989686966,
0.07812298089265823,
0.011534642428159714,
0.029250560328364372,
-0.06438423693180084,
-0.5167919993400574,
0.11923181265592575,
0.08673632144927979,
-0.2491912990808487,
-0.11132238060235977,
-0.2631072998046875,
0.054450623691082,
-0.06456004083156586,
0.11234000325202942,
0.35259464383125305,
0.016249880194664,
-0.016000233590602875,
0.17474360764026642,
-0.11899151653051376,
0.1389789581298828,
0.13217701017856598,
-0.04112190753221512,
0.17600110173225403,
0.2561711072921753,
0.2741449177265167,
-0.2493889182806015,
-0.028323035687208176,
-0.20000773668289185,
0.03170350193977356,
-0.18025438487529755,
0.16621503233909607,
0.5353685617446899,
-0.07468712329864502,
-0.26142942905426025,
0.07873909920454025,
0.24260351061820984,
0.36298805475234985,
-0.18357564508914948,
-0.1748603880405426,
0.10341335088014603,
0.11012226343154907,
-0.06437091529369354,
-0.1458936333656311,
-0.003570413216948509,
0.1563485711812973,
-0.005545135587453842,
-0.1837490200996399,
-0.012189075350761414,
-0.2386498600244522,
-0.20726017653942108,
0.17740553617477417,
0.5339285731315613,
-0.08017652481794357,
0.2823376953601837,
-0.058630820363759995,
-0.11792317032814026,
0.2211908996105194,
0.4282342791557312,
-0.007273923605680466,
0.12553036212921143,
0.1364814192056656,
0.1802375614643097,
-0.11685340106487274,
-0.10309746116399765,
0.3370248079299927,
0.04358352720737457,
-0.26191630959510803,
-0.2941820025444031,
0.23491623997688293,
-0.22739604115486145,
0.20051071047782898,
0.16400229930877686,
0.3081050217151642,
-0.11773184686899185,
0.25531458854675293,
-0.1588640809059143,
0.129378080368042,
0.1347745954990387,
-0.3370513319969177,
0.0109681636095047,
-0.16289794445037842,
-0.003914080560207367,
0.16404907405376434,
-0.07156997919082642,
-0.34441471099853516,
0.050529785454273224,
0.08785088360309601,
-0.2058088332414627,
-0.8290616273880005,
-0.13373452425003052,
-0.04580584913492203,
0.18675515055656433,
-0.04484647512435913,
0.13155321776866913,
0.2624756097793579,
-0.28673940896987915,
0.08219555020332336,
0.2768283188343048,
0.4013330936431885,
-0.02386452630162239,
0.3373929560184479,
0.23312026262283325,
0.19862216711044312,
-0.07572165131568909,
-0.17991669476032257,
-0.044526614248752594,
0.1356050670146942,
-0.03552345559000969,
0.11035549640655518,
0.1973681002855301,
-0.17037685215473175,
0.06586430966854095,
-0.10524305701255798,
0.6928538680076599,
-0.3680700957775116,
0.7324965000152588,
-0.2783050835132599,
0.05050189048051834,
-0.020065579563379288,
0.018827319145202637,
-0.566272497177124,
0.04268261045217514,
0.3816736936569214,
-0.19750118255615234,
0.09244797378778458,
-0.22970275580883026,
0.024846307933330536,
0.009503071196377277,
0.42741766571998596,
0.575556755065918,
-0.060759954154491425,
-0.10758314281702042,
-0.13541749119758606,
-0.44468942284584045,
0.2663891613483429,
0.0186709426343441,
-0.013737404718995094,
0.04010660946369171,
0.16647039353847504,
-0.19399508833885193,
-0.02197221666574478,
0.07547421753406525,
0.12541012465953827,
-0.23134779930114746,
0.1370500773191452,
-0.19796539843082428,
-0.2388974279165268,
-0.4044911861419678,
0.5394235849380493,
0.07746424525976181,
-0.0884895771741867,
0.2564661502838135,
-0.029095731675624847,
-0.07615172117948532,
-0.1375676840543747,
-0.2571394443511963,
0.05435676500201225,
-0.2540915608406067,
0.6137753129005432,
0.2255796194076538,
-0.18350234627723694,
0.02458588406443596,
-0.18362559378147125,
-0.5475998520851135,
-0.5155298709869385,
-0.06703102588653564,
0.036675870418548584,
-0.1415960043668747,
0.15677234530448914,
-0.0832536369562149,
-0.13451474905014038,
-0.21704286336898804,
0.3064669668674469,
0.04566913843154907,
-0.059637442231178284,
0.00909087061882019,
0.12850062549114227,
0.13964322209358215,
-0.11182665079832077,
-0.10754178464412689,
0.30220407247543335,
-0.03956791013479233,
0.07457396388053894,
-0.04411754384636879,
-0.38942188024520874,
0.42216864228248596,
-0.36889055371284485,
-0.15305596590042114,
-0.09786538034677505,
0.3248646855354309,
-0.3312600255012512,
-0.043793514370918274,
-0.2254439890384674,
0.1833435595035553,
0.3818226158618927,
0.10107502341270447,
-0.423051655292511,
-0.020315051078796387,
-0.15718597173690796,
0.30314901471138,
-0.16161282360553741,
0.3463062345981598,
0.3362888693809509,
-0.41314947605133057,
0.1735670566558838,
-0.07767947018146515
] |
https://github.com/huggingface/datasets/issues/5541 | Flattening indices in selected datasets is extremely inefficient | Running the script above on the branch https://github.com/huggingface/datasets/pull/5542 results in the expected behaviour:
```
Num chunks for original ds: 1
Original ds save/load
save_to_disk -- RAM memory used: 0.671875 MB -- Total time: 0.255265 s
load_from_disk -- RAM memory used: 42.796875 MB -- Total time: 0.014899 s
Num chunks for original ds after reloading: 5000
Num chunks for selected ds: 1
flatten_indices -- RAM memory used: 42.546875 MB -- Total time: 23.735089 s
Num chunks for selected ds after flattening: 5000
Selected ds save/load
save_to_disk -- RAM memory used: 0.0 MB -- Total time: 0.287112 s
load_from_disk -- RAM memory used: 38.84375 MB -- Total time: 0.014772 s
Num chunks for selected ds after reloading: 5000
``` | ### Describe the bug
If we perform a `select` (or `shuffle`, `train_test_split`, etc.) operation on a dataset , we end up with a dataset with an `indices_table`. Currently, flattening such dataset consumes a lot of memory and the resulting flat dataset contains ChunkedArrays with as many chunks as there are rows. This is extremely inefficient and slows down the operations on the flat dataset, e.g., saving/loading the dataset to disk becomes really slow.
Perhaps more importantly, loading the dataset back from disk basically loads the whole table into RAM, as it cannot take advantage of memory mapping.
### Steps to reproduce the bug
The following script reproduces the issue:
```python
import gc
import os
import psutil
import tempfile
import time
from datasets import Dataset
DATASET_SIZE = 5000000
def profile(func):
def wrapper(*args, **kwargs):
mem_before = psutil.Process(os.getpid()).memory_info().rss / (1024 * 1024)
start = time.time()
# Run function here
out = func(*args, **kwargs)
end = time.time()
mem_after = psutil.Process(os.getpid()).memory_info().rss / (1024 * 1024)
print(f"{func.__name__} -- RAM memory used: {mem_after - mem_before} MB -- Total time: {end - start:.6f} s")
return out
return wrapper
def main():
ds = Dataset.from_list([{'col': i} for i in range(DATASET_SIZE)])
print(f"Num chunks for original ds: {ds.data['col'].num_chunks}")
with tempfile.TemporaryDirectory() as tmpdir:
path1 = os.path.join(tmpdir, 'ds1')
print("Original ds save/load")
profile(ds.save_to_disk)(path1)
ds_loaded = profile(Dataset.load_from_disk)(path1)
print(f"Num chunks for original ds after reloading: {ds_loaded.data['col'].num_chunks}")
print("")
ds_select = ds.select(reversed(range(len(ds))))
print(f"Num chunks for selected ds: {ds_select.data['col'].num_chunks}")
del ds
del ds_loaded
gc.collect()
# This would happen anyway when we call save_to_disk
ds_select = profile(ds_select.flatten_indices)()
print(f"Num chunks for selected ds after flattening: {ds_select.data['col'].num_chunks}")
print("")
path2 = os.path.join(tmpdir, 'ds2')
print("Selected ds save/load")
profile(ds_select.save_to_disk)(path2)
del ds_select
gc.collect()
ds_select_loaded = profile(Dataset.load_from_disk)(path2)
print(f"Num chunks for selected ds after reloading: {ds_select_loaded.data['col'].num_chunks}")
if __name__ == '__main__':
main()
```
Sample result:
```
Num chunks for original ds: 1
Original ds save/load
save_to_disk -- RAM memory used: 0.515625 MB -- Total time: 0.253888 s
load_from_disk -- RAM memory used: 42.765625 MB -- Total time: 0.015176 s
Num chunks for original ds after reloading: 5000
Num chunks for selected ds: 1
flatten_indices -- RAM memory used: 4852.609375 MB -- Total time: 46.116774 s
Num chunks for selected ds after flattening: 5000000
Selected ds save/load
save_to_disk -- RAM memory used: 1326.65625 MB -- Total time: 42.309825 s
load_from_disk -- RAM memory used: 2085.953125 MB -- Total time: 11.659137 s
Num chunks for selected ds after reloading: 5000000
```
### Expected behavior
Saving/loading the dataset should be much faster and consume almost no extra memory thanks to pyarrow memory mapping.
### Environment info
- `datasets` version: 2.9.1.dev0
- Platform: macOS-13.1-arm64-arm-64bit
- Python version: 3.10.8
- PyArrow version: 11.0.0
- Pandas version: 1.5.3 | 117 | Flattening indices in selected datasets is extremely inefficient
### Describe the bug
If we perform a `select` (or `shuffle`, `train_test_split`, etc.) operation on a dataset , we end up with a dataset with an `indices_table`. Currently, flattening such dataset consumes a lot of memory and the resulting flat dataset contains ChunkedArrays with as many chunks as there are rows. This is extremely inefficient and slows down the operations on the flat dataset, e.g., saving/loading the dataset to disk becomes really slow.
Perhaps more importantly, loading the dataset back from disk basically loads the whole table into RAM, as it cannot take advantage of memory mapping.
### Steps to reproduce the bug
The following script reproduces the issue:
```python
import gc
import os
import psutil
import tempfile
import time
from datasets import Dataset
DATASET_SIZE = 5000000
def profile(func):
def wrapper(*args, **kwargs):
mem_before = psutil.Process(os.getpid()).memory_info().rss / (1024 * 1024)
start = time.time()
# Run function here
out = func(*args, **kwargs)
end = time.time()
mem_after = psutil.Process(os.getpid()).memory_info().rss / (1024 * 1024)
print(f"{func.__name__} -- RAM memory used: {mem_after - mem_before} MB -- Total time: {end - start:.6f} s")
return out
return wrapper
def main():
ds = Dataset.from_list([{'col': i} for i in range(DATASET_SIZE)])
print(f"Num chunks for original ds: {ds.data['col'].num_chunks}")
with tempfile.TemporaryDirectory() as tmpdir:
path1 = os.path.join(tmpdir, 'ds1')
print("Original ds save/load")
profile(ds.save_to_disk)(path1)
ds_loaded = profile(Dataset.load_from_disk)(path1)
print(f"Num chunks for original ds after reloading: {ds_loaded.data['col'].num_chunks}")
print("")
ds_select = ds.select(reversed(range(len(ds))))
print(f"Num chunks for selected ds: {ds_select.data['col'].num_chunks}")
del ds
del ds_loaded
gc.collect()
# This would happen anyway when we call save_to_disk
ds_select = profile(ds_select.flatten_indices)()
print(f"Num chunks for selected ds after flattening: {ds_select.data['col'].num_chunks}")
print("")
path2 = os.path.join(tmpdir, 'ds2')
print("Selected ds save/load")
profile(ds_select.save_to_disk)(path2)
del ds_select
gc.collect()
ds_select_loaded = profile(Dataset.load_from_disk)(path2)
print(f"Num chunks for selected ds after reloading: {ds_select_loaded.data['col'].num_chunks}")
if __name__ == '__main__':
main()
```
Sample result:
```
Num chunks for original ds: 1
Original ds save/load
save_to_disk -- RAM memory used: 0.515625 MB -- Total time: 0.253888 s
load_from_disk -- RAM memory used: 42.765625 MB -- Total time: 0.015176 s
Num chunks for original ds after reloading: 5000
Num chunks for selected ds: 1
flatten_indices -- RAM memory used: 4852.609375 MB -- Total time: 46.116774 s
Num chunks for selected ds after flattening: 5000000
Selected ds save/load
save_to_disk -- RAM memory used: 1326.65625 MB -- Total time: 42.309825 s
load_from_disk -- RAM memory used: 2085.953125 MB -- Total time: 11.659137 s
Num chunks for selected ds after reloading: 5000000
```
### Expected behavior
Saving/loading the dataset should be much faster and consume almost no extra memory thanks to pyarrow memory mapping.
### Environment info
- `datasets` version: 2.9.1.dev0
- Platform: macOS-13.1-arm64-arm-64bit
- Python version: 3.10.8
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
Running the script above on the branch https://github.com/huggingface/datasets/pull/5542 results in the expected behaviour:
```
Num chunks for original ds: 1
Original ds save/load
save_to_disk -- RAM memory used: 0.671875 MB -- Total time: 0.255265 s
load_from_disk -- RAM memory used: 42.796875 MB -- Total time: 0.014899 s
Num chunks for original ds after reloading: 5000
Num chunks for selected ds: 1
flatten_indices -- RAM memory used: 42.546875 MB -- Total time: 23.735089 s
Num chunks for selected ds after flattening: 5000
Selected ds save/load
save_to_disk -- RAM memory used: 0.0 MB -- Total time: 0.287112 s
load_from_disk -- RAM memory used: 38.84375 MB -- Total time: 0.014772 s
Num chunks for selected ds after reloading: 5000
``` | [
-0.19913232326507568,
-0.24241355061531067,
-0.026689382269978523,
0.42907869815826416,
0.08236698806285858,
0.24479401111602783,
0.01324290782213211,
0.44538038969039917,
-0.06731289625167847,
0.3971453905105591,
0.07559619098901749,
0.658035397529602,
-0.008868818171322346,
-0.17665702104568481,
-0.07424245029687881,
0.14605118334293365,
0.10699322819709778,
0.11375470459461212,
-0.051749616861343384,
-0.0567515604197979,
-0.5296621322631836,
-0.24902750551700592,
-0.283330500125885,
-0.36210960149765015,
-0.27994251251220703,
-0.10216441005468369,
0.1312144547700882,
0.07598456740379333,
-0.27081090211868286,
-0.09290509670972824,
0.3391991853713989,
0.09799376130104065,
-0.1983557790517807,
0.4514278173446655,
-0.00011920493125217035,
0.032481878995895386,
0.1592477560043335,
0.07164398580789566,
-0.4114287793636322,
0.2758263349533081,
-0.3960528075695038,
-0.12513749301433563,
-0.010850464925169945,
-0.3627094328403473,
0.03706473857164383,
-0.05849897488951683,
-0.26024129986763,
-0.8054006695747375,
-0.14458893239498138,
-0.0006462018936872482,
0.11545314639806747,
0.2985095977783203,
-0.5752395987510681,
-0.09784302860498428,
0.232357919216156,
0.02404593676328659,
-0.13604797422885895,
-0.042473338544368744,
-0.12264765799045563,
-0.24196846783161163,
0.25372904539108276,
0.2931940257549286,
-0.32659193873405457,
0.024146659299731255,
0.11221060156822205,
0.10992196947336197,
0.10438748449087143,
0.01606758125126362,
-0.029363028705120087,
0.10591288655996323,
0.3395443558692932,
-0.21137943863868713,
-0.23128741979599,
-0.3765512704849243,
0.049826186150312424,
-0.1662515103816986,
-0.05730444937944412,
0.1626032441854477,
0.09617072343826294,
0.16620998084545135,
-0.214317187666893,
0.26011624932289124,
0.31037381291389465,
0.04023313522338867,
0.3469756245613098,
0.07832401245832443,
0.18901485204696655,
0.0385756641626358,
0.49458765983581543,
-0.04996480792760849,
0.22293047606945038,
-0.24250590801239014,
0.16149188578128815,
-0.08369585126638412,
-0.3727274239063263,
-0.09255240857601166,
0.17298173904418945,
-0.4159802794456482,
0.1934318244457245,
-0.005610007792711258,
0.22420737147331238,
0.09584008157253265,
0.19708256423473358,
0.051264554262161255,
0.1632240265607834,
0.3586544394493103,
-0.15093153715133667,
0.42392635345458984,
-0.04026440531015396,
0.24236808717250824,
0.174561008810997,
0.06673850119113922,
0.028457075357437134,
0.0958842858672142,
0.11246451735496521,
-0.17264431715011597,
-0.015003281645476818,
0.07106734812259674,
-0.7277239561080933,
0.0658162534236908,
-0.0013029426336288452,
0.11560003459453583,
0.0716409683227539,
0.09024415165185928,
0.10408644378185272,
0.29348108172416687,
-0.14587479829788208,
-0.07394081354141235,
-0.3437626361846924,
0.2609618306159973,
-0.31114837527275085,
-0.18318457901477814,
-0.2554735839366913,
0.23055580258369446,
-0.00437464565038681,
0.07930606603622437,
-0.10850965976715088,
0.2727243900299072,
0.112960085272789,
0.14370203018188477,
0.13152211904525757,
-0.27384334802627563,
0.2447355091571808,
0.29027101397514343,
-0.3688015341758728,
0.031076209619641304,
0.24965424835681915,
0.03881147503852844,
-0.23604461550712585,
0.3941916227340698,
-0.20143947005271912,
-0.2634996175765991,
0.095125213265419,
0.1401893049478531,
0.08981035649776459,
0.11793392896652222,
-0.18253564834594727,
0.41361886262893677,
0.268846333026886,
0.00821167603135109,
0.1283763349056244,
-0.32003653049468994,
-0.33600595593452454,
-0.21000441908836365,
0.4442954957485199,
0.3602331280708313,
-0.22042572498321533,
0.02258320152759552,
-0.08608463406562805,
0.09648339450359344,
0.42981329560279846,
0.5784971117973328,
-0.17698778212070465,
-0.009735658764839172,
0.06616093963384628,
-0.029406994581222534,
-0.2532162070274353,
0.1349743902683258,
-0.6957849264144897,
-0.04069982096552849,
-0.15070927143096924,
0.31485724449157715,
0.25826966762542725,
0.08841035515069962,
0.35493868589401245,
0.10232562571763992,
0.575100302696228,
0.3786541819572449,
-0.1381552666425705,
0.10512840002775192,
-0.2140648365020752,
-0.4293978214263916,
0.24821028113365173,
0.14992186427116394,
-0.2524304986000061,
0.04634925350546837,
-0.195085346698761,
-0.09623094648122787,
0.2694447338581085,
-0.04639396443963051,
-0.12433179467916489,
0.14344879984855652,
0.04756024852395058,
-0.2676476240158081,
0.14274346828460693,
-0.35586416721343994,
-0.45041942596435547,
0.1936737596988678,
0.02582390233874321,
-0.09294655919075012,
-0.032148778438568115,
-0.4232061505317688,
0.017709307372570038,
0.1029684916138649,
-0.01840972527861595,
0.3456113338470459,
0.011178426444530487,
-0.18485087156295776,
0.13241265714168549,
-0.008258098736405373,
-0.19459618628025055,
-0.17001494765281677,
-0.1012764573097229,
-0.08282238990068436,
-0.15271738171577454,
0.1696891039609909,
0.35788583755493164,
-0.21021082997322083,
-0.03870613873004913,
0.16527965664863586,
-0.028101421892642975,
-0.07666873931884766,
0.0007405374199151993,
0.17796295881271362,
0.20108464360237122,
-0.2712360620498657,
0.11742262542247772,
0.38318467140197754,
0.10876185446977615,
0.042801033705472946,
0.06753787398338318,
0.12675485014915466,
0.19371964037418365,
-0.0944022387266159,
-0.11060520261526108,
0.26463019847869873,
-0.6058147549629211,
0.1876683384180069,
-0.09441773593425751,
-0.08697090297937393,
0.0698961392045021,
-0.02506805583834648,
0.03344699740409851,
-0.44389304518699646,
0.00743350014090538,
-0.010547351092100143,
-0.3652956783771515,
0.24520079791545868,
-0.2404508888721466,
0.199344664812088,
0.26836076378822327,
-0.13292033970355988,
-0.18272903561592102,
0.2605991065502167,
0.06474373489618301,
0.02658023312687874,
0.10503096133470535,
-0.25607600808143616,
0.38197678327560425,
0.2703297436237335,
0.00388447567820549,
-0.153676375746727,
0.23640809953212738,
-0.02627611719071865,
0.23161104321479797,
0.18356741964817047,
0.047920290380716324,
0.12265511602163315,
-0.24651318788528442,
0.05508093908429146,
-0.15086199343204498,
0.15552963316440582,
0.24678775668144226,
0.2595463693141937,
0.004744682461023331,
0.03940430283546448,
-0.6067954897880554,
-0.18988704681396484,
-0.019470836967229843,
-0.1146232858300209,
0.0646919459104538,
-0.21186751127243042,
-0.0009357035160064697,
0.1262083798646927,
-0.3629935383796692,
0.19030776619911194,
-0.2106555700302124,
0.47838062047958374,
0.3241651654243469,
-0.31245332956314087,
-0.17965704202651978,
-0.10328418761491776,
-0.03804865479469299,
-0.06882896274328232,
0.3237664997577667,
0.09876462072134018,
0.13847015798091888,
-0.057883672416210175,
-0.05079483240842819,
-0.2373141348361969,
0.17416882514953613,
-0.06681524217128754,
-0.13437962532043457,
0.0011264681816101074,
-0.09557141363620758,
-0.024966321885585785,
-0.4498082399368286,
0.021743949502706528,
0.07176203280687332,
-0.07804235070943832,
0.17132994532585144,
0.18847773969173431,
0.29261019825935364,
-0.16929230093955994,
-0.17737436294555664,
-0.16346216201782227,
-0.13902783393859863,
-0.18548078835010529,
0.026618633419275284,
-0.2382197082042694,
0.17783957719802856,
0.05312706530094147,
0.18989026546478271,
-0.012983581982553005,
-0.14574705064296722,
-0.03859434276819229,
-0.2759762704372406,
-0.06105935201048851,
0.03390127420425415,
0.30603349208831787,
-0.09427447617053986,
-0.5281074047088623,
-0.031007230281829834,
-0.5217568278312683,
0.2378566563129425,
-0.3588901162147522,
0.28258928656578064,
-0.35018759965896606,
-0.07314855605363846,
-0.061230674386024475,
0.207997128367424,
0.2524387836456299,
0.0532633475959301,
-0.1013757511973381,
0.00475851446390152,
-0.23411394655704498,
0.05352459102869034,
0.3676419258117676,
0.09765975177288055,
0.04438076168298721,
0.24464765191078186,
0.11400273442268372,
0.21138721704483032,
0.41086065769195557,
0.08067229390144348,
0.17123936116695404,
0.13903674483299255,
0.16211417317390442,
-0.26697176694869995,
-0.192764550447464,
-0.16457246243953705,
-0.12902769446372986,
-0.31812822818756104,
0.18875078856945038,
-0.14163991808891296,
-0.13669803738594055,
0.21928054094314575,
0.15482671558856964,
0.2718676030635834,
-0.1937991827726364,
0.5000035762786865,
-0.4774649739265442,
-0.0762697234749794,
0.20475339889526367,
0.038723573088645935,
-0.21974457800388336,
-0.007581761106848717,
0.055829618126153946,
-0.2780236601829529,
0.2794356048107147,
-0.42010220885276794,
0.03886091336607933,
0.01840084418654442,
-0.29646652936935425,
0.2313183844089508,
0.0018069699872285128,
0.3954082429409027,
0.04725845530629158,
-0.3190772235393524,
0.049879930913448334,
0.40309587121009827,
0.4819905757904053,
0.0586404874920845,
-0.3734259605407715,
0.3678412437438965,
-0.008349020034074783,
-0.46192994713783264,
-0.1263658106327057,
-0.2703469395637512,
0.3552897274494171,
-0.17806631326675415,
0.6626200079917908,
-0.4205484986305237,
0.037644773721694946,
0.17801176011562347,
0.5186828970909119,
-0.18034660816192627,
-0.15367072820663452,
-0.37992793321609497,
-0.1589798629283905,
-0.0317549929022789,
0.25670114159584045,
0.04983820766210556,
0.23174281418323517,
0.15282253921031952,
0.07947850227355957,
-0.23065663874149323,
0.0726223886013031,
0.15600451827049255,
-0.05490392446517944,
0.4560961127281189,
0.032315317541360855,
0.3187567889690399,
0.2485228329896927,
-0.021631911396980286,
0.3685436248779297,
0.6836731433868408,
-0.21154014766216278,
0.16705037653446198,
-0.0773734375834465,
0.3665047287940979,
0.2097083032131195,
0.39798516035079956,
0.15316671133041382,
0.23188015818595886,
-0.05339956283569336,
0.4073324203491211,
-0.2848972678184509,
-0.3489692211151123,
0.004788402933627367,
0.05274958163499832,
-0.4063217043876648,
-0.7093238830566406,
0.37272748351097107,
0.05623578652739525,
-0.03763720393180847,
0.46922358870506287,
0.3631793260574341,
0.0928727239370346,
0.5199947357177734,
0.3948531746864319,
1.045552134513855,
-0.21560828387737274,
0.2486054003238678,
0.20517683029174805,
0.4322788715362549,
0.036372605711221695,
-0.07054978609085083,
0.3882315158843994,
-0.11155600100755692,
-0.65599125623703,
0.17985659837722778,
-0.18252032995224,
-0.009826846420764923,
0.017281945794820786,
-0.09772353619337082,
0.17947596311569214,
-0.3509029150009155,
0.16911056637763977,
-0.12287472188472748,
-0.2445593774318695,
-0.056573785841464996,
-0.38581860065460205,
0.04957469925284386,
0.03600529581308365,
0.20011746883392334,
-0.32037103176116943,
0.10182789713144302,
0.10514118522405624,
-0.1866205334663391,
0.026830226182937622,
-0.004775881767272949,
-0.05456202104687691,
-0.12785236537456512,
0.47057390213012695,
-0.35021907091140747,
-0.34823429584503174,
-0.05808049812912941,
-0.270967960357666,
-0.16419656574726105,
0.031317368149757385,
0.21597208082675934,
-0.08257688581943512,
0.23104843497276306,
0.2319752722978592,
0.10284505784511566,
-0.2256268411874771,
0.4068368971347809,
0.3002946674823761,
-0.21518060564994812,
-0.21137535572052002,
0.12002819776535034,
-0.27623438835144043,
0.06193190813064575,
0.05299167335033417,
-0.06075643002986908,
-0.27105164527893066,
-0.5612037777900696,
-0.07602010667324066,
-0.017577551305294037,
-0.17305675148963928,
0.11202828586101532,
0.02410260960459709,
-0.12256550788879395,
0.8012806177139282,
0.007594019174575806,
-0.2528475224971771,
-0.09797050058841705,
0.32365453243255615,
0.16141313314437866,
0.2745135426521301,
0.26535534858703613,
-0.2586318552494049,
-0.3715536594390869,
-0.16187496483325958,
0.26442158222198486,
0.16068021953105927,
0.15503543615341187,
0.4625714123249054,
-0.4372141361236572,
0.016426220536231995,
-0.05840069428086281,
-0.1401829719543457,
0.1294771134853363,
0.09796790778636932,
-0.6049978733062744,
-0.003835529088973999,
-0.26846733689308167,
0.3993954062461853,
0.12762396037578583,
0.31337684392929077,
-0.15141984820365906,
-0.5387183427810669,
-0.4197291135787964,
-0.09618986397981644,
-0.24287168681621552,
-0.07053244113922119,
-0.17654678225517273,
0.05156225338578224,
-0.06360257416963577,
0.06517762690782547,
0.12736967206001282,
-0.3119948208332062,
0.1251382827758789,
0.14430689811706543,
0.19691844284534454,
-0.20610636472702026,
0.0016708597540855408,
0.07509488612413406,
-0.04482576996088028,
-0.11680800467729568,
-0.05634521320462227,
-0.3257295489311218,
-0.2354012131690979,
-0.44783732295036316,
0.16743215918540955,
0.05959969758987427,
0.02944742888212204,
-0.051833320409059525,
0.3308170735836029,
-0.42328527569770813,
0.15220730006694794,
0.30799242854118347,
-0.033065132796764374,
0.06385016441345215,
-0.13187041878700256,
0.2852146029472351,
-0.08541514724493027,
-0.05916749686002731,
-0.2640551030635834,
0.09633494168519974,
0.11040598154067993,
-0.09009603410959244,
0.3864952623844147,
-0.20789511501789093,
0.1696745753288269,
0.4066075086593628,
0.320014625787735,
0.541107177734375,
-0.05047011375427246,
-0.3012738823890686,
0.21344494819641113,
0.16858989000320435,
0.002129584550857544,
-0.19976826012134552,
0.24468490481376648,
0.16587772965431213,
-0.044620104134082794,
0.3298622965812683,
0.07450675964355469,
0.03503255546092987,
-0.603519856929779,
-0.15410909056663513,
0.1354084461927414,
0.21162298321723938,
0.18622992932796478,
0.3908350169658661,
0.4093697667121887,
-0.30610859394073486,
0.20611508190631866,
0.053577445447444916,
0.4320457875728607,
0.3998644948005676,
-0.039928339421749115,
0.47687050700187683,
0.19342884421348572,
0.06534786522388458,
-0.29370200634002686,
-0.20178820192813873,
0.06912946701049805,
0.3359958827495575,
-0.18147552013397217,
0.2720606029033661,
0.28558027744293213,
0.15652787685394287,
-0.4573568105697632,
-0.03879440575838089,
-0.15506881475448608,
0.08219192922115326,
-0.3945330083370209,
0.035144977271556854,
0.2164306342601776,
-0.1791919469833374,
0.25376078486442566,
-0.06686440110206604,
-0.10728637874126434,
0.11901305615901947,
0.40290865302085876,
-0.0059059858322143555,
0.010621555149555206,
0.11610758304595947,
0.11033637076616287,
0.22997164726257324,
0.4353764057159424,
-0.33838343620300293,
-0.41772139072418213,
0.20022940635681152,
0.1329764574766159,
-0.17951492965221405,
0.326373428106308,
0.35815978050231934,
0.08946604281663895,
-0.20051942765712738,
-0.04398808255791664,
0.11597269773483276,
-0.06842171400785446,
-0.010779212228953838,
0.3718014657497406,
0.02174391597509384,
-0.0306415818631649,
0.1554206758737564,
0.008770832791924477,
-0.20014476776123047,
-0.27141284942626953,
0.2696157395839691,
0.29060009121894836,
-0.1814427375793457,
-0.23438280820846558,
0.09426290541887283,
-0.22164636850357056,
0.21857918798923492,
0.10526949912309647,
0.10560045391321182,
0.051489051431417465,
0.2765263020992279,
-0.18513396382331848,
0.10185965895652771,
0.27825894951820374,
0.05560346692800522,
-0.1398903876543045,
0.5747928023338318,
-0.017193157225847244,
-0.18757247924804688,
-0.1825219839811325,
-0.034897834062576294,
-0.3556189239025116,
-0.08220861107110977,
-0.13974985480308533,
-0.19468100368976593,
0.6521165370941162,
0.19766786694526672,
-0.042655594646930695,
0.20434428751468658,
0.0009327754378318787,
0.00012479163706302643,
-0.07053979486227036,
0.32906121015548706,
-0.12250107526779175,
-0.0819932222366333,
-0.352108359336853,
-0.1809379905462265,
-0.04457511752843857,
-0.7005319595336914,
0.16850726306438446,
0.03534538671374321,
0.011044993996620178,
-0.24983470141887665,
0.29106464982032776,
-0.06548228859901428,
0.24290026724338531,
0.1803271472454071,
0.2517698407173157,
0.09405706077814102,
0.004603780806064606,
-0.0341210663318634,
-0.12077070772647858,
-0.26943257451057434,
-0.15837399661540985,
0.05379704758524895,
-0.05539468303322792,
0.03399559482932091,
-0.3052608072757721,
-0.10553225874900818,
-0.07513774931430817,
0.14110179245471954,
-0.14238403737545013,
-0.12908878922462463,
-0.3472237288951874,
-0.019681043922901154,
-0.07091934233903885,
0.11426062881946564,
-0.07706250250339508,
0.3540254235267639,
0.1437932550907135,
0.23089386522769928,
0.0698089450597763,
-0.21390309929847717,
0.304291307926178,
-0.043608784675598145,
-0.37322086095809937,
0.05535241961479187,
-0.008225135505199432,
-0.05837080627679825,
-0.10918989032506943,
-0.1334092617034912,
-0.09576407074928284,
0.05786304548382759,
-0.1618720293045044,
-0.131750226020813,
0.15354841947555542,
-0.09077759087085724,
-0.02494359016418457,
-0.09863677620887756,
0.32402050495147705,
-0.1138184443116188,
-0.0976182147860527,
0.16094228625297546,
-0.22557590901851654
] |
https://github.com/huggingface/datasets/issues/5539 | IndexError: invalid index of a 0-dim tensor. Use `tensor.item()` in Python or `tensor.item<T>()` in C++ to convert a 0-dim tensor to a number | Hi! The `set_transform` does not apply a custom formatting transform on a single example but the entire batch, so the fixed version of your transform would look as follows:
```python
from datasets import load_dataset
import torch
dataset = load_dataset("lambdalabs/pokemon-blip-captions", split='train')
def t(batch):
return {"test": torch.tensor([1] * len(batch[next(iter(batch))]))}
dataset.set_transform(t)
d_0 = dataset[0]
```
Still, the formatter's error message should mention that a dict of **sequences** is expected as the returned value (not just a dict) to make debugging easier. | ### Describe the bug
When dataset contains a 0-dim tensor, formatting.py raises a following error and fails.
```bash
Traceback (most recent call last):
File "<path>/lib/python3.8/site-packages/datasets/formatting/formatting.py", line 501, in format_row
return _unnest(formatted_batch)
File "<path>/lib/python3.8/site-packages/datasets/formatting/formatting.py", line 137, in _unnest
return {key: array[0] for key, array in py_dict.items()}
File "<path>/lib/python3.8/site-packages/datasets/formatting/formatting.py", line 137, in <dictcomp>
return {key: array[0] for key, array in py_dict.items()}
IndexError: invalid index of a 0-dim tensor. Use `tensor.item()` in Python or `tensor.item<T>()` in C++ to convert a 0-dim tensor to a number
```
### Steps to reproduce the bug
Load whichever dataset and add transform method to add 0-dim tensor. Or create/find a dataset containing 0-dim tensor. E.g.
```python
from datasets import load_dataset
import torch
dataset = load_dataset("lambdalabs/pokemon-blip-captions", split='train')
def t(batch):
return {"test": torch.tensor(1)}
dataset.set_transform(t)
d_0 = dataset[0]
```
### Expected behavior
Extractor will correctly get a row from the dataset, even if it contains 0-dim tensor.
### Environment info
`datasets==2.8.0`, but it looks like it is also applicable to main branch version (as of 16th February) | 78 | IndexError: invalid index of a 0-dim tensor. Use `tensor.item()` in Python or `tensor.item<T>()` in C++ to convert a 0-dim tensor to a number
### Describe the bug
When dataset contains a 0-dim tensor, formatting.py raises a following error and fails.
```bash
Traceback (most recent call last):
File "<path>/lib/python3.8/site-packages/datasets/formatting/formatting.py", line 501, in format_row
return _unnest(formatted_batch)
File "<path>/lib/python3.8/site-packages/datasets/formatting/formatting.py", line 137, in _unnest
return {key: array[0] for key, array in py_dict.items()}
File "<path>/lib/python3.8/site-packages/datasets/formatting/formatting.py", line 137, in <dictcomp>
return {key: array[0] for key, array in py_dict.items()}
IndexError: invalid index of a 0-dim tensor. Use `tensor.item()` in Python or `tensor.item<T>()` in C++ to convert a 0-dim tensor to a number
```
### Steps to reproduce the bug
Load whichever dataset and add transform method to add 0-dim tensor. Or create/find a dataset containing 0-dim tensor. E.g.
```python
from datasets import load_dataset
import torch
dataset = load_dataset("lambdalabs/pokemon-blip-captions", split='train')
def t(batch):
return {"test": torch.tensor(1)}
dataset.set_transform(t)
d_0 = dataset[0]
```
### Expected behavior
Extractor will correctly get a row from the dataset, even if it contains 0-dim tensor.
### Environment info
`datasets==2.8.0`, but it looks like it is also applicable to main branch version (as of 16th February)
Hi! The `set_transform` does not apply a custom formatting transform on a single example but the entire batch, so the fixed version of your transform would look as follows:
```python
from datasets import load_dataset
import torch
dataset = load_dataset("lambdalabs/pokemon-blip-captions", split='train')
def t(batch):
return {"test": torch.tensor([1] * len(batch[next(iter(batch))]))}
dataset.set_transform(t)
d_0 = dataset[0]
```
Still, the formatter's error message should mention that a dict of **sequences** is expected as the returned value (not just a dict) to make debugging easier. | [
-0.2542387843132019,
-0.4156858026981354,
-0.0268503837287426,
0.4272727370262146,
0.26932069659233093,
0.12956944108009338,
0.7767345905303955,
0.6795443892478943,
-0.2534794211387634,
0.15314579010009766,
0.039237722754478455,
0.26701319217681885,
-0.3639734387397766,
0.002250911667943001,
0.10781872272491455,
-0.4976572096347809,
-0.04296223074197769,
0.40574076771736145,
0.3238583207130432,
-0.03116152621805668,
-0.2989230155944824,
-0.015004666522145271,
-0.5329359769821167,
-0.031094640493392944,
-0.47351741790771484,
-0.16194070875644684,
0.13884210586547852,
-0.011492528021335602,
-0.09210621565580368,
-0.41310951113700867,
0.3099392056465149,
-0.4561616778373718,
0.08660835027694702,
0.6839882731437683,
-0.00011288569658063352,
0.09799771010875702,
0.25575461983680725,
-0.053319063037633896,
-0.16780681908130646,
-0.42139190435409546,
-0.14906923472881317,
-0.2882954180240631,
-0.014945700764656067,
-0.37502577900886536,
-0.012199874967336655,
-0.3724048435688019,
-0.14693905413150787,
-0.20817868411540985,
0.1306951642036438,
0.5142543315887451,
0.19378195703029633,
0.6797736883163452,
0.10420848429203033,
0.043473076075315475,
0.3473001718521118,
0.08247320353984833,
-0.009220326319336891,
0.05041845515370369,
0.02777722105383873,
0.43166884779930115,
0.09704756736755371,
0.3296472132205963,
-0.2660864293575287,
-0.06235041841864586,
0.04668036848306656,
0.04567364603281021,
-0.014251165091991425,
-0.25298917293548584,
0.08521831035614014,
0.2438080608844757,
0.11672911792993546,
-0.1366775929927826,
-0.4195130169391632,
-0.19433099031448364,
-0.018909066915512085,
-0.703909158706665,
0.14034882187843323,
0.03797140717506409,
0.12685368955135345,
0.08896852284669876,
0.08169066160917282,
0.2775978147983551,
-0.3206479549407959,
0.15648318827152252,
-0.2442646324634552,
0.2864585518836975,
-0.10162227600812912,
-0.018857888877391815,
-0.2382243424654007,
0.05693577975034714,
0.21118199825286865,
0.08007544279098511,
0.07914740592241287,
0.33672046661376953,
-0.2940811812877655,
-0.1231381893157959,
0.12619364261627197,
-0.6624786257743835,
-0.08755755424499512,
-0.04747536778450012,
-0.002521147020161152,
0.13015645742416382,
-0.026624932885169983,
0.1673312783241272,
0.023210298269987106,
0.5882493853569031,
-0.023605212569236755,
0.403142511844635,
0.09217841178178787,
-0.12282968312501907,
0.20159417390823364,
-0.02157389000058174,
0.005173393525183201,
-0.3241792321205139,
0.10541076958179474,
0.15153533220291138,
0.2559398412704468,
-0.03587714955210686,
-0.5586438775062561,
0.2010020911693573,
-0.41968634724617004,
-0.0387423038482666,
0.14930360019207,
0.17829012870788574,
0.023985419422388077,
0.349379301071167,
0.2991584539413452,
0.1972007304430008,
-0.2771167457103729,
0.08125624060630798,
-0.19278447329998016,
0.28581032156944275,
-0.03770606219768524,
-0.3259716033935547,
0.02091098204255104,
-0.15690132975578308,
0.04212043434381485,
-0.017304841428995132,
0.06416556984186172,
-0.10235878825187683,
0.038973137736320496,
-0.19789761304855347,
0.22946465015411377,
0.22876833379268646,
-0.3836332857608795,
0.14352037012577057,
0.24505357444286346,
-0.0631476640701294,
-0.09667327255010605,
0.2849929928779602,
-0.33238643407821655,
-0.4626343548297882,
-0.4972601532936096,
0.20021319389343262,
-0.025331437587738037,
0.11438082158565521,
0.13885554671287537,
0.05275314301252365,
0.3950392007827759,
-0.16023680567741394,
0.0054032206535339355,
-0.29344838857650757,
-0.025235895067453384,
-0.275513619184494,
0.26762664318084717,
0.30695879459381104,
-0.29749101400375366,
0.01840219646692276,
-0.0023369528353214264,
0.18630923330783844,
0.36540940403938293,
0.10309387743473053,
-0.09130678325891495,
0.09156454354524612,
-0.20733019709587097,
0.2716633677482605,
0.3238263428211212,
-0.07496142387390137,
-0.31117144227027893,
0.1589040607213974,
-0.33912426233291626,
0.048912160098552704,
0.00020975619554519653,
0.15809477865695953,
0.21020929515361786,
0.04404054954648018,
0.3127914071083069,
0.06451667845249176,
-0.09994681179523468,
0.016385892406105995,
-0.31717488169670105,
-0.028864078223705292,
0.3372305631637573,
0.058536332100629807,
0.33441469073295593,
0.02447151392698288,
-0.3032035827636719,
0.2041480839252472,
0.1260354220867157,
-0.21266412734985352,
0.06653732806444168,
-0.05478457361459732,
0.11522050201892853,
-0.025163933634757996,
0.09051163494586945,
-0.42777788639068604,
-0.17641645669937134,
0.13534364104270935,
-0.16532546281814575,
0.18518474698066711,
-0.2419906109571457,
-0.03946951404213905,
-0.25929534435272217,
-0.054600462317466736,
-0.13617177307605743,
-0.31750038266181946,
0.16102173924446106,
-0.17123198509216309,
-0.0057679396122694016,
-0.049914367496967316,
-0.37021881341934204,
-0.14360615611076355,
-0.011224430054426193,
0.12055160105228424,
-0.024847012013196945,
0.0552666038274765,
-0.20386876165866852,
-0.2442837357521057,
-0.2595144510269165,
0.299265593290329,
0.14251670241355896,
-0.2042909413576126,
-0.3327893316745758,
0.3638405203819275,
-0.022923961281776428,
-0.3611137270927429,
-0.4855963885784149,
0.050992339849472046,
0.3015695810317993,
-0.03912274166941643,
0.021159416064620018,
0.2252497375011444,
0.1501753032207489,
-0.04005616530776024,
0.10643741488456726,
0.6478731632232666,
-0.07895179092884064,
0.09556040167808533,
-0.33670687675476074,
0.03547423332929611,
0.05739923566579819,
0.02431492879986763,
0.03466147184371948,
-0.38032957911491394,
0.14277790486812592,
0.002066001296043396,
0.3704257011413574,
-0.1448599249124527,
-0.6402080059051514,
-0.141346275806427,
0.016120191663503647,
0.017784487456083298,
0.22402849793434143,
0.06910476088523865,
-0.19026750326156616,
0.14795729517936707,
0.03427795320749283,
-0.16039198637008667,
0.1041056290268898,
0.21590709686279297,
-0.05521075055003166,
0.09123343974351883,
0.0486234612762928,
-0.15703503787517548,
0.3274684250354767,
0.12160289287567139,
0.024184176698327065,
0.15983688831329346,
0.21573831140995026,
0.13347335159778595,
0.025631457567214966,
-0.1237114816904068,
-0.012660503387451172,
0.27398502826690674,
-0.41972383856773376,
0.2731694281101227,
-0.1146756038069725,
0.02915307879447937,
-0.399759441614151,
-0.32176473736763,
0.00527871772646904,
-0.1001347079873085,
-0.015884485095739365,
-0.03427943214774132,
-0.05686604976654053,
0.245088130235672,
-0.004542188718914986,
-0.006555795669555664,
0.3834860324859619,
-0.2559235990047455,
-0.04947318136692047,
0.06381016224622726,
-0.2538760006427765,
-0.0024720802903175354,
0.16922304034233093,
-0.2531958520412445,
0.2841190993785858,
-0.14080491662025452,
-0.07978197187185287,
0.1754772812128067,
-0.37437903881073,
0.1444699466228485,
-0.18613983690738678,
-0.06570791453123093,
0.29403793811798096,
0.19472625851631165,
-0.11109019815921783,
-0.1511005312204361,
0.17766885459423065,
0.11030790209770203,
-0.02140604704618454,
0.27716171741485596,
-0.065926693379879,
0.1346541792154312,
-0.22924695909023285,
-0.44406065344810486,
0.05791954696178436,
-0.3301142752170563,
-0.08321425318717957,
-0.20028463006019592,
0.48479604721069336,
0.24008344113826752,
0.24522927403450012,
0.36124110221862793,
0.2473554164171219,
0.23423618078231812,
-0.007142010144889355,
-0.07806702703237534,
0.3438367247581482,
0.0019702259451150894,
-0.1894260048866272,
-0.04444330185651779,
-0.1711171567440033,
-0.12942303717136383,
0.2870367765426636,
-0.0972655713558197,
-0.11330707371234894,
0.03214491531252861,
0.06504496932029724,
-0.015886493027210236,
0.06546106189489365,
0.4315633773803711,
0.1422644406557083,
-0.0689946860074997,
-0.030384330078959465,
-0.02168959192931652,
-0.19727540016174316,
0.003511803224682808,
0.17071877419948578,
0.058537889271974564,
0.24581417441368103,
0.2847268283367157,
0.29267609119415283,
0.1461150199174881,
-0.4183451533317566,
0.13273262977600098,
-0.20625057816505432,
0.13676495850086212,
-0.20456919074058533,
-0.4048333168029785,
0.02374015748500824,
-0.03455394506454468,
-0.1747370809316635,
0.032235220074653625,
-0.26882636547088623,
-0.2824036180973053,
-0.11519656330347061,
-0.02972760982811451,
-0.32265612483024597,
-0.13001345098018646,
0.2872316539287567,
-0.35447558760643005,
0.35546550154685974,
-0.14746001362800598,
0.4420531094074249,
-0.21176716685295105,
0.02699843794107437,
-0.06065225228667259,
0.1457916498184204,
0.09561523795127869,
-0.023633508011698723,
0.16077008843421936,
-0.32197898626327515,
-0.18543359637260437,
0.4442816376686096,
0.288992315530777,
0.5996997356414795,
0.25059399008750916,
-0.154291570186615,
0.059420112520456314,
0.032034873962402344,
0.8065325617790222,
-0.0317043662071228,
-0.1563389152288437,
0.2776654064655304,
-0.10002791881561279,
-0.5784762501716614,
-0.16964998841285706,
-0.3088264763355255,
0.28542643785476685,
0.08043345808982849,
0.5446043014526367,
-0.1898515522480011,
-0.13118480145931244,
0.47214075922966003,
0.07683154940605164,
-0.02412731572985649,
-0.12234135717153549,
-0.08754108101129532,
-0.11665815860033035,
-0.057902589440345764,
0.21628138422966003,
-0.07139188051223755,
0.46719586849212646,
0.18068715929985046,
0.17448565363883972,
-0.32551124691963196,
0.04067050665616989,
0.1499936282634735,
-0.07506215572357178,
0.38352125883102417,
0.03794998303055763,
-0.052691128104925156,
0.17913618683815002,
0.3471806049346924,
0.2893885374069214,
-0.06554791331291199,
-0.18009957671165466,
-0.048095837235450745,
-0.07452896237373352,
0.06828499585390091,
0.08983056992292404,
0.32349637150764465,
-0.04603482410311699,
-0.06160249561071396,
-0.04624537378549576,
0.11099623143672943,
-0.12475945800542831,
0.17774276435375214,
0.2739192247390747,
0.15983349084854126,
-0.34997469186782837,
-0.4139679968357086,
0.2772841155529022,
0.05256592109799385,
0.2601538896560669,
0.09748882800340652,
0.027193136513233185,
-0.30941101908683777,
0.614710807800293,
0.192203089594841,
0.757087767124176,
0.14293724298477173,
0.07645644247531891,
0.32702893018722534,
-0.040746212005615234,
0.29950132966041565,
0.17687085270881653,
0.4771556854248047,
-0.3853405714035034,
-0.37810954451560974,
-0.10919484496116638,
-0.12484702467918396,
0.0031730011105537415,
0.02235347032546997,
-0.23422139883041382,
0.12949280440807343,
-0.5484871864318848,
0.022147677838802338,
-0.026225483044981956,
-0.05226081237196922,
0.020136937499046326,
-0.32988834381103516,
-0.1719723492860794,
0.06842558830976486,
-0.09311600029468536,
0.25739234685897827,
-0.1293579787015915,
-0.11257214844226837,
-0.2726449966430664,
-0.3008061647415161,
-0.2303093522787094,
-0.10912073403596878,
-0.22407056391239166,
0.1570412516593933,
-0.13876768946647644,
-0.743966281414032,
0.17389613389968872,
0.017135977745056152,
0.04140609875321388,
0.005173683166503906,
-0.033549852669239044,
-0.1929803341627121,
0.0974254384636879,
0.11396275460720062,
0.3501109182834625,
-0.11101648956537247,
0.6859932541847229,
0.1574031114578247,
-0.017422638833522797,
-0.046294815838336945,
-0.21316984295845032,
0.06177360564470291,
0.1501309871673584,
0.212890625,
-0.033480167388916016,
-0.16629436612129211,
-0.27450236678123474,
-0.04743166267871857,
-0.016909465193748474,
-0.14439968764781952,
0.17629119753837585,
-0.006187327206134796,
-0.19052664935588837,
0.24320068955421448,
-0.14963245391845703,
-0.198465958237648,
-0.0023391693830490112,
0.5123318433761597,
0.291301965713501,
0.030694693326950073,
0.4156680107116699,
0.2547101676464081,
-0.24415743350982666,
-0.15236535668373108,
0.14822092652320862,
0.2879490554332733,
-0.16489478945732117,
0.3962964117527008,
-0.28628918528556824,
-0.06656644493341446,
-0.08748259395360947,
0.0508587472140789,
0.15959501266479492,
0.2991257905960083,
-0.3076959252357483,
-0.15472301840782166,
-0.4227169454097748,
0.09649668633937836,
0.19733260571956635,
0.3130658268928528,
-0.13826975226402283,
0.5905181765556335,
-0.0420510470867157,
-0.2173958420753479,
-0.3344397246837616,
0.08408644050359726,
-0.16752760112285614,
0.352527916431427,
-0.07611127197742462,
0.08420757949352264,
0.333683580160141,
-0.1086946427822113,
0.13033638894557953,
0.10682149231433868,
-0.14525143802165985,
-0.19973570108413696,
-0.2459750920534134,
0.06435411423444748,
-0.013097930699586868,
-0.3494846522808075,
0.18509848415851593,
0.005484744906425476,
-0.2678002715110779,
-0.25618767738342285,
0.14223065972328186,
0.35183072090148926,
-0.14467531442642212,
0.33590638637542725,
-0.1842278391122818,
0.1664941906929016,
-0.0615481473505497,
-0.023841876536607742,
-0.11948975920677185,
0.23880597949028015,
-0.04418289661407471,
0.3250075876712799,
-0.025169117376208305,
0.023330502212047577,
-0.27099400758743286,
0.10828080773353577,
-0.09325282275676727,
0.052570641040802,
0.1704244315624237,
-0.47677987813949585,
-0.08097151666879654,
0.18604344129562378,
0.20860899984836578,
0.16740447282791138,
-0.1510230451822281,
0.10057825595140457,
0.019086692482233047,
0.23234590888023376,
-0.16514185070991516,
0.016379959881305695,
-0.11522950232028961,
-0.04099119454622269,
0.06502312421798706,
0.30357131361961365,
-0.07360145449638367,
0.1920568346977234,
-0.5456587672233582,
0.2712853252887726,
0.14073315262794495,
-0.14935247600078583,
0.2870948612689972,
0.3773803114891052,
-0.07993337512016296,
-0.04586538299918175,
0.3387998044490814,
-0.004647187888622284,
0.32421377301216125,
0.35999566316604614,
0.16665205359458923,
0.4511730372905731,
0.2564835250377655,
-0.032657746225595474,
-0.22162440419197083,
-0.10864074528217316,
-0.2031978815793991,
0.21411466598510742,
0.20847448706626892,
0.24207118153572083,
0.08001276850700378,
0.297554075717926,
-0.3922273814678192,
-0.10029565542936325,
0.09646296501159668,
-0.04603268578648567,
-0.37609344720840454,
0.23485076427459717,
-0.18269957602024078,
-0.04032404348254204,
-0.022719942033290863,
-0.3465626537799835,
0.016695987433195114,
0.06942759454250336,
0.1347605586051941,
0.1791359782218933,
-0.24780254065990448,
0.08721368759870529,
-0.13930940628051758,
0.37104564905166626,
0.17855164408683777,
-0.3524906635284424,
0.06386981904506683,
0.1914168894290924,
-0.021497942507267,
0.07449124753475189,
0.276109904050827,
0.5357275009155273,
0.4468138813972473,
-0.23600292205810547,
-0.21691091358661652,
-0.1200779527425766,
-0.1428028643131256,
0.1386902779340744,
-0.08225429803133011,
-0.13581109046936035,
0.044222090393304825,
0.14293980598449707,
0.12327079474925995,
-0.18836896121501923,
0.16845737397670746,
0.24972760677337646,
0.1922912299633026,
-0.14739665389060974,
0.10035247355699539,
-0.11956669390201569,
-0.43418559432029724,
-0.2460128664970398,
-0.19004333019256592,
-0.22309720516204834,
0.11657515168190002,
0.2792228162288666,
0.13468055427074432,
0.12312240153551102,
0.333913654088974,
0.09780192375183105,
0.10632579028606415,
0.21065479516983032,
0.2759748697280884,
-0.02398541569709778,
-0.13708224892616272,
0.09177494049072266,
-0.3516167402267456,
0.2028307020664215,
0.1586000919342041,
0.18487274646759033,
0.2058277577161789,
0.3038926422595978,
-0.16053789854049683,
-0.16285717487335205,
0.3135976791381836,
-0.2564389109611511,
0.2324068397283554,
0.2324254959821701,
-0.18160216510295868,
-0.09579457342624664,
-0.08525983989238739,
-0.15388204157352448,
0.04741410166025162,
-0.24194541573524475,
0.005599800497293472,
-0.28238871693611145,
0.14994564652442932,
-0.257168710231781,
0.15348802506923676,
-0.008594457060098648,
0.06443753093481064,
0.6673204898834229,
0.07254430651664734,
0.2610185146331787,
-0.05252695828676224,
-0.03785904124379158,
-0.2101694643497467,
-0.01384044997394085,
-0.4814365804195404,
0.3468610644340515,
0.09997019171714783,
0.49043986201286316,
0.027826381847262383,
-0.3674647808074951,
-0.2780442535877228,
0.39816391468048096,
0.050574302673339844,
-0.17301960289478302,
-0.40148040652275085,
0.40947917103767395,
-0.35319846868515015,
-0.08205528557300568,
-0.004666515626013279,
0.2896093726158142,
0.20419438183307648,
0.18646031618118286,
-0.2942599058151245,
-0.6313585042953491,
0.4394991099834442,
-0.28447631001472473,
-0.2576487064361572,
-0.13082881271839142,
0.15678812563419342,
0.09692637622356415,
0.10436010360717773,
-0.4843515455722809,
-0.18059617280960083,
0.20321227610111237,
-0.09607992321252823,
-0.5408792495727539,
-0.047192707657814026,
0.007630784064531326,
-0.061663173139095306,
-0.09511156380176544,
0.15394936501979828,
-0.08693774044513702,
-0.14919458329677582,
-0.11377185583114624,
-0.11782490462064743
] |
https://github.com/huggingface/datasets/issues/5539 | IndexError: invalid index of a 0-dim tensor. Use `tensor.item()` in Python or `tensor.item<T>()` in C++ to convert a 0-dim tensor to a number | > Hi! The `set_transform` does not apply a custom formatting transform on a single example but the entire batch, so the fixed version of your transform would look as follows:
>
> ```python
> from datasets import load_dataset
> import torch
>
> dataset = load_dataset("lambdalabs/pokemon-blip-captions", split='train')
> def t(batch):
> return {"test": torch.tensor([1] * len(batch[next(iter(batch))]))}
>
> dataset.set_transform(t)
> d_0 = dataset[0]
> ```
>
> Still, the formatter's error message should mention that a dict of **sequences** is expected as the returned value (not just a dict) to make debugging easier.
ok, will change it according to suggestion. Thanks for the reply! | ### Describe the bug
When dataset contains a 0-dim tensor, formatting.py raises a following error and fails.
```bash
Traceback (most recent call last):
File "<path>/lib/python3.8/site-packages/datasets/formatting/formatting.py", line 501, in format_row
return _unnest(formatted_batch)
File "<path>/lib/python3.8/site-packages/datasets/formatting/formatting.py", line 137, in _unnest
return {key: array[0] for key, array in py_dict.items()}
File "<path>/lib/python3.8/site-packages/datasets/formatting/formatting.py", line 137, in <dictcomp>
return {key: array[0] for key, array in py_dict.items()}
IndexError: invalid index of a 0-dim tensor. Use `tensor.item()` in Python or `tensor.item<T>()` in C++ to convert a 0-dim tensor to a number
```
### Steps to reproduce the bug
Load whichever dataset and add transform method to add 0-dim tensor. Or create/find a dataset containing 0-dim tensor. E.g.
```python
from datasets import load_dataset
import torch
dataset = load_dataset("lambdalabs/pokemon-blip-captions", split='train')
def t(batch):
return {"test": torch.tensor(1)}
dataset.set_transform(t)
d_0 = dataset[0]
```
### Expected behavior
Extractor will correctly get a row from the dataset, even if it contains 0-dim tensor.
### Environment info
`datasets==2.8.0`, but it looks like it is also applicable to main branch version (as of 16th February) | 104 | IndexError: invalid index of a 0-dim tensor. Use `tensor.item()` in Python or `tensor.item<T>()` in C++ to convert a 0-dim tensor to a number
### Describe the bug
When dataset contains a 0-dim tensor, formatting.py raises a following error and fails.
```bash
Traceback (most recent call last):
File "<path>/lib/python3.8/site-packages/datasets/formatting/formatting.py", line 501, in format_row
return _unnest(formatted_batch)
File "<path>/lib/python3.8/site-packages/datasets/formatting/formatting.py", line 137, in _unnest
return {key: array[0] for key, array in py_dict.items()}
File "<path>/lib/python3.8/site-packages/datasets/formatting/formatting.py", line 137, in <dictcomp>
return {key: array[0] for key, array in py_dict.items()}
IndexError: invalid index of a 0-dim tensor. Use `tensor.item()` in Python or `tensor.item<T>()` in C++ to convert a 0-dim tensor to a number
```
### Steps to reproduce the bug
Load whichever dataset and add transform method to add 0-dim tensor. Or create/find a dataset containing 0-dim tensor. E.g.
```python
from datasets import load_dataset
import torch
dataset = load_dataset("lambdalabs/pokemon-blip-captions", split='train')
def t(batch):
return {"test": torch.tensor(1)}
dataset.set_transform(t)
d_0 = dataset[0]
```
### Expected behavior
Extractor will correctly get a row from the dataset, even if it contains 0-dim tensor.
### Environment info
`datasets==2.8.0`, but it looks like it is also applicable to main branch version (as of 16th February)
> Hi! The `set_transform` does not apply a custom formatting transform on a single example but the entire batch, so the fixed version of your transform would look as follows:
>
> ```python
> from datasets import load_dataset
> import torch
>
> dataset = load_dataset("lambdalabs/pokemon-blip-captions", split='train')
> def t(batch):
> return {"test": torch.tensor([1] * len(batch[next(iter(batch))]))}
>
> dataset.set_transform(t)
> d_0 = dataset[0]
> ```
>
> Still, the formatter's error message should mention that a dict of **sequences** is expected as the returned value (not just a dict) to make debugging easier.
ok, will change it according to suggestion. Thanks for the reply! | [
-0.2582031488418579,
-0.4255248010158539,
-0.031091837212443352,
0.4377169609069824,
0.26600369811058044,
0.13616031408309937,
0.7793343663215637,
0.6722733378410339,
-0.2549665868282318,
0.1577700972557068,
0.03240693360567093,
0.26492029428482056,
-0.36549460887908936,
0.00868486799299717,
0.09768151491880417,
-0.49559298157691956,
-0.05111325532197952,
0.40037351846694946,
0.34440886974334717,
-0.02765990048646927,
-0.2894120514392853,
-0.021800803020596504,
-0.5267710089683533,
-0.028836853802204132,
-0.4684549570083618,
-0.1685718595981598,
0.13894200325012207,
-0.01409728080034256,
-0.10440273582935333,
-0.41728949546813965,
0.31168821454048157,
-0.4526617228984833,
0.09052572399377823,
0.6803982257843018,
-0.00011238615843467414,
0.09889736771583557,
0.2597072720527649,
-0.03954315185546875,
-0.17795662581920624,
-0.4138143062591553,
-0.14922504127025604,
-0.28859975934028625,
-0.007833333685994148,
-0.37510550022125244,
-0.010396087542176247,
-0.3746250569820404,
-0.14988285303115845,
-0.210704043507576,
0.11811581999063492,
0.5100951194763184,
0.19673411548137665,
0.6910315752029419,
0.101133793592453,
0.04673881456255913,
0.35249021649360657,
0.08158190548419952,
-0.010609708726406097,
0.06123404577374458,
0.0319446437060833,
0.42289236187934875,
0.10225053131580353,
0.3357609510421753,
-0.2713881731033325,
-0.04711439087986946,
0.046860985457897186,
0.045061707496643066,
-0.008338116109371185,
-0.2479933798313141,
0.09080304205417633,
0.2524019479751587,
0.13838815689086914,
-0.13651379942893982,
-0.4098621606826782,
-0.18932130932807922,
-0.01862470805644989,
-0.7158517241477966,
0.1363174021244049,
0.04354607313871384,
0.12220460176467896,
0.07938393205404282,
0.08504139631986618,
0.2865833640098572,
-0.3214477300643921,
0.15562725067138672,
-0.2407829463481903,
0.28571075201034546,
-0.10121472179889679,
-0.018267065286636353,
-0.24588073790073395,
0.04486064985394478,
0.20577816665172577,
0.07150478661060333,
0.0784631222486496,
0.33590689301490784,
-0.29616105556488037,
-0.11975052952766418,
0.12394529581069946,
-0.658109724521637,
-0.07885152101516724,
-0.050861261785030365,
0.00996052473783493,
0.13000032305717468,
-0.028874635696411133,
0.18146148324012756,
0.02940426394343376,
0.5702069401741028,
-0.00826309621334076,
0.3921540081501007,
0.0927761048078537,
-0.11651603132486343,
0.20047244429588318,
-0.01829928532242775,
0.002769830636680126,
-0.3240959644317627,
0.10340853035449982,
0.14610663056373596,
0.2556707262992859,
-0.04216497763991356,
-0.5715386867523193,
0.21289925277233124,
-0.4275771677494049,
-0.03697814792394638,
0.1538647562265396,
0.18692947924137115,
0.017063971608877182,
0.33552584052085876,
0.2801268696784973,
0.18720215559005737,
-0.2781865894794464,
0.07958988845348358,
-0.19352568686008453,
0.28674644231796265,
-0.03104040026664734,
-0.3308514952659607,
0.014195956289768219,
-0.15771116316318512,
0.04363206773996353,
-0.020835096016526222,
0.06618262082338333,
-0.11028698086738586,
0.03943212330341339,
-0.21054647862911224,
0.22367271780967712,
0.2266884446144104,
-0.3859270513057709,
0.1358998566865921,
0.2407604157924652,
-0.06009570136666298,
-0.0968540608882904,
0.27978768944740295,
-0.3282424807548523,
-0.4577961266040802,
-0.4975859522819519,
0.2043888419866562,
-0.024429261684417725,
0.10903988778591156,
0.1365722268819809,
0.0508234016597271,
0.38564980030059814,
-0.15810252726078033,
-0.0003350600600242615,
-0.2978668808937073,
-0.03494887053966522,
-0.2768000662326813,
0.271359384059906,
0.3111819922924042,
-0.31012433767318726,
0.023823022842407227,
0.010534577071666718,
0.18083755671977997,
0.3587891161441803,
0.11160659790039062,
-0.0939302146434784,
0.09517539292573929,
-0.20729665458202362,
0.26369911432266235,
0.3164532780647278,
-0.08161945641040802,
-0.3015967607498169,
0.1642449051141739,
-0.3313397169113159,
0.057043902575969696,
-0.00838131457567215,
0.16473746299743652,
0.20788413286209106,
0.05188964679837227,
0.3317781090736389,
0.05503705143928528,
-0.10292930901050568,
0.011424491181969643,
-0.31598547101020813,
-0.029633769765496254,
0.3398839831352234,
0.06820222735404968,
0.3325013816356659,
0.006363250315189362,
-0.3021518886089325,
0.19073866307735443,
0.13032042980194092,
-0.20733636617660522,
0.055795468389987946,
-0.04765528440475464,
0.11981000006198883,
-0.020605459809303284,
0.08387403935194016,
-0.4347724914550781,
-0.18513751029968262,
0.14184042811393738,
-0.1565866768360138,
0.187303826212883,
-0.23822017014026642,
-0.04829466715455055,
-0.2542848289012909,
-0.04887321591377258,
-0.14179648458957672,
-0.32017144560813904,
0.16640204191207886,
-0.17311009764671326,
-0.016406653448939323,
-0.045971423387527466,
-0.3688940405845642,
-0.13947230577468872,
-0.03275664150714874,
0.11888594925403595,
-0.020163219422101974,
0.04015582054853439,
-0.20467022061347961,
-0.23859064280986786,
-0.24130500853061676,
0.3034153878688812,
0.141537606716156,
-0.19286638498306274,
-0.3235151469707489,
0.3678799867630005,
-0.0159053485840559,
-0.37183791399002075,
-0.4785213768482208,
0.03774082660675049,
0.30194422602653503,
-0.0339333713054657,
0.01272692158818245,
0.21315205097198486,
0.1461797058582306,
-0.03473470360040665,
0.1021963357925415,
0.6459372043609619,
-0.07407139241695404,
0.08755764365196228,
-0.32876211404800415,
0.02468595840036869,
0.05181881785392761,
0.03497937694191933,
0.03570699691772461,
-0.3757103979587555,
0.15198267996311188,
0.005328148603439331,
0.36173462867736816,
-0.1381383091211319,
-0.6548851132392883,
-0.1429453194141388,
0.00822092592716217,
0.02006230130791664,
0.21750116348266602,
0.0652342289686203,
-0.1877000331878662,
0.14888978004455566,
0.05023932456970215,
-0.1636720895767212,
0.09343709796667099,
0.22162580490112305,
-0.05155525729060173,
0.08460013568401337,
0.04277384281158447,
-0.15858422219753265,
0.32058000564575195,
0.12226642668247223,
0.01506414171308279,
0.15982428193092346,
0.21675267815589905,
0.12943461537361145,
0.02754782885313034,
-0.12436755001544952,
-0.018409311771392822,
0.2836708426475525,
-0.42141759395599365,
0.2670021951198578,
-0.12333143502473831,
0.020666584372520447,
-0.3872027099132538,
-0.308672159910202,
-0.008836958557367325,
-0.10428623110055923,
-0.010096684098243713,
-0.031094413250684738,
-0.05297864228487015,
0.23324428498744965,
-0.009631982073187828,
-0.012682124972343445,
0.3831259608268738,
-0.25301599502563477,
-0.043970391154289246,
0.054028358310461044,
-0.25652337074279785,
0.0031188391149044037,
0.17305870354175568,
-0.23595763742923737,
0.29483750462532043,
-0.13253654539585114,
-0.08362673968076706,
0.1657279133796692,
-0.36844637989997864,
0.1438053846359253,
-0.1832328736782074,
-0.0645245611667633,
0.29154592752456665,
0.1996125876903534,
-0.125364750623703,
-0.14191597700119019,
0.18384911119937897,
0.11325079202651978,
-0.0186026431620121,
0.26986628770828247,
-0.06421513110399246,
0.13858841359615326,
-0.22821049392223358,
-0.4393759071826935,
0.04515852779150009,
-0.32601624727249146,
-0.0884927362203598,
-0.18827949464321136,
0.48919957876205444,
0.23732954263687134,
0.2494639754295349,
0.3665454089641571,
0.2356218844652176,
0.2296672910451889,
-0.011157824657857418,
-0.09419600665569305,
0.33586379885673523,
0.000028511742129921913,
-0.19023513793945312,
-0.046400804072618484,
-0.16642870008945465,
-0.12117303907871246,
0.281499981880188,
-0.10370244085788727,
-0.12421414256095886,
0.04031988978385925,
0.06801311671733856,
-0.00946374237537384,
0.05536270886659622,
0.42102357745170593,
0.14076943695545197,
-0.07514718174934387,
-0.02578779309988022,
-0.012726583518087864,
-0.1947384476661682,
-0.013530511409044266,
0.1691206395626068,
0.05408965051174164,
0.23770886659622192,
0.28250619769096375,
0.2889588475227356,
0.14529244601726532,
-0.4176331162452698,
0.1360895335674286,
-0.21179932355880737,
0.1494518518447876,
-0.1979774534702301,
-0.40136033296585083,
0.026385638862848282,
-0.03820759057998657,
-0.1747586727142334,
0.03581660985946655,
-0.2656586170196533,
-0.271576464176178,
-0.11414012312889099,
-0.029352525249123573,
-0.3169277608394623,
-0.12758560478687286,
0.28206613659858704,
-0.3546457588672638,
0.34971484541893005,
-0.14812739193439484,
0.43805819749832153,
-0.21508941054344177,
0.03039177879691124,
-0.06651037931442261,
0.14918360114097595,
0.09674302488565445,
-0.02741282992064953,
0.15110130608081818,
-0.3148403465747833,
-0.19060158729553223,
0.43750786781311035,
0.292890727519989,
0.5980033278465271,
0.25204014778137207,
-0.14053446054458618,
0.05870481953024864,
0.03181476145982742,
0.7946790456771851,
-0.0341525599360466,
-0.1517888307571411,
0.2800174951553345,
-0.08577850461006165,
-0.5713358521461487,
-0.16124024987220764,
-0.31505024433135986,
0.29389992356300354,
0.07187946140766144,
0.5441439151763916,
-0.19735047221183777,
-0.13503287732601166,
0.47422710061073303,
0.07596992701292038,
-0.028724489733576775,
-0.12748928368091583,
-0.09534018486738205,
-0.10996682196855545,
-0.061031974852085114,
0.21869555115699768,
-0.06544768810272217,
0.46952974796295166,
0.18133611977100372,
0.16928303241729736,
-0.3251912593841553,
0.05086847394704819,
0.15987208485603333,
-0.06672649085521698,
0.3844606280326843,
0.03396294265985489,
-0.05626258999109268,
0.1857670694589615,
0.3440200388431549,
0.3079216480255127,
-0.06328088790178299,
-0.19583503901958466,
-0.046598970890045166,
-0.07808617502450943,
0.06734155863523483,
0.09602846205234528,
0.32459571957588196,
-0.05163279175758362,
-0.05683057755231857,
-0.0627199336886406,
0.10807051509618759,
-0.1251389980316162,
0.17434105277061462,
0.27696800231933594,
0.16524994373321533,
-0.35753539204597473,
-0.42204439640045166,
0.26810944080352783,
0.05866764113306999,
0.26601117849349976,
0.10144536942243576,
0.03442602604627609,
-0.29684123396873474,
0.6055955290794373,
0.1936853677034378,
0.751056969165802,
0.1346784085035324,
0.07693753391504288,
0.33840155601501465,
-0.027311600744724274,
0.3053049147129059,
0.17904821038246155,
0.4763568639755249,
-0.38649165630340576,
-0.3626767694950104,
-0.10449792444705963,
-0.11823710799217224,
0.011226184666156769,
0.02090206742286682,
-0.22270624339580536,
0.1333891749382019,
-0.5433236956596375,
0.03254074603319168,
-0.026041263714432716,
-0.040067415684461594,
0.020488757640123367,
-0.3194163143634796,
-0.17257265746593475,
0.07506862282752991,
-0.1034604012966156,
0.2461005002260208,
-0.1365962028503418,
-0.10876838117837906,
-0.2638736367225647,
-0.3049929738044739,
-0.22083595395088196,
-0.1177627444267273,
-0.2232530266046524,
0.15379348397254944,
-0.1426602154970169,
-0.7512104511260986,
0.17042839527130127,
0.026631707325577736,
0.03465929627418518,
0.013907363638281822,
-0.034894272685050964,
-0.19310688972473145,
0.09747262299060822,
0.10470357537269592,
0.3390035331249237,
-0.11359432339668274,
0.6838371157646179,
0.15514299273490906,
-0.02144884318113327,
-0.040959954261779785,
-0.20580938458442688,
0.05640444904565811,
0.15615835785865784,
0.21674130856990814,
-0.02993377298116684,
-0.1698608249425888,
-0.2798106074333191,
-0.06266644597053528,
-0.02426799014210701,
-0.1442161202430725,
0.17854413390159607,
-0.0022675544023513794,
-0.19126944243907928,
0.23298555612564087,
-0.14268767833709717,
-0.19455555081367493,
0.00047340430319309235,
0.5096051096916199,
0.28996554017066956,
0.03274231404066086,
0.41601815819740295,
0.26366180181503296,
-0.24662812054157257,
-0.15799099206924438,
0.1519850492477417,
0.290044903755188,
-0.14128243923187256,
0.3915605843067169,
-0.27905216813087463,
-0.05654595047235489,
-0.08637309074401855,
0.05419822782278061,
0.15620805323123932,
0.29711151123046875,
-0.29913991689682007,
-0.15327604115009308,
-0.42290300130844116,
0.09669707715511322,
0.1916286200284958,
0.3179098665714264,
-0.12644042074680328,
0.5808789134025574,
-0.04762047901749611,
-0.21653515100479126,
-0.33961188793182373,
0.08739723265171051,
-0.17664264142513275,
0.351961612701416,
-0.07185927778482437,
0.08575889468193054,
0.33910584449768066,
-0.10388167202472687,
0.13620741665363312,
0.11498319357633591,
-0.14289487898349762,
-0.20734211802482605,
-0.23476459085941315,
0.06386032700538635,
-0.01389889046549797,
-0.3516640365123749,
0.18815110623836517,
0.00038415752351284027,
-0.273328959941864,
-0.2561494708061218,
0.14183831214904785,
0.3564140200614929,
-0.14480876922607422,
0.32532885670661926,
-0.18957994878292084,
0.18316543102264404,
-0.05455875024199486,
-0.024612300097942352,
-0.12066347897052765,
0.25045204162597656,
-0.04111972823739052,
0.31427818536758423,
-0.030129574239253998,
0.0224016010761261,
-0.25100958347320557,
0.10722485184669495,
-0.09920862317085266,
0.04727328568696976,
0.16480761766433716,
-0.47802066802978516,
-0.0841350108385086,
0.1731514185667038,
0.2106512486934662,
0.16886493563652039,
-0.14790351688861847,
0.10051310807466507,
0.019047770649194717,
0.2352496087551117,
-0.16821768879890442,
0.011570826172828674,
-0.1032128781080246,
-0.0455467626452446,
0.07228197157382965,
0.29966697096824646,
-0.06751351058483124,
0.2028222680091858,
-0.5533208250999451,
0.26358553767204285,
0.13841135799884796,
-0.14880573749542236,
0.2744287848472595,
0.3601472079753876,
-0.079205721616745,
-0.05642102286219597,
0.3406900465488434,
0.0046365149319171906,
0.3261813521385193,
0.3697851896286011,
0.16018806397914886,
0.4468560814857483,
0.2603801190853119,
-0.037186142057180405,
-0.22502923011779785,
-0.11557912826538086,
-0.19548162817955017,
0.21616382896900177,
0.21626931428909302,
0.2375287115573883,
0.07121656090021133,
0.30161482095718384,
-0.39735329151153564,
-0.0942717120051384,
0.10089997202157974,
-0.056538354605436325,
-0.37658771872520447,
0.23385463654994965,
-0.19225788116455078,
-0.04408450424671173,
-0.01799444481730461,
-0.3453984558582306,
0.01685965619981289,
0.055546291172504425,
0.11619441211223602,
0.17393578588962555,
-0.24780549108982086,
0.07988473027944565,
-0.1360936462879181,
0.37859800457954407,
0.17618489265441895,
-0.3488823175430298,
0.06168317049741745,
0.19255633652210236,
-0.01923062652349472,
0.07460233569145203,
0.2663721442222595,
0.5395837426185608,
0.44414275884628296,
-0.23067326843738556,
-0.21822455525398254,
-0.12449027597904205,
-0.14274334907531738,
0.13989880681037903,
-0.08994872868061066,
-0.12995299696922302,
0.03932211920619011,
0.15266156196594238,
0.12887121737003326,
-0.19003655016422272,
0.1648900955915451,
0.26060616970062256,
0.19005602598190308,
-0.1464969515800476,
0.09035121649503708,
-0.12236936390399933,
-0.43716269731521606,
-0.2512998878955841,
-0.18753576278686523,
-0.2298993468284607,
0.12007416039705276,
0.29220661520957947,
0.14942018687725067,
0.12786439061164856,
0.32928022742271423,
0.10053273290395737,
0.09766873717308044,
0.21545228362083435,
0.2786560356616974,
-0.020111985504627228,
-0.14557012915611267,
0.10486377775669098,
-0.3735792338848114,
0.20405735075473785,
0.1369170844554901,
0.17790444195270538,
0.2067781239748001,
0.307910293340683,
-0.1605134904384613,
-0.1613178849220276,
0.3141990900039673,
-0.24636688828468323,
0.24298891425132751,
0.22204896807670593,
-0.19086535274982452,
-0.0903729498386383,
-0.08808521926403046,
-0.16144412755966187,
0.05132705718278885,
-0.24726000428199768,
0.008554838597774506,
-0.3014930486679077,
0.15066474676132202,
-0.2540847659111023,
0.15090173482894897,
-0.012425774708390236,
0.052724599838256836,
0.6621571183204651,
0.06701923906803131,
0.26071834564208984,
-0.046078942716121674,
-0.046243250370025635,
-0.21032002568244934,
-0.0015870598144829273,
-0.4739455580711365,
0.3568657636642456,
0.11222827434539795,
0.49262723326683044,
0.028044061735272408,
-0.3588876724243164,
-0.2779681086540222,
0.41482752561569214,
0.044123485684394836,
-0.18275141716003418,
-0.39454177021980286,
0.4023790657520294,
-0.34106770157814026,
-0.08635091781616211,
-0.017082463949918747,
0.2935012876987457,
0.20361843705177307,
0.18027359247207642,
-0.303025484085083,
-0.6260632276535034,
0.44157376885414124,
-0.29137760400772095,
-0.2512308657169342,
-0.13198688626289368,
0.1537097692489624,
0.12586228549480438,
0.11319251358509064,
-0.49367353320121765,
-0.1724892556667328,
0.20595002174377441,
-0.09432221949100494,
-0.5418984293937683,
-0.05270766094326973,
0.013451588340103626,
-0.05281452462077141,
-0.09639789909124374,
0.13215170800685883,
-0.09092008322477341,
-0.14712277054786682,
-0.1066807359457016,
-0.127977192401886
] |
https://github.com/huggingface/datasets/issues/5538 | load_dataset in seaborn is not working for me. getting this error. | Hi! `seaborn`'s `load_dataset` pulls datasets from [here](https://github.com/mwaskom/seaborn-data) and not from our Hub, so this issue is not related to our library in any way and should be reported in their repo instead. | TimeoutError Traceback (most recent call last)
~\anaconda3\lib\urllib\request.py in do_open(self, http_class, req, **http_conn_args)
1345 try:
-> 1346 h.request(req.get_method(), req.selector, req.data, headers,
1347 encode_chunked=req.has_header('Transfer-encoding'))
~\anaconda3\lib\http\client.py in request(self, method, url, body, headers, encode_chunked)
1278 """Send a complete request to the server."""
-> 1279 self._send_request(method, url, body, headers, encode_chunked)
1280
~\anaconda3\lib\http\client.py in _send_request(self, method, url, body, headers, encode_chunked)
1324 body = _encode(body, 'body')
-> 1325 self.endheaders(body, encode_chunked=encode_chunked)
1326
~\anaconda3\lib\http\client.py in endheaders(self, message_body, encode_chunked)
1273 raise CannotSendHeader()
-> 1274 self._send_output(message_body, encode_chunked=encode_chunked)
1275
~\anaconda3\lib\http\client.py in _send_output(self, message_body, encode_chunked)
1033 del self._buffer[:]
-> 1034 self.send(msg)
1035
~\anaconda3\lib\http\client.py in send(self, data)
973 if self.auto_open:
--> 974 self.connect()
975 else:
~\anaconda3\lib\http\client.py in connect(self)
1440
-> 1441 super().connect()
1442
~\anaconda3\lib\http\client.py in connect(self)
944 """Connect to the host and port specified in __init__."""
--> 945 self.sock = self._create_connection(
946 (self.host,self.port), self.timeout, self.source_address)
~\anaconda3\lib\socket.py in create_connection(address, timeout, source_address)
843 try:
--> 844 raise err
845 finally:
~\anaconda3\lib\socket.py in create_connection(address, timeout, source_address)
831 sock.bind(source_address)
--> 832 sock.connect(sa)
833 # Break explicitly a reference cycle
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
During handling of the above exception, another exception occurred:
URLError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_12220/2927704185.py in <module>
1 import seaborn as sn
----> 2 iris = sn.load_dataset('iris')
~\anaconda3\lib\site-packages\seaborn\utils.py in load_dataset(name, cache, data_home, **kws)
594 if name not in get_dataset_names():
595 raise ValueError(f"'{name}' is not one of the example datasets.")
--> 596 urlretrieve(url, cache_path)
597 full_path = cache_path
598 else:
~\anaconda3\lib\urllib\request.py in urlretrieve(url, filename, reporthook, data)
237 url_type, path = _splittype(url)
238
--> 239 with contextlib.closing(urlopen(url, data)) as fp:
240 headers = fp.info()
241
~\anaconda3\lib\urllib\request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)
212 else:
213 opener = _opener
--> 214 return opener.open(url, data, timeout)
215
216 def install_opener(opener):
~\anaconda3\lib\urllib\request.py in open(self, fullurl, data, timeout)
515
516 sys.audit('urllib.Request', req.full_url, req.data, req.headers, req.get_method())
--> 517 response = self._open(req, data)
518
519 # post-process response
~\anaconda3\lib\urllib\request.py in _open(self, req, data)
532
533 protocol = req.type
--> 534 result = self._call_chain(self.handle_open, protocol, protocol +
535 '_open', req)
536 if result:
~\anaconda3\lib\urllib\request.py in _call_chain(self, chain, kind, meth_name, *args)
492 for handler in handlers:
493 func = getattr(handler, meth_name)
--> 494 result = func(*args)
495 if result is not None:
496 return result
~\anaconda3\lib\urllib\request.py in https_open(self, req)
1387
1388 def https_open(self, req):
-> 1389 return self.do_open(http.client.HTTPSConnection, req,
1390 context=self._context, check_hostname=self._check_hostname)
1391
~\anaconda3\lib\urllib\request.py in do_open(self, http_class, req, **http_conn_args)
1347 encode_chunked=req.has_header('Transfer-encoding'))
1348 except OSError as err: # timeout error
-> 1349 raise URLError(err)
1350 r = h.getresponse()
1351 except:
URLError: <urlopen error [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond>
| 32 | load_dataset in seaborn is not working for me. getting this error.
TimeoutError Traceback (most recent call last)
~\anaconda3\lib\urllib\request.py in do_open(self, http_class, req, **http_conn_args)
1345 try:
-> 1346 h.request(req.get_method(), req.selector, req.data, headers,
1347 encode_chunked=req.has_header('Transfer-encoding'))
~\anaconda3\lib\http\client.py in request(self, method, url, body, headers, encode_chunked)
1278 """Send a complete request to the server."""
-> 1279 self._send_request(method, url, body, headers, encode_chunked)
1280
~\anaconda3\lib\http\client.py in _send_request(self, method, url, body, headers, encode_chunked)
1324 body = _encode(body, 'body')
-> 1325 self.endheaders(body, encode_chunked=encode_chunked)
1326
~\anaconda3\lib\http\client.py in endheaders(self, message_body, encode_chunked)
1273 raise CannotSendHeader()
-> 1274 self._send_output(message_body, encode_chunked=encode_chunked)
1275
~\anaconda3\lib\http\client.py in _send_output(self, message_body, encode_chunked)
1033 del self._buffer[:]
-> 1034 self.send(msg)
1035
~\anaconda3\lib\http\client.py in send(self, data)
973 if self.auto_open:
--> 974 self.connect()
975 else:
~\anaconda3\lib\http\client.py in connect(self)
1440
-> 1441 super().connect()
1442
~\anaconda3\lib\http\client.py in connect(self)
944 """Connect to the host and port specified in __init__."""
--> 945 self.sock = self._create_connection(
946 (self.host,self.port), self.timeout, self.source_address)
~\anaconda3\lib\socket.py in create_connection(address, timeout, source_address)
843 try:
--> 844 raise err
845 finally:
~\anaconda3\lib\socket.py in create_connection(address, timeout, source_address)
831 sock.bind(source_address)
--> 832 sock.connect(sa)
833 # Break explicitly a reference cycle
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
During handling of the above exception, another exception occurred:
URLError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_12220/2927704185.py in <module>
1 import seaborn as sn
----> 2 iris = sn.load_dataset('iris')
~\anaconda3\lib\site-packages\seaborn\utils.py in load_dataset(name, cache, data_home, **kws)
594 if name not in get_dataset_names():
595 raise ValueError(f"'{name}' is not one of the example datasets.")
--> 596 urlretrieve(url, cache_path)
597 full_path = cache_path
598 else:
~\anaconda3\lib\urllib\request.py in urlretrieve(url, filename, reporthook, data)
237 url_type, path = _splittype(url)
238
--> 239 with contextlib.closing(urlopen(url, data)) as fp:
240 headers = fp.info()
241
~\anaconda3\lib\urllib\request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)
212 else:
213 opener = _opener
--> 214 return opener.open(url, data, timeout)
215
216 def install_opener(opener):
~\anaconda3\lib\urllib\request.py in open(self, fullurl, data, timeout)
515
516 sys.audit('urllib.Request', req.full_url, req.data, req.headers, req.get_method())
--> 517 response = self._open(req, data)
518
519 # post-process response
~\anaconda3\lib\urllib\request.py in _open(self, req, data)
532
533 protocol = req.type
--> 534 result = self._call_chain(self.handle_open, protocol, protocol +
535 '_open', req)
536 if result:
~\anaconda3\lib\urllib\request.py in _call_chain(self, chain, kind, meth_name, *args)
492 for handler in handlers:
493 func = getattr(handler, meth_name)
--> 494 result = func(*args)
495 if result is not None:
496 return result
~\anaconda3\lib\urllib\request.py in https_open(self, req)
1387
1388 def https_open(self, req):
-> 1389 return self.do_open(http.client.HTTPSConnection, req,
1390 context=self._context, check_hostname=self._check_hostname)
1391
~\anaconda3\lib\urllib\request.py in do_open(self, http_class, req, **http_conn_args)
1347 encode_chunked=req.has_header('Transfer-encoding'))
1348 except OSError as err: # timeout error
-> 1349 raise URLError(err)
1350 r = h.getresponse()
1351 except:
URLError: <urlopen error [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond>
Hi! `seaborn`'s `load_dataset` pulls datasets from [here](https://github.com/mwaskom/seaborn-data) and not from our Hub, so this issue is not related to our library in any way and should be reported in their repo instead. | [
-0.3725789189338684,
-0.077509306371212,
-0.06400500982999802,
0.11478471755981445,
0.3414335250854492,
-0.056207239627838135,
0.3485483229160309,
0.2673206031322479,
-0.043627262115478516,
0.023610085248947144,
-0.3443041741847992,
0.12141767144203186,
0.35465630888938904,
0.20980794727802277,
0.09600964933633804,
0.03026067279279232,
-0.08966340869665146,
0.25210219621658325,
-0.25259172916412354,
-0.003591921180486679,
-0.21642917394638062,
-0.14251482486724854,
-0.23141685128211975,
0.050821103155612946,
0.22971853613853455,
-0.0037823375314474106,
-0.04358633980154991,
0.17958912253379822,
-0.3024214506149292,
-0.36868569254875183,
0.39390188455581665,
0.10256734490394592,
0.425232857465744,
0.4310891628265381,
-0.00011553258082130924,
0.2782735824584961,
0.47282713651657104,
-0.1973467767238617,
-0.4896472692489624,
0.015046589076519012,
-0.2108445167541504,
-0.012328927405178547,
0.3818317651748657,
-0.19330433011054993,
0.05115463584661484,
-0.09986890852451324,
0.04398609697818756,
-0.3810498118400574,
0.5713571906089783,
0.5005091428756714,
0.1428738534450531,
-0.04924650490283966,
0.2852412760257721,
0.049049269407987595,
-0.1514643430709839,
0.255799800157547,
-0.13831742107868195,
0.25901031494140625,
0.07767912745475769,
0.06224239617586136,
0.3296329081058502,
0.1510666459798813,
-0.08041507005691528,
0.2627526819705963,
0.05078520253300667,
-0.05984720587730408,
0.07666806876659393,
-0.21102720499038696,
-0.1159815713763237,
0.17768150568008423,
0.6539836525917053,
-0.1202429011464119,
-0.292135089635849,
0.0334417000412941,
-0.07375705242156982,
-0.3859245777130127,
0.1346755027770996,
0.17024622857570648,
-0.2438901960849762,
0.03572063893079758,
-0.09297393262386322,
0.05877000838518143,
-0.30428630113601685,
0.3122113347053528,
0.02949245274066925,
0.326887845993042,
-0.10529779642820358,
0.41618746519088745,
0.0917353555560112,
-0.0526140034198761,
0.14205381274223328,
-0.05371518433094025,
-0.1435393989086151,
-0.08927600085735321,
-0.22494761645793915,
0.04472409933805466,
-0.11468901485204697,
0.08537860959768295,
0.09062103927135468,
0.07926099002361298,
0.3759952485561371,
0.18244928121566772,
-0.08373798429965973,
0.20329242944717407,
0.23703083395957947,
0.014526324346661568,
0.39116397500038147,
-0.041189804673194885,
0.2779379189014435,
0.3263992369174957,
-0.1198393702507019,
0.04288763552904129,
0.026106752455234528,
-0.1379290372133255,
0.10883595049381256,
-0.11389855295419693,
0.3010423183441162,
-0.264637291431427,
0.08750881999731064,
-0.36322468519210815,
0.18503031134605408,
-0.19906461238861084,
0.09367607533931732,
0.6668977737426758,
-0.3831743896007538,
0.09446124732494354,
0.475023090839386,
0.08203265070915222,
-0.29688501358032227,
-0.19902271032333374,
-0.14465641975402832,
0.10214933753013611,
-0.019410833716392517,
0.0008472688496112823,
0.17413906753063202,
-0.2325415313243866,
0.10111164301633835,
-0.0571640245616436,
-0.02543872594833374,
-0.020591624081134796,
0.24905741214752197,
-0.2668881118297577,
0.020937711000442505,
0.09549342840909958,
0.1460171639919281,
-0.051114022731781006,
0.26243749260902405,
-0.20967087149620056,
-0.0313233844935894,
-0.08137842267751694,
-0.05751665681600571,
-0.23967677354812622,
0.007472025230526924,
0.1696694791316986,
0.08859583735466003,
-0.035939887166023254,
-0.13150808215141296,
-0.13090839982032776,
0.22867918014526367,
-0.31032678484916687,
-0.11912811547517776,
-0.2701879143714905,
-0.17961035668849945,
-0.05850682035088539,
0.24687013030052185,
0.374650776386261,
-0.4191209673881531,
0.08726522326469421,
-0.004381537903100252,
-0.009904038161039352,
0.2327215075492859,
0.0019389130175113678,
-0.19873249530792236,
-0.04271525889635086,
-0.03770085424184799,
-0.3861306309700012,
0.5109942555427551,
-0.6823878884315491,
-0.12937669456005096,
0.06184375286102295,
0.1140802651643753,
-0.2561337947845459,
-0.14687788486480713,
-0.06120293214917183,
0.38964375853538513,
0.1817435920238495,
0.1550089716911316,
0.2847445011138916,
0.041177064180374146,
-0.06424711644649506,
-0.07103876769542694,
-0.11578091979026794,
-0.1813749074935913,
0.44380807876586914,
-0.23104242980480194,
-0.019516684114933014,
0.16211636364459991,
0.1820037066936493,
0.1341068297624588,
0.009367376565933228,
0.2632986009120941,
0.31627899408340454,
0.06533647328615189,
0.0931544303894043,
0.26335933804512024,
0.019221745431423187,
-0.2860395610332489,
0.1732361614704132,
0.20192904770374298,
0.4777064919471741,
-0.292091429233551,
0.152861550450325,
-0.1765000820159912,
-0.09747334569692612,
-0.40294748544692993,
0.07845598459243774,
0.03247369825839996,
0.13903015851974487,
0.22749736905097961,
0.3429354131221771,
0.08949315547943115,
0.26416975259780884,
-0.5508783459663391,
0.1781926304101944,
-0.3057593107223511,
0.2755698561668396,
-0.11042948812246323,
-0.19639916718006134,
-0.07363355159759521,
-0.21295833587646484,
0.10677470266819,
-0.15703162550926208,
-0.3267580568790436,
0.0561801940202713,
-0.08548562228679657,
-0.02585010975599289,
-0.2411162555217743,
-0.26292216777801514,
0.09280414879322052,
-0.439175009727478,
0.08689532428979874,
-0.025576118379831314,
0.1856851875782013,
-0.11881116777658463,
-0.3916424810886383,
0.06750506162643433,
-0.01224634051322937,
0.3929300904273987,
0.23085685074329376,
0.008139282464981079,
0.347089558839798,
0.02910180762410164,
0.036699943244457245,
-0.0346287302672863,
0.0610218308866024,
-0.22770971059799194,
0.20509983599185944,
-0.29508307576179504,
0.07659533619880676,
0.03599073737859726,
0.43600353598594666,
0.09188105165958405,
0.08630841970443726,
0.16386820375919342,
0.028055552393198013,
-0.222131609916687,
0.24435608088970184,
0.1462315171957016,
0.5978252291679382,
0.24428948760032654,
0.10655251145362854,
0.0878656730055809,
0.003666447941213846,
0.03225407749414444,
0.14525729417800903,
-0.14531035721302032,
0.38708364963531494,
-0.11562194675207138,
0.07609973102807999,
-0.1810850352048874,
-0.2928047478199005,
-0.2800792157649994,
0.11060913652181625,
0.3127247095108032,
-0.1374838799238205,
0.22488124668598175,
-0.09328919649124146,
0.05944284796714783,
0.10321158915758133,
-0.10515648126602173,
-0.29772910475730896,
-0.2610752582550049,
-0.24641253054141998,
0.3485255539417267,
0.05096813663840294,
0.2541806995868683,
-0.26320594549179077,
-0.1124119907617569,
0.4963104724884033,
-0.3228309750556946,
-0.15256467461585999,
0.07337203621864319,
-0.10016041249036789,
-0.006109170615673065,
0.08458510041236877,
0.19811932742595673,
0.26103341579437256,
-0.167634978890419,
-0.12918272614479065,
0.0886552631855011,
-0.11450951546430588,
0.1184602603316307,
0.026638515293598175,
0.20758463442325592,
-0.03230954706668854,
0.28771600127220154,
-0.0572085902094841,
0.06489359587430954,
0.5609846115112305,
-0.24150046706199646,
-0.022146807983517647,
0.12532931566238403,
-0.07059746235609055,
0.28045257925987244,
-0.09568952023983002,
-0.323108434677124,
-0.522126317024231,
-0.49287083745002747,
0.11874024569988251,
0.1690072864294052,
0.12074395269155502,
0.16468575596809387,
0.18039245903491974,
0.15583448112010956,
-0.04530428349971771,
0.3642467260360718,
-0.12307754904031754,
-0.3125392496585846,
0.0767827183008194,
-0.2003708928823471,
-0.19217059016227722,
0.057514090090990067,
0.1910233050584793,
0.3870770335197449,
-0.039007626473903656,
-0.49609434604644775,
-0.07250646501779556,
-0.185978963971138,
0.10206861793994904,
-0.2713462710380554,
0.036264531314373016,
0.3635312020778656,
-0.20454932749271393,
-0.11018092185258865,
-0.0799143835902214,
-0.13718464970588684,
0.2967435121536255,
-0.1572009027004242,
0.12078563123941422,
-0.03029666468501091,
0.59968101978302,
-0.26446035504341125,
0.3357456922531128,
0.05790464207530022,
-0.21695326268672943,
0.5263117551803589,
-0.11539945751428604,
0.2243463397026062,
-0.10440880805253983,
-0.40886107087135315,
0.02619294449687004,
0.16635215282440186,
0.28868812322616577,
-0.0757899284362793,
0.0826319009065628,
-0.09351358562707901,
-0.4235740900039673,
-0.25801533460617065,
-0.12985345721244812,
-0.09925968945026398,
0.038344454020261765,
0.1926477998495102,
-0.029307380318641663,
-0.07812117040157318,
-0.002969488501548767,
-0.13787132501602173,
-0.11703164130449295,
-0.39198029041290283,
0.3028947114944458,
-0.042611248791217804,
-0.08684398233890533,
-0.804900050163269,
-0.1894751340150833,
-0.3033420741558075,
0.48939740657806396,
-0.04611871391534805,
0.44085192680358887,
-0.13874545693397522,
0.13004475831985474,
0.09275104105472565,
-0.16233964264392853,
0.6130653619766235,
-0.15509311854839325,
0.06222496181726456,
0.13681715726852417,
-0.03535616025328636,
-0.7573189735412598,
0.22451280057430267,
0.10234235227108002,
0.15709955990314484,
0.23984909057617188,
0.0649527981877327,
-0.22029349207878113,
-0.2224927842617035,
0.00953240878880024,
0.24464474618434906,
-0.2664112448692322,
-0.2532464861869812,
-0.47397059202194214,
-0.310224711894989,
-0.45819637179374695,
0.048583511263132095,
-0.1004953384399414,
0.1834719032049179,
-0.020493723452091217,
-0.36035609245300293,
0.0548957884311676,
0.0938248261809349,
-0.0050866007804870605,
0.12056869268417358,
0.004078611731529236,
-0.03652951121330261,
0.31244850158691406,
-0.11728198826313019,
0.49609503149986267,
0.31648099422454834,
0.5642052888870239,
-0.12242084741592407,
-0.3748207688331604,
0.005468623712658882,
0.13384796679019928,
0.12252403050661087,
-0.02562043070793152,
0.09467539191246033,
0.07286994904279709,
0.09063282608985901,
0.3878190517425537,
-0.15192651748657227,
0.07672702521085739,
0.11407685279846191,
0.04676244407892227,
-0.5405951738357544,
-0.5682543516159058,
0.21354436874389648,
-0.24253037571907043,
0.17244161665439606,
0.6840158104896545,
0.04900418594479561,
-0.20119477808475494,
0.0668550431728363,
0.10649558901786804,
0.8963579535484314,
-0.13914717733860016,
0.21778930723667145,
0.30240076780319214,
0.22134043276309967,
0.578972578048706,
-0.06950273364782333,
0.014970180578529835,
-0.13817285001277924,
-0.003911931999027729,
0.07440410554409027,
-0.21072876453399658,
0.06649281084537506,
-0.0752037912607193,
-0.43539026379585266,
0.043522898107767105,
0.04612863063812256,
-0.08311283588409424,
-0.11279052495956421,
0.26893121004104614,
-0.2408125102519989,
-0.2303374707698822,
-0.4114918112754822,
0.1067594438791275,
-0.15954717993736267,
0.04391811788082123,
0.04675937816500664,
0.005763636901974678,
0.03050095960497856,
-0.15816852450370789,
0.16965870559215546,
0.23161524534225464,
0.012821117416024208,
0.14741699397563934,
-0.5343182682991028,
-0.0013452917337417603,
0.21132901310920715,
0.42315998673439026,
0.06123257800936699,
-0.07762154936790466,
-0.13174192607402802,
0.1828383207321167,
-0.29246196150779724,
-0.102566659450531,
-0.11770294606685638,
0.029129959642887115,
0.19263207912445068,
-0.21711456775665283,
-0.48446643352508545,
0.3021419644355774,
0.09507341682910919,
-0.3319031596183777,
0.28592392802238464,
0.27934956550598145,
0.047214701771736145,
-0.46381473541259766,
-0.19523106515407562,
-0.2592601776123047,
-0.023664584383368492,
-0.1814066469669342,
0.08853074908256531,
0.19247651100158691,
-0.23140467703342438,
0.2534618675708771,
-0.08757443726062775,
-0.4012329876422882,
-0.06029308959841728,
0.6150239109992981,
0.021595686674118042,
0.21268609166145325,
0.8086410760879517,
0.32182154059410095,
-0.07139416038990021,
-0.2170255184173584,
0.13925912976264954,
-0.08202176541090012,
-0.4541292190551758,
0.06402331590652466,
0.2675431966781616,
0.23192574083805084,
-0.07873669266700745,
0.00676640123128891,
-0.12655635178089142,
0.07432778179645538,
0.09553760290145874,
-0.46150651574134827,
-0.29876527190208435,
0.04035218432545662,
-0.129697784781456,
-0.058823999017477036,
0.08116421103477478,
0.28682923316955566,
0.022967102006077766,
0.0745028629899025,
-0.2735646963119507,
0.10215453058481216,
-0.14146119356155396,
0.053076520562171936,
0.15009282529354095,
-0.12358883768320084,
0.1436137557029724,
-0.1682962030172348,
0.055097028613090515,
0.3550286293029785,
-0.1451885998249054,
-0.20006614923477173,
-0.04456734657287598,
0.18173232674598694,
-0.11004840582609177,
-0.2706005871295929,
-0.2293524593114853,
-0.5877468585968018,
-0.35089775919914246,
0.038784198462963104,
0.12028510868549347,
-0.056691285222768784,
-0.1521688848733902,
-0.07673029601573944,
0.20028044283390045,
0.08646293729543686,
-0.09848247468471527,
0.13532689213752747,
-0.09104117751121521,
0.23460844159126282,
-0.008272250182926655,
0.1166045069694519,
0.015993570908904076,
-0.07904380559921265,
-0.38505056500434875,
0.004116229712963104,
-0.20573295652866364,
-0.05225820094347,
0.32655954360961914,
-0.25097572803497314,
-0.03517024219036102,
-0.1914040893316269,
0.24705445766448975,
0.35310494899749756,
-0.15700776875019073,
0.1303354650735855,
0.04083312302827835,
0.15389293432235718,
-0.1526269167661667,
0.046956852078437805,
-0.045543085783720016,
-0.23891571164131165,
0.08585125207901001,
0.08282177895307541,
-0.3434130549430847,
-0.01377829909324646,
0.23512482643127441,
0.07259867340326309,
0.36773037910461426,
0.04188396781682968,
0.15780533850193024,
0.31163904070854187,
-0.17894478142261505,
0.1568300426006317,
0.5179752111434937,
0.19028756022453308,
0.1127837523818016,
0.42811691761016846,
-0.2418142557144165,
0.1982446312904358,
-0.24545952677726746,
0.2364235371351242,
-0.11855236440896988,
-0.41810497641563416,
0.08373197913169861,
0.13525785505771637,
-0.15908405184745789,
0.06022261083126068,
-0.11273562908172607,
0.42757683992385864,
-0.5572357773780823,
-0.051921941339969635,
-0.2758901119232178,
0.21859055757522583,
-0.017569798976182938,
0.003441399894654751,
-0.37988948822021484,
-0.29739099740982056,
0.2052566409111023,
0.027010027319192886,
0.053215641528367996,
-0.06856900453567505,
-0.14062181115150452,
0.19149476289749146,
-0.03594006597995758,
-0.25943949818611145,
-0.28107914328575134,
0.2980373501777649,
-0.10153602808713913,
-0.0980246365070343,
0.19990868866443634,
0.7050865888595581,
0.08750680088996887,
-0.041687678545713425,
0.052869584411382675,
0.4943269193172455,
0.15012259781360626,
0.1719496101140976,
0.3716035485267639,
0.1727467030286789,
-0.21124471724033356,
-0.20354187488555908,
0.16141277551651,
0.3931005895137787,
0.08559492230415344,
0.1951761692762375,
0.19714666903018951,
-0.13434168696403503,
-0.12550847232341766,
-0.023951683193445206,
0.28260207176208496,
-0.03898756951093674,
0.5269726514816284,
-0.00776754692196846,
-0.03522761911153793,
-0.33864080905914307,
0.0651235356926918,
-0.43303319811820984,
0.5947667360305786,
0.37663212418556213,
-0.28947973251342773,
0.057210929691791534,
-0.32110103964805603,
0.018540948629379272,
-0.29346564412117004,
0.44593095779418945,
0.11931135505437851,
0.3797830045223236,
-0.039462458342313766,
-0.21029429137706757,
-0.25801926851272583,
-0.02315410226583481,
-0.47670090198516846,
-0.3931465148925781,
0.12658286094665527,
0.23017647862434387,
0.3165360987186432,
-0.08502387255430222,
0.26984113454818726,
0.08519934862852097,
0.117064468562603,
-0.09857514500617981,
-0.35725268721580505,
-0.39869171380996704,
-0.09571008384227753,
0.3945002555847168,
-0.11029557138681412,
-0.6747007369995117,
0.20908378064632416,
0.2580975592136383,
-0.055060915648937225,
-0.31626391410827637,
0.06120900809764862,
-0.031346678733825684,
-0.17693868279457092,
0.42411327362060547,
0.1635030061006546,
0.5594786405563354,
-0.03685678914189339,
-0.2205357551574707,
0.04825662821531296,
-0.3582431972026825,
0.05175956338644028,
0.15857750177383423,
0.2388308048248291,
0.584855318069458,
-0.2603703439235687,
-0.2727600634098053,
-0.22965513169765472,
0.380778968334198,
-0.15732786059379578,
-0.31435635685920715,
0.05500367283821106,
-0.13796377182006836,
0.10907543450593948,
0.14558301866054535,
-0.04155031591653824,
0.10758351534605026,
0.11535172909498215,
-0.14110584557056427,
-0.4279642105102539,
-0.08671977370977402,
0.5233427882194519,
-0.11256062984466553,
-0.2966059148311615,
0.03833664208650589,
-0.05420762300491333,
0.02253791317343712,
-0.017251482233405113,
-0.3639739155769348,
0.24482479691505432,
0.4230562746524811,
-0.03555581718683243,
-0.338159441947937,
0.4045221209526062,
0.03229121118783951,
0.22454817593097687,
-0.1250489354133606,
0.22290430963039398,
0.02714557945728302,
-0.22594407200813293,
-0.1560434103012085,
-0.11263292282819748
] |
https://github.com/huggingface/datasets/issues/5537 | Increase speed of data files resolution | You were right, if `self.dir_cache` is not None in glob, it is exactly the same as what is returned by find, at least for all the tests we have, and some extended evaluation I did across a random sample of about 1000 datasets.
Thanks for the nice hints, and let me know if this is not exactly what we want here!
see PR: https://github.com/huggingface/datasets/pull/5704
| Certain datasets like `bigcode/the-stack-dedup` have so many files that loading them takes forever right from the data files resolution step.
`datasets` uses file patterns to check the structure of the repository but it takes too much time to iterate over and over again on all the data files.
This comes from `resolve_patterns_in_dataset_repository` which calls `_resolve_single_pattern_in_dataset_repository`, which iterates on all the files at
```python
glob_iter = [PurePath(filepath) for filepath in fs.glob(PurePath(pattern).as_posix()) if fs.isfile(filepath)]
```
but calling `glob` on such a dataset is too expensive. Indeed it calls `ls()` in `hffilesystem.py` too many times.
Maybe `glob` can be more optimized in `hffilesystem.py`, or the data files resolution can directly be implemented in the filesystem by checking its `dir_cache` ? | 64 | Increase speed of data files resolution
Certain datasets like `bigcode/the-stack-dedup` have so many files that loading them takes forever right from the data files resolution step.
`datasets` uses file patterns to check the structure of the repository but it takes too much time to iterate over and over again on all the data files.
This comes from `resolve_patterns_in_dataset_repository` which calls `_resolve_single_pattern_in_dataset_repository`, which iterates on all the files at
```python
glob_iter = [PurePath(filepath) for filepath in fs.glob(PurePath(pattern).as_posix()) if fs.isfile(filepath)]
```
but calling `glob` on such a dataset is too expensive. Indeed it calls `ls()` in `hffilesystem.py` too many times.
Maybe `glob` can be more optimized in `hffilesystem.py`, or the data files resolution can directly be implemented in the filesystem by checking its `dir_cache` ?
You were right, if `self.dir_cache` is not None in glob, it is exactly the same as what is returned by find, at least for all the tests we have, and some extended evaluation I did across a random sample of about 1000 datasets.
Thanks for the nice hints, and let me know if this is not exactly what we want here!
see PR: https://github.com/huggingface/datasets/pull/5704
| [
-0.2851494252681732,
-0.017127923667430878,
-0.1667213886976242,
0.2510114908218384,
0.22652849555015564,
-0.027485206723213196,
-0.06366461515426636,
0.769538402557373,
0.18300290405750275,
0.15410853922367096,
-0.1291680783033371,
0.1802806854248047,
-0.08980454504489899,
0.06925535202026367,
-0.0454024076461792,
0.24156887829303741,
-0.05697622150182724,
0.16065926849842072,
0.0020302608609199524,
-0.2184007167816162,
-0.20583254098892212,
0.061854325234889984,
-0.025911450386047363,
-0.3761664628982544,
-0.339164674282074,
0.16700050234794617,
-0.14200007915496826,
0.25083601474761963,
-0.09769102185964584,
-0.36886119842529297,
0.2659761607646942,
0.2290470153093338,
-0.0351901613175869,
0.3839787244796753,
-0.00010997448407579213,
-0.059224992990493774,
0.3019741177558899,
-0.07888182252645493,
-0.3624655604362488,
0.3456774652004242,
-0.3095861077308655,
-0.46129918098449707,
-0.2415032833814621,
-0.2798433303833008,
-0.08070449531078339,
-0.1681004911661148,
-0.019272567704319954,
-0.3348477780818939,
0.051499057561159134,
0.07066916674375534,
0.2267126590013504,
0.11538507044315338,
-0.07096534222364426,
-0.011724260635674,
0.3569311499595642,
0.3843194842338562,
-0.04424723610281944,
0.43429383635520935,
0.3813651502132416,
-0.13932181894779205,
-0.1754932701587677,
0.413430392742157,
-0.25386038422584534,
0.24865058064460754,
0.1607622504234314,
0.21956151723861694,
0.2537161111831665,
-0.228517085313797,
0.1346248984336853,
0.19711175560951233,
0.2377801239490509,
-0.2336881458759308,
-0.43656104803085327,
-0.5298620462417603,
-0.15181973576545715,
-0.28152763843536377,
0.25343039631843567,
0.15273532271385193,
-0.18299010396003723,
0.08087871968746185,
-0.032460182905197144,
-0.1103157177567482,
0.12731269001960754,
-0.0811527669429779,
0.052613407373428345,
-0.016888193786144257,
-0.027720853686332703,
-0.20822149515151978,
0.5147075653076172,
0.2145494669675827,
-0.06519713252782822,
-0.20636388659477234,
0.08911104500293732,
0.14819544553756714,
-0.5576969981193542,
-0.14478397369384766,
0.31633663177490234,
0.211355060338974,
0.4322375953197479,
0.15586167573928833,
-0.14427034556865692,
0.12348444014787674,
-0.1609455645084381,
-0.08995304256677628,
-0.14564558863639832,
0.2705560624599457,
-0.2054593861103058,
0.10083538293838501,
0.40060919523239136,
0.10908219963312149,
-0.15456566214561462,
0.1710227131843567,
-0.23385432362556458,
-0.20770813524723053,
0.04201377555727959,
0.08790106326341629,
0.12820853292942047,
-0.19252778589725494,
-0.02484319359064102,
-0.1233312115073204,
-0.07178431004285812,
-0.34319162368774414,
0.2456098347902298,
0.4058522880077362,
0.070721335709095,
0.3220812976360321,
-0.261164128780365,
-0.26817113161087036,
-0.24643133580684662,
0.053294386714696884,
-0.2220795452594757,
0.03537822514772415,
-0.09856191277503967,
0.1741291731595993,
0.1489744484424591,
-0.3513912260532379,
0.08327919989824295,
-0.0683518797159195,
0.036900315433740616,
0.10668028891086578,
0.03689495474100113,
-0.313906729221344,
0.21201348304748535,
0.17907437682151794,
-0.4471137225627899,
-0.06561386585235596,
0.14971472322940826,
0.016612939536571503,
-0.3645506501197815,
-0.01178278774023056,
-0.31139278411865234,
-0.4532913863658905,
-0.02657519467175007,
0.1421637088060379,
-0.021146269515156746,
0.2456955462694168,
-0.20460543036460876,
0.24006688594818115,
-0.13425567746162415,
0.09917381405830383,
0.03494448959827423,
-0.18205171823501587,
0.07424944639205933,
-0.11448984593153,
0.5064419507980347,
0.4463523030281067,
-0.1070818230509758,
0.07098981738090515,
-0.16568951308727264,
0.019491180777549744,
0.39255085587501526,
0.5021218657493591,
-0.017139537259936333,
0.15789823234081268,
-0.5543961524963379,
-0.03670057654380798,
0.5029776692390442,
-0.469347208738327,
-0.5371386408805847,
0.14875169098377228,
-0.037222012877464294,
0.05424713343381882,
0.39969614148139954,
0.1827469766139984,
-0.11228259652853012,
-0.1981843113899231,
-0.07484045624732971,
0.19194543361663818,
-0.11852094531059265,
0.15541782975196838,
-0.4639119803905487,
-0.10404562205076218,
-0.2190818041563034,
0.3831591010093689,
0.004384923726320267,
-0.02304236590862274,
0.022735491394996643,
-0.2541610896587372,
0.14716196060180664,
-0.12708260118961334,
-0.08854340016841888,
0.031047770753502846,
0.5269424319267273,
-0.01844704896211624,
0.018949782475829124,
0.11884775012731552,
-0.3055877685546875,
0.41472163796424866,
-0.16776159405708313,
-0.2329176962375641,
-0.14134252071380615,
-0.4076160788536072,
0.04551549255847931,
0.017598947510123253,
-0.022381331771612167,
-0.05340571328997612,
0.08517977595329285,
0.26426780223846436,
0.43440672755241394,
-0.09060019254684448,
-0.19172541797161102,
0.36352771520614624,
-0.22157786786556244,
0.00905671902000904,
-0.11784781515598297,
0.3252968192100525,
-0.00416918657720089,
0.02595606818795204,
-0.15339010953903198,
0.023732848465442657,
-0.04645075649023056,
-0.2849004864692688,
-0.05007138475775719,
0.3329629600048065,
0.07536080479621887,
-0.057818129658699036,
0.38014912605285645,
0.576956033706665,
0.03484951704740524,
0.036409202963113785,
0.22282804548740387,
-0.11333499848842621,
0.111794613301754,
0.0010955557227134705,
-0.04613356292247772,
0.12872162461280823,
0.10465139150619507,
0.2593265771865845,
0.1324034333229065,
-0.2920723855495453,
0.14205746352672577,
0.04570396617054939,
0.25630098581314087,
-0.027410872280597687,
0.3702968955039978,
-0.01168922707438469,
0.5853418111801147,
0.40334248542785645,
-0.11104284226894379,
0.158225417137146,
0.7681431174278259,
-0.23366618156433105,
0.07354912161827087,
0.5040732026100159,
-0.027508236467838287,
-0.38438108563423157,
-0.10887254774570465,
0.2643834352493286,
0.3789936304092407,
0.2570560574531555,
0.18995460867881775,
-0.01710822992026806,
0.1617773324251175,
-0.029037151485681534,
0.19881963729858398,
0.003643818199634552,
0.024937927722930908,
0.10183539986610413,
0.048631489276885986,
0.04457949474453926,
-0.12809139490127563,
-0.34718918800354004,
-0.14302216470241547,
0.11477363854646683,
0.12982361018657684,
0.021215764805674553,
-0.18737611174583435,
-0.24106356501579285,
0.0807909443974495,
0.3574896454811096,
-0.01792457327246666,
-0.20056340098381042,
0.11203267425298691,
-0.10853630304336548,
0.03648356720805168,
0.20515914261341095,
0.17006252706050873,
0.4524844288825989,
-0.00825049914419651,
-0.2595963478088379,
-0.44080230593681335,
-0.12319925427436829,
-0.14099901914596558,
-0.003983121365308762,
0.23638351261615753,
-0.08648403733968735,
0.408180832862854,
-0.27769210934638977,
-0.001880512572824955,
-0.47424858808517456,
-0.28569161891937256,
0.04891971871256828,
-0.07024761289358139,
-0.028189243748784065,
0.18343578279018402,
-0.1619817167520523,
-0.05524961277842522,
0.09809331595897675,
0.25072115659713745,
-0.1749504804611206,
-0.08301030844449997,
-0.032106660306453705,
-0.051896240562200546,
0.04380681365728378,
-0.13734857738018036,
0.022854425013065338,
-0.3786658048629761,
-0.5869815945625305,
0.25856631994247437,
-0.01399410329759121,
0.1370665580034256,
0.14931128919124603,
-0.15748797357082367,
0.24408531188964844,
-0.2379056215286255,
0.21537251770496368,
-0.25461065769195557,
-0.4744062125682831,
0.2413462996482849,
0.20768901705741882,
-0.054310817271471024,
-0.27358004450798035,
-0.3262951970100403,
-0.04305804893374443,
0.1758573055267334,
-0.5444012880325317,
-0.4287657141685486,
-0.5717774629592896,
0.18612444400787354,
-0.08622704446315765,
0.1871752142906189,
0.1821521371603012,
0.06505431234836578,
-0.2650856673717499,
-0.025575295090675354,
-0.024405021220445633,
0.10270501673221588,
0.008686050772666931,
0.08814822882413864,
0.03515513613820076,
0.10602334141731262,
0.12921082973480225,
0.3910934329032898,
0.3927222490310669,
-0.18296319246292114,
0.30846941471099854,
0.08477510511875153,
0.5363024473190308,
-0.18510183691978455,
-0.2970243990421295,
0.14298515021800995,
0.18963822722434998,
-0.11241082102060318,
0.335768461227417,
0.15456849336624146,
-0.15291768312454224,
0.010386105626821518,
-0.1642909049987793,
0.04788777977228165,
-0.2697947025299072,
0.2251126766204834,
0.032062631100416183,
0.19690653681755066,
-0.15811887383460999,
-0.05996140465140343,
-0.016878724098205566,
-0.0022640121169388294,
0.2642064690589905,
0.16548755764961243,
0.129682719707489,
-0.06180305778980255,
-0.012027949094772339,
-0.016405818983912468,
-0.43244868516921997,
0.2814096510410309,
0.06699877232313156,
-0.032019492238759995,
-0.0655142068862915,
-0.2440880537033081,
0.06975513696670532,
-0.11256004124879837,
0.691598653793335,
0.10931823402643204,
-0.07485470175743103,
0.06151183322072029,
-0.19405832886695862,
-0.03939596563577652,
-0.11882606148719788,
-0.18081305921077728,
0.18352602422237396,
-0.06954565644264221,
0.3729102909564972,
-0.3172886073589325,
-0.3645325005054474,
0.031996652483940125,
0.2848660945892334,
0.12483300268650055,
-0.00418902887031436,
-0.14646746218204498,
-0.2708705961704254,
-0.17684096097946167,
0.14270389080047607,
0.01939336769282818,
-0.1020556390285492,
-0.04659857600927353,
-0.22391197085380554,
-0.014732396230101585,
0.004447460174560547,
0.09031708538532257,
0.10072456300258636,
0.20140090584754944,
0.04127274081110954,
0.28445306420326233,
0.019666284322738647,
0.21839387714862823,
0.34726178646087646,
0.602935254573822,
-0.3544032871723175,
-0.022915400564670563,
-0.018564634025096893,
0.14514656364917755,
0.16441243886947632,
0.2813832759857178,
-0.2326270490884781,
-0.14091837406158447,
-0.5733845233917236,
0.35503089427948,
-0.5866484642028809,
0.2511097192764282,
0.24963156878948212,
0.2350648194551468,
-0.47968581318855286,
-0.31636330485343933,
0.5937071442604065,
0.2085152417421341,
-0.12566262483596802,
0.40388399362564087,
0.32261553406715393,
-0.09584847837686539,
0.15350580215454102,
-0.13001856207847595,
0.799361526966095,
-0.08518938720226288,
-0.023036431521177292,
0.03044561855494976,
0.06388784199953079,
0.2601790130138397,
-0.3389180302619934,
0.15075574815273285,
-0.07043900340795517,
-0.44851863384246826,
0.14313827455043793,
-0.2392699420452118,
0.10469899326562881,
0.10048116743564606,
-0.23644407093524933,
0.277315229177475,
0.09048469364643097,
-0.1957738697528839,
-0.11995135247707367,
0.22881817817687988,
-0.12375631183385849,
-0.25183480978012085,
-0.38407862186431885,
0.25059741735458374,
-0.05001615732908249,
0.27532464265823364,
0.1752144992351532,
0.1665244996547699,
-0.02944284677505493,
-0.026151305064558983,
-0.10540986061096191,
-0.13406452536582947,
-0.13814131915569305,
0.18682892620563507,
-0.09631863236427307,
-0.12431035190820694,
-0.11473377048969269,
-0.01933177188038826,
0.11600974202156067,
0.28295472264289856,
-0.059290193021297455,
0.18730902671813965,
0.003270946443080902,
0.4192846715450287,
0.4313884973526001,
-0.2057488113641739,
0.18838609755039215,
0.1615145206451416,
0.07420026510953903,
-0.27335694432258606,
-0.25899267196655273,
-0.22708235681056976,
0.039156362414360046,
-0.15996402502059937,
-0.02211643010377884,
0.1670226901769638,
-0.0832575112581253,
-0.014415077865123749,
-0.3044464886188507,
-0.14576278626918793,
0.16946843266487122,
0.35698115825653076,
-0.12692110240459442,
0.30593717098236084,
-0.12144336104393005,
-0.3136993646621704,
-0.09341298043727875,
0.10473931580781937,
-0.049443356692790985,
0.17560483515262604,
0.172252357006073,
-0.27151453495025635,
-0.21819956600666046,
-0.295969694852829,
0.005735866725444794,
-0.053724050521850586,
-0.317032128572464,
0.34604722261428833,
-0.012201163917779922,
-0.16892322897911072,
0.16281463205814362,
-0.10131971538066864,
0.3081779479980469,
-0.24311235547065735,
-0.13171440362930298,
-0.19738949835300446,
-0.3248201012611389,
0.14320752024650574,
-0.24095620214939117,
0.46055182814598083,
-0.10203041136264801,
-0.2895558774471283,
-0.16950608789920807,
0.11822770535945892,
-0.3999970853328705,
-0.02706190012395382,
-0.5831845998764038,
-0.10416790843009949,
-0.07170574367046356,
0.10991933941841125,
0.37389057874679565,
0.11098933219909668,
0.17841893434524536,
0.06054901331663132,
-0.2352556437253952,
-0.28065401315689087,
0.1715359091758728,
0.1072002500295639,
-0.24663129448890686,
0.13638167083263397,
0.3288159966468811,
-0.06248587369918823,
-0.22971290349960327,
-0.4949255883693695,
0.24833941459655762,
-0.16287639737129211,
0.007304280996322632,
0.10412941128015518,
0.19964344799518585,
-0.3836597800254822,
0.08300485461950302,
0.28496360778808594,
-0.1050412505865097,
0.05842285975813866,
-0.04077394679188728,
0.06245085597038269,
-0.2671694755554199,
-0.17603982985019684,
0.12401663511991501,
0.21742373704910278,
0.1774691641330719,
0.08050155639648438,
0.26421844959259033,
0.17310357093811035,
-0.0463210865855217,
0.13914205133914948,
0.32985439896583557,
0.13797301054000854,
-0.051820043474435806,
0.017800329253077507,
0.33680078387260437,
0.262624055147171,
-0.29184702038764954,
-0.22050409018993378,
0.2171698957681656,
-0.10449887067079544,
0.3483865261077881,
0.1470373421907425,
0.3110889494419098,
0.33356308937072754,
0.08375279605388641,
-0.04735416918992996,
0.3531646430492401,
0.05282729119062424,
0.15501844882965088,
0.3496389389038086,
0.36596953868865967,
-0.0705999881029129,
0.24825340509414673,
-0.20316630601882935,
0.2345893681049347,
0.40316712856292725,
-0.4405840039253235,
0.6121708750724792,
-0.17865100502967834,
0.31950539350509644,
0.0737781897187233,
-0.31675106287002563,
0.09602341055870056,
0.19342517852783203,
-0.16683226823806763,
0.2304890751838684,
-0.23751598596572876,
0.05578499287366867,
-0.2319442629814148,
-0.08420506864786148,
-0.05677606910467148,
0.17749977111816406,
0.026642439886927605,
-0.038062095642089844,
0.5382895469665527,
-0.012671038508415222,
-0.1385340839624405,
-0.00003116205334663391,
0.00007117539644241333,
-0.2280452400445938,
0.18782922625541687,
0.21847029030323029,
0.27104759216308594,
-0.09543422609567642,
0.1972811222076416,
-0.08711438626050949,
0.508661687374115,
-0.14612740278244019,
0.08004304021596909,
0.12369149923324585,
0.04598233103752136,
0.10513639450073242,
0.4464866816997528,
0.3173626959323883,
0.3853568434715271,
-0.14888779819011688,
-0.14563876390457153,
-0.11541107296943665,
-0.03152213990688324,
-0.31997203826904297,
0.20067454874515533,
-0.28501302003860474,
-0.3742697834968567,
0.05566122755408287,
0.09179598093032837,
-0.23653817176818848,
-0.18028892576694489,
-0.3271358907222748,
-0.06527775526046753,
-0.1771814525127411,
0.5454090237617493,
0.15190757811069489,
-0.10034985840320587,
-0.25168904662132263,
0.11753439158201218,
-0.5750014781951904,
-0.182102769613266,
0.5786474347114563,
-0.1478760838508606,
0.1288566291332245,
0.2283478081226349,
0.12828020751476288,
-0.14915648102760315,
0.454318642616272,
0.23118507862091064,
0.0876971036195755,
-0.1437961310148239,
-0.03323313966393471,
-0.44612812995910645,
-0.19291293621063232,
0.013070132583379745,
-0.355633407831192,
0.024256451055407524,
0.20385608077049255,
0.05099797621369362,
-0.06812386214733124,
0.33109375834465027,
-0.250620573759079,
0.36994507908821106,
-0.14789268374443054,
-0.39879587292671204,
0.006820235401391983,
-0.2797967195510864,
-0.21948449313640594,
0.0729610025882721,
-0.5333624482154846,
0.1769028604030609,
0.025750096887350082,
0.07140254229307175,
0.05272466689348221,
0.21172818541526794,
0.3224019706249237,
-0.007035508751869202,
0.3691369295120239,
0.08979374170303345,
0.024328187108039856,
-0.07258211076259613,
-0.10093546658754349,
-0.2578994035720825,
-0.08431325107812881,
0.03328423574566841,
-0.04002274572849274,
-0.14246661961078644,
0.2103380709886551,
-0.4135713279247284,
-0.15619242191314697,
-0.3306470513343811,
0.01956305466592312,
0.044673144817352295,
-0.15300704538822174,
-0.1740906983613968,
0.06770778447389603,
-0.06345515698194504,
0.1768116056919098,
0.10669839382171631,
0.2627700865268707,
0.12941762804985046,
-0.07827943563461304,
-0.43779271841049194,
-0.298099547624588,
0.5545189380645752,
-0.11913041770458221,
-0.08897267282009125,
0.009360785596072674,
0.35683679580688477,
0.14519648253917694,
0.037113696336746216,
-0.39134010672569275,
0.06671395152807236,
0.3417457342147827,
0.28330233693122864,
-0.2517072558403015,
0.3683590292930603,
-0.10470037162303925,
0.13277532160282135,
-0.08419808745384216,
-0.0353173166513443,
-0.23556703329086304,
-0.27142399549484253,
0.02984703704714775,
-0.1034107506275177
] |
https://github.com/huggingface/datasets/issues/5537 | Increase speed of data files resolution | I think we can make the data files resolution (significantly) faster in 2 steps:
1. `glob` calls `find` (which in turn calls `ls`), so we need `find` to be fast, and this can be achieved by fetching all the entries in a single API call and avoiding calls to `ls`. Implementing this for `HfFileSystem.find` (the one in `huggingface_hub`) is on my TO-DO list.
2. caching the repeated `find` calls in `_get_data_files_patterns` when the `data_files` patterns are not provided in `load_dataset`. To address this, we can introduce a `_resolve_single_pattern` function that would accept a filesystem object and a list of regex patterns to resolve. Then we can wrap this filesystem object in `_get_data_files_patterns` with an object that would cache the find calls before resolving the patterns with `_resolve_single_pattern`. (Feel free to suggest a cleaner implementation)
WDYT? | Certain datasets like `bigcode/the-stack-dedup` have so many files that loading them takes forever right from the data files resolution step.
`datasets` uses file patterns to check the structure of the repository but it takes too much time to iterate over and over again on all the data files.
This comes from `resolve_patterns_in_dataset_repository` which calls `_resolve_single_pattern_in_dataset_repository`, which iterates on all the files at
```python
glob_iter = [PurePath(filepath) for filepath in fs.glob(PurePath(pattern).as_posix()) if fs.isfile(filepath)]
```
but calling `glob` on such a dataset is too expensive. Indeed it calls `ls()` in `hffilesystem.py` too many times.
Maybe `glob` can be more optimized in `hffilesystem.py`, or the data files resolution can directly be implemented in the filesystem by checking its `dir_cache` ? | 135 | Increase speed of data files resolution
Certain datasets like `bigcode/the-stack-dedup` have so many files that loading them takes forever right from the data files resolution step.
`datasets` uses file patterns to check the structure of the repository but it takes too much time to iterate over and over again on all the data files.
This comes from `resolve_patterns_in_dataset_repository` which calls `_resolve_single_pattern_in_dataset_repository`, which iterates on all the files at
```python
glob_iter = [PurePath(filepath) for filepath in fs.glob(PurePath(pattern).as_posix()) if fs.isfile(filepath)]
```
but calling `glob` on such a dataset is too expensive. Indeed it calls `ls()` in `hffilesystem.py` too many times.
Maybe `glob` can be more optimized in `hffilesystem.py`, or the data files resolution can directly be implemented in the filesystem by checking its `dir_cache` ?
I think we can make the data files resolution (significantly) faster in 2 steps:
1. `glob` calls `find` (which in turn calls `ls`), so we need `find` to be fast, and this can be achieved by fetching all the entries in a single API call and avoiding calls to `ls`. Implementing this for `HfFileSystem.find` (the one in `huggingface_hub`) is on my TO-DO list.
2. caching the repeated `find` calls in `_get_data_files_patterns` when the `data_files` patterns are not provided in `load_dataset`. To address this, we can introduce a `_resolve_single_pattern` function that would accept a filesystem object and a list of regex patterns to resolve. Then we can wrap this filesystem object in `_get_data_files_patterns` with an object that would cache the find calls before resolving the patterns with `_resolve_single_pattern`. (Feel free to suggest a cleaner implementation)
WDYT? | [
-0.049320608377456665,
0.10979937016963959,
-0.06484201550483704,
0.21430625021457672,
0.022935984656214714,
-0.0795358419418335,
-0.08590029180049896,
0.7598603963851929,
0.13545364141464233,
0.1230635792016983,
-0.00472032418474555,
0.16313964128494263,
-0.13723717629909515,
0.07755681127309799,
-0.009637831710278988,
0.12176681309938431,
0.09473078697919846,
0.15161113440990448,
0.19935080409049988,
0.02669331431388855,
-0.18497274816036224,
-0.02260786108672619,
0.1494809240102768,
-0.38666605949401855,
-0.2824975550174713,
0.10730430483818054,
-0.12702777981758118,
0.06874852627515793,
-0.09966619312763214,
-0.28608179092407227,
0.3209913372993469,
0.25658029317855835,
0.05742735415697098,
0.053824469447135925,
-0.00012379782856442034,
-0.08502710610628128,
0.2526167631149292,
-0.000394672155380249,
-0.09885667264461517,
0.4113156795501709,
-0.4651123583316803,
-0.48644784092903137,
-0.21936604380607605,
-0.28146249055862427,
0.0753033384680748,
-0.11291828751564026,
0.028580253943800926,
-0.4985719919204712,
0.2262754589319229,
0.01707351580262184,
0.06457075476646423,
-0.21085943281650543,
-0.13521330058574677,
0.08617129176855087,
0.31159064173698425,
0.42481958866119385,
0.13481976091861725,
0.36700135469436646,
0.5535457134246826,
-0.32796767354011536,
-0.23203444480895996,
0.4315583407878876,
-0.3760125935077667,
0.05975314602255821,
0.35949277877807617,
0.26371297240257263,
0.2890692949295044,
-0.13872294127941132,
0.12378717213869095,
0.11244747042655945,
0.16727487742900848,
-0.24522274732589722,
-0.49025779962539673,
-0.6220484375953674,
-0.15085604786872864,
-0.28853639960289,
0.16092634201049805,
-0.11154832690954208,
-0.009877757169306278,
0.07587991654872894,
0.13150887191295624,
-0.34922099113464355,
0.17029517889022827,
-0.044429801404476166,
0.18213923275470734,
-0.20130440592765808,
0.12842611968517303,
-0.07293235510587692,
0.5439044237136841,
0.06124678999185562,
0.005410108715295792,
-0.24985769391059875,
0.1694858819246292,
0.2675968408584595,
-0.6634272336959839,
-0.0755402222275734,
0.3750237226486206,
0.30260029435157776,
0.42692744731903076,
0.2088579386472702,
-0.11163786053657532,
0.21168610453605652,
-0.1985418200492859,
-0.1295854151248932,
-0.16126754879951477,
0.4389812648296356,
-0.04624158889055252,
0.016733359545469284,
0.32180100679397583,
0.10421939939260483,
-0.16553811728954315,
0.1737702488899231,
-0.11015836894512177,
-0.2804306149482727,
-0.19283689558506012,
0.3879857063293457,
0.037120915949344635,
-0.26407912373542786,
0.14199727773666382,
-0.10358808934688568,
-0.1856352686882019,
-0.32447323203086853,
0.2722756266593933,
0.25220224261283875,
-0.0035900617949664593,
0.5339588522911072,
-0.09339962154626846,
-0.1591838002204895,
-0.143601655960083,
0.017666291445493698,
-0.09712262451648712,
-0.0056754108518362045,
0.009492248296737671,
0.535207211971283,
0.2581106424331665,
-0.2468034327030182,
-0.10116967558860779,
-0.05194150656461716,
0.1396447718143463,
0.016659967601299286,
-0.04841136932373047,
-0.3488125205039978,
0.07398258149623871,
-0.043731797486543655,
-0.6560982465744019,
-0.06629563122987747,
0.15511152148246765,
0.05306943506002426,
-0.42573776841163635,
0.015078119933605194,
-0.2898811101913452,
-0.39614227414131165,
0.10800858587026596,
-0.018554680049419403,
-0.058631349354982376,
0.3124699890613556,
-0.1036810502409935,
0.43969616293907166,
-0.002865120768547058,
-0.12226498126983643,
-0.11980681866407394,
-0.18643732368946075,
0.029625501483678818,
-0.12299404293298721,
0.4901057779788971,
0.28140395879745483,
-0.27744781970977783,
0.06192071735858917,
-0.3334025740623474,
0.19375373423099518,
0.3760436475276947,
0.40417537093162537,
-0.08019540458917618,
0.28356343507766724,
-0.4488723874092102,
0.08114218711853027,
0.35114991664886475,
-0.6445114612579346,
-0.496672123670578,
0.08514659851789474,
-0.105532705783844,
0.15736129879951477,
0.5598357915878296,
0.09638845920562744,
0.05920892208814621,
-0.22498367726802826,
0.04122588410973549,
0.23507781326770782,
-0.16829045116901398,
0.02058841474354267,
-0.2634424865245819,
-0.2959601581096649,
-0.23084305226802826,
0.23356907069683075,
-0.012199323624372482,
0.055950380861759186,
-0.07181248813867569,
-0.2501671016216278,
0.2026752233505249,
-0.03992092236876488,
0.02908814512193203,
-0.09370985627174377,
0.45446211099624634,
0.06817138940095901,
0.14742708206176758,
0.21617835760116577,
-0.3500401973724365,
0.30355122685432434,
-0.31075426936149597,
-0.22160208225250244,
-0.31765270233154297,
-0.41687875986099243,
0.2074766755104065,
-0.07204687595367432,
0.12447534501552582,
0.12392017245292664,
-0.07630259543657303,
0.24269096553325653,
0.351175993680954,
-0.14395540952682495,
-0.2570284605026245,
0.42925581336021423,
-0.13109828531742096,
-0.013368220068514347,
-0.239043191075325,
0.37189051508903503,
0.14254321157932281,
-0.022703148424625397,
-0.27585211396217346,
-0.05495945364236832,
-0.07076951116323471,
-0.20057688653469086,
0.04744252189993858,
0.1272536814212799,
0.1868738830089569,
-0.022641398012638092,
0.15556678175926208,
0.740267813205719,
0.0925469845533371,
0.05871611461043358,
0.18230204284191132,
-0.08801637589931488,
0.12895487248897552,
-0.1879289746284485,
0.07505727559328079,
0.14592108130455017,
0.22619976103305817,
0.517577588558197,
0.031919218599796295,
-0.35018467903137207,
0.03447127342224121,
0.012229610234498978,
0.1598653495311737,
-0.022496815770864487,
0.32357826828956604,
0.03731236606836319,
0.3927885890007019,
0.19078335165977478,
0.12586712837219238,
0.2723383605480194,
0.6591005325317383,
-0.18923936784267426,
-0.0033536776900291443,
0.39617180824279785,
0.10191071033477783,
-0.4607897698879242,
-0.012946253642439842,
0.16758328676223755,
0.4475964307785034,
0.10292986035346985,
0.04072679579257965,
-0.007867032662034035,
0.3068597614765167,
-0.02312873676419258,
0.09127244353294373,
0.08570194244384766,
-0.018635744228959084,
0.20282024145126343,
-0.07799078524112701,
-0.03117639198899269,
0.14274287223815918,
-0.5761289596557617,
-0.02522733248770237,
-0.023535659536719322,
0.07263089716434479,
-0.010321022011339664,
-0.32612335681915283,
-0.2030758261680603,
0.0512467697262764,
0.23712655901908875,
-0.03219809755682945,
-0.11661024391651154,
0.05466732382774353,
-0.06649398803710938,
0.019881684333086014,
0.06682514399290085,
0.2795027196407318,
0.5911806225776672,
-0.11980552226305008,
-0.3125860393047333,
-0.41270092129707336,
-0.21656568348407745,
-0.08525514602661133,
-0.16773849725723267,
0.2632519602775574,
-0.13108447194099426,
0.15806810557842255,
-0.20334289968013763,
0.09160124510526657,
-0.40444377064704895,
-0.1948595643043518,
-0.03914631903171539,
0.05605430155992508,
-0.15017837285995483,
0.03221076726913452,
-0.16792555153369904,
-0.20560981333255768,
-0.01065902505069971,
0.08361309766769409,
-0.04584141820669174,
0.010121086612343788,
-0.2685508728027344,
-0.1036863625049591,
0.3292161822319031,
-0.019233640283346176,
0.18060916662216187,
-0.43681639432907104,
-0.406893789768219,
0.16180026531219482,
-0.1252969652414322,
0.12869803607463837,
-0.028439797461032867,
-0.22047021985054016,
0.23057593405246735,
-0.3929102420806885,
0.22761215269565582,
-0.17763572931289673,
-0.37448906898498535,
0.10583009570837021,
0.21767087280750275,
-0.037876542657613754,
-0.5193294286727905,
-0.28963762521743774,
-0.050536226481199265,
0.23340493440628052,
-0.46232908964157104,
-0.5871024131774902,
-0.37679827213287354,
0.05703216418623924,
-0.24390548467636108,
0.16529333591461182,
0.21107636392116547,
0.1290523260831833,
-0.09620402753353119,
-0.03746810927987099,
-0.10819724202156067,
0.3196336030960083,
0.1989227533340454,
0.06645102798938751,
0.3183099925518036,
0.12598076462745667,
0.1382872462272644,
0.424546480178833,
0.4117063581943512,
-0.13711778819561005,
0.31470751762390137,
0.3984113037586212,
0.26025205850601196,
-0.09438129514455795,
-0.16106654703617096,
0.0341748371720314,
0.03983554244041443,
-0.032054509967565536,
0.179509237408638,
0.17454850673675537,
-0.03983614593744278,
-0.0060147494077682495,
-0.14936016499996185,
0.14624062180519104,
-0.37943872809410095,
0.3145256042480469,
-0.07609830796718597,
0.19744665920734406,
-0.23243297636508942,
-0.029657941311597824,
-0.2699623107910156,
0.055525779724121094,
0.3056630492210388,
0.12569737434387207,
0.380321741104126,
-0.07479377835988998,
-0.05627792701125145,
-0.4023267924785614,
-0.3617388904094696,
0.256064772605896,
0.21155822277069092,
0.04409942030906677,
-0.030939577147364616,
-0.04463901370763779,
0.00447431206703186,
-0.04251048341393471,
0.6844480037689209,
0.38216811418533325,
-0.0275069922208786,
0.13511870801448822,
-0.23083297908306122,
0.0932009220123291,
-0.0046307481825351715,
-0.005745850503444672,
0.20473991334438324,
-0.3668329119682312,
0.5369714498519897,
-0.4135131239891052,
-0.1585111916065216,
-0.36702558398246765,
0.46385276317596436,
0.033442173153162,
0.0245375856757164,
0.15631088614463806,
-0.33195263147354126,
-0.18582825362682343,
-0.01879231631755829,
0.07349531352519989,
0.051596079021692276,
0.09111252427101135,
-0.1940692812204361,
0.004124501720070839,
-0.10755103081464767,
0.20318391919136047,
-0.1392366588115692,
0.19805201888084412,
0.02787003666162491,
0.1883508861064911,
0.135116845369339,
0.1188340112566948,
0.0849546492099762,
0.41266533732414246,
-0.26524803042411804,
-0.05451732873916626,
-0.1431291401386261,
0.3003321886062622,
0.18857285380363464,
0.3974408805370331,
-0.2685019373893738,
0.09982799738645554,
-0.3653908371925354,
0.11191405355930328,
-0.6115196347236633,
0.24352066218852997,
0.009139440022408962,
0.17752142250537872,
-0.6043866872787476,
-0.501394510269165,
0.5851938724517822,
0.38923564553260803,
-0.22510187327861786,
0.4380073845386505,
0.4612310528755188,
-0.17360256612300873,
0.30177247524261475,
-0.13639885187149048,
1.0273284912109375,
-0.05552300065755844,
0.031357042491436005,
-0.08195219933986664,
0.13828465342521667,
0.4091368019580841,
-0.4836888313293457,
0.2713146209716797,
-0.02641771361231804,
-0.5126028656959534,
0.07599014043807983,
-0.24962438642978668,
0.12692441046237946,
0.31790703535079956,
-0.239399716258049,
0.22584563493728638,
0.21875961124897003,
-0.25752031803131104,
-0.012608138844370842,
0.1665804386138916,
-0.030823415145277977,
-0.36046484112739563,
-0.2636696398258209,
0.10996834933757782,
-0.051522769033908844,
0.17591850459575653,
0.14819109439849854,
0.1464778631925583,
-0.034481022506952286,
-0.0738634467124939,
0.02328798919916153,
-0.13151350617408752,
-0.05840591713786125,
0.3283379077911377,
-0.28914520144462585,
-0.10562428832054138,
-0.1138925701379776,
0.00918569415807724,
-0.12733332812786102,
0.08232252299785614,
-0.07228908687829971,
0.12078115344047546,
0.09367971867322922,
0.32912465929985046,
0.42489710450172424,
-0.29497575759887695,
0.12670375406742096,
0.2096993625164032,
0.07505512982606888,
-0.19594863057136536,
-0.25847500562667847,
-0.43537694215774536,
-0.03525067865848541,
-0.1554400771856308,
-0.11717669665813446,
0.29457324743270874,
-0.21512973308563232,
0.13207902014255524,
-0.137686088681221,
-0.06185136362910271,
0.03171352297067642,
0.6265729069709778,
-0.21597997844219208,
0.6110671758651733,
-0.391084760427475,
-0.12241575121879578,
0.036463379859924316,
0.16946491599082947,
0.04392625764012337,
0.002912212163209915,
0.18347644805908203,
-0.12281560897827148,
-0.26525986194610596,
-0.1473824381828308,
-0.0903702899813652,
0.03661821037530899,
-0.31714531779289246,
0.269440233707428,
-0.11579492688179016,
-0.08813489973545074,
0.03548123687505722,
-0.2098647952079773,
0.29805541038513184,
-0.17377051711082458,
-0.11537721753120422,
-0.252349317073822,
-0.46500489115715027,
0.25514543056488037,
-0.16314257681369781,
0.324117511510849,
0.02332194149494171,
-0.4000490605831146,
-0.450117826461792,
0.38121405243873596,
-0.19166263937950134,
-0.04117888957262039,
-0.3595736026763916,
0.015204929746687412,
-0.12695874273777008,
0.1709795892238617,
0.32893121242523193,
0.2213989645242691,
0.029540615156292915,
0.16894690692424774,
-0.0017884410917758942,
-0.07583367824554443,
0.24239158630371094,
0.21793043613433838,
-0.14089271426200867,
0.0640518069267273,
0.22883617877960205,
-0.19307972490787506,
-0.24533390998840332,
-0.4701809883117676,
0.2020438313484192,
-0.16774410009384155,
-0.019429415464401245,
-0.073410265147686,
0.22376978397369385,
-0.34366661310195923,
0.1699793040752411,
0.43940258026123047,
0.025902841240167618,
0.08037518709897995,
-0.13330413401126862,
0.24614472687244415,
-0.17839424312114716,
-0.18456301093101501,
0.19217140972614288,
0.2104566991329193,
0.3919280171394348,
-0.04271349310874939,
0.24860665202140808,
0.3112918734550476,
-0.20840297639369965,
0.06191614270210266,
0.26902610063552856,
0.20082445442676544,
0.1246437355875969,
0.22180838882923126,
0.5098389983177185,
0.03770884871482849,
-0.13410967588424683,
-0.3155544400215149,
0.34328192472457886,
-0.0890943706035614,
0.16588696837425232,
0.08012305945158005,
0.25277647376060486,
0.3699621558189392,
-0.022076502442359924,
-0.1441970318555832,
0.31529709696769714,
0.3152769207954407,
0.14744654297828674,
0.4048832058906555,
0.3092088997364044,
-0.154741108417511,
0.2418079674243927,
-0.09752058982849121,
0.3202594518661499,
0.24266020953655243,
-0.5910176634788513,
0.6146248579025269,
-0.029398135840892792,
0.34741008281707764,
0.15861287713050842,
-0.40495938062667847,
-0.013234283775091171,
0.3410230875015259,
-0.0044474974274635315,
0.12047221511602402,
-0.28400900959968567,
0.048553187400102615,
-0.25478851795196533,
-0.06203706935048103,
0.0073690954595804214,
0.278538316488266,
0.22916340827941895,
-0.046640776097774506,
0.652319610118866,
-0.0750594511628151,
-0.06847056746482849,
-0.053376469761133194,
-0.06901407241821289,
-0.2654794454574585,
0.3537167012691498,
0.2590748369693756,
0.3572345972061157,
0.06036827713251114,
-0.044199757277965546,
-0.0835566595196724,
0.5077008008956909,
-0.018276657909154892,
-0.06213092803955078,
0.12776894867420197,
0.06108403950929642,
0.26165929436683655,
0.2115626186132431,
0.021681740880012512,
0.3156477212905884,
-0.12867464125156403,
-0.09343679249286652,
-0.09947457909584045,
0.04513072967529297,
-0.3195475935935974,
0.18439102172851562,
-0.2392444908618927,
-0.44268307089805603,
0.030769582837820053,
-0.08488648384809494,
-0.1046505942940712,
-0.30234792828559875,
-0.40915992856025696,
-0.04843906685709953,
-0.11387710273265839,
0.676841676235199,
0.19398340582847595,
0.034297309815883636,
-0.06392541527748108,
0.04860173165798187,
-0.566546618938446,
-0.29151326417922974,
0.6410946249961853,
-0.23625032603740692,
0.0018212459981441498,
0.19564856588840485,
0.04373089224100113,
-0.31866171956062317,
0.25235694646835327,
0.22420203685760498,
0.2524435520172119,
-0.11195949465036392,
-0.02660207450389862,
-0.17552608251571655,
-0.26738983392715454,
0.11709524691104889,
-0.27312177419662476,
0.051769744604825974,
0.00042561814188957214,
-0.015635311603546143,
-0.0009637810289859772,
0.1327633261680603,
-0.2737796902656555,
0.4979449510574341,
-0.05185827612876892,
-0.3622780442237854,
0.11671201884746552,
-0.1172049343585968,
-0.06404092907905579,
0.06233755499124527,
-0.4133278727531433,
0.21060669422149658,
0.31814029812812805,
-0.05182066932320595,
-0.08108817040920258,
0.03842538595199585,
0.26708659529685974,
-0.026114411652088165,
0.5032894611358643,
0.23459680378437042,
0.12503860890865326,
-0.007047431543469429,
-0.08398333936929703,
-0.1946512758731842,
0.06735257804393768,
0.02115398272871971,
-0.09698658436536789,
-0.2903733551502228,
0.24168628454208374,
-0.6141852736473083,
0.2007637619972229,
-0.2987361252307892,
0.029140250757336617,
-0.2131534218788147,
-0.29476580023765564,
-0.3388940691947937,
0.059595994651317596,
-0.25744137167930603,
0.07618191093206406,
0.0563160739839077,
0.20982807874679565,
0.0914381742477417,
0.06477902829647064,
-0.39055001735687256,
-0.04407256841659546,
0.6196181774139404,
-0.17593826353549957,
-0.0753445252776146,
0.09067084640264511,
0.22610652446746826,
-0.10337609797716141,
0.07304385304450989,
-0.3436337411403656,
-0.11851201951503754,
0.23632113635540009,
0.2710306644439697,
-0.06302174925804138,
0.29043784737586975,
0.04466661810874939,
-0.06212477758526802,
-0.19879773259162903,
-0.22206661105155945,
-0.03395818918943405,
-0.17513687908649445,
-0.14914360642433167,
-0.22132998704910278
] |
https://github.com/huggingface/datasets/issues/5537 | Increase speed of data files resolution | Good idea :)
For 2:
That would work ! It's also possible to have a FileSystem with a cache on `.find` and use it inside the resolver passed to `_get_data_files_patterns`. Right now they're pretty simple:
```python
# for remote repositories
resolver = partial(_resolve_single_pattern_in_dataset_repository, dataset_info, base_path=base_path)
# for local
resolver = partial(_resolve_single_pattern_locally, base_path)
``` | Certain datasets like `bigcode/the-stack-dedup` have so many files that loading them takes forever right from the data files resolution step.
`datasets` uses file patterns to check the structure of the repository but it takes too much time to iterate over and over again on all the data files.
This comes from `resolve_patterns_in_dataset_repository` which calls `_resolve_single_pattern_in_dataset_repository`, which iterates on all the files at
```python
glob_iter = [PurePath(filepath) for filepath in fs.glob(PurePath(pattern).as_posix()) if fs.isfile(filepath)]
```
but calling `glob` on such a dataset is too expensive. Indeed it calls `ls()` in `hffilesystem.py` too many times.
Maybe `glob` can be more optimized in `hffilesystem.py`, or the data files resolution can directly be implemented in the filesystem by checking its `dir_cache` ? | 53 | Increase speed of data files resolution
Certain datasets like `bigcode/the-stack-dedup` have so many files that loading them takes forever right from the data files resolution step.
`datasets` uses file patterns to check the structure of the repository but it takes too much time to iterate over and over again on all the data files.
This comes from `resolve_patterns_in_dataset_repository` which calls `_resolve_single_pattern_in_dataset_repository`, which iterates on all the files at
```python
glob_iter = [PurePath(filepath) for filepath in fs.glob(PurePath(pattern).as_posix()) if fs.isfile(filepath)]
```
but calling `glob` on such a dataset is too expensive. Indeed it calls `ls()` in `hffilesystem.py` too many times.
Maybe `glob` can be more optimized in `hffilesystem.py`, or the data files resolution can directly be implemented in the filesystem by checking its `dir_cache` ?
Good idea :)
For 2:
That would work ! It's also possible to have a FileSystem with a cache on `.find` and use it inside the resolver passed to `_get_data_files_patterns`. Right now they're pretty simple:
```python
# for remote repositories
resolver = partial(_resolve_single_pattern_in_dataset_repository, dataset_info, base_path=base_path)
# for local
resolver = partial(_resolve_single_pattern_locally, base_path)
``` | [
-0.1536896973848343,
0.15076646208763123,
-0.15555904805660248,
0.21844053268432617,
0.18327803909778595,
-0.09429463744163513,
0.020885098725557327,
0.7693638205528259,
0.09961138665676117,
0.16804906725883484,
-0.0872386246919632,
0.21129822731018066,
-0.04070941358804703,
0.049849800765514374,
-0.14390680193901062,
0.13539233803749084,
-0.045943208038806915,
0.1277564913034439,
0.15080362558364868,
-0.16655826568603516,
-0.07154229283332825,
-0.024378055706620216,
0.1428261697292328,
-0.3124309182167053,
-0.23562146723270416,
0.15007935464382172,
-0.07574085146188736,
0.22940826416015625,
-0.02930419333279133,
-0.40687060356140137,
0.24169962108135223,
0.26949021220207214,
0.031865399330854416,
0.17079158127307892,
-0.00011069602624047548,
0.04118036478757858,
0.28806036710739136,
-0.007209273055195808,
-0.2070840448141098,
0.3715229034423828,
-0.401005357503891,
-0.5897379517555237,
-0.1506020873785019,
-0.3853435218334198,
-0.04427027702331543,
-0.09659969061613083,
-0.060783520340919495,
-0.3817048668861389,
0.08901017159223557,
0.07686465978622437,
0.19993558526039124,
0.10835658013820648,
-0.10474742949008942,
0.0362335629761219,
0.37302714586257935,
0.3560059070587158,
0.02750617451965809,
0.517765998840332,
0.5299981236457825,
-0.09801409393548965,
-0.1618141531944275,
0.3552592694759369,
-0.31650447845458984,
0.16882941126823425,
0.23685011267662048,
0.16786159574985504,
0.4162035584449768,
-0.27188000082969666,
0.031004684045910835,
0.1075601726770401,
0.1755886971950531,
-0.22080174088478088,
-0.47879651188850403,
-0.46947410702705383,
-0.28369396924972534,
-0.288226842880249,
0.22297906875610352,
0.15856127440929413,
-0.13490162789821625,
0.1137828677892685,
0.03483477607369423,
-0.22204972803592682,
0.03279280662536621,
-0.054370470345020294,
0.1268622875213623,
0.0256362184882164,
0.17928318679332733,
-0.1676497757434845,
0.3859745264053345,
0.08743314445018768,
0.012897687032818794,
-0.14384649693965912,
0.21142882108688354,
0.1493951380252838,
-0.5137020945549011,
-0.15220209956169128,
0.2987969219684601,
0.22158703207969666,
0.3709775507450104,
0.19625625014305115,
-0.21355043351650238,
0.19121134281158447,
-0.14462412893772125,
-0.04584502428770065,
-0.17837518453598022,
0.3067736327648163,
-0.21712562441825867,
0.12871898710727692,
0.4662584066390991,
0.006597456522285938,
-0.2592432200908661,
0.1546841263771057,
-0.22275951504707336,
-0.24583396315574646,
0.048062633723020554,
0.2819860875606537,
0.030764203518629074,
-0.3391430377960205,
0.24294030666351318,
-0.10491734743118286,
-0.06669501960277557,
-0.2819323241710663,
0.23787522315979004,
0.41261357069015503,
0.032247625291347504,
0.4991925060749054,
-0.24198025465011597,
-0.15058398246765137,
-0.19658973813056946,
-0.016497761011123657,
-0.1387518346309662,
-0.04298477992415428,
-0.04141668230295181,
0.23413169384002686,
0.2193118780851364,
-0.33835509419441223,
0.039954185485839844,
-0.14708752930164337,
0.1014341413974762,
0.18856161832809448,
0.09654418379068375,
-0.35366854071617126,
0.1520906239748001,
0.14531122148036957,
-0.5559042692184448,
-0.15933215618133545,
0.14420698583126068,
-0.019092991948127747,
-0.41582921147346497,
0.003170907497406006,
-0.2769912779331207,
-0.4746760427951813,
0.03154880180954933,
0.1545967310667038,
-0.013418363407254219,
0.30547404289245605,
-0.06840472668409348,
0.21225114166736603,
-0.0974464938044548,
-0.026822170242667198,
-0.010811537504196167,
-0.16361850500106812,
0.09029674530029297,
-0.22970803081989288,
0.5471410155296326,
0.34733402729034424,
-0.14763054251670837,
0.1285916119813919,
-0.188090980052948,
-0.059159595519304276,
0.3892346918582916,
0.4917322099208832,
-0.08064539730548859,
0.18907134234905243,
-0.39417093992233276,
-0.01478315144777298,
0.49973446130752563,
-0.5421296954154968,
-0.5161747336387634,
0.20197941362857819,
-0.17065036296844482,
0.01707586459815502,
0.49617132544517517,
0.19359254837036133,
0.0729871317744255,
-0.22794903814792633,
-0.07677452266216278,
0.2949317693710327,
-0.1893904060125351,
0.14389938116073608,
-0.5296568274497986,
-0.13858364522457123,
-0.22186274826526642,
0.432872474193573,
0.11380130052566528,
0.11898505687713623,
0.04769735038280487,
-0.32015401124954224,
0.14570832252502441,
-0.057243335992097855,
0.02041296474635601,
-0.11255766451358795,
0.5352499485015869,
0.06377549469470978,
0.07529957592487335,
0.2190033495426178,
-0.19059884548187256,
0.4127088189125061,
-0.32990479469299316,
-0.28076568245887756,
-0.15034879744052887,
-0.37825310230255127,
0.09279337525367737,
-0.07815202325582504,
0.020047511905431747,
-0.01743004098534584,
0.09494951367378235,
0.36756250262260437,
0.4604126513004303,
-0.01865473762154579,
-0.1817885935306549,
0.36697816848754883,
-0.19624699652194977,
-0.08403418958187103,
-0.041451167315244675,
0.3516881465911865,
-0.0758809894323349,
-0.04647991806268692,
-0.26151883602142334,
-0.06576422601938248,
-0.10754340142011642,
-0.20311839878559113,
-0.08589204400777817,
0.2497413158416748,
0.07537277787923813,
0.09778891503810883,
0.34320971369743347,
0.6514464020729065,
0.10090594738721848,
0.08075302839279175,
0.27742037177085876,
-0.005816413089632988,
0.1296079158782959,
0.059677042067050934,
-0.013319417834281921,
0.2768813967704773,
0.16699840128421783,
0.40774962306022644,
0.17435377836227417,
-0.3018946945667267,
0.23128578066825867,
0.01835470274090767,
0.14359775185585022,
0.022775553166866302,
0.30790966749191284,
-0.06888361275196075,
0.3812106251716614,
0.2245861291885376,
-0.09607798606157303,
0.24660605192184448,
0.5072457194328308,
-0.10132259130477905,
-0.04521532356739044,
0.43783244490623474,
0.11504381895065308,
-0.26775845885276794,
-0.06919503957033157,
0.3598901331424713,
0.3966948986053467,
0.26118555665016174,
0.030391423031687737,
-0.0022201500833034515,
0.2557413876056671,
-0.1164572611451149,
0.10588584840297699,
0.007206231355667114,
-0.11291728168725967,
0.17390896379947662,
0.12119008600711823,
-0.019001401960849762,
0.07306061685085297,
-0.4011166989803314,
-0.13084329664707184,
0.0012892112135887146,
0.13010002672672272,
0.04419697821140289,
-0.24609783291816711,
-0.2800593376159668,
0.015618005767464638,
0.3121577501296997,
0.023546742275357246,
-0.13074445724487305,
0.1211249977350235,
-0.08986786007881165,
-0.16893745958805084,
0.1824507713317871,
0.13041692972183228,
0.4419174790382385,
-0.09443340450525284,
-0.22964923083782196,
-0.3472716808319092,
-0.2986848056316376,
-0.06302909553050995,
-0.015388901345431805,
0.2639201581478119,
0.027165820822119713,
0.448697954416275,
-0.24822349846363068,
-0.07846763730049133,
-0.4374692142009735,
-0.12517964839935303,
-0.05041291564702988,
0.059195250272750854,
-0.07084561139345169,
0.027497515082359314,
-0.23637573421001434,
-0.07642705738544464,
-0.07181712239980698,
0.3344576060771942,
-0.19052864611148834,
-0.0373895987868309,
-0.1515689492225647,
-0.05059899762272835,
0.09850199520587921,
-0.18087957799434662,
-0.03198068588972092,
-0.5965860486030579,
-0.6682552695274353,
0.23245768249034882,
-0.02391493320465088,
0.13418035209178925,
0.04233420640230179,
-0.11841651052236557,
0.19185863435268402,
-0.2771882116794586,
0.26930874586105347,
-0.08891744166612625,
-0.4602935314178467,
0.2391834557056427,
0.07223621010780334,
-0.06563551723957062,
-0.3034224808216095,
-0.37546008825302124,
-0.10802623629570007,
0.2366960495710373,
-0.5193678140640259,
-0.3992979824542999,
-0.519859790802002,
0.20109304785728455,
0.007524468004703522,
0.10174287855625153,
0.2669481039047241,
0.15851759910583496,
-0.2585209906101227,
0.006716106086969376,
0.03755525127053261,
0.25694507360458374,
-0.04974403232336044,
-0.014191217720508575,
0.16198468208312988,
0.18111518025398254,
0.004069492220878601,
0.5370645523071289,
0.1726926863193512,
-0.06612591445446014,
0.28048884868621826,
0.2548006474971771,
0.24237844347953796,
-0.030502744019031525,
-0.279035747051239,
0.1438576728105545,
0.09483925998210907,
-0.13732308149337769,
0.28513550758361816,
0.13320083916187286,
-0.25872114300727844,
-0.14557689428329468,
-0.2865435481071472,
0.13142627477645874,
-0.33249005675315857,
0.25528258085250854,
-0.05519375205039978,
0.3580970764160156,
-0.17736953496932983,
-0.10034260153770447,
-0.0781126320362091,
0.07014281302690506,
0.2242717295885086,
0.11722715944051743,
0.0973363146185875,
-0.0658658966422081,
0.009385239332914352,
-0.19657067954540253,
-0.3013814687728882,
0.19918914139270782,
0.21498849987983704,
0.013884976506233215,
-0.0471310056746006,
-0.2446191906929016,
-0.04659338295459747,
-0.1035972312092781,
0.5037266612052917,
0.15112362802028656,
0.017418112605810165,
0.13078619539737701,
-0.33211618661880493,
0.035731278359889984,
-0.1803063303232193,
-0.06051810458302498,
0.10849690437316895,
-0.29382917284965515,
0.3880041837692261,
-0.22853216528892517,
-0.2087072879076004,
-0.2196546494960785,
0.40430769324302673,
-0.0412369966506958,
0.03510286286473274,
0.019183512777090073,
-0.14638584852218628,
-0.38643163442611694,
0.15058189630508423,
-0.08361785858869553,
-0.20956045389175415,
-0.06695770472288132,
-0.1650254726409912,
0.04802276939153671,
0.12561854720115662,
0.0218672975897789,
0.11194851994514465,
0.33983758091926575,
-0.13392409682273865,
0.2882077991962433,
0.05451861768960953,
0.2203778773546219,
0.25361523032188416,
0.44306182861328125,
-0.3208998739719391,
0.06621676683425903,
-0.09521593153476715,
0.12167419493198395,
0.16460856795310974,
0.3106624484062195,
-0.20048244297504425,
-0.022298261523246765,
-0.4129659831523895,
0.288845419883728,
-0.5247481465339661,
0.21797531843185425,
0.1560244858264923,
0.024296317249536514,
-0.32911384105682373,
-0.4439767301082611,
0.3970641791820526,
0.15102316439151764,
-0.1654783934354782,
0.24437393248081207,
0.2106347382068634,
-0.1012040376663208,
0.21917112171649933,
-0.09228477627038956,
0.9053962230682373,
0.029702983796596527,
0.040492989122867584,
-0.003453809767961502,
0.0785202831029892,
0.24021156132221222,
-0.47379070520401,
0.1277092546224594,
-0.011241704225540161,
-0.35394448041915894,
0.1376350224018097,
-0.2912355363368988,
-0.008863717317581177,
0.13533179461956024,
-0.43369486927986145,
0.24139975011348724,
0.05321785807609558,
-0.14701305329799652,
-0.03390255570411682,
0.22215157747268677,
0.05914836376905441,
-0.30733364820480347,
-0.3789474070072174,
0.2208765745162964,
0.05259174108505249,
0.0749300867319107,
0.12835988402366638,
0.05311375483870506,
-0.0480872243642807,
0.004835452884435654,
0.02009376883506775,
-0.1168239638209343,
-0.059140272438526154,
0.3226916193962097,
-0.22055524587631226,
-0.04652083292603493,
-0.19684208929538727,
-0.03005046769976616,
0.06065395474433899,
0.2929547429084778,
-0.10959811508655548,
0.091560959815979,
0.20117390155792236,
0.3264152407646179,
0.4229876399040222,
-0.2367929220199585,
0.16772134602069855,
0.029570676386356354,
-0.038071759045124054,
-0.21725791692733765,
-0.2769359350204468,
-0.33527374267578125,
-0.005788743495941162,
-0.09344291687011719,
0.009552046656608582,
0.34675332903862,
-0.030102096498012543,
0.016720473766326904,
-0.3972075879573822,
-0.1354236602783203,
0.1713583916425705,
0.42444664239883423,
-0.23497018218040466,
0.3522053360939026,
-0.17463579773902893,
-0.19702228903770447,
-0.09214946627616882,
0.10036963224411011,
-0.019223686307668686,
0.04235128313302994,
0.1479322910308838,
-0.16234144568443298,
-0.26240074634552,
-0.2684911787509918,
-0.04008644074201584,
-0.22720222175121307,
-0.3547394573688507,
0.37843334674835205,
-0.13690568506717682,
-0.23272576928138733,
0.03082416206598282,
-0.1258450597524643,
0.36042511463165283,
-0.2323802411556244,
-0.1605541855096817,
-0.2320173680782318,
-0.4885484278202057,
0.0859447717666626,
-0.1845143884420395,
0.31047576665878296,
-0.12125298380851746,
-0.284399151802063,
-0.3081947863101959,
0.22549450397491455,
-0.38407203555107117,
-0.010812492109835148,
-0.5922908782958984,
0.05686553567647934,
-0.13876773416996002,
0.13778766989707947,
0.28758400678634644,
0.08106310665607452,
0.11522078514099121,
0.11350717395544052,
-0.10334788262844086,
-0.2714708745479584,
0.20400984585285187,
0.14789502322673798,
-0.262040913105011,
0.054278768599033356,
0.4266433119773865,
-0.17271018028259277,
-0.18687279522418976,
-0.3291639983654022,
0.16296570003032684,
-0.1472540944814682,
-0.06106552481651306,
0.007468278519809246,
0.332720547914505,
-0.25170016288757324,
0.052562035620212555,
0.3335711658000946,
-0.08056114614009857,
0.08435996621847153,
-0.03771435096859932,
0.06691243499517441,
-0.24757255613803864,
-0.24477002024650574,
0.23994340002536774,
0.21903660893440247,
0.21840310096740723,
0.14659011363983154,
0.3563416600227356,
0.21039244532585144,
-0.09121230244636536,
0.14775528013706207,
0.39215776324272156,
0.20095068216323853,
0.04063984751701355,
0.21751238405704498,
0.499720960855484,
0.2531728744506836,
-0.2486436665058136,
-0.2028885930776596,
0.27869877219200134,
-0.21666105091571808,
0.3194487392902374,
0.11623524874448776,
0.35034438967704773,
0.22396963834762573,
0.07482793927192688,
0.07649870216846466,
0.2580828368663788,
0.016286179423332214,
0.1067151427268982,
0.41864651441574097,
0.37718743085861206,
-0.11573034524917603,
0.02052786946296692,
-0.176666259765625,
0.2388547658920288,
0.2807503342628479,
-0.4188355803489685,
0.5863232016563416,
-0.008304081857204437,
0.260170578956604,
0.13393592834472656,
-0.16586005687713623,
0.11153902113437653,
0.20003220438957214,
-0.09930898249149323,
0.18248003721237183,
-0.2720133662223816,
0.10151993483304977,
-0.05582834407687187,
-0.17764505743980408,
0.018247028812766075,
0.3314147889614105,
0.09802952408790588,
-0.0009132903069257736,
0.5750328302383423,
-0.09921800345182419,
-0.21875473856925964,
0.036840979009866714,
0.025982558727264404,
-0.02710644155740738,
0.23173139989376068,
0.31144052743911743,
0.38451361656188965,
-0.08126324415206909,
0.24490070343017578,
-0.11504384130239487,
0.5397236347198486,
-0.19134464859962463,
-0.03464718908071518,
0.2804173231124878,
-0.07770246267318726,
0.12739315629005432,
0.35971057415008545,
0.24674151837825775,
0.5249290466308594,
-0.23809972405433655,
0.007002444937825203,
-0.13408420979976654,
0.010453963652253151,
-0.37980183959007263,
0.26560959219932556,
-0.21754318475723267,
-0.33260732889175415,
0.11917230486869812,
0.06834820657968521,
-0.27132338285446167,
-0.08627010881900787,
-0.48367929458618164,
-0.052005585283041,
-0.06967802345752716,
0.6630347371101379,
0.39748382568359375,
-0.06842950731515884,
-0.22035551071166992,
-0.02083098143339157,
-0.6499399542808533,
-0.10772544145584106,
0.5243023037910461,
-0.12487509846687317,
0.1367385983467102,
0.20972858369350433,
0.11123557388782501,
-0.18949241936206818,
0.5449994802474976,
0.27542588114738464,
0.24237152934074402,
-0.23839759826660156,
-0.05446955934166908,
-0.37707874178886414,
-0.1272088885307312,
-0.09158973395824432,
-0.2702471911907196,
-0.04501407593488693,
0.15771029889583588,
0.031219646334648132,
0.08857622742652893,
0.19417916238307953,
-0.3511899411678314,
0.27675265073776245,
-0.1616990566253662,
-0.3733750581741333,
0.03863026946783066,
-0.2432369440793991,
-0.1567402333021164,
0.18970108032226562,
-0.49217867851257324,
0.1267179697751999,
0.05006220564246178,
0.09018676728010178,
0.11528950184583664,
-0.031980231404304504,
0.36697009205818176,
0.08089081943035126,
0.2738964259624481,
0.10084974765777588,
0.0785626769065857,
-0.008192438632249832,
-0.11844586580991745,
-0.2781224250793457,
-0.10859203338623047,
0.05405789986252785,
-0.23819464445114136,
-0.13691401481628418,
0.18512341380119324,
-0.6103889346122742,
-0.07311376929283142,
-0.4499641954898834,
0.006155479699373245,
-0.10297861695289612,
-0.13150212168693542,
-0.11293771862983704,
-0.012698073871433735,
-0.013376116752624512,
0.06824304908514023,
-0.027311647310853004,
0.14835073053836823,
0.0881093442440033,
-0.029801812022924423,
-0.5115393996238708,
-0.13623546063899994,
0.5963168144226074,
-0.08571869879961014,
-0.11996334791183472,
-0.09372176229953766,
0.24281899631023407,
-0.026562876999378204,
0.2015155404806137,
-0.2870587110519409,
0.03678388148546219,
0.29119426012039185,
0.34164029359817505,
-0.2266819328069687,
0.27925583720207214,
0.054756127297878265,
0.02737436071038246,
-0.1262281835079193,
-0.2176666259765625,
-0.17865431308746338,
-0.14816296100616455,
-0.26331827044487,
-0.1564311385154724
] |
https://github.com/huggingface/datasets/issues/5537 | Increase speed of data files resolution | something like this maybe (with Quentin's reimplementation of `HfFilesystem.find`)?
```
@lru_cache(max_size=None)
def _find(self, path, maxdepth=None, withdirs=False, detail=False, **kwargs):
```
In any case please let me know if I can help in any way! | Certain datasets like `bigcode/the-stack-dedup` have so many files that loading them takes forever right from the data files resolution step.
`datasets` uses file patterns to check the structure of the repository but it takes too much time to iterate over and over again on all the data files.
This comes from `resolve_patterns_in_dataset_repository` which calls `_resolve_single_pattern_in_dataset_repository`, which iterates on all the files at
```python
glob_iter = [PurePath(filepath) for filepath in fs.glob(PurePath(pattern).as_posix()) if fs.isfile(filepath)]
```
but calling `glob` on such a dataset is too expensive. Indeed it calls `ls()` in `hffilesystem.py` too many times.
Maybe `glob` can be more optimized in `hffilesystem.py`, or the data files resolution can directly be implemented in the filesystem by checking its `dir_cache` ? | 33 | Increase speed of data files resolution
Certain datasets like `bigcode/the-stack-dedup` have so many files that loading them takes forever right from the data files resolution step.
`datasets` uses file patterns to check the structure of the repository but it takes too much time to iterate over and over again on all the data files.
This comes from `resolve_patterns_in_dataset_repository` which calls `_resolve_single_pattern_in_dataset_repository`, which iterates on all the files at
```python
glob_iter = [PurePath(filepath) for filepath in fs.glob(PurePath(pattern).as_posix()) if fs.isfile(filepath)]
```
but calling `glob` on such a dataset is too expensive. Indeed it calls `ls()` in `hffilesystem.py` too many times.
Maybe `glob` can be more optimized in `hffilesystem.py`, or the data files resolution can directly be implemented in the filesystem by checking its `dir_cache` ?
something like this maybe (with Quentin's reimplementation of `HfFilesystem.find`)?
```
@lru_cache(max_size=None)
def _find(self, path, maxdepth=None, withdirs=False, detail=False, **kwargs):
```
In any case please let me know if I can help in any way! | [
-0.2579191029071808,
0.023926079273223877,
-0.14815211296081543,
0.22986972332000732,
0.12737588584423065,
0.021586455404758453,
-0.13294391334056854,
0.7983734011650085,
-0.04930676519870758,
0.16989825665950775,
0.055421896278858185,
0.0977417454123497,
0.004393680952489376,
0.07529810816049576,
-0.028095915913581848,
0.10095135867595673,
0.02924635261297226,
0.2748291492462158,
0.07298023253679276,
-0.08526501059532166,
-0.18410713970661163,
-0.15031282603740692,
0.025315597653388977,
-0.4608715772628784,
-0.30358096957206726,
0.24522656202316284,
-0.15643657743930817,
0.13156633079051971,
-0.08557359129190445,
-0.4108240306377411,
0.24907346069812775,
0.383876234292984,
0.04984965920448303,
0.1643550992012024,
-0.0001165892172139138,
-0.021438978612422943,
0.2374386191368103,
-0.03623870760202408,
-0.34439998865127563,
0.48277103900909424,
-0.37378689646720886,
-0.6596845984458923,
-0.2745243012905121,
-0.24590983986854553,
0.030182816088199615,
-0.1749885380268097,
0.006938090547919273,
-0.3654178977012634,
-0.002135351300239563,
0.022411681711673737,
0.11673681437969208,
-0.17514461278915405,
-0.048319652676582336,
0.07596031576395035,
0.22817108035087585,
0.5205689668655396,
0.08149803429841995,
0.5137279033660889,
0.4704650640487671,
-0.22381281852722168,
-0.1317853033542633,
0.38740283250808716,
-0.288484126329422,
0.24967637658119202,
0.2634766101837158,
0.12759998440742493,
0.3351207375526428,
-0.15843208134174347,
0.1545713245868683,
0.1604163944721222,
0.2909966707229614,
-0.30095434188842773,
-0.4542735815048218,
-0.47522300481796265,
-0.10209052264690399,
-0.4114701449871063,
0.2488638460636139,
0.0338917151093483,
-0.10023175179958344,
0.02141735889017582,
0.07193746417760849,
-0.2269483059644699,
0.1360643059015274,
-0.03868696838617325,
0.07541058957576752,
-0.06962592899799347,
0.10454420745372772,
-0.1318778395652771,
0.5897359251976013,
0.0752120167016983,
0.02818196639418602,
-0.18942368030548096,
0.05015232414007187,
0.20138591527938843,
-0.6621460914611816,
-0.07847487926483154,
0.19148340821266174,
0.23631656169891357,
0.4158986806869507,
0.04984632879495621,
-0.18422111868858337,
0.17173418402671814,
0.07467837631702423,
-0.13369163870811462,
-0.07872895896434784,
0.24171330034732819,
-0.191396564245224,
0.28708261251449585,
0.3637205958366394,
0.12200790643692017,
-0.1863829791545868,
0.2333473265171051,
-0.30631375312805176,
-0.4270758330821991,
-0.031956739723682404,
0.0812147706747055,
-0.01190528180450201,
-0.25340625643730164,
0.0006972569972276688,
-0.16904255747795105,
-0.15504348278045654,
-0.34937459230422974,
0.2814944088459015,
0.40899795293807983,
-0.04926922544836998,
0.48631182312965393,
-0.26344069838523865,
-0.2612383961677551,
-0.249673530459404,
0.07015856355428696,
-0.05343170091509819,
-0.09474381804466248,
-0.040372636169195175,
0.298706591129303,
0.17988915741443634,
-0.3122616112232208,
-0.14259961247444153,
-0.08973531424999237,
0.09277396649122238,
0.05348554998636246,
-0.04158699885010719,
-0.3628779947757721,
0.019957132637500763,
0.07745086401700974,
-0.5270686745643616,
-0.09191048890352249,
0.15739378333091736,
0.15119291841983795,
-0.30738335847854614,
0.049971070140600204,
-0.41422930359840393,
-0.32289639115333557,
-0.15492983162403107,
0.049393896013498306,
0.024332161992788315,
0.19533567130565643,
-0.22989332675933838,
0.27782881259918213,
-0.09099302440881729,
-0.09218282997608185,
-0.1739465594291687,
-0.21577948331832886,
0.05835150554776192,
-0.14502502977848053,
0.5542969703674316,
0.3714597821235657,
-0.3660872280597687,
0.043871402740478516,
-0.22524888813495636,
0.14831557869911194,
0.4523318409919739,
0.488524466753006,
-0.0696287676692009,
0.17792144417762756,
-0.4200824499130249,
-0.09023500978946686,
0.4862269461154938,
-0.42107364535331726,
-0.7015925645828247,
0.2133905589580536,
0.03454356640577316,
0.07217017561197281,
0.5095456838607788,
0.26357606053352356,
-0.04256889596581459,
-0.22768625617027283,
-0.09660957753658295,
0.25471383333206177,
-0.10475209355354309,
0.11387420445680618,
-0.3972255289554596,
-0.08205951005220413,
-0.21406753361225128,
0.4013020992279053,
-0.06675893068313599,
0.025655820965766907,
-0.05350171774625778,
-0.24786712229251862,
0.3172498047351837,
-0.10939259827136993,
-0.00020472262986004353,
0.14488758146762848,
0.41763588786125183,
0.23913535475730896,
0.0779905840754509,
0.2248390018939972,
-0.17886212468147278,
0.3529326915740967,
-0.23835697770118713,
-0.3459179103374481,
-0.19880251586437225,
-0.381631076335907,
0.16131684184074402,
-0.04562484472990036,
-0.03552854433655739,
0.08324494957923889,
-0.026562238112092018,
0.3062099814414978,
0.4027824401855469,
-0.10784955322742462,
-0.15672874450683594,
0.48348426818847656,
-0.2284231036901474,
0.00813498254865408,
0.01506885513663292,
0.427171915769577,
0.10131829977035522,
-0.07229115068912506,
-0.21351571381092072,
-0.08429303020238876,
-0.09756240993738174,
-0.29795095324516296,
-0.09025726467370987,
0.2008952796459198,
0.11713014543056488,
-0.06731435656547546,
0.3788803815841675,
0.7077958583831787,
0.07127467542886734,
0.059704121202230453,
0.24814185500144958,
-0.06996464729309082,
0.1386142373085022,
-0.09250812232494354,
0.005824755877256393,
0.15593478083610535,
0.2076149582862854,
0.3332926630973816,
0.11186876893043518,
-0.28003692626953125,
0.10821962356567383,
0.11848001182079315,
0.31935426592826843,
0.029902055859565735,
0.4855950176715851,
0.06671997904777527,
0.5126038789749146,
0.3525739014148712,
0.060544759035110474,
0.13496626913547516,
0.5985247492790222,
-0.20943495631217957,
0.06617774069309235,
0.44882771372795105,
-0.008325152099132538,
-0.3527778685092926,
-0.10995984077453613,
0.21203191578388214,
0.3426115810871124,
0.18272891640663147,
-0.004878673702478409,
-0.030510110780596733,
0.2592865526676178,
0.029994841665029526,
0.08479724079370499,
0.005618728697299957,
0.09768591076135635,
0.21341010928153992,
-0.039050884544849396,
-0.036336325109004974,
0.12629473209381104,
-0.3293403089046478,
-0.03749854490160942,
0.18835195899009705,
0.10528391599655151,
0.01699190028011799,
-0.34527885913848877,
-0.27793288230895996,
0.03143901750445366,
0.2964094281196594,
-0.01893342286348343,
-0.12552617490291595,
0.07695174962282181,
-0.15670347213745117,
0.16545629501342773,
0.1200646311044693,
0.23548921942710876,
0.3368549048900604,
0.08959245681762695,
-0.3664391338825226,
-0.25886988639831543,
-0.16378869116306305,
-0.15455520153045654,
-0.10208341479301453,
0.3116420805454254,
-0.12869927287101746,
0.2606792151927948,
-0.22281450033187866,
0.03131764754652977,
-0.4841233491897583,
-0.1319752335548401,
-0.06832149624824524,
-0.08331555128097534,
-0.03160663694143295,
-0.016731396317481995,
-0.05126550793647766,
-0.16089411079883575,
0.06922726333141327,
0.18644915521144867,
0.022888274863362312,
0.06339278817176819,
-0.03652351349592209,
-0.11631704121828079,
0.08483672887086868,
0.05192231014370918,
0.11439835280179977,
-0.5069118142127991,
-0.49329641461372375,
0.1760309934616089,
-0.066251739859581,
0.2353104203939438,
0.03921017050743103,
-0.06682414561510086,
0.20409253239631653,
-0.2708321809768677,
0.14658701419830322,
-0.06397925317287445,
-0.38739171624183655,
0.21388556063175201,
0.18610511720180511,
-0.0911717563867569,
-0.33178409934043884,
-0.2533033490180969,
-0.07521137595176697,
0.2681175470352173,
-0.5847664475440979,
-0.4066371023654938,
-0.3974113464355469,
0.16500069200992584,
-0.1665811687707901,
0.1860891878604889,
0.08119060844182968,
0.03129550442099571,
-0.14493334293365479,
0.061082273721694946,
0.07930594682693481,
0.1320728063583374,
0.035066526383161545,
0.15622460842132568,
0.10441316664218903,
0.19278571009635925,
0.10974527895450592,
0.3721740245819092,
0.45894676446914673,
-0.18659095466136932,
0.33397039771080017,
0.16956131160259247,
0.3397853374481201,
-0.10109268873929977,
-0.2509874999523163,
0.18196949362754822,
0.11211563646793365,
-0.006159253418445587,
0.3036491274833679,
0.11472214758396149,
-0.03272698074579239,
0.05199093371629715,
-0.20764471590518951,
0.12035802751779556,
-0.2960439920425415,
0.3147222101688385,
-0.1508626937866211,
0.35387298464775085,
-0.2918378412723541,
-0.1559104323387146,
-0.16525448858737946,
-0.07682301849126816,
0.24868741631507874,
0.2844589352607727,
0.17605486512184143,
-0.022639982402324677,
0.033113982528448105,
-0.20723362267017365,
-0.1710403859615326,
0.31149762868881226,
0.2229703664779663,
0.057553406804800034,
-0.09966686367988586,
-0.05488843098282814,
0.05526128038764,
-0.017575401812791824,
0.6375206708908081,
0.21788525581359863,
-0.07410179823637009,
0.08273030817508698,
-0.11152390390634537,
0.05418282002210617,
-0.1447628140449524,
-0.11238212883472443,
0.22639630734920502,
-0.2829866111278534,
0.36472466588020325,
-0.23731544613838196,
-0.2821735441684723,
-0.12945468723773956,
0.46083587408065796,
-0.06786687672138214,
-0.013398295268416405,
-0.0642891377210617,
-0.25644850730895996,
-0.18577373027801514,
-0.0013042241334915161,
-0.1075267344713211,
-0.01917012594640255,
0.030874324962496758,
-0.17605853080749512,
-0.04758569598197937,
-0.012432340532541275,
0.10646922141313553,
0.07743929326534271,
0.21003413200378418,
-0.06605575978755951,
0.2385764718055725,
-0.004773594439029694,
0.3039770722389221,
0.3811657726764679,
0.40795227885246277,
-0.18754643201828003,
-0.07709981501102448,
-0.11142776161432266,
0.22217871248722076,
0.2886294722557068,
0.2073420137166977,
-0.2083888202905655,
-0.017144978046417236,
-0.48735663294792175,
0.28463271260261536,
-0.6749664545059204,
0.18597950041294098,
0.2539623975753784,
0.24324539303779602,
-0.6647583842277527,
-0.47282424569129944,
0.5550513863563538,
0.2958148717880249,
-0.0778040885925293,
0.3926389515399933,
0.40272390842437744,
0.02402424067258835,
0.13833469152450562,
-0.10778235644102097,
0.8410283923149109,
-0.13175740838050842,
-0.05541539564728737,
-0.06506101042032242,
0.12592260539531708,
0.12904296815395355,
-0.49108946323394775,
0.29649269580841064,
-0.10253031551837921,
-0.5175251364707947,
0.12788301706314087,
-0.24503028392791748,
0.233377605676651,
0.24168390035629272,
-0.28417280316352844,
0.33041420578956604,
0.012971945106983185,
-0.3442215621471405,
-0.15911640226840973,
0.10291191935539246,
-0.04358088970184326,
-0.21145099401474,
-0.34738433361053467,
0.20068401098251343,
-0.08006685972213745,
0.218460351228714,
0.11528178304433823,
0.15304827690124512,
-0.0869612991809845,
0.1381196230649948,
-0.07881421595811844,
-0.20388537645339966,
-0.18694661557674408,
0.2914673089981079,
-0.2993440628051758,
-0.03750113397836685,
-0.1848834902048111,
0.017196577042341232,
-0.07352049648761749,
0.28777217864990234,
0.028416629880666733,
0.17501381039619446,
0.04319080710411072,
0.22907818853855133,
0.4036930203437805,
-0.17232385277748108,
0.030771374702453613,
0.12645751237869263,
-0.03796374797821045,
-0.2490878701210022,
-0.18483127653598785,
-0.3817717432975769,
-0.004005983471870422,
-0.2839789390563965,
0.05295060575008392,
0.2777482271194458,
-0.10054461658000946,
-0.011014014482498169,
-0.27159780263900757,
-0.1198582798242569,
0.10752291977405548,
0.4703734517097473,
-0.2263835072517395,
0.49307820200920105,
-0.27922484278678894,
-0.15800973773002625,
-0.04256344959139824,
0.08576910197734833,
0.03795890137553215,
0.046738311648368835,
0.2057635486125946,
-0.1944863200187683,
-0.2606933116912842,
-0.24169611930847168,
0.018680602312088013,
-0.16247276961803436,
-0.2607796788215637,
0.25263628363609314,
0.016931893303990364,
-0.08054180443286896,
0.09789180010557175,
-0.23128440976142883,
0.2926819920539856,
-0.24820956587791443,
-0.25833842158317566,
-0.26095807552337646,
-0.4259069859981537,
0.10651060193777084,
-0.20945553481578827,
0.37684744596481323,
-0.1231580600142479,
-0.36885398626327515,
-0.27652668952941895,
0.33895155787467957,
-0.265677273273468,
-0.10125003010034561,
-0.4640786647796631,
-0.03071644902229309,
-0.10420000553131104,
0.15126803517341614,
0.27895545959472656,
0.1768144965171814,
0.1380280703306198,
0.04113689810037613,
0.015854129567742348,
-0.18115198612213135,
0.21298539638519287,
0.17124056816101074,
-0.30287817120552063,
0.1030450239777565,
0.2901589870452881,
-0.24360084533691406,
-0.23757922649383545,
-0.4667801856994629,
0.22938090562820435,
-0.2917281985282898,
0.025962885469198227,
0.027419663965702057,
0.3395160734653473,
-0.48465201258659363,
0.14423760771751404,
0.38951775431632996,
0.011206194758415222,
0.07781325280666351,
-0.1396533101797104,
0.13815370202064514,
-0.13153518736362457,
-0.22158290445804596,
-0.04984365403652191,
0.2377288043498993,
0.3731788992881775,
-0.1294144093990326,
0.2499328851699829,
0.15960201621055603,
-0.024796640500426292,
0.1169641762971878,
0.2832900583744049,
0.30922994017601013,
0.10077442228794098,
0.145869642496109,
0.4744380712509155,
0.12696002423763275,
-0.29100731015205383,
-0.31578460335731506,
0.2513425946235657,
-0.18183135986328125,
0.28092896938323975,
0.09277646243572235,
0.30110448598861694,
0.3548548221588135,
-0.033284761011600494,
-0.1131790280342102,
0.12649305164813995,
0.09309061616659164,
0.05570573732256889,
0.6096832156181335,
0.45249924063682556,
-0.16725221276283264,
0.14880816638469696,
-0.19218164682388306,
0.23744162917137146,
0.3593027591705322,
-0.4594123959541321,
0.6064003109931946,
-0.038991332054138184,
0.3462488353252411,
0.09275934845209122,
-0.36201226711273193,
-0.05756237730383873,
0.1878415048122406,
-0.16590893268585205,
0.12110117077827454,
-0.22284656763076782,
0.005630135536193848,
-0.20938502252101898,
-0.12649807333946228,
-0.08730092644691467,
0.23469391465187073,
0.06927138566970825,
-0.06081359460949898,
0.6603784561157227,
-0.04618692770600319,
-0.243864044547081,
-0.07682681083679199,
-0.03877178952097893,
-0.23031114041805267,
0.1963074803352356,
0.3179459273815155,
0.3197557330131531,
-0.04762190580368042,
0.18091288208961487,
0.03525388613343239,
0.566291093826294,
-0.07995875179767609,
-0.03758479654788971,
0.08051992952823639,
0.09997594356536865,
0.1384807974100113,
0.3431801199913025,
0.22347082197666168,
0.38755327463150024,
-0.10818366706371307,
-0.1627635508775711,
-0.13558323681354523,
0.03814389556646347,
-0.27668941020965576,
0.18423885107040405,
-0.34269270300865173,
-0.33170464634895325,
0.0850943773984909,
0.004852131009101868,
-0.09912876784801483,
-0.1783074140548706,
-0.4460931420326233,
-0.04769605025649071,
-0.1539856493473053,
0.5290238261222839,
0.1445593386888504,
-0.026543207466602325,
-0.1866675615310669,
0.08751723915338516,
-0.5867074728012085,
-0.2458590418100357,
0.6808907389640808,
-0.1627015620470047,
0.006014635786414146,
0.2678157091140747,
0.07562617212533951,
-0.23930081725120544,
0.4034314453601837,
0.32676780223846436,
0.2034638226032257,
-0.1632484793663025,
-0.07601191848516464,
-0.36899641156196594,
-0.20451706647872925,
-0.04660438373684883,
-0.4256545305252075,
0.11414270102977753,
0.1135939359664917,
-0.014322087168693542,
-0.01739414781332016,
0.2522711157798767,
-0.3094085156917572,
0.4705047905445099,
0.0002608783543109894,
-0.3871798813343048,
-0.02533705160021782,
-0.12909220159053802,
-0.12588299810886383,
0.026522420346736908,
-0.5900282859802246,
0.23951728641986847,
0.1876063048839569,
0.018099531531333923,
-0.0051666926592588425,
0.13520823419094086,
0.37733811140060425,
-0.039876826107501984,
0.4498089849948883,
0.05807660520076752,
0.08933946490287781,
0.012964703142642975,
-0.11842471361160278,
-0.31497272849082947,
0.017383534461259842,
-0.004353866912424564,
-0.061526112258434296,
-0.14491814374923706,
0.2002212107181549,
-0.43214404582977295,
-0.026935476809740067,
-0.33652251958847046,
-0.015103348530828953,
-0.16586032509803772,
-0.20123162865638733,
-0.14561304450035095,
-0.11906914412975311,
0.006496347486972809,
0.18448305130004883,
0.07485801726579666,
0.18073198199272156,
0.14554862678050995,
-0.005625462159514427,
-0.3921453356742859,
-0.027710063382983208,
0.4597397744655609,
-0.11580714583396912,
-0.03188583627343178,
0.029999498277902603,
0.34818148612976074,
-0.009626448154449463,
0.15277646481990814,
-0.2806850075721741,
0.03843025118112564,
0.33158639073371887,
0.3365396559238434,
-0.066875159740448,
0.40713924169540405,
-0.07382075488567352,
0.0771460235118866,
-0.08815468102693558,
-0.14583200216293335,
-0.22498801350593567,
-0.1483784168958664,
-0.15156452357769012,
-0.07211627811193466
] |
https://github.com/huggingface/datasets/issues/5536 | Failure to hash function when using .map() | Hi ! `enc` is not hashable:
```python
import tiktoken
from datasets.fingerprint import Hasher
enc = tiktoken.get_encoding("gpt2")
Hasher.hash(enc)
# raises TypeError: cannot pickle 'builtins.CoreBPE' object
```
It happens because it's not picklable, and because of that it's not possible to cache the result of `map`, hence the warning message.
You can find more details about caching here: https://huggingface.co/docs/datasets/about_cache
You can also provide your own unique hash in `map` if you want, with the `new_fingerprint` argument.
Or disable caching using
```python
import datasets
datasets.disable_caching()
``` | ### Describe the bug
_Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed._
This issue with `.map()` happens for me consistently, as also described in closed issue #4506
Dataset indices can be individually serialized using dill and pickle without any errors. I'm using tiktoken to encode in the function passed to map(). Similarly, indices can be individually encoded without error.
### Steps to reproduce the bug
```py
from datasets import load_dataset
import tiktoken
dataset = load_dataset("stas/openwebtext-10k")
enc = tiktoken.get_encoding("gpt2")
tokenized = dataset.map(
process,
remove_columns=['text'],
desc="tokenizing the OWT splits",
)
def process(example):
ids = enc.encode(example['text'])
ids.append(enc.eot_token)
out = {'ids': ids, 'len': len(ids)}
return out
```
### Expected behavior
Should encode simple text objects.
### Environment info
Python versions tried: both 3.8 and 3.10.10
`PYTHONUTF8=1` as env variable
Datasets tried:
- stas/openwebtext-10k
- rotten_tomatoes
- local text file
OS: Ubuntu Linux 20.04
Package versions:
- torch 1.13.1
- dill 0.3.4 (if using 0.3.6 - same issue)
- datasets 2.9.0
- tiktoken 0.2.0
| 83 | Failure to hash function when using .map()
### Describe the bug
_Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed._
This issue with `.map()` happens for me consistently, as also described in closed issue #4506
Dataset indices can be individually serialized using dill and pickle without any errors. I'm using tiktoken to encode in the function passed to map(). Similarly, indices can be individually encoded without error.
### Steps to reproduce the bug
```py
from datasets import load_dataset
import tiktoken
dataset = load_dataset("stas/openwebtext-10k")
enc = tiktoken.get_encoding("gpt2")
tokenized = dataset.map(
process,
remove_columns=['text'],
desc="tokenizing the OWT splits",
)
def process(example):
ids = enc.encode(example['text'])
ids.append(enc.eot_token)
out = {'ids': ids, 'len': len(ids)}
return out
```
### Expected behavior
Should encode simple text objects.
### Environment info
Python versions tried: both 3.8 and 3.10.10
`PYTHONUTF8=1` as env variable
Datasets tried:
- stas/openwebtext-10k
- rotten_tomatoes
- local text file
OS: Ubuntu Linux 20.04
Package versions:
- torch 1.13.1
- dill 0.3.4 (if using 0.3.6 - same issue)
- datasets 2.9.0
- tiktoken 0.2.0
Hi ! `enc` is not hashable:
```python
import tiktoken
from datasets.fingerprint import Hasher
enc = tiktoken.get_encoding("gpt2")
Hasher.hash(enc)
# raises TypeError: cannot pickle 'builtins.CoreBPE' object
```
It happens because it's not picklable, and because of that it's not possible to cache the result of `map`, hence the warning message.
You can find more details about caching here: https://huggingface.co/docs/datasets/about_cache
You can also provide your own unique hash in `map` if you want, with the `new_fingerprint` argument.
Or disable caching using
```python
import datasets
datasets.disable_caching()
``` | [
-0.27017712593078613,
0.04610013961791992,
0.022127307951450348,
0.06650808453559875,
0.3817780017852783,
0.09339509159326553,
0.5055848360061646,
0.40053316950798035,
0.2478596270084381,
0.05585066229104996,
0.11794228106737137,
0.6140043139457703,
-0.2589096128940582,
-0.0799008458852768,
-0.15462476015090942,
0.09002558887004852,
0.019506976008415222,
-0.054450541734695435,
-0.2802594304084778,
-0.15737667679786682,
-0.4212518036365509,
0.10377391427755356,
-0.169256791472435,
0.3373323082923889,
-0.34259840846061707,
-0.14245733618736267,
0.08190105110406876,
-0.07583614438772202,
0.0017703436315059662,
-0.2591453790664673,
-0.08379171788692474,
-0.3629775643348694,
-0.11958936601877213,
0.6003471612930298,
-0.00010949879651889205,
0.06661275029182434,
0.2567562758922577,
-0.1867634654045105,
-0.08534958958625793,
-0.45276153087615967,
-0.19681483507156372,
-0.13846485316753387,
-0.03513125330209732,
-0.2859524190425873,
0.17695176601409912,
-0.29907554388046265,
0.21169693768024445,
-0.607973039150238,
0.31893759965896606,
0.10423682630062103,
0.2224304974079132,
0.019976843148469925,
0.15476401150226593,
0.194308802485466,
0.409607470035553,
0.007306933403015137,
-0.29064854979515076,
0.03346117585897446,
0.0810907855629921,
0.04804075509309769,
-0.32753679156303406,
0.331190824508667,
-0.022145362570881844,
0.049281712621450424,
0.07516682893037796,
0.05118091031908989,
0.2519698739051819,
-0.45707595348358154,
0.20123136043548584,
-0.017007537186145782,
0.1993238627910614,
-0.39761850237846375,
-0.4418853223323822,
0.0644763931632042,
-0.2831331491470337,
-0.022075016051530838,
0.29259470105171204,
0.16667293012142181,
0.09205229580402374,
0.11928676068782806,
-0.3799833655357361,
0.1486511528491974,
0.1455523520708084,
0.22095482051372528,
0.271198034286499,
0.20783743262290955,
0.10943972319364548,
0.32067713141441345,
0.07781609892845154,
-0.20389585196971893,
-0.09509442001581192,
-0.011207986623048782,
0.04727426916360855,
0.25223860144615173,
-0.19084595143795013,
-0.023658812046051025,
0.1699078381061554,
-0.44285687804222107,
0.1640995442867279,
0.07423423230648041,
0.08208713680505753,
0.11606482416391373,
-0.0007785093039274216,
0.18425649404525757,
0.2398119419813156,
0.24058188498020172,
0.19694310426712036,
0.3961413502693176,
0.18625332415103912,
-0.4489583373069763,
-0.17544075846672058,
0.03382052853703499,
0.1387101113796234,
-0.20691488683223724,
0.20332220196723938,
0.1787293255329132,
0.3276459574699402,
0.014786358922719955,
-0.10614640265703201,
0.13194027543067932,
-0.4965231120586395,
-0.1428944319486618,
-0.22247007489204407,
0.18995478749275208,
0.325914591550827,
-0.07838698476552963,
0.23459134995937347,
0.0017695613205432892,
-0.009747453965246677,
0.1866229772567749,
-0.2645469605922699,
-0.1342257708311081,
-0.2880089282989502,
0.16217125952243805,
0.030010681599378586,
-0.12391437590122223,
0.20110653340816498,
0.03640483319759369,
0.017999377101659775,
-0.05637822672724724,
-0.0036045126616954803,
-0.12295588850975037,
0.5343945026397705,
0.20099079608917236,
-0.15730705857276917,
0.33176496624946594,
0.15097126364707947,
0.15622301399707794,
-0.07358535379171371,
0.2626725733280182,
-0.3990817964076996,
-0.2593173086643219,
-0.08409962058067322,
0.09441327303647995,
-0.0038375724107027054,
0.2472161501646042,
0.11166591942310333,
0.049257323145866394,
0.5060136914253235,
-0.23383066058158875,
0.08513203263282776,
-0.13576656579971313,
-0.3030110001564026,
-0.26339080929756165,
0.01007823832333088,
0.35641252994537354,
0.14123111963272095,
-0.06973068416118622,
0.042224228382110596,
0.17937183380126953,
0.1168220043182373,
0.37326928973197937,
-0.25201159715652466,
0.004370018839836121,
-0.17810028791427612,
0.4853653907775879,
0.2018747180700302,
0.002636399120092392,
-0.4668445289134979,
0.4019993841648102,
-0.007470957934856415,
-0.017708536237478256,
-0.2911171317100525,
-0.09939813613891602,
0.313766747713089,
-0.3245723843574524,
-0.061403945088386536,
-0.011750489473342896,
0.035561881959438324,
0.22697710990905762,
-0.4115479588508606,
-0.1774262636899948,
0.3127438426017761,
-0.3083609640598297,
0.10733605921268463,
-0.08517219871282578,
0.05992088466882706,
-0.15589037537574768,
0.12992599606513977,
-0.031362760812044144,
0.36540570855140686,
0.021906781941652298,
0.11172664165496826,
-0.27806925773620605,
0.1832156628370285,
-0.16306370496749878,
-0.23631539940834045,
0.13599053025245667,
-0.08650390803813934,
-0.022044099867343903,
-0.31438714265823364,
0.010325636714696884,
0.03784185275435448,
0.04834507405757904,
-0.07722173631191254,
-0.0888519138097763,
0.06576669961214066,
-0.03317313641309738,
-0.18492873013019562,
0.11424140632152557,
-0.26198768615722656,
-0.08868248760700226,
-0.0331215001642704,
-0.19030511379241943,
0.1004897952079773,
-0.1500304937362671,
-0.1393987238407135,
-0.33211416006088257,
-0.12675172090530396,
-0.17178240418434143,
0.19598880410194397,
-0.0853828638792038,
-0.4732881486415863,
0.27526506781578064,
-0.14035247266292572,
-0.1719161421060562,
-0.152931809425354,
0.31225883960723877,
0.11356669664382935,
-0.4077480435371399,
0.07606907188892365,
0.2865273356437683,
0.1099495142698288,
-0.14156010746955872,
0.08001463115215302,
0.12368068099021912,
0.019359763711690903,
0.0524519607424736,
-0.3113900423049927,
0.19199733436107635,
0.06896283477544785,
-0.05553264543414116,
-0.15243598818778992,
-0.2513216733932495,
-0.277556449174881,
-0.15532852709293365,
0.3029264509677887,
0.11413099616765976,
0.25546297430992126,
0.058430686593055725,
0.7241373062133789,
0.17374487221240997,
0.260285347700119,
0.3096638321876526,
-0.05718030780553818,
-0.1774059236049652,
-0.07186457514762878,
-0.08769078552722931,
0.23415236175060272,
-0.010351967066526413,
-0.08973276615142822,
0.08556952327489853,
-0.06320498883724213,
0.08365448564291,
0.20218762755393982,
-0.04319954663515091,
0.2842332422733307,
0.3212197422981262,
0.05712330341339111,
0.11639965325593948,
-0.11675534397363663,
-0.1689012199640274,
0.1930057406425476,
0.3128065764904022,
-0.47353607416152954,
0.02151794545352459,
-0.21656744182109833,
0.35193344950675964,
0.15532661974430084,
-0.19279003143310547,
0.017546385526657104,
-0.2977644205093384,
0.1105106994509697,
0.007338430732488632,
-0.44638925790786743,
0.6660394668579102,
0.1164768785238266,
-0.10011695325374603,
0.2693493068218231,
-0.07233572006225586,
-0.28727954626083374,
-0.32645848393440247,
-0.10992156714200974,
-0.022877320647239685,
0.2518562078475952,
-0.3278663456439972,
0.01790917105972767,
0.06150176376104355,
-0.1382862627506256,
-0.4704374670982361,
-0.0620432086288929,
0.08245305716991425,
-0.3342475891113281,
0.07082649320363998,
-0.011117048561573029,
0.10771335661411285,
-0.43818122148513794,
-0.2661508321762085,
0.22741706669330597,
-0.5690295100212097,
-0.1909981071949005,
0.15536683797836304,
0.051209188997745514,
-0.14189748466014862,
-0.34621065855026245,
-0.4163113534450531,
0.05905734747648239,
-0.3023204803466797,
0.33575063943862915,
-0.30548372864723206,
0.28686219453811646,
0.13444818556308746,
0.14284075796604156,
-0.03192673623561859,
0.16978615522384644,
-0.163681760430336,
-0.2807820439338684,
-0.2010139673948288,
0.45295828580856323,
-0.13163867592811584,
-0.3824417293071747,
0.057368744164705276,
0.12172931432723999,
-0.27759507298469543,
0.4306304454803467,
-0.12663857638835907,
0.14191801846027374,
-0.08405672758817673,
0.0036916732788085938,
-0.05476134270429611,
0.10356247425079346,
0.39370742440223694,
0.26410096883773804,
-0.19430051743984222,
-0.3096165359020233,
-0.3150329291820526,
0.26430124044418335,
0.11673236638307571,
0.24361324310302734,
0.2412731647491455,
0.40521132946014404,
0.21859532594680786,
0.7500946521759033,
0.23232969641685486,
-0.44282039999961853,
0.24268878996372223,
-0.07212523370981216,
-0.051623936742544174,
-0.03954038769006729,
-0.3663520812988281,
-0.14437924325466156,
-0.23474568128585815,
0.07392079383134842,
0.10476274788379669,
-0.14925625920295715,
-0.3732391893863678,
-0.07433375716209412,
0.2114282101392746,
-0.42860177159309387,
-0.34688684344291687,
0.37459778785705566,
-0.506173849105835,
0.21366578340530396,
-0.0023121125996112823,
0.20520681142807007,
-0.15499860048294067,
-0.06032497063279152,
0.2538302540779114,
-0.13366416096687317,
0.5787051320075989,
-0.027560174465179443,
0.2967628240585327,
0.24152253568172455,
-0.17486292123794556,
0.35249942541122437,
0.14070798456668854,
0.3838644027709961,
-0.11280287802219391,
-0.2967286705970764,
-0.14868144690990448,
0.03730440139770508,
0.4052640199661255,
-0.4191052317619324,
0.055052727460861206,
0.12091879546642303,
-0.11699596047401428,
-0.3611399233341217,
-0.012578990310430527,
-0.19780051708221436,
0.5905081033706665,
0.19645439088344574,
0.2758188247680664,
-0.33822014927864075,
-0.040751826018095016,
0.03229609504342079,
-0.17246948182582855,
-0.02732432633638382,
0.06803327053785324,
-0.13975144922733307,
-0.13945432007312775,
-0.3806810677051544,
0.16150996088981628,
0.28099074959754944,
-0.0820741355419159,
-0.11136096715927124,
0.049101296812295914,
-0.06046970933675766,
-0.11832123249769211,
-0.032033830881118774,
-0.0689048171043396,
0.2584274113178253,
-0.0019132790621370077,
0.26887843012809753,
0.028784221038222313,
0.27827930450439453,
0.03732464089989662,
0.32158100605010986,
-0.019706688821315765,
-0.009547106921672821,
0.14446495473384857,
-0.13142582774162292,
-0.046873994171619415,
0.41808629035949707,
-0.07266568392515182,
-0.325339138507843,
-0.057006172835826874,
0.11884443461894989,
-0.03970395401120186,
-0.11886076629161835,
0.38804957270622253,
-0.1032174676656723,
-0.21050111949443817,
-0.2140328586101532,
0.2870090901851654,
0.08315016329288483,
-0.21787650883197784,
0.7016912698745728,
-0.28880012035369873,
-0.18076753616333008,
0.5699887871742249,
0.27784642577171326,
0.9876158833503723,
-0.1013306975364685,
-0.12081815302371979,
-0.19386982917785645,
0.14909972250461578,
-0.22756776213645935,
-0.010111220180988312,
-0.0009044613689184189,
-0.40850695967674255,
-0.30206185579299927,
0.058173276484012604,
-0.13926787674427032,
0.09208235144615173,
0.3584206700325012,
-0.33665579557418823,
-0.04145190119743347,
-0.05320248752832413,
0.27941349148750305,
0.06713812053203583,
0.06383002549409866,
-0.0952921137213707,
-0.17018626630306244,
0.20579291880130768,
0.17449331283569336,
0.006537839770317078,
0.15401065349578857,
0.09447802603244781,
-0.14699789881706238,
-0.14304910600185394,
-0.37121522426605225,
-0.4854292869567871,
0.10320859402418137,
-0.38006436824798584,
0.47998642921447754,
-0.29515600204467773,
-0.04782656207680702,
0.13585726916790009,
0.16672436892986298,
-0.043432094156742096,
0.013362705707550049,
-0.19581238925457,
0.012554770335555077,
0.29312488436698914,
0.22653594613075256,
-0.11408083885908127,
-0.10513871908187866,
0.31984883546829224,
0.11341961473226547,
-0.2381519377231598,
-0.062247417867183685,
-0.07145202904939651,
-0.3349798321723938,
-0.07065980136394501,
0.08799389004707336,
-0.1017543226480484,
-0.39526692032814026,
-0.01811601221561432,
0.010401271283626556,
-0.2632478177547455,
-0.11780694127082825,
0.14376047253608704,
0.05554156377911568,
-0.013519673608243465,
0.5348337888717651,
0.025109536945819855,
-0.2959938049316406,
0.19842679798603058,
0.5113275647163391,
-0.0836658924818039,
0.058857470750808716,
0.215865358710289,
-0.0826360434293747,
-0.26556819677352905,
-0.1714147925376892,
0.1046767607331276,
-0.07903149724006653,
-0.43924710154533386,
0.29828667640686035,
-0.277369886636734,
0.11761654913425446,
-0.07278727740049362,
0.16311170160770416,
-0.04810991883277893,
0.40707191824913025,
-0.10176973044872284,
-0.24481740593910217,
-0.1251802146434784,
0.3356572985649109,
-0.09806561470031738,
0.36947858333587646,
-0.29939091205596924,
0.1937370002269745,
0.0803770050406456,
0.24758875370025635,
-0.34257322549819946,
0.30985403060913086,
0.0031172651797533035,
0.19072005152702332,
0.09998899698257446,
0.09278729557991028,
0.20267237722873688,
-0.13414807617664337,
0.017296133562922478,
0.4015859365463257,
-0.29571333527565,
-0.15590780973434448,
-0.15175294876098633,
0.16681227087974548,
0.09865844249725342,
-0.013662081211805344,
-0.1870582103729248,
-0.17841288447380066,
-0.03664953261613846,
-0.2529684603214264,
0.038141846656799316,
0.41227030754089355,
-0.15357743203639984,
0.318420946598053,
0.3622005581855774,
-0.08020097762346268,
0.05382125824689865,
-0.1818608045578003,
-0.34516826272010803,
0.24552489817142487,
-0.10149439424276352,
0.10786285996437073,
0.22155077755451202,
0.03518664091825485,
-0.2511630356311798,
-0.06459812074899673,
0.023796409368515015,
0.21697023510932922,
0.3537959158420563,
-0.039193108677864075,
-0.02260386198759079,
0.16961908340454102,
0.20421624183654785,
0.12056759744882584,
-0.41507965326309204,
-0.2913345694541931,
0.059917524456977844,
0.16420312225818634,
-0.158302903175354,
0.11331864446401596,
0.23874695599079132,
0.043864306062459946,
-0.12608207762241364,
-0.03504147380590439,
0.1420983225107193,
-0.10044851899147034,
-0.1958402544260025,
0.08450919389724731,
0.3123435378074646,
-0.37322813272476196,
0.017585299909114838,
0.2773396074771881,
-0.19811953604221344,
0.16516682505607605,
0.1759168803691864,
-0.2695451080799103,
0.36819183826446533,
0.3088604211807251,
-0.19747507572174072,
0.27427953481674194,
0.2981407046318054,
0.23963074386119843,
-0.08942482620477676,
-0.2652662694454193,
0.2709934711456299,
0.141426220536232,
-0.17334094643592834,
0.17512261867523193,
0.19410672783851624,
0.2194068431854248,
-0.1328563541173935,
-0.1557857245206833,
-0.03585407882928848,
0.5260376334190369,
-0.22080457210540771,
0.10109807550907135,
0.005627226084470749,
-0.18179431557655334,
-0.1978890597820282,
-0.04657059162855148,
-0.1820964366197586,
0.23590824007987976,
0.8802787065505981,
0.30993741750717163,
-0.00384337455034256,
0.12593185901641846,
-0.20183119177818298,
-0.13523009419441223,
0.5930665731430054,
-0.2635284960269928,
0.10066147148609161,
0.15238970518112183,
-0.11799092590808868,
-0.1025037169456482,
0.41458430886268616,
0.4146806001663208,
0.3582838475704193,
-0.24766486883163452,
0.31827759742736816,
-0.060079071670770645,
-0.032713569700717926,
0.01498464122414589,
0.4458843171596527,
0.09193649142980576,
-0.28527015447616577,
0.16657133400440216,
0.07812537997961044,
-0.07944707572460175,
-0.10179540514945984,
0.07991546392440796,
0.5268135666847229,
0.36289623379707336,
0.30174317955970764,
-0.06334400177001953,
-0.13819998502731323,
0.16477394104003906,
-0.1101410761475563,
0.0952683612704277,
-0.27753961086273193,
0.4085552990436554,
-0.07344769686460495,
0.24217170476913452,
-0.19458737969398499,
0.11128467321395874,
0.08420194685459137,
0.40366342663764954,
0.28311777114868164,
-0.1979375183582306,
-0.2561092674732208,
0.018294043838977814,
-0.3350506126880646,
0.2909170091152191,
0.008973918855190277,
0.20688267052173615,
-0.0567791610956192,
0.05121587961912155,
0.11734024435281754,
0.2899283766746521,
0.17385053634643555,
-0.09235911816358566,
-0.15434394776821136,
0.5116828680038452,
-0.33089756965637207,
0.09776939451694489,
-0.1640990525484085,
0.24268479645252228,
0.2912353575229645,
-0.3077646791934967,
0.0037243179976940155,
-0.15103518962860107,
0.17086905241012573,
-0.2988317012786865,
-0.34640517830848694,
0.1417415738105774,
0.00973840057849884,
0.7891465425491333,
0.2984306216239929,
0.13336527347564697,
-0.2463749647140503,
-0.09368529915809631,
-0.07540781795978546,
-0.2728646397590637,
-0.0002331780269742012,
0.2648736238479614,
0.18454350531101227,
0.17956165969371796,
-0.07649131119251251,
-0.3196585476398468,
-0.257500022649765,
0.013390698470175266,
-0.30939120054244995,
0.22827287018299103,
-0.28220468759536743,
-0.016976092010736465,
-0.08109313994646072,
-0.18389040231704712,
-0.2887524366378784,
0.28614482283592224,
-0.08325088024139404,
0.2593197822570801,
-0.20202334225177765,
-0.5549628734588623,
0.7436178922653198,
-0.3592359721660614,
-0.2903766632080078,
0.060051701962947845,
0.11106065660715103,
-0.26478704810142517,
-0.020473571494221687,
-0.5123920440673828,
-0.22936752438545227,
0.256131649017334,
0.0891973078250885,
-0.5298709273338318,
-0.09561297297477722,
-0.02955591306090355,
-0.06494635343551636,
-0.10380429029464722,
0.43274593353271484,
0.02122306078672409,
-0.19101080298423767,
-0.011277098208665848,
-0.17565511167049408
] |
https://github.com/huggingface/datasets/issues/5536 | Failure to hash function when using .map() | @lhoestq Thank you for the explanation and advice. Will relay all of this to the repo where this (non)issue arose.
Great job with huggingface! | ### Describe the bug
_Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed._
This issue with `.map()` happens for me consistently, as also described in closed issue #4506
Dataset indices can be individually serialized using dill and pickle without any errors. I'm using tiktoken to encode in the function passed to map(). Similarly, indices can be individually encoded without error.
### Steps to reproduce the bug
```py
from datasets import load_dataset
import tiktoken
dataset = load_dataset("stas/openwebtext-10k")
enc = tiktoken.get_encoding("gpt2")
tokenized = dataset.map(
process,
remove_columns=['text'],
desc="tokenizing the OWT splits",
)
def process(example):
ids = enc.encode(example['text'])
ids.append(enc.eot_token)
out = {'ids': ids, 'len': len(ids)}
return out
```
### Expected behavior
Should encode simple text objects.
### Environment info
Python versions tried: both 3.8 and 3.10.10
`PYTHONUTF8=1` as env variable
Datasets tried:
- stas/openwebtext-10k
- rotten_tomatoes
- local text file
OS: Ubuntu Linux 20.04
Package versions:
- torch 1.13.1
- dill 0.3.4 (if using 0.3.6 - same issue)
- datasets 2.9.0
- tiktoken 0.2.0
| 24 | Failure to hash function when using .map()
### Describe the bug
_Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed._
This issue with `.map()` happens for me consistently, as also described in closed issue #4506
Dataset indices can be individually serialized using dill and pickle without any errors. I'm using tiktoken to encode in the function passed to map(). Similarly, indices can be individually encoded without error.
### Steps to reproduce the bug
```py
from datasets import load_dataset
import tiktoken
dataset = load_dataset("stas/openwebtext-10k")
enc = tiktoken.get_encoding("gpt2")
tokenized = dataset.map(
process,
remove_columns=['text'],
desc="tokenizing the OWT splits",
)
def process(example):
ids = enc.encode(example['text'])
ids.append(enc.eot_token)
out = {'ids': ids, 'len': len(ids)}
return out
```
### Expected behavior
Should encode simple text objects.
### Environment info
Python versions tried: both 3.8 and 3.10.10
`PYTHONUTF8=1` as env variable
Datasets tried:
- stas/openwebtext-10k
- rotten_tomatoes
- local text file
OS: Ubuntu Linux 20.04
Package versions:
- torch 1.13.1
- dill 0.3.4 (if using 0.3.6 - same issue)
- datasets 2.9.0
- tiktoken 0.2.0
@lhoestq Thank you for the explanation and advice. Will relay all of this to the repo where this (non)issue arose.
Great job with huggingface! | [
-0.2785501480102539,
0.05490994453430176,
0.022331468760967255,
0.06358535587787628,
0.3812029957771301,
0.09191403537988663,
0.5076667666435242,
0.40114763379096985,
0.2533603608608246,
0.05205825716257095,
0.10599610209465027,
0.6064263582229614,
-0.257708877325058,
-0.08370460569858551,
-0.15629230439662933,
0.09566883742809296,
0.018756739795207977,
-0.05341266095638275,
-0.28665271401405334,
-0.15420778095722198,
-0.42140284180641174,
0.104808010160923,
-0.17061543464660645,
0.3289914131164551,
-0.3499497175216675,
-0.14661255478858948,
0.08752056956291199,
-0.07556241005659103,
0.0025828955695033073,
-0.26252156496047974,
-0.08661359548568726,
-0.36473482847213745,
-0.12326498329639435,
0.611335277557373,
-0.00010930872667813674,
0.06868958473205566,
0.25913065671920776,
-0.18251162767410278,
-0.08184057474136353,
-0.45085668563842773,
-0.2004885971546173,
-0.1295182853937149,
-0.03138324245810509,
-0.2770377993583679,
0.1724657118320465,
-0.29601848125457764,
0.20807510614395142,
-0.6159782409667969,
0.32054999470710754,
0.11039673537015915,
0.2236061692237854,
0.030667442828416824,
0.1531788557767868,
0.1915990263223648,
0.4083925187587738,
0.00807616114616394,
-0.2963302433490753,
0.03381205350160599,
0.08233452588319778,
0.045620910823345184,
-0.3310677409172058,
0.3260224461555481,
-0.020276721566915512,
0.05320442095398903,
0.06921254843473434,
0.051344119012355804,
0.2427285611629486,
-0.45287060737609863,
0.20312312245368958,
-0.012312576174736023,
0.19906477630138397,
-0.39477211236953735,
-0.44560950994491577,
0.06601964682340622,
-0.28563424944877625,
-0.01827855035662651,
0.29146915674209595,
0.17144328355789185,
0.0954698771238327,
0.1212523877620697,
-0.38155296444892883,
0.15440157055854797,
0.14713309705257416,
0.2193087786436081,
0.27658772468566895,
0.2059793323278427,
0.10258845239877701,
0.31845390796661377,
0.08183114975690842,
-0.20611107349395752,
-0.09069604426622391,
-0.012974102050065994,
0.05010650306940079,
0.25439271330833435,
-0.19538696110248566,
-0.0250416100025177,
0.16760198771953583,
-0.4377981126308441,
0.16302800178527832,
0.07313841581344604,
0.09043344855308533,
0.10978767275810242,
-0.005644966848194599,
0.18018919229507446,
0.24167563021183014,
0.2448081523180008,
0.19991245865821838,
0.3972417116165161,
0.19280315935611725,
-0.43926313519477844,
-0.1761418581008911,
0.03481161594390869,
0.1430107206106186,
-0.21096915006637573,
0.20433539152145386,
0.17646247148513794,
0.3286724090576172,
0.016233298927545547,
-0.10489168763160706,
0.12774130702018738,
-0.4839218854904175,
-0.14428924024105072,
-0.22400064766407013,
0.18675503134727478,
0.32816001772880554,
-0.07223514467477798,
0.23206491768360138,
-0.0005960650742053986,
-0.007764735259115696,
0.18240080773830414,
-0.26880642771720886,
-0.1329648494720459,
-0.2910916209220886,
0.16669480502605438,
0.036607902497053146,
-0.12366646528244019,
0.20139196515083313,
0.03230218216776848,
0.01326613500714302,
-0.05529758334159851,
-0.010007491335272789,
-0.12262663245201111,
0.5326560735702515,
0.21082289516925812,
-0.15145866572856903,
0.3264671564102173,
0.15033186972141266,
0.1577107310295105,
-0.07448984682559967,
0.26977333426475525,
-0.392173171043396,
-0.26248300075531006,
-0.07912585884332657,
0.09604451060295105,
-0.008295994251966476,
0.2483631819486618,
0.10242084413766861,
0.04797601327300072,
0.49920809268951416,
-0.22571581602096558,
0.08555053174495697,
-0.13345028460025787,
-0.29873281717300415,
-0.2628200352191925,
0.006487922742962837,
0.3623993992805481,
0.13300952315330505,
-0.0671987384557724,
0.033753979951143265,
0.17295190691947937,
0.11260325461626053,
0.3794192373752594,
-0.25362423062324524,
0.0040526241064071655,
-0.17221716046333313,
0.49005991220474243,
0.2073109894990921,
0.006532151252031326,
-0.4658152759075165,
0.40728434920310974,
-0.004201546311378479,
-0.02036457322537899,
-0.29204678535461426,
-0.09584391117095947,
0.31574204564094543,
-0.3231717050075531,
-0.07165989279747009,
-0.01644471287727356,
0.03627847507596016,
0.2278011441230774,
-0.4139467477798462,
-0.18005873262882233,
0.30799466371536255,
-0.3027438819408417,
0.11035562306642532,
-0.07781917601823807,
0.061670850962400436,
-0.15875130891799927,
0.13314668834209442,
-0.021852057427167892,
0.36740031838417053,
0.018479149788618088,
0.11945931613445282,
-0.2713632583618164,
0.18169376254081726,
-0.16679725050926208,
-0.23970428109169006,
0.13520261645317078,
-0.08059495687484741,
-0.02477969229221344,
-0.304315984249115,
0.00753575935959816,
0.03447388485074043,
0.0478985533118248,
-0.07432207465171814,
-0.08487418293952942,
0.06485556066036224,
-0.037217237055301666,
-0.18056535720825195,
0.10749185085296631,
-0.27092671394348145,
-0.08939218521118164,
-0.037747859954833984,
-0.18663389980793,
0.10023613274097443,
-0.15049238502979279,
-0.14061126112937927,
-0.334114134311676,
-0.12605181336402893,
-0.1817896068096161,
0.1944337785243988,
-0.08862993121147156,
-0.4675903916358948,
0.2814668118953705,
-0.13775385916233063,
-0.17681969702243805,
-0.14544254541397095,
0.3187246024608612,
0.1100996881723404,
-0.40113839507102966,
0.07447000592947006,
0.285062313079834,
0.10901178419589996,
-0.14120052754878998,
0.07920845597982407,
0.12376323342323303,
0.01236806996166706,
0.053842682391405106,
-0.3094821572303772,
0.1908375769853592,
0.07004434615373611,
-0.05515768378973007,
-0.14893639087677002,
-0.25011730194091797,
-0.27916789054870605,
-0.15429890155792236,
0.30356666445732117,
0.11718384176492691,
0.25794678926467896,
0.05967982858419418,
0.7198591232299805,
0.16704100370407104,
0.2578924894332886,
0.3109918534755707,
-0.05309963971376419,
-0.17880982160568237,
-0.0749586820602417,
-0.08653456717729568,
0.24268659949302673,
-0.00920033734291792,
-0.09097172319889069,
0.08312927931547165,
-0.06146954745054245,
0.07643068581819534,
0.1983674168586731,
-0.04379185289144516,
0.2856345474720001,
0.32133975625038147,
0.056791696697473526,
0.11567039042711258,
-0.11616169661283493,
-0.1661655306816101,
0.19248700141906738,
0.3082674443721771,
-0.47313398122787476,
0.014949606731534004,
-0.209407240152359,
0.3591761291027069,
0.1553606390953064,
-0.1846383661031723,
0.021981729194521904,
-0.2969575524330139,
0.10768061876296997,
0.010542403906583786,
-0.448944091796875,
0.6683923006057739,
0.10908918082714081,
-0.09013225138187408,
0.2669621706008911,
-0.06814537942409515,
-0.2854662835597992,
-0.32823795080184937,
-0.10563527792692184,
-0.018432777374982834,
0.2510432004928589,
-0.33605363965034485,
0.007885243743658066,
0.06193608045578003,
-0.14009565114974976,
-0.4694775640964508,
-0.05657047778367996,
0.08111564815044403,
-0.33535921573638916,
0.0741501897573471,
-0.01112489402294159,
0.10905985534191132,
-0.43110597133636475,
-0.2631438374519348,
0.22565728425979614,
-0.5770919919013977,
-0.19022038578987122,
0.14955417811870575,
0.05131480097770691,
-0.14743249118328094,
-0.3438604772090912,
-0.41714897751808167,
0.06475097686052322,
-0.30325812101364136,
0.3468496799468994,
-0.3072449862957001,
0.2849496603012085,
0.12733304500579834,
0.14371103048324585,
-0.03648923709988594,
0.16470418870449066,
-0.16549237072467804,
-0.28346526622772217,
-0.20454902946949005,
0.44968080520629883,
-0.13125744462013245,
-0.38458722829818726,
0.0653643012046814,
0.1259395182132721,
-0.27628564834594727,
0.4254375696182251,
-0.1297292709350586,
0.1443205028772354,
-0.09503322094678879,
0.0012896806001663208,
-0.04889146238565445,
0.10256882011890411,
0.39843079447746277,
0.2576393485069275,
-0.19858351349830627,
-0.31319713592529297,
-0.3137708306312561,
0.26820799708366394,
0.11434440314769745,
0.2377171814441681,
0.24229967594146729,
0.39873284101486206,
0.2145300805568695,
0.7474747896194458,
0.23082038760185242,
-0.44265544414520264,
0.2371666133403778,
-0.07322663068771362,
-0.04873031750321388,
-0.04000881314277649,
-0.36193883419036865,
-0.15237310528755188,
-0.23449233174324036,
0.0748554989695549,
0.10450786352157593,
-0.14557582139968872,
-0.36912521719932556,
-0.07553543150424957,
0.2129412144422531,
-0.431216835975647,
-0.3448258936405182,
0.37186139822006226,
-0.5015705227851868,
0.20977556705474854,
0.0030990205705165863,
0.19786563515663147,
-0.1526212990283966,
-0.06293895840644836,
0.24866604804992676,
-0.12981051206588745,
0.5820791721343994,
-0.027493519708514214,
0.30566588044166565,
0.2503508925437927,
-0.17656657099723816,
0.352186381816864,
0.1336296796798706,
0.3824109137058258,
-0.11058677732944489,
-0.2992497384548187,
-0.15245385468006134,
0.04407835006713867,
0.4082706570625305,
-0.4188903272151947,
0.061172306537628174,
0.12436391413211823,
-0.12110314518213272,
-0.3601425588130951,
-0.011500496417284012,
-0.2040652334690094,
0.5808282494544983,
0.19790218770503998,
0.27996909618377686,
-0.3374566435813904,
-0.04248415678739548,
0.03268672153353691,
-0.18017753958702087,
-0.023993728682398796,
0.0639733076095581,
-0.14349910616874695,
-0.13531704246997833,
-0.3727076053619385,
0.15752840042114258,
0.2870342433452606,
-0.08218994736671448,
-0.11681260913610458,
0.052551474422216415,
-0.062413498759269714,
-0.12574049830436707,
-0.030400916934013367,
-0.06569831818342209,
0.2574187219142914,
0.004020904656499624,
0.2722724974155426,
0.028818296268582344,
0.2769033908843994,
0.03295339643955231,
0.326341450214386,
-0.02236243709921837,
-0.009244576096534729,
0.1471034735441208,
-0.13180121779441833,
-0.049688540399074554,
0.4202757179737091,
-0.07680926471948624,
-0.32464125752449036,
-0.06240089237689972,
0.11727206408977509,
-0.03935568779706955,
-0.11260521411895752,
0.38535580039024353,
-0.1065194383263588,
-0.20057053864002228,
-0.21254655718803406,
0.2935996949672699,
0.08332966268062592,
-0.22017723321914673,
0.7052856683731079,
-0.27798646688461304,
-0.18198178708553314,
0.5636342763900757,
0.2768745720386505,
0.982384443283081,
-0.10653296113014221,
-0.11757771670818329,
-0.19935590028762817,
0.1512116640806198,
-0.23031587898731232,
-0.0043155476450920105,
0.0018934840336441994,
-0.4065989553928375,
-0.30264848470687866,
0.05876302719116211,
-0.13979391753673553,
0.09437236934900284,
0.3657965660095215,
-0.3321799337863922,
-0.039224252104759216,
-0.058758459985256195,
0.2916533648967743,
0.07118035107851028,
0.06169985979795456,
-0.09336452186107635,
-0.16823337972164154,
0.2013293206691742,
0.17768295109272003,
0.006095856428146362,
0.15032581984996796,
0.0967845693230629,
-0.1397233009338379,
-0.14230911433696747,
-0.36246323585510254,
-0.48545849323272705,
0.10302755981683731,
-0.3801979124546051,
0.4776389002799988,
-0.2892187237739563,
-0.0374283492565155,
0.1377921849489212,
0.16955141723155975,
-0.044283121824264526,
0.00826515257358551,
-0.19286809861660004,
0.01590491086244583,
0.2943646311759949,
0.22164393961429596,
-0.11496467888355255,
-0.10020136088132858,
0.3184681832790375,
0.11545444279909134,
-0.23850342631340027,
-0.06234797090291977,
-0.07341919839382172,
-0.33613109588623047,
-0.07156933099031448,
0.08852820098400116,
-0.10820047557353973,
-0.40968218445777893,
-0.020255420356988907,
0.01026248186826706,
-0.265620619058609,
-0.11516165733337402,
0.14546577632427216,
0.053420476615428925,
-0.011610211804509163,
0.533176064491272,
0.03064744547009468,
-0.2963208556175232,
0.19655808806419373,
0.5115468502044678,
-0.08461512625217438,
0.06005804240703583,
0.21066594123840332,
-0.08466117084026337,
-0.26636558771133423,
-0.1742045283317566,
0.10212799161672592,
-0.07545039057731628,
-0.44098567962646484,
0.30668866634368896,
-0.2816711962223053,
0.11283786594867706,
-0.06404045969247818,
0.17360460758209229,
-0.043239884078502655,
0.4124618172645569,
-0.10164317488670349,
-0.244034543633461,
-0.12221071124076843,
0.33640962839126587,
-0.0972839742898941,
0.3677024841308594,
-0.3029260039329529,
0.19770370423793793,
0.0771392434835434,
0.2449459731578827,
-0.34440645575523376,
0.3097343146800995,
0.00296664796769619,
0.18844608962535858,
0.09238874912261963,
0.09347822517156601,
0.20741961896419525,
-0.13383041322231293,
0.01756909303367138,
0.4062659740447998,
-0.29369574785232544,
-0.1585874855518341,
-0.15149100124835968,
0.16629305481910706,
0.09732523560523987,
-0.014093775302171707,
-0.18988719582557678,
-0.17643378674983978,
-0.04294963553547859,
-0.25067880749702454,
0.03969959169626236,
0.41150686144828796,
-0.15230262279510498,
0.3158888816833496,
0.3684927523136139,
-0.08950165659189224,
0.05122758448123932,
-0.18088193237781525,
-0.3493761420249939,
0.2446044683456421,
-0.10359548777341843,
0.10426370799541473,
0.2264590710401535,
0.03558996319770813,
-0.2420613318681717,
-0.0648302361369133,
0.025070786476135254,
0.22276511788368225,
0.35906627774238586,
-0.04076027870178223,
-0.023365166038274765,
0.16609789431095123,
0.2151455283164978,
0.12047573179006577,
-0.40856197476387024,
-0.29124021530151367,
0.05037785321474075,
0.16480684280395508,
-0.16461235284805298,
0.11105110496282578,
0.2325722575187683,
0.05220765247941017,
-0.12367826700210571,
-0.03365571051836014,
0.14115680754184723,
-0.0933200791478157,
-0.1935749500989914,
0.08810090273618698,
0.3201625645160675,
-0.3692978620529175,
0.017340686172246933,
0.2730414867401123,
-0.19779151678085327,
0.1669580638408661,
0.18393127620220184,
-0.2670099437236786,
0.3650107979774475,
0.3060570955276489,
-0.2023247480392456,
0.27997279167175293,
0.2875831127166748,
0.2392350435256958,
-0.09085861593484879,
-0.26771196722984314,
0.275954008102417,
0.1401892900466919,
-0.1797923445701599,
0.17425456643104553,
0.18419969081878662,
0.22027596831321716,
-0.13790762424468994,
-0.1575814038515091,
-0.03294707089662552,
0.5159295797348022,
-0.21869045495986938,
0.1004548966884613,
-0.0001496821641921997,
-0.180713951587677,
-0.1977536827325821,
-0.045255206525325775,
-0.1813727766275406,
0.24066132307052612,
0.8825353384017944,
0.30453890562057495,
-0.00019928812980651855,
0.12546545267105103,
-0.2041057050228119,
-0.13731053471565247,
0.5958097577095032,
-0.2629967927932739,
0.10409818589687347,
0.1507246047258377,
-0.11552225053310394,
-0.09637290239334106,
0.41741278767585754,
0.41000357270240784,
0.3538416922092438,
-0.23724740743637085,
0.3197750747203827,
-0.06569737195968628,
-0.03725054860115051,
0.018778447061777115,
0.4488142132759094,
0.09533503651618958,
-0.28755396604537964,
0.16386213898658752,
0.08098900318145752,
-0.07890154421329498,
-0.09561748802661896,
0.069807268679142,
0.532289981842041,
0.36099037528038025,
0.29926204681396484,
-0.06593551486730576,
-0.14107917249202728,
0.16036520898342133,
-0.10754463821649551,
0.10167039185762405,
-0.27587923407554626,
0.4064824879169464,
-0.08249948173761368,
0.24337732791900635,
-0.19947366416454315,
0.11198359727859497,
0.08509044349193573,
0.41184526681900024,
0.2828243374824524,
-0.2061518132686615,
-0.2569805979728699,
0.011989481747150421,
-0.33339786529541016,
0.28768742084503174,
0.007531560957431793,
0.20616106688976288,
-0.060978859663009644,
0.054847151041030884,
0.1128186360001564,
0.28898268938064575,
0.1746116429567337,
-0.09345134347677231,
-0.16174441576004028,
0.5017184019088745,
-0.32988306879997253,
0.09153600037097931,
-0.1638692170381546,
0.24036020040512085,
0.2943113148212433,
-0.30542051792144775,
0.003050442785024643,
-0.14848464727401733,
0.17068597674369812,
-0.29645031690597534,
-0.34756866097450256,
0.1465328335762024,
0.009844612330198288,
0.7779451608657837,
0.2964053452014923,
0.13033892214298248,
-0.2432204782962799,
-0.091193787753582,
-0.08281786739826202,
-0.2794707715511322,
-0.00456972885876894,
0.2544398009777069,
0.18501286208629608,
0.17763134837150574,
-0.07998722791671753,
-0.31182411313056946,
-0.2574261724948883,
0.011695225723087788,
-0.3092527985572815,
0.2301170825958252,
-0.2880723774433136,
-0.023854859173297882,
-0.08365844190120697,
-0.18409915268421173,
-0.28080934286117554,
0.28833046555519104,
-0.08774727582931519,
0.25855109095573425,
-0.20350003242492676,
-0.5573439002037048,
0.7422791719436646,
-0.36362650990486145,
-0.289338082075119,
0.05814441293478012,
0.10607609152793884,
-0.2607279121875763,
-0.02463885210454464,
-0.5117624402046204,
-0.2266882061958313,
0.25621920824050903,
0.09080398082733154,
-0.5279130339622498,
-0.09507831931114197,
-0.040361437946558,
-0.0657702088356018,
-0.10575608909130096,
0.4298229217529297,
0.02556423842906952,
-0.19017648696899414,
-0.016631778329610825,
-0.17074546217918396
] |
https://github.com/huggingface/datasets/issues/5536 | Failure to hash function when using .map() | Just a heads up that when I'm trying to use TikToken along with the a given Dataset `.map()` method, I am still met with the following error :
```
File "/opt/conda/lib/python3.8/site-packages/dill/_dill.py", line 388, in save
StockPickler.save(self, obj, save_persistent_id)
File "/opt/conda/lib/python3.8/pickle.py", line 578, in save
rv = reduce(self.proto)
TypeError: cannot pickle 'builtins.CoreBPE' object
```
My current environment is running datasets v2.10.0. | ### Describe the bug
_Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed._
This issue with `.map()` happens for me consistently, as also described in closed issue #4506
Dataset indices can be individually serialized using dill and pickle without any errors. I'm using tiktoken to encode in the function passed to map(). Similarly, indices can be individually encoded without error.
### Steps to reproduce the bug
```py
from datasets import load_dataset
import tiktoken
dataset = load_dataset("stas/openwebtext-10k")
enc = tiktoken.get_encoding("gpt2")
tokenized = dataset.map(
process,
remove_columns=['text'],
desc="tokenizing the OWT splits",
)
def process(example):
ids = enc.encode(example['text'])
ids.append(enc.eot_token)
out = {'ids': ids, 'len': len(ids)}
return out
```
### Expected behavior
Should encode simple text objects.
### Environment info
Python versions tried: both 3.8 and 3.10.10
`PYTHONUTF8=1` as env variable
Datasets tried:
- stas/openwebtext-10k
- rotten_tomatoes
- local text file
OS: Ubuntu Linux 20.04
Package versions:
- torch 1.13.1
- dill 0.3.4 (if using 0.3.6 - same issue)
- datasets 2.9.0
- tiktoken 0.2.0
| 60 | Failure to hash function when using .map()
### Describe the bug
_Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed._
This issue with `.map()` happens for me consistently, as also described in closed issue #4506
Dataset indices can be individually serialized using dill and pickle without any errors. I'm using tiktoken to encode in the function passed to map(). Similarly, indices can be individually encoded without error.
### Steps to reproduce the bug
```py
from datasets import load_dataset
import tiktoken
dataset = load_dataset("stas/openwebtext-10k")
enc = tiktoken.get_encoding("gpt2")
tokenized = dataset.map(
process,
remove_columns=['text'],
desc="tokenizing the OWT splits",
)
def process(example):
ids = enc.encode(example['text'])
ids.append(enc.eot_token)
out = {'ids': ids, 'len': len(ids)}
return out
```
### Expected behavior
Should encode simple text objects.
### Environment info
Python versions tried: both 3.8 and 3.10.10
`PYTHONUTF8=1` as env variable
Datasets tried:
- stas/openwebtext-10k
- rotten_tomatoes
- local text file
OS: Ubuntu Linux 20.04
Package versions:
- torch 1.13.1
- dill 0.3.4 (if using 0.3.6 - same issue)
- datasets 2.9.0
- tiktoken 0.2.0
Just a heads up that when I'm trying to use TikToken along with the a given Dataset `.map()` method, I am still met with the following error :
```
File "/opt/conda/lib/python3.8/site-packages/dill/_dill.py", line 388, in save
StockPickler.save(self, obj, save_persistent_id)
File "/opt/conda/lib/python3.8/pickle.py", line 578, in save
rv = reduce(self.proto)
TypeError: cannot pickle 'builtins.CoreBPE' object
```
My current environment is running datasets v2.10.0. | [
-0.2785240411758423,
0.05236083269119263,
0.023018188774585724,
0.05987487733364105,
0.3843640089035034,
0.08648700267076492,
0.5084617733955383,
0.39903345704078674,
0.2548632323741913,
0.050213515758514404,
0.11116009950637817,
0.604576826095581,
-0.25605282187461853,
-0.07523947209119797,
-0.15621361136436462,
0.09258318692445755,
0.019898436963558197,
-0.05718472599983215,
-0.280274897813797,
-0.15526452660560608,
-0.4225538969039917,
0.10713834315538406,
-0.16679823398590088,
0.33853793144226074,
-0.3544550836086273,
-0.14229455590248108,
0.0854727029800415,
-0.07326851040124893,
0.0007109232246875763,
-0.26154404878616333,
-0.08571471273899078,
-0.36332598328590393,
-0.12274468690156937,
0.6118921041488647,
-0.00010911493154708296,
0.06365904211997986,
0.260722279548645,
-0.17936201393604279,
-0.08534294366836548,
-0.44921016693115234,
-0.20478951930999756,
-0.13139167428016663,
-0.02973209321498871,
-0.27378520369529724,
0.17065298557281494,
-0.29903745651245117,
0.20709013938903809,
-0.6128769516944885,
0.3205631375312805,
0.1078089252114296,
0.22620882093906403,
0.02905476838350296,
0.15279154479503632,
0.18514899909496307,
0.41116318106651306,
0.006199397146701813,
-0.2975136637687683,
0.03299635648727417,
0.08150475472211838,
0.03777000308036804,
-0.32642585039138794,
0.32880696654319763,
-0.021265780553221703,
0.053535107523202896,
0.07499925047159195,
0.05409037694334984,
0.24690446257591248,
-0.4512733817100525,
0.20128488540649414,
-0.012302212417125702,
0.20319226384162903,
-0.3944595158100128,
-0.44723016023635864,
0.05892527848482132,
-0.28929945826530457,
-0.020314034074544907,
0.2917909026145935,
0.1705915629863739,
0.08763046562671661,
0.12213149666786194,
-0.377355694770813,
0.15646512806415558,
0.14740833640098572,
0.219378262758255,
0.2673453092575073,
0.21173298358917236,
0.10354416817426682,
0.31551143527030945,
0.08340135961771011,
-0.2044486403465271,
-0.09246208518743515,
-0.010332170873880386,
0.04850049316883087,
0.2532695531845093,
-0.19166697561740875,
-0.025522131472826004,
0.17235764861106873,
-0.44193896651268005,
0.1587548553943634,
0.08044663071632385,
0.09330258518457413,
0.10952744632959366,
-0.006563710980117321,
0.18126127123832703,
0.24635954201221466,
0.24715681374073029,
0.19947464764118195,
0.3890429735183716,
0.19594644010066986,
-0.44210284948349,
-0.172054260969162,
0.03279009461402893,
0.14470277726650238,
-0.21079926192760468,
0.20287904143333435,
0.1770104467868805,
0.33227336406707764,
0.015386808663606644,
-0.1068723052740097,
0.1280142366886139,
-0.4792347848415375,
-0.13888150453567505,
-0.2257944792509079,
0.18579256534576416,
0.32779166102409363,
-0.07286065071821213,
0.2346109002828598,
0.0012235138565301895,
-0.012623079121112823,
0.18500451743602753,
-0.2701631486415863,
-0.13807369768619537,
-0.2946843206882477,
0.16798453032970428,
0.03728186711668968,
-0.11537148058414459,
0.20078802108764648,
0.03341209143400192,
0.014028046280145645,
-0.051689308136701584,
-0.01223368663340807,
-0.11599524319171906,
0.532213032245636,
0.21484529972076416,
-0.15634022653102875,
0.32992276549339294,
0.15162189304828644,
0.15818554162979126,
-0.07659918069839478,
0.2657410800457001,
-0.3885633051395416,
-0.2648371160030365,
-0.08150120079517365,
0.09809330105781555,
-0.008857049979269505,
0.24240033328533173,
0.10736504197120667,
0.05037367716431618,
0.49965429306030273,
-0.2245987355709076,
0.08485818654298782,
-0.13123640418052673,
-0.29989948868751526,
-0.26066938042640686,
0.0030838027596473694,
0.35980212688446045,
0.13194386661052704,
-0.06759697943925858,
0.03986269608139992,
0.17446132004261017,
0.11116185039281845,
0.37588968873023987,
-0.253985732793808,
-0.00016596168279647827,
-0.17364493012428284,
0.4806276559829712,
0.20106589794158936,
0.005945634096860886,
-0.46194443106651306,
0.4068754315376282,
-0.004031471908092499,
-0.019884943962097168,
-0.2962673306465149,
-0.09993211925029755,
0.3113694190979004,
-0.32439303398132324,
-0.06812317669391632,
-0.012959130108356476,
0.0348769947886467,
0.23109424114227295,
-0.4160543978214264,
-0.17788028717041016,
0.3096717596054077,
-0.30155909061431885,
0.11129115521907806,
-0.08217694610357285,
0.05526929721236229,
-0.1595195233821869,
0.1350913643836975,
-0.022397581487894058,
0.3668975532054901,
0.017188480123877525,
0.11923590302467346,
-0.2725751996040344,
0.1860138177871704,
-0.17088761925697327,
-0.23231461644172668,
0.13655933737754822,
-0.08034674823284149,
-0.02057410031557083,
-0.30388975143432617,
0.010033834725618362,
0.032715875655412674,
0.049213238060474396,
-0.07579432427883148,
-0.08516505360603333,
0.06745819747447968,
-0.04246797412633896,
-0.1827080398797989,
0.10561572015285492,
-0.27531370520591736,
-0.08730029314756393,
-0.034384530037641525,
-0.1824646294116974,
0.10466817021369934,
-0.150821253657341,
-0.1390470415353775,
-0.3365632891654968,
-0.12590232491493225,
-0.17841944098472595,
0.19508734345436096,
-0.08328716456890106,
-0.4658036231994629,
0.28138789534568787,
-0.1365952491760254,
-0.17603914439678192,
-0.1480458378791809,
0.32107532024383545,
0.1152455061674118,
-0.39921361207962036,
0.07843631505966187,
0.28771719336509705,
0.10482686012983322,
-0.14663907885551453,
0.07992251962423325,
0.1250099241733551,
0.009293623268604279,
0.05667323246598244,
-0.3075845241546631,
0.19278979301452637,
0.07106181979179382,
-0.0566352978348732,
-0.15420730412006378,
-0.24742208421230316,
-0.27898651361465454,
-0.16100415587425232,
0.2933874726295471,
0.1125931441783905,
0.2582950294017792,
0.06977210938930511,
0.7187790870666504,
0.16913114488124847,
0.25557002425193787,
0.3094877004623413,
-0.054745011031627655,
-0.1775842010974884,
-0.07394897937774658,
-0.08852040767669678,
0.2407592236995697,
-0.006439379416406155,
-0.09070326387882233,
0.08304329961538315,
-0.06695587933063507,
0.07527792453765869,
0.2004537582397461,
-0.04144074767827988,
0.2802474796772003,
0.31677812337875366,
0.058387648314237595,
0.11033972352743149,
-0.11808230727910995,
-0.16640804708003998,
0.18805217742919922,
0.30990901589393616,
-0.475904643535614,
0.018708335235714912,
-0.20764532685279846,
0.34987783432006836,
0.15252768993377686,
-0.19090130925178528,
0.014299232512712479,
-0.30003970861434937,
0.11293721199035645,
0.015468664467334747,
-0.45129576325416565,
0.6641615629196167,
0.11067880690097809,
-0.0850181132555008,
0.2642909288406372,
-0.06500528007745743,
-0.28483515977859497,
-0.3308145999908447,
-0.10598429292440414,
-0.015731729567050934,
0.254064679145813,
-0.33434125781059265,
0.011832673102617264,
0.06775753200054169,
-0.13737422227859497,
-0.46430179476737976,
-0.05795306712388992,
0.08269006013870239,
-0.33844083547592163,
0.07185724377632141,
-0.01108463853597641,
0.11115825921297073,
-0.4291638135910034,
-0.26606446504592896,
0.22611422836780548,
-0.5766522884368896,
-0.18700078129768372,
0.1518232673406601,
0.05341038852930069,
-0.1452697515487671,
-0.3462986350059509,
-0.4122926890850067,
0.0692700520157814,
-0.30480116605758667,
0.34824657440185547,
-0.3009240925312042,
0.28265389800071716,
0.13419583439826965,
0.14365817606449127,
-0.039252880960702896,
0.17118674516677856,
-0.16730734705924988,
-0.2839154303073883,
-0.20515501499176025,
0.4454065263271332,
-0.13175782561302185,
-0.38652926683425903,
0.06617234647274017,
0.1285596638917923,
-0.27682366967201233,
0.42163318395614624,
-0.12785030901432037,
0.1462031900882721,
-0.09690285474061966,
-0.0009106099605560303,
-0.04617556929588318,
0.1031644269824028,
0.40392476320266724,
0.2556893527507782,
-0.20224714279174805,
-0.3136655390262604,
-0.31294679641723633,
0.2687123119831085,
0.11911501735448837,
0.24219417572021484,
0.23637112975120544,
0.38834166526794434,
0.2141660451889038,
0.7472496628761292,
0.22351610660552979,
-0.43826568126678467,
0.234329491853714,
-0.07047533243894577,
-0.049085620790719986,
-0.041631199419498444,
-0.3650294840335846,
-0.15345008671283722,
-0.23794952034950256,
0.07347317039966583,
0.10075119882822037,
-0.1391969621181488,
-0.37088432908058167,
-0.08100907504558563,
0.21798238158226013,
-0.425430029630661,
-0.3455581068992615,
0.3692918121814728,
-0.5015803575515747,
0.20409366488456726,
0.005801644176244736,
0.20116469264030457,
-0.15733355283737183,
-0.064117431640625,
0.25014394521713257,
-0.12919564545154572,
0.5813742876052856,
-0.030392654240131378,
0.30350425839424133,
0.2528076469898224,
-0.17603567242622375,
0.34810566902160645,
0.13126595318317413,
0.37203678488731384,
-0.11082635819911957,
-0.30423909425735474,
-0.15022385120391846,
0.03978211432695389,
0.4055650234222412,
-0.4167023301124573,
0.055120013654232025,
0.12714055180549622,
-0.12026253342628479,
-0.3685929477214813,
-0.01595121994614601,
-0.20212392508983612,
0.5826730728149414,
0.19573822617530823,
0.27850446105003357,
-0.33313170075416565,
-0.041888706386089325,
0.03545248135924339,
-0.18352119624614716,
-0.026513876393437386,
0.06323803961277008,
-0.14263007044792175,
-0.13770824670791626,
-0.3718395531177521,
0.1612282693386078,
0.29052433371543884,
-0.08622835576534271,
-0.11864461749792099,
0.05235041305422783,
-0.062243588268756866,
-0.12749846279621124,
-0.0278967022895813,
-0.06756807863712311,
0.2565368115901947,
0.002548002637922764,
0.2724134027957916,
0.03202860802412033,
0.28084778785705566,
0.028840914368629456,
0.3255241811275482,
-0.016516108065843582,
-0.006350010633468628,
0.1469137966632843,
-0.1342450976371765,
-0.048173315823078156,
0.4274234175682068,
-0.0729091539978981,
-0.3265514373779297,
-0.06497929990291595,
0.11448995023965836,
-0.04507140442728996,
-0.11503536254167557,
0.38306108117103577,
-0.10746221989393234,
-0.20090459287166595,
-0.21398678421974182,
0.297264039516449,
0.07944057881832123,
-0.22371920943260193,
0.7089406847953796,
-0.2777782678604126,
-0.18206973373889923,
0.5697231888771057,
0.2743643522262573,
0.9933705925941467,
-0.1021510660648346,
-0.11088879406452179,
-0.19516336917877197,
0.14962171018123627,
-0.22755423188209534,
-0.011893756687641144,
0.003428088501095772,
-0.40625715255737305,
-0.30178898572921753,
0.059571273624897,
-0.13815537095069885,
0.09030656516551971,
0.3604434132575989,
-0.33455565571784973,
-0.043425943702459335,
-0.06256401538848877,
0.2887875437736511,
0.07016033679246902,
0.05824977159500122,
-0.10128302872180939,
-0.16872434318065643,
0.19960476458072662,
0.17903152108192444,
0.008634276688098907,
0.1530928909778595,
0.0946766808629036,
-0.14175762236118317,
-0.14307846128940582,
-0.36275285482406616,
-0.49187976121902466,
0.10134448856115341,
-0.37627214193344116,
0.47457754611968994,
-0.29177242517471313,
-0.03589865192770958,
0.13341094553470612,
0.16342411935329437,
-0.0392465814948082,
0.004949804395437241,
-0.19855061173439026,
0.017117824405431747,
0.2973432242870331,
0.22275662422180176,
-0.11698232591152191,
-0.10127297788858414,
0.32585087418556213,
0.11233387142419815,
-0.2411353886127472,
-0.06250395625829697,
-0.06953277438879013,
-0.3367825150489807,
-0.07797475904226303,
0.08762466907501221,
-0.11233867704868317,
-0.40977761149406433,
-0.015298396348953247,
0.014666043221950531,
-0.2596849501132965,
-0.11650063097476959,
0.14848384261131287,
0.05638890713453293,
-0.009798679500818253,
0.5353063941001892,
0.029946815222501755,
-0.29294127225875854,
0.19371731579303741,
0.5116832256317139,
-0.08279326558113098,
0.05714177340269089,
0.20812754333019257,
-0.07991006970405579,
-0.266491174697876,
-0.17303642630577087,
0.10116284340620041,
-0.070219025015831,
-0.43812716007232666,
0.3061785101890564,
-0.27983805537223816,
0.10948461294174194,
-0.06381971389055252,
0.17539913952350616,
-0.04556126892566681,
0.40922290086746216,
-0.09879928082227707,
-0.24069327116012573,
-0.12079744786024094,
0.3355868458747864,
-0.09602946043014526,
0.37236079573631287,
-0.30943432450294495,
0.1974136233329773,
0.07775785028934479,
0.23998574912548065,
-0.3470084071159363,
0.31045621633529663,
0.007782375440001488,
0.18599998950958252,
0.09554284811019897,
0.0898391604423523,
0.207387775182724,
-0.13993848860263824,
0.018458960577845573,
0.40848690271377563,
-0.29549655318260193,
-0.1611596941947937,
-0.15220172703266144,
0.16693150997161865,
0.09804482758045197,
-0.019429322332143784,
-0.18887099623680115,
-0.17492280900478363,
-0.039736177772283554,
-0.2472633719444275,
0.04326198622584343,
0.41794532537460327,
-0.1538853943347931,
0.31331712007522583,
0.36539265513420105,
-0.08540890365839005,
0.062102220952510834,
-0.18183207511901855,
-0.34681999683380127,
0.2530149817466736,
-0.09859687089920044,
0.10287681967020035,
0.22194035351276398,
0.03535909950733185,
-0.23462773859500885,
-0.055741868913173676,
0.01663556694984436,
0.2230871319770813,
0.35808420181274414,
-0.04347027838230133,
-0.02684277668595314,
0.1672818958759308,
0.21932591497898102,
0.1215568333864212,
-0.40551120042800903,
-0.29225945472717285,
0.05007358267903328,
0.16788700222969055,
-0.16275352239608765,
0.11515713483095169,
0.23285143077373505,
0.05260840058326721,
-0.12802456319332123,
-0.03446977585554123,
0.14340996742248535,
-0.09671125560998917,
-0.19136540591716766,
0.09139370918273926,
0.32031261920928955,
-0.3728049397468567,
0.01880611479282379,
0.26734742522239685,
-0.20115341246128082,
0.16150639951229095,
0.180276021361351,
-0.2687166631221771,
0.3653949499130249,
0.30623310804367065,
-0.20142385363578796,
0.2742604613304138,
0.2918943166732788,
0.2396194338798523,
-0.09124324470758438,
-0.2675575613975525,
0.27104464173316956,
0.13590598106384277,
-0.17730188369750977,
0.17386861145496368,
0.1881456971168518,
0.22371822595596313,
-0.13977666199207306,
-0.15596656501293182,
-0.03641890734434128,
0.5152009725570679,
-0.2179887592792511,
0.10262060165405273,
-0.0046510472893714905,
-0.18417038023471832,
-0.19716878235340118,
-0.045866258442401886,
-0.18201573193073273,
0.23871201276779175,
0.881843090057373,
0.30069029331207275,
0.0014506131410598755,
0.12122134119272232,
-0.20004421472549438,
-0.14354434609413147,
0.5987659096717834,
-0.260498970746994,
0.10113585740327835,
0.15259450674057007,
-0.11977137625217438,
-0.09373374283313751,
0.4161708354949951,
0.41271114349365234,
0.353344202041626,
-0.2445334494113922,
0.3212220370769501,
-0.0742085725069046,
-0.0372544601559639,
0.017493750900030136,
0.44985368847846985,
0.09680075943470001,
-0.281199187040329,
0.16544616222381592,
0.08256518840789795,
-0.07954785972833633,
-0.09908603131771088,
0.07009899616241455,
0.5310189723968506,
0.357510507106781,
0.3010712265968323,
-0.06773246079683304,
-0.13935770094394684,
0.15877991914749146,
-0.10700195282697678,
0.10393895953893661,
-0.28300741314888,
0.40802109241485596,
-0.07945021986961365,
0.24368256330490112,
-0.19863153994083405,
0.1129085123538971,
0.08340339362621307,
0.40993982553482056,
0.28160741925239563,
-0.20199954509735107,
-0.25527551770210266,
0.016396567225456238,
-0.33150818943977356,
0.286956250667572,
0.005860459059476852,
0.2109685242176056,
-0.06265579164028168,
0.05632835626602173,
0.11646066606044769,
0.28674668073654175,
0.1723816841840744,
-0.08944939821958542,
-0.16492824256420135,
0.49768516421318054,
-0.3321867287158966,
0.0943148285150528,
-0.1644861400127411,
0.23969340324401855,
0.29371020197868347,
-0.3017757833003998,
0.0025799982249736786,
-0.14995695650577545,
0.17245694994926453,
-0.2943282127380371,
-0.349224716424942,
0.14601224660873413,
0.011635653674602509,
0.7785243988037109,
0.29550623893737793,
0.1331997811794281,
-0.2341848611831665,
-0.09556097537279129,
-0.08773542940616608,
-0.28230181336402893,
-0.008428905159235,
0.25901108980178833,
0.1836124211549759,
0.17893680930137634,
-0.07661367952823639,
-0.31629741191864014,
-0.25738924741744995,
0.01927967183291912,
-0.30667412281036377,
0.2293384075164795,
-0.28613001108169556,
-0.025414763018488884,
-0.08358604460954666,
-0.18347886204719543,
-0.2827884554862976,
0.2857135534286499,
-0.08882321417331696,
0.2587823271751404,
-0.19916410744190216,
-0.5624298453330994,
0.7426475882530212,
-0.3550196588039398,
-0.291435182094574,
0.0615997314453125,
0.10725684463977814,
-0.2589074373245239,
-0.020400917157530785,
-0.515058696269989,
-0.2303319275379181,
0.25259843468666077,
0.08847937732934952,
-0.5254621505737305,
-0.09396450221538544,
-0.03601142019033432,
-0.06851888447999954,
-0.10820776224136353,
0.42910200357437134,
0.02779720351099968,
-0.190804585814476,
-0.014093203470110893,
-0.16869550943374634
] |
https://github.com/huggingface/datasets/issues/5536 | Failure to hash function when using .map() | @lhoestq @edhenry I am on datasets version `'2.12.0'. I see the same `TypeError: cannot pickle 'builtins.CoreBPE' object` that others are seeing. | ### Describe the bug
_Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed._
This issue with `.map()` happens for me consistently, as also described in closed issue #4506
Dataset indices can be individually serialized using dill and pickle without any errors. I'm using tiktoken to encode in the function passed to map(). Similarly, indices can be individually encoded without error.
### Steps to reproduce the bug
```py
from datasets import load_dataset
import tiktoken
dataset = load_dataset("stas/openwebtext-10k")
enc = tiktoken.get_encoding("gpt2")
tokenized = dataset.map(
process,
remove_columns=['text'],
desc="tokenizing the OWT splits",
)
def process(example):
ids = enc.encode(example['text'])
ids.append(enc.eot_token)
out = {'ids': ids, 'len': len(ids)}
return out
```
### Expected behavior
Should encode simple text objects.
### Environment info
Python versions tried: both 3.8 and 3.10.10
`PYTHONUTF8=1` as env variable
Datasets tried:
- stas/openwebtext-10k
- rotten_tomatoes
- local text file
OS: Ubuntu Linux 20.04
Package versions:
- torch 1.13.1
- dill 0.3.4 (if using 0.3.6 - same issue)
- datasets 2.9.0
- tiktoken 0.2.0
| 21 | Failure to hash function when using .map()
### Describe the bug
_Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed._
This issue with `.map()` happens for me consistently, as also described in closed issue #4506
Dataset indices can be individually serialized using dill and pickle without any errors. I'm using tiktoken to encode in the function passed to map(). Similarly, indices can be individually encoded without error.
### Steps to reproduce the bug
```py
from datasets import load_dataset
import tiktoken
dataset = load_dataset("stas/openwebtext-10k")
enc = tiktoken.get_encoding("gpt2")
tokenized = dataset.map(
process,
remove_columns=['text'],
desc="tokenizing the OWT splits",
)
def process(example):
ids = enc.encode(example['text'])
ids.append(enc.eot_token)
out = {'ids': ids, 'len': len(ids)}
return out
```
### Expected behavior
Should encode simple text objects.
### Environment info
Python versions tried: both 3.8 and 3.10.10
`PYTHONUTF8=1` as env variable
Datasets tried:
- stas/openwebtext-10k
- rotten_tomatoes
- local text file
OS: Ubuntu Linux 20.04
Package versions:
- torch 1.13.1
- dill 0.3.4 (if using 0.3.6 - same issue)
- datasets 2.9.0
- tiktoken 0.2.0
@lhoestq @edhenry I am on datasets version `'2.12.0'. I see the same `TypeError: cannot pickle 'builtins.CoreBPE' object` that others are seeing. | [
-0.2785501480102539,
0.05490994453430176,
0.022331468760967255,
0.06358535587787628,
0.3812029957771301,
0.09191403537988663,
0.5076667666435242,
0.40114763379096985,
0.2533603608608246,
0.05205825716257095,
0.10599610209465027,
0.6064263582229614,
-0.257708877325058,
-0.08370460569858551,
-0.15629230439662933,
0.09566883742809296,
0.018756739795207977,
-0.05341266095638275,
-0.28665271401405334,
-0.15420778095722198,
-0.42140284180641174,
0.104808010160923,
-0.17061543464660645,
0.3289914131164551,
-0.3499497175216675,
-0.14661255478858948,
0.08752056956291199,
-0.07556241005659103,
0.0025828955695033073,
-0.26252156496047974,
-0.08661359548568726,
-0.36473482847213745,
-0.12326498329639435,
0.611335277557373,
-0.00010930872667813674,
0.06868958473205566,
0.25913065671920776,
-0.18251162767410278,
-0.08184057474136353,
-0.45085668563842773,
-0.2004885971546173,
-0.1295182853937149,
-0.03138324245810509,
-0.2770377993583679,
0.1724657118320465,
-0.29601848125457764,
0.20807510614395142,
-0.6159782409667969,
0.32054999470710754,
0.11039673537015915,
0.2236061692237854,
0.030667442828416824,
0.1531788557767868,
0.1915990263223648,
0.4083925187587738,
0.00807616114616394,
-0.2963302433490753,
0.03381205350160599,
0.08233452588319778,
0.045620910823345184,
-0.3310677409172058,
0.3260224461555481,
-0.020276721566915512,
0.05320442095398903,
0.06921254843473434,
0.051344119012355804,
0.2427285611629486,
-0.45287060737609863,
0.20312312245368958,
-0.012312576174736023,
0.19906477630138397,
-0.39477211236953735,
-0.44560950994491577,
0.06601964682340622,
-0.28563424944877625,
-0.01827855035662651,
0.29146915674209595,
0.17144328355789185,
0.0954698771238327,
0.1212523877620697,
-0.38155296444892883,
0.15440157055854797,
0.14713309705257416,
0.2193087786436081,
0.27658772468566895,
0.2059793323278427,
0.10258845239877701,
0.31845390796661377,
0.08183114975690842,
-0.20611107349395752,
-0.09069604426622391,
-0.012974102050065994,
0.05010650306940079,
0.25439271330833435,
-0.19538696110248566,
-0.0250416100025177,
0.16760198771953583,
-0.4377981126308441,
0.16302800178527832,
0.07313841581344604,
0.09043344855308533,
0.10978767275810242,
-0.005644966848194599,
0.18018919229507446,
0.24167563021183014,
0.2448081523180008,
0.19991245865821838,
0.3972417116165161,
0.19280315935611725,
-0.43926313519477844,
-0.1761418581008911,
0.03481161594390869,
0.1430107206106186,
-0.21096915006637573,
0.20433539152145386,
0.17646247148513794,
0.3286724090576172,
0.016233298927545547,
-0.10489168763160706,
0.12774130702018738,
-0.4839218854904175,
-0.14428924024105072,
-0.22400064766407013,
0.18675503134727478,
0.32816001772880554,
-0.07223514467477798,
0.23206491768360138,
-0.0005960650742053986,
-0.007764735259115696,
0.18240080773830414,
-0.26880642771720886,
-0.1329648494720459,
-0.2910916209220886,
0.16669480502605438,
0.036607902497053146,
-0.12366646528244019,
0.20139196515083313,
0.03230218216776848,
0.01326613500714302,
-0.05529758334159851,
-0.010007491335272789,
-0.12262663245201111,
0.5326560735702515,
0.21082289516925812,
-0.15145866572856903,
0.3264671564102173,
0.15033186972141266,
0.1577107310295105,
-0.07448984682559967,
0.26977333426475525,
-0.392173171043396,
-0.26248300075531006,
-0.07912585884332657,
0.09604451060295105,
-0.008295994251966476,
0.2483631819486618,
0.10242084413766861,
0.04797601327300072,
0.49920809268951416,
-0.22571581602096558,
0.08555053174495697,
-0.13345028460025787,
-0.29873281717300415,
-0.2628200352191925,
0.006487922742962837,
0.3623993992805481,
0.13300952315330505,
-0.0671987384557724,
0.033753979951143265,
0.17295190691947937,
0.11260325461626053,
0.3794192373752594,
-0.25362423062324524,
0.0040526241064071655,
-0.17221716046333313,
0.49005991220474243,
0.2073109894990921,
0.006532151252031326,
-0.4658152759075165,
0.40728434920310974,
-0.004201546311378479,
-0.02036457322537899,
-0.29204678535461426,
-0.09584391117095947,
0.31574204564094543,
-0.3231717050075531,
-0.07165989279747009,
-0.01644471287727356,
0.03627847507596016,
0.2278011441230774,
-0.4139467477798462,
-0.18005873262882233,
0.30799466371536255,
-0.3027438819408417,
0.11035562306642532,
-0.07781917601823807,
0.061670850962400436,
-0.15875130891799927,
0.13314668834209442,
-0.021852057427167892,
0.36740031838417053,
0.018479149788618088,
0.11945931613445282,
-0.2713632583618164,
0.18169376254081726,
-0.16679725050926208,
-0.23970428109169006,
0.13520261645317078,
-0.08059495687484741,
-0.02477969229221344,
-0.304315984249115,
0.00753575935959816,
0.03447388485074043,
0.0478985533118248,
-0.07432207465171814,
-0.08487418293952942,
0.06485556066036224,
-0.037217237055301666,
-0.18056535720825195,
0.10749185085296631,
-0.27092671394348145,
-0.08939218521118164,
-0.037747859954833984,
-0.18663389980793,
0.10023613274097443,
-0.15049238502979279,
-0.14061126112937927,
-0.334114134311676,
-0.12605181336402893,
-0.1817896068096161,
0.1944337785243988,
-0.08862993121147156,
-0.4675903916358948,
0.2814668118953705,
-0.13775385916233063,
-0.17681969702243805,
-0.14544254541397095,
0.3187246024608612,
0.1100996881723404,
-0.40113839507102966,
0.07447000592947006,
0.285062313079834,
0.10901178419589996,
-0.14120052754878998,
0.07920845597982407,
0.12376323342323303,
0.01236806996166706,
0.053842682391405106,
-0.3094821572303772,
0.1908375769853592,
0.07004434615373611,
-0.05515768378973007,
-0.14893639087677002,
-0.25011730194091797,
-0.27916789054870605,
-0.15429890155792236,
0.30356666445732117,
0.11718384176492691,
0.25794678926467896,
0.05967982858419418,
0.7198591232299805,
0.16704100370407104,
0.2578924894332886,
0.3109918534755707,
-0.05309963971376419,
-0.17880982160568237,
-0.0749586820602417,
-0.08653456717729568,
0.24268659949302673,
-0.00920033734291792,
-0.09097172319889069,
0.08312927931547165,
-0.06146954745054245,
0.07643068581819534,
0.1983674168586731,
-0.04379185289144516,
0.2856345474720001,
0.32133975625038147,
0.056791696697473526,
0.11567039042711258,
-0.11616169661283493,
-0.1661655306816101,
0.19248700141906738,
0.3082674443721771,
-0.47313398122787476,
0.014949606731534004,
-0.209407240152359,
0.3591761291027069,
0.1553606390953064,
-0.1846383661031723,
0.021981729194521904,
-0.2969575524330139,
0.10768061876296997,
0.010542403906583786,
-0.448944091796875,
0.6683923006057739,
0.10908918082714081,
-0.09013225138187408,
0.2669621706008911,
-0.06814537942409515,
-0.2854662835597992,
-0.32823795080184937,
-0.10563527792692184,
-0.018432777374982834,
0.2510432004928589,
-0.33605363965034485,
0.007885243743658066,
0.06193608045578003,
-0.14009565114974976,
-0.4694775640964508,
-0.05657047778367996,
0.08111564815044403,
-0.33535921573638916,
0.0741501897573471,
-0.01112489402294159,
0.10905985534191132,
-0.43110597133636475,
-0.2631438374519348,
0.22565728425979614,
-0.5770919919013977,
-0.19022038578987122,
0.14955417811870575,
0.05131480097770691,
-0.14743249118328094,
-0.3438604772090912,
-0.41714897751808167,
0.06475097686052322,
-0.30325812101364136,
0.3468496799468994,
-0.3072449862957001,
0.2849496603012085,
0.12733304500579834,
0.14371103048324585,
-0.03648923709988594,
0.16470418870449066,
-0.16549237072467804,
-0.28346526622772217,
-0.20454902946949005,
0.44968080520629883,
-0.13125744462013245,
-0.38458722829818726,
0.0653643012046814,
0.1259395182132721,
-0.27628564834594727,
0.4254375696182251,
-0.1297292709350586,
0.1443205028772354,
-0.09503322094678879,
0.0012896806001663208,
-0.04889146238565445,
0.10256882011890411,
0.39843079447746277,
0.2576393485069275,
-0.19858351349830627,
-0.31319713592529297,
-0.3137708306312561,
0.26820799708366394,
0.11434440314769745,
0.2377171814441681,
0.24229967594146729,
0.39873284101486206,
0.2145300805568695,
0.7474747896194458,
0.23082038760185242,
-0.44265544414520264,
0.2371666133403778,
-0.07322663068771362,
-0.04873031750321388,
-0.04000881314277649,
-0.36193883419036865,
-0.15237310528755188,
-0.23449233174324036,
0.0748554989695549,
0.10450786352157593,
-0.14557582139968872,
-0.36912521719932556,
-0.07553543150424957,
0.2129412144422531,
-0.431216835975647,
-0.3448258936405182,
0.37186139822006226,
-0.5015705227851868,
0.20977556705474854,
0.0030990205705165863,
0.19786563515663147,
-0.1526212990283966,
-0.06293895840644836,
0.24866604804992676,
-0.12981051206588745,
0.5820791721343994,
-0.027493519708514214,
0.30566588044166565,
0.2503508925437927,
-0.17656657099723816,
0.352186381816864,
0.1336296796798706,
0.3824109137058258,
-0.11058677732944489,
-0.2992497384548187,
-0.15245385468006134,
0.04407835006713867,
0.4082706570625305,
-0.4188903272151947,
0.061172306537628174,
0.12436391413211823,
-0.12110314518213272,
-0.3601425588130951,
-0.011500496417284012,
-0.2040652334690094,
0.5808282494544983,
0.19790218770503998,
0.27996909618377686,
-0.3374566435813904,
-0.04248415678739548,
0.03268672153353691,
-0.18017753958702087,
-0.023993728682398796,
0.0639733076095581,
-0.14349910616874695,
-0.13531704246997833,
-0.3727076053619385,
0.15752840042114258,
0.2870342433452606,
-0.08218994736671448,
-0.11681260913610458,
0.052551474422216415,
-0.062413498759269714,
-0.12574049830436707,
-0.030400916934013367,
-0.06569831818342209,
0.2574187219142914,
0.004020904656499624,
0.2722724974155426,
0.028818296268582344,
0.2769033908843994,
0.03295339643955231,
0.326341450214386,
-0.02236243709921837,
-0.009244576096534729,
0.1471034735441208,
-0.13180121779441833,
-0.049688540399074554,
0.4202757179737091,
-0.07680926471948624,
-0.32464125752449036,
-0.06240089237689972,
0.11727206408977509,
-0.03935568779706955,
-0.11260521411895752,
0.38535580039024353,
-0.1065194383263588,
-0.20057053864002228,
-0.21254655718803406,
0.2935996949672699,
0.08332966268062592,
-0.22017723321914673,
0.7052856683731079,
-0.27798646688461304,
-0.18198178708553314,
0.5636342763900757,
0.2768745720386505,
0.982384443283081,
-0.10653296113014221,
-0.11757771670818329,
-0.19935590028762817,
0.1512116640806198,
-0.23031587898731232,
-0.0043155476450920105,
0.0018934840336441994,
-0.4065989553928375,
-0.30264848470687866,
0.05876302719116211,
-0.13979391753673553,
0.09437236934900284,
0.3657965660095215,
-0.3321799337863922,
-0.039224252104759216,
-0.058758459985256195,
0.2916533648967743,
0.07118035107851028,
0.06169985979795456,
-0.09336452186107635,
-0.16823337972164154,
0.2013293206691742,
0.17768295109272003,
0.006095856428146362,
0.15032581984996796,
0.0967845693230629,
-0.1397233009338379,
-0.14230911433696747,
-0.36246323585510254,
-0.48545849323272705,
0.10302755981683731,
-0.3801979124546051,
0.4776389002799988,
-0.2892187237739563,
-0.0374283492565155,
0.1377921849489212,
0.16955141723155975,
-0.044283121824264526,
0.00826515257358551,
-0.19286809861660004,
0.01590491086244583,
0.2943646311759949,
0.22164393961429596,
-0.11496467888355255,
-0.10020136088132858,
0.3184681832790375,
0.11545444279909134,
-0.23850342631340027,
-0.06234797090291977,
-0.07341919839382172,
-0.33613109588623047,
-0.07156933099031448,
0.08852820098400116,
-0.10820047557353973,
-0.40968218445777893,
-0.020255420356988907,
0.01026248186826706,
-0.265620619058609,
-0.11516165733337402,
0.14546577632427216,
0.053420476615428925,
-0.011610211804509163,
0.533176064491272,
0.03064744547009468,
-0.2963208556175232,
0.19655808806419373,
0.5115468502044678,
-0.08461512625217438,
0.06005804240703583,
0.21066594123840332,
-0.08466117084026337,
-0.26636558771133423,
-0.1742045283317566,
0.10212799161672592,
-0.07545039057731628,
-0.44098567962646484,
0.30668866634368896,
-0.2816711962223053,
0.11283786594867706,
-0.06404045969247818,
0.17360460758209229,
-0.043239884078502655,
0.4124618172645569,
-0.10164317488670349,
-0.244034543633461,
-0.12221071124076843,
0.33640962839126587,
-0.0972839742898941,
0.3677024841308594,
-0.3029260039329529,
0.19770370423793793,
0.0771392434835434,
0.2449459731578827,
-0.34440645575523376,
0.3097343146800995,
0.00296664796769619,
0.18844608962535858,
0.09238874912261963,
0.09347822517156601,
0.20741961896419525,
-0.13383041322231293,
0.01756909303367138,
0.4062659740447998,
-0.29369574785232544,
-0.1585874855518341,
-0.15149100124835968,
0.16629305481910706,
0.09732523560523987,
-0.014093775302171707,
-0.18988719582557678,
-0.17643378674983978,
-0.04294963553547859,
-0.25067880749702454,
0.03969959169626236,
0.41150686144828796,
-0.15230262279510498,
0.3158888816833496,
0.3684927523136139,
-0.08950165659189224,
0.05122758448123932,
-0.18088193237781525,
-0.3493761420249939,
0.2446044683456421,
-0.10359548777341843,
0.10426370799541473,
0.2264590710401535,
0.03558996319770813,
-0.2420613318681717,
-0.0648302361369133,
0.025070786476135254,
0.22276511788368225,
0.35906627774238586,
-0.04076027870178223,
-0.023365166038274765,
0.16609789431095123,
0.2151455283164978,
0.12047573179006577,
-0.40856197476387024,
-0.29124021530151367,
0.05037785321474075,
0.16480684280395508,
-0.16461235284805298,
0.11105110496282578,
0.2325722575187683,
0.05220765247941017,
-0.12367826700210571,
-0.03365571051836014,
0.14115680754184723,
-0.0933200791478157,
-0.1935749500989914,
0.08810090273618698,
0.3201625645160675,
-0.3692978620529175,
0.017340686172246933,
0.2730414867401123,
-0.19779151678085327,
0.1669580638408661,
0.18393127620220184,
-0.2670099437236786,
0.3650107979774475,
0.3060570955276489,
-0.2023247480392456,
0.27997279167175293,
0.2875831127166748,
0.2392350435256958,
-0.09085861593484879,
-0.26771196722984314,
0.275954008102417,
0.1401892900466919,
-0.1797923445701599,
0.17425456643104553,
0.18419969081878662,
0.22027596831321716,
-0.13790762424468994,
-0.1575814038515091,
-0.03294707089662552,
0.5159295797348022,
-0.21869045495986938,
0.1004548966884613,
-0.0001496821641921997,
-0.180713951587677,
-0.1977536827325821,
-0.045255206525325775,
-0.1813727766275406,
0.24066132307052612,
0.8825353384017944,
0.30453890562057495,
-0.00019928812980651855,
0.12546545267105103,
-0.2041057050228119,
-0.13731053471565247,
0.5958097577095032,
-0.2629967927932739,
0.10409818589687347,
0.1507246047258377,
-0.11552225053310394,
-0.09637290239334106,
0.41741278767585754,
0.41000357270240784,
0.3538416922092438,
-0.23724740743637085,
0.3197750747203827,
-0.06569737195968628,
-0.03725054860115051,
0.018778447061777115,
0.4488142132759094,
0.09533503651618958,
-0.28755396604537964,
0.16386213898658752,
0.08098900318145752,
-0.07890154421329498,
-0.09561748802661896,
0.069807268679142,
0.532289981842041,
0.36099037528038025,
0.29926204681396484,
-0.06593551486730576,
-0.14107917249202728,
0.16036520898342133,
-0.10754463821649551,
0.10167039185762405,
-0.27587923407554626,
0.4064824879169464,
-0.08249948173761368,
0.24337732791900635,
-0.19947366416454315,
0.11198359727859497,
0.08509044349193573,
0.41184526681900024,
0.2828243374824524,
-0.2061518132686615,
-0.2569805979728699,
0.011989481747150421,
-0.33339786529541016,
0.28768742084503174,
0.007531560957431793,
0.20616106688976288,
-0.060978859663009644,
0.054847151041030884,
0.1128186360001564,
0.28898268938064575,
0.1746116429567337,
-0.09345134347677231,
-0.16174441576004028,
0.5017184019088745,
-0.32988306879997253,
0.09153600037097931,
-0.1638692170381546,
0.24036020040512085,
0.2943113148212433,
-0.30542051792144775,
0.003050442785024643,
-0.14848464727401733,
0.17068597674369812,
-0.29645031690597534,
-0.34756866097450256,
0.1465328335762024,
0.009844612330198288,
0.7779451608657837,
0.2964053452014923,
0.13033892214298248,
-0.2432204782962799,
-0.091193787753582,
-0.08281786739826202,
-0.2794707715511322,
-0.00456972885876894,
0.2544398009777069,
0.18501286208629608,
0.17763134837150574,
-0.07998722791671753,
-0.31182411313056946,
-0.2574261724948883,
0.011695225723087788,
-0.3092527985572815,
0.2301170825958252,
-0.2880723774433136,
-0.023854859173297882,
-0.08365844190120697,
-0.18409915268421173,
-0.28080934286117554,
0.28833046555519104,
-0.08774727582931519,
0.25855109095573425,
-0.20350003242492676,
-0.5573439002037048,
0.7422791719436646,
-0.36362650990486145,
-0.289338082075119,
0.05814441293478012,
0.10607609152793884,
-0.2607279121875763,
-0.02463885210454464,
-0.5117624402046204,
-0.2266882061958313,
0.25621920824050903,
0.09080398082733154,
-0.5279130339622498,
-0.09507831931114197,
-0.040361437946558,
-0.0657702088356018,
-0.10575608909130096,
0.4298229217529297,
0.02556423842906952,
-0.19017648696899414,
-0.016631778329610825,
-0.17074546217918396
] |
https://github.com/huggingface/datasets/issues/5536 | Failure to hash function when using .map() | I am able to reproduce this on datasets 2.14.2. The `datasets.disable_caching()` doesn't work around it.
@lhoestq - you might want to reopen this issue. Because of this issue folks won't be able run Karpathy's NanoGPT :(. | ### Describe the bug
_Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed._
This issue with `.map()` happens for me consistently, as also described in closed issue #4506
Dataset indices can be individually serialized using dill and pickle without any errors. I'm using tiktoken to encode in the function passed to map(). Similarly, indices can be individually encoded without error.
### Steps to reproduce the bug
```py
from datasets import load_dataset
import tiktoken
dataset = load_dataset("stas/openwebtext-10k")
enc = tiktoken.get_encoding("gpt2")
tokenized = dataset.map(
process,
remove_columns=['text'],
desc="tokenizing the OWT splits",
)
def process(example):
ids = enc.encode(example['text'])
ids.append(enc.eot_token)
out = {'ids': ids, 'len': len(ids)}
return out
```
### Expected behavior
Should encode simple text objects.
### Environment info
Python versions tried: both 3.8 and 3.10.10
`PYTHONUTF8=1` as env variable
Datasets tried:
- stas/openwebtext-10k
- rotten_tomatoes
- local text file
OS: Ubuntu Linux 20.04
Package versions:
- torch 1.13.1
- dill 0.3.4 (if using 0.3.6 - same issue)
- datasets 2.9.0
- tiktoken 0.2.0
| 36 | Failure to hash function when using .map()
### Describe the bug
_Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed._
This issue with `.map()` happens for me consistently, as also described in closed issue #4506
Dataset indices can be individually serialized using dill and pickle without any errors. I'm using tiktoken to encode in the function passed to map(). Similarly, indices can be individually encoded without error.
### Steps to reproduce the bug
```py
from datasets import load_dataset
import tiktoken
dataset = load_dataset("stas/openwebtext-10k")
enc = tiktoken.get_encoding("gpt2")
tokenized = dataset.map(
process,
remove_columns=['text'],
desc="tokenizing the OWT splits",
)
def process(example):
ids = enc.encode(example['text'])
ids.append(enc.eot_token)
out = {'ids': ids, 'len': len(ids)}
return out
```
### Expected behavior
Should encode simple text objects.
### Environment info
Python versions tried: both 3.8 and 3.10.10
`PYTHONUTF8=1` as env variable
Datasets tried:
- stas/openwebtext-10k
- rotten_tomatoes
- local text file
OS: Ubuntu Linux 20.04
Package versions:
- torch 1.13.1
- dill 0.3.4 (if using 0.3.6 - same issue)
- datasets 2.9.0
- tiktoken 0.2.0
I am able to reproduce this on datasets 2.14.2. The `datasets.disable_caching()` doesn't work around it.
@lhoestq - you might want to reopen this issue. Because of this issue folks won't be able run Karpathy's NanoGPT :(. | [
-0.25540387630462646,
0.052326858043670654,
0.0350506417453289,
0.0766218900680542,
0.3983868956565857,
0.07499410957098007,
0.5143856406211853,
0.3840460479259491,
0.23183977603912354,
0.055268317461013794,
0.10514780133962631,
0.6219761967658997,
-0.25351962447166443,
-0.08838693052530289,
-0.1580267697572708,
0.08762852847576141,
0.02112475037574768,
-0.061268046498298645,
-0.2820482552051544,
-0.1530894637107849,
-0.4087834656238556,
0.10032226890325546,
-0.18631038069725037,
0.3087131977081299,
-0.3600762188434601,
-0.14859095215797424,
0.08407154679298401,
-0.08364991098642349,
-0.00046349503099918365,
-0.2547670900821686,
-0.07727227360010147,
-0.3580872714519501,
-0.11835384368896484,
0.6179583668708801,
-0.00011170121433679014,
0.07305456697940826,
0.2625287175178528,
-0.2005230039358139,
-0.08890965580940247,
-0.4785389304161072,
-0.17364951968193054,
-0.1388629525899887,
-0.028229424729943275,
-0.2788047194480896,
0.1664009392261505,
-0.2886410653591156,
0.215231791138649,
-0.6032744646072388,
0.3144043982028961,
0.10491171479225159,
0.20328058302402496,
0.011315964162349701,
0.15088512003421783,
0.2012157440185547,
0.403929740190506,
0.03085445612668991,
-0.30193474888801575,
0.0370778813958168,
0.08677878230810165,
0.0538252592086792,
-0.33578208088874817,
0.31676068902015686,
-0.012638945132493973,
0.047766491770744324,
0.08517234027385712,
0.056201089173555374,
0.23858746886253357,
-0.4649161994457245,
0.20267435908317566,
-0.018192432820796967,
0.2262967824935913,
-0.40384334325790405,
-0.45479971170425415,
0.05700860172510147,
-0.2785216271877289,
-0.007700642570853233,
0.3052780032157898,
0.15851405262947083,
0.09493847191333771,
0.11838121712207794,
-0.3920498788356781,
0.156063511967659,
0.14700527489185333,
0.23551179468631744,
0.26618266105651855,
0.19284175336360931,
0.11211693286895752,
0.3238237500190735,
0.07320421189069748,
-0.21177944540977478,
-0.0890815332531929,
-0.015154261142015457,
0.061811789870262146,
0.2590455710887909,
-0.19874297082424164,
-0.007696609944105148,
0.1744048148393631,
-0.4551258981227875,
0.16002672910690308,
0.07942909002304077,
0.10231482982635498,
0.1212652251124382,
-0.02724047377705574,
0.17717766761779785,
0.24277840554714203,
0.253547340631485,
0.21024179458618164,
0.40742427110671997,
0.19594448804855347,
-0.45267295837402344,
-0.18271386623382568,
0.03821200132369995,
0.12667898833751678,
-0.19727574288845062,
0.19426047801971436,
0.18004056811332703,
0.3343619108200073,
0.02117084339261055,
-0.0957232415676117,
0.1444113552570343,
-0.5122773051261902,
-0.14460164308547974,
-0.223786398768425,
0.18513169884681702,
0.32706114649772644,
-0.08343135565519333,
0.24688638746738434,
0.015065081417560577,
-0.008402866311371326,
0.1922948956489563,
-0.24149249494075775,
-0.13229985535144806,
-0.2804224491119385,
0.15621332824230194,
0.04842091724276543,
-0.15255708992481232,
0.19735389947891235,
0.0569211021065712,
0.028925638645887375,
-0.06305687129497528,
-0.013884218409657478,
-0.1305040419101715,
0.5392152070999146,
0.1940181702375412,
-0.16867506504058838,
0.34667548537254333,
0.13944050669670105,
0.14961262047290802,
-0.06629073619842529,
0.27858760952949524,
-0.40162432193756104,
-0.2404775172472,
-0.07692629843950272,
0.06785397976636887,
-0.007719480432569981,
0.2571297585964203,
0.12325923889875412,
0.05225341022014618,
0.49572423100471497,
-0.24181629717350006,
0.07742328196763992,
-0.14127112925052643,
-0.30163681507110596,
-0.26665422320365906,
0.031329475343227386,
0.3569798767566681,
0.12578102946281433,
-0.07104655355215073,
0.04623352736234665,
0.1882854402065277,
0.13052436709403992,
0.3642033040523529,
-0.23070475459098816,
0.019807986915111542,
-0.1657189428806305,
0.49251461029052734,
0.20129212737083435,
-0.005543850362300873,
-0.4814811646938324,
0.3978162109851837,
0.006875529885292053,
-0.0010207109153270721,
-0.2907671630382538,
-0.10359103232622147,
0.3289213478565216,
-0.304111123085022,
-0.06204836070537567,
-0.01824789121747017,
0.03496570512652397,
0.21129605174064636,
-0.4104686379432678,
-0.1709069162607193,
0.32738083600997925,
-0.2934211194515228,
0.1060616597533226,
-0.08119527250528336,
0.07666657865047455,
-0.14939860999584198,
0.1266409158706665,
-0.02607591077685356,
0.35996389389038086,
0.017084989696741104,
0.10856542736291885,
-0.2796081304550171,
0.18594606220722198,
-0.16281044483184814,
-0.2455180585384369,
0.1496557891368866,
-0.06648266315460205,
-0.011140316724777222,
-0.3214658498764038,
0.01410740241408348,
0.04759860038757324,
0.04425080865621567,
-0.08332206308841705,
-0.09875087440013885,
0.0410967618227005,
-0.027523480355739594,
-0.18927471339702606,
0.12341731786727905,
-0.24799375236034393,
-0.09272223711013794,
-0.020531825721263885,
-0.18988387286663055,
0.11245168745517731,
-0.15091060101985931,
-0.13527776300907135,
-0.3390343189239502,
-0.13416770100593567,
-0.15650758147239685,
0.20487764477729797,
-0.10610103607177734,
-0.47002771496772766,
0.2708355486392975,
-0.12495841085910797,
-0.1935160607099533,
-0.17768532037734985,
0.3057371973991394,
0.12954622507095337,
-0.3741356134414673,
0.0527997761964798,
0.2915872037410736,
0.11119619011878967,
-0.15665902197360992,
0.07490924745798111,
0.12056035548448563,
0.030482612550258636,
0.07163089513778687,
-0.3211750388145447,
0.20070241391658783,
0.06638449430465698,
-0.056388404220342636,
-0.152093306183815,
-0.246110200881958,
-0.25609517097473145,
-0.16563962399959564,
0.32540228962898254,
0.11446934938430786,
0.2558141350746155,
0.059236302971839905,
0.7108352184295654,
0.17377987504005432,
0.26828107237815857,
0.29693204164505005,
-0.05342429131269455,
-0.15513530373573303,
-0.07577504962682724,
-0.0997907891869545,
0.23054227232933044,
-0.033448703587055206,
-0.09008254110813141,
0.08516845107078552,
-0.06317351013422012,
0.09009667485952377,
0.17614689469337463,
-0.0534798800945282,
0.280773788690567,
0.34119728207588196,
0.06291285157203674,
0.12994423508644104,
-0.11146758496761322,
-0.1518247425556183,
0.19860658049583435,
0.30225875973701477,
-0.4664373993873596,
0.0181808453053236,
-0.24052982032299042,
0.3748384714126587,
0.16018743813037872,
-0.1891133338212967,
0.012223131954669952,
-0.294307678937912,
0.1046103984117508,
0.013179872184991837,
-0.4333488941192627,
0.6879763603210449,
0.12469345331192017,
-0.10341770946979523,
0.27554354071617126,
-0.0779004767537117,
-0.2866044342517853,
-0.31713059544563293,
-0.11156114190816879,
-0.04693347215652466,
0.25409725308418274,
-0.34675267338752747,
0.011049749329686165,
0.059158653020858765,
-0.1409001350402832,
-0.47146815061569214,
-0.07066871970891953,
0.08352290838956833,
-0.32502758502960205,
0.08654739707708359,
-0.016497455537319183,
0.0971386730670929,
-0.4336448311805725,
-0.25847190618515015,
0.23865962028503418,
-0.5629883408546448,
-0.19483669102191925,
0.15563935041427612,
0.055932871997356415,
-0.15419311821460724,
-0.35185399651527405,
-0.411859929561615,
0.06977084279060364,
-0.3031805157661438,
0.3415815830230713,
-0.3127894103527069,
0.2860223054885864,
0.12693741917610168,
0.14150787889957428,
-0.0370001457631588,
0.16669130325317383,
-0.16897469758987427,
-0.261322557926178,
-0.18447163701057434,
0.4705527722835541,
-0.1369861215353012,
-0.3946186900138855,
0.0515563078224659,
0.13279660046100616,
-0.28795772790908813,
0.45412611961364746,
-0.11992789804935455,
0.16007159650325775,
-0.07914908975362778,
0.016407616436481476,
-0.06697627902030945,
0.1151050254702568,
0.381389319896698,
0.2585016191005707,
-0.166221022605896,
-0.3205643892288208,
-0.3291949927806854,
0.2695389986038208,
0.1169004738330841,
0.24879398941993713,
0.2578834891319275,
0.4153272211551666,
0.22867387533187866,
0.7503339648246765,
0.23724320530891418,
-0.44462546706199646,
0.2450908124446869,
-0.07562640309333801,
-0.04767092689871788,
-0.03891677409410477,
-0.3630060851573944,
-0.1445963829755783,
-0.23970931768417358,
0.07773686200380325,
0.1043151244521141,
-0.15180274844169617,
-0.35135123133659363,
-0.07258260250091553,
0.20515403151512146,
-0.43355807662010193,
-0.3509843945503235,
0.3801634907722473,
-0.5269157290458679,
0.21536272764205933,
-0.011275067925453186,
0.2302863597869873,
-0.14660608768463135,
-0.05114716663956642,
0.24124401807785034,
-0.13532224297523499,
0.584565281867981,
-0.015097703784704208,
0.2876051068305969,
0.2425278276205063,
-0.1871897280216217,
0.3449614644050598,
0.14551538228988647,
0.40864551067352295,
-0.12075316905975342,
-0.28761181235313416,
-0.1421445906162262,
0.060861729085445404,
0.4191892743110657,
-0.4173430800437927,
0.059925273060798645,
0.12409169971942902,
-0.12937882542610168,
-0.3622656464576721,
-0.02280012145638466,
-0.1822197288274765,
0.6107702851295471,
0.2038918435573578,
0.27467072010040283,
-0.3442992568016052,
-0.03146950528025627,
0.01403318252414465,
-0.1764872521162033,
-0.02590334601700306,
0.061943721026182175,
-0.1266942024230957,
-0.14745599031448364,
-0.37687137722969055,
0.1421433687210083,
0.27797362208366394,
-0.06311780214309692,
-0.10725725442171097,
0.06028672680258751,
-0.06589601933956146,
-0.11733411252498627,
-0.02483266592025757,
-0.0824371874332428,
0.2605150640010834,
-0.0006551372352987528,
0.27478519082069397,
0.04437090829014778,
0.2775041162967682,
0.04967859387397766,
0.32784324884414673,
-0.021273769438266754,
-0.022963210940361023,
0.15020796656608582,
-0.1527342051267624,
-0.050904445350170135,
0.4221661388874054,
-0.07401415705680847,
-0.33173927664756775,
-0.07245610654354095,
0.09960572421550751,
-0.04935001581907272,
-0.12617583572864532,
0.3804708421230316,
-0.11763851344585419,
-0.21534603834152222,
-0.2111864984035492,
0.27663716673851013,
0.0844978541135788,
-0.21736951172351837,
0.7108598351478577,
-0.30868852138519287,
-0.18463502824306488,
0.5772397518157959,
0.26320886611938477,
0.9888505935668945,
-0.11659811437129974,
-0.12394127249717712,
-0.19993728399276733,
0.16264870762825012,
-0.23458363115787506,
-0.012388017028570175,
0.008619069121778011,
-0.41830289363861084,
-0.3069949150085449,
0.05401627719402313,
-0.14702165126800537,
0.07809530198574066,
0.36554139852523804,
-0.31542569398880005,
-0.050974950194358826,
-0.054854318499565125,
0.2838294804096222,
0.07263321429491043,
0.055913932621479034,
-0.0889291763305664,
-0.15986251831054688,
0.2236001342535019,
0.1564762443304062,
0.02308228611946106,
0.1648774892091751,
0.10567926615476608,
-0.15112248063087463,
-0.1585780382156372,
-0.38253116607666016,
-0.49603599309921265,
0.10498461872339249,
-0.3940770626068115,
0.4869369864463806,
-0.27626922726631165,
-0.06644412130117416,
0.14719928801059723,
0.17792698740959167,
-0.048138514161109924,
0.004684515297412872,
-0.19107867777347565,
0.006719797849655151,
0.29265570640563965,
0.23317405581474304,
-0.10663826018571854,
-0.10795429348945618,
0.3104479908943176,
0.11814171820878983,
-0.221888467669487,
-0.06715600937604904,
-0.0803675577044487,
-0.3408154249191284,
-0.08429218083620071,
0.09118276834487915,
-0.10407745838165283,
-0.39002248644828796,
-0.02160128951072693,
-0.0029247403144836426,
-0.25365307927131653,
-0.11551190912723541,
0.12517115473747253,
0.048868659883737564,
0.0009909237269312143,
0.533683717250824,
-1.4901161193847656e-8,
-0.27950915694236755,
0.20597146451473236,
0.5347433686256409,
-0.09280558675527573,
0.055708348751068115,
0.21596181392669678,
-0.07014234364032745,
-0.2627670466899872,
-0.15239568054676056,
0.11995721608400345,
-0.07966215908527374,
-0.43367794156074524,
0.2915783226490021,
-0.2874268591403961,
0.12284572422504425,
-0.08227057754993439,
0.1776765137910843,
-0.05782625079154968,
0.3978552520275116,
-0.11705787479877472,
-0.2482403814792633,
-0.12046743184328079,
0.3353891968727112,
-0.09036277234554291,
0.3539816439151764,
-0.30350688099861145,
0.21286915242671967,
0.08485332876443863,
0.25353458523750305,
-0.3147438168525696,
0.3085741698741913,
0.01293540932238102,
0.1940283477306366,
0.11562611907720566,
0.10639964044094086,
0.19456811249256134,
-0.13897846639156342,
-0.007617798633873463,
0.3988800644874573,
-0.2861616611480713,
-0.1296081393957138,
-0.17104950547218323,
0.1767878234386444,
0.11400894820690155,
-0.0024911118671298027,
-0.18581679463386536,
-0.18593928217887878,
-0.037751004099845886,
-0.2654925286769867,
0.0323101207613945,
0.42828497290611267,
-0.15505734086036682,
0.3212943971157074,
0.367037832736969,
-0.05489169806241989,
0.05482415109872818,
-0.1675422191619873,
-0.3461153507232666,
0.25489068031311035,
-0.09828793257474899,
0.10332529246807098,
0.22888606786727905,
0.046568647027015686,
-0.2676333785057068,
-0.0819690153002739,
0.0026134252548217773,
0.21153002977371216,
0.35275912284851074,
-0.049873560667037964,
-0.0016831271350383759,
0.1666465401649475,
0.20154054462909698,
0.13909417390823364,
-0.4308805465698242,
-0.290314257144928,
0.0545571930706501,
0.1389114260673523,
-0.15159913897514343,
0.09222499281167984,
0.2430422157049179,
0.051714129745960236,
-0.1334296017885208,
-0.03626742213964462,
0.13526323437690735,
-0.1150088682770729,
-0.21258001029491425,
0.07475124299526215,
0.31536078453063965,
-0.37793833017349243,
0.023435361683368683,
0.29101189970970154,
-0.19767358899116516,
0.16904857754707336,
0.16952650249004364,
-0.27649417519569397,
0.339667409658432,
0.3270573019981384,
-0.1989212930202484,
0.26389673352241516,
0.2930442988872528,
0.2304968237876892,
-0.08028130978345871,
-0.27365991473197937,
0.2605336010456085,
0.12941810488700867,
-0.17435094714164734,
0.17574600875377655,
0.1750079095363617,
0.21651789546012878,
-0.14947764575481415,
-0.1505061239004135,
-0.02013285458087921,
0.5169976949691772,
-0.22125592827796936,
0.10331518948078156,
0.003997817635536194,
-0.1870274841785431,
-0.1888812780380249,
-0.040720775723457336,
-0.19315171241760254,
0.24745889008045197,
0.8917936086654663,
0.3042914867401123,
-0.022268034517765045,
0.11353799700737,
-0.21220242977142334,
-0.14385339617729187,
0.5983157753944397,
-0.269725501537323,
0.10890185832977295,
0.14305360615253448,
-0.11952768266201019,
-0.10701888799667358,
0.40677323937416077,
0.42619675397872925,
0.3830043375492096,
-0.24638119339942932,
0.30473244190216064,
-0.0734027624130249,
-0.02400406450033188,
0.01546398550271988,
0.45321550965309143,
0.08927976340055466,
-0.3043022155761719,
0.16731804609298706,
0.05348144471645355,
-0.062125787138938904,
-0.09226571023464203,
0.07897264510393143,
0.5264683961868286,
0.3674495816230774,
0.3109157085418701,
-0.07438172399997711,
-0.130449116230011,
0.1845829337835312,
-0.10894735902547836,
0.1035849079489708,
-0.2707098126411438,
0.4096686542034149,
-0.05104959383606911,
0.2476179599761963,
-0.20776237547397614,
0.09958106279373169,
0.08100731670856476,
0.3895062804222107,
0.2827892601490021,
-0.21126490831375122,
-0.2590271234512329,
0.029828377068042755,
-0.3320554494857788,
0.2983449399471283,
0.008944481611251831,
0.20919787883758545,
-0.05075826868414879,
0.042146772146224976,
0.1251416951417923,
0.28776729106903076,
0.17965911328792572,
-0.09170122444629669,
-0.15443232655525208,
0.5206824541091919,
-0.32314255833625793,
0.09263716638088226,
-0.18139323592185974,
0.2446906566619873,
0.28910768032073975,
-0.3149496614933014,
0.020645227283239365,
-0.15927830338478088,
0.15317854285240173,
-0.30324554443359375,
-0.34437137842178345,
0.13928759098052979,
0.015703413635492325,
0.786186158657074,
0.3057592213153839,
0.13547858595848083,
-0.24038365483283997,
-0.09435441344976425,
-0.09255276620388031,
-0.25842612981796265,
0.014639665372669697,
0.2686886191368103,
0.1853742003440857,
0.17637619376182556,
-0.09618357568979263,
-0.327631413936615,
-0.2656163275241852,
0.0038510069716721773,
-0.32229429483413696,
0.24154949188232422,
-0.2664865255355835,
-0.017583144828677177,
-0.09058430045843124,
-0.17242000997066498,
-0.2782024145126343,
0.2985156774520874,
-0.09669549763202667,
0.25985366106033325,
-0.20902594923973083,
-0.5598651766777039,
0.7307931780815125,
-0.3712477684020996,
-0.2900109589099884,
0.053099438548088074,
0.08779355138540268,
-0.25622883439064026,
-0.013011487200856209,
-0.5115010142326355,
-0.24552473425865173,
0.258634477853775,
0.07692457735538483,
-0.5334775447845459,
-0.10393296182155609,
-0.02625920996069908,
-0.07024697959423065,
-0.10553154349327087,
0.4426819086074829,
0.02708897553384304,
-0.19402246177196503,
-0.008223362267017365,
-0.1669582724571228
] |
https://github.com/huggingface/datasets/issues/5536 | Failure to hash function when using .map() | update: temporarily solved the problem by setting
```
--preprocess_num_workers 1
```
-------------
I have met the same problem, here is my env:
```
datasets 2.14.4
transformers 4.31.0
tiktoken 0.4.0
torch 1.13.1
``` | ### Describe the bug
_Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed._
This issue with `.map()` happens for me consistently, as also described in closed issue #4506
Dataset indices can be individually serialized using dill and pickle without any errors. I'm using tiktoken to encode in the function passed to map(). Similarly, indices can be individually encoded without error.
### Steps to reproduce the bug
```py
from datasets import load_dataset
import tiktoken
dataset = load_dataset("stas/openwebtext-10k")
enc = tiktoken.get_encoding("gpt2")
tokenized = dataset.map(
process,
remove_columns=['text'],
desc="tokenizing the OWT splits",
)
def process(example):
ids = enc.encode(example['text'])
ids.append(enc.eot_token)
out = {'ids': ids, 'len': len(ids)}
return out
```
### Expected behavior
Should encode simple text objects.
### Environment info
Python versions tried: both 3.8 and 3.10.10
`PYTHONUTF8=1` as env variable
Datasets tried:
- stas/openwebtext-10k
- rotten_tomatoes
- local text file
OS: Ubuntu Linux 20.04
Package versions:
- torch 1.13.1
- dill 0.3.4 (if using 0.3.6 - same issue)
- datasets 2.9.0
- tiktoken 0.2.0
| 32 | Failure to hash function when using .map()
### Describe the bug
_Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed._
This issue with `.map()` happens for me consistently, as also described in closed issue #4506
Dataset indices can be individually serialized using dill and pickle without any errors. I'm using tiktoken to encode in the function passed to map(). Similarly, indices can be individually encoded without error.
### Steps to reproduce the bug
```py
from datasets import load_dataset
import tiktoken
dataset = load_dataset("stas/openwebtext-10k")
enc = tiktoken.get_encoding("gpt2")
tokenized = dataset.map(
process,
remove_columns=['text'],
desc="tokenizing the OWT splits",
)
def process(example):
ids = enc.encode(example['text'])
ids.append(enc.eot_token)
out = {'ids': ids, 'len': len(ids)}
return out
```
### Expected behavior
Should encode simple text objects.
### Environment info
Python versions tried: both 3.8 and 3.10.10
`PYTHONUTF8=1` as env variable
Datasets tried:
- stas/openwebtext-10k
- rotten_tomatoes
- local text file
OS: Ubuntu Linux 20.04
Package versions:
- torch 1.13.1
- dill 0.3.4 (if using 0.3.6 - same issue)
- datasets 2.9.0
- tiktoken 0.2.0
update: temporarily solved the problem by setting
```
--preprocess_num_workers 1
```
-------------
I have met the same problem, here is my env:
```
datasets 2.14.4
transformers 4.31.0
tiktoken 0.4.0
torch 1.13.1
``` | [
-0.2792896628379822,
0.06205107271671295,
0.02379767596721649,
0.06021393835544586,
0.3827197551727295,
0.08332618325948715,
0.49643194675445557,
0.40409204363822937,
0.25012820959091187,
0.05256231129169464,
0.11732447147369385,
0.6077716946601868,
-0.24820895493030548,
-0.06989516317844391,
-0.16089771687984467,
0.0898662731051445,
0.016324229538440704,
-0.04555521905422211,
-0.28358662128448486,
-0.14882956445217133,
-0.4230809807777405,
0.11304287612438202,
-0.17731700837612152,
0.32632726430892944,
-0.34157049655914307,
-0.14393235743045807,
0.08587312698364258,
-0.08446157723665237,
0.005670899525284767,
-0.26520541310310364,
-0.07834652066230774,
-0.3642646074295044,
-0.12280935794115067,
0.6041211485862732,
-0.00010889633995248005,
0.06648430228233337,
0.2691744267940521,
-0.181020587682724,
-0.08446939289569855,
-0.45448100566864014,
-0.21750617027282715,
-0.13198481500148773,
-0.029579544439911842,
-0.2701601982116699,
0.16650858521461487,
-0.2964682877063751,
0.21160000562667847,
-0.6124430298805237,
0.31686997413635254,
0.10439141094684601,
0.22702829539775848,
0.03164336830377579,
0.15855956077575684,
0.1830293834209442,
0.40826359391212463,
0.007096745073795319,
-0.29978179931640625,
0.03430618345737457,
0.08438550680875778,
0.03923855721950531,
-0.33359646797180176,
0.32646530866622925,
-0.014432334341108799,
0.06409904360771179,
0.07223448902368546,
0.04928221553564072,
0.25298017263412476,
-0.446451336145401,
0.21137437224388123,
-0.007139481604099274,
0.2059818059206009,
-0.3923683762550354,
-0.44487252831459045,
0.06666678935289383,
-0.2882305383682251,
-0.017361750826239586,
0.3006877303123474,
0.1742980182170868,
0.1028808206319809,
0.12663570046424866,
-0.37152519822120667,
0.16713599860668182,
0.15371957421302795,
0.22410057485103607,
0.26211780309677124,
0.1983223855495453,
0.09905670583248138,
0.3115031123161316,
0.08577153086662292,
-0.21871702373027802,
-0.09480443596839905,
-0.018379248678684235,
0.037320576608181,
0.2574511766433716,
-0.19583536684513092,
-0.019786208868026733,
0.1732833981513977,
-0.43943896889686584,
0.16387450695037842,
0.07210559397935867,
0.09861946851015091,
0.12440995126962662,
-0.007094011642038822,
0.1878492534160614,
0.24861083924770355,
0.2398306280374527,
0.20864304900169373,
0.39564284682273865,
0.197992742061615,
-0.4354989528656006,
-0.17764528095722198,
0.03073493018746376,
0.15057027339935303,
-0.21324805915355682,
0.20193949341773987,
0.17283284664154053,
0.31324058771133423,
0.02045411244034767,
-0.09687991440296173,
0.12084030359983444,
-0.47943612933158875,
-0.14007556438446045,
-0.2137470543384552,
0.1830834001302719,
0.33569660782814026,
-0.07357128709554672,
0.23289822041988373,
-0.002089817076921463,
-0.00949026271700859,
0.18760482966899872,
-0.2679139971733093,
-0.14238078892230988,
-0.29251042008399963,
0.16738992929458618,
0.04644108936190605,
-0.11596877872943878,
0.2032080888748169,
0.03089894726872444,
0.015435528010129929,
-0.0609576478600502,
-0.009529296308755875,
-0.121159628033638,
0.5314422249794006,
0.21063052117824554,
-0.14949224889278412,
0.33033064007759094,
0.13610303401947021,
0.16037942469120026,
-0.07010061293840408,
0.2655889391899109,
-0.3801649212837219,
-0.25749436020851135,
-0.07204577326774597,
0.09828438609838486,
-0.008379795588552952,
0.24753206968307495,
0.10650376975536346,
0.044945865869522095,
0.49372631311416626,
-0.22990870475769043,
0.07703103125095367,
-0.13489122688770294,
-0.29678961634635925,
-0.25710391998291016,
0.006963547319173813,
0.35149699449539185,
0.14234967529773712,
-0.06594804674386978,
0.029891300946474075,
0.17202432453632355,
0.10402732342481613,
0.36669665575027466,
-0.25545433163642883,
-0.004533149302005768,
-0.1727321743965149,
0.4838178753852844,
0.19770139455795288,
0.01020800694823265,
-0.46962061524391174,
0.41012635827064514,
0.004011332988739014,
-0.02606179006397724,
-0.30913516879081726,
-0.09496123343706131,
0.31098511815071106,
-0.3172663152217865,
-0.07667240500450134,
-0.009391432628035545,
0.04098903760313988,
0.23678439855575562,
-0.40885594487190247,
-0.17209038138389587,
0.30519652366638184,
-0.29201722145080566,
0.11286436021327972,
-0.08865175396203995,
0.05765368416905403,
-0.16455069184303284,
0.12828916311264038,
-0.026269521564245224,
0.37476077675819397,
0.022049065679311752,
0.11888600885868073,
-0.28185713291168213,
0.1869155615568161,
-0.1730157732963562,
-0.23386189341545105,
0.14113610982894897,
-0.08770245313644409,
-0.02768860012292862,
-0.30765002965927124,
0.01798032969236374,
0.037663478404283524,
0.047199055552482605,
-0.08077307045459747,
-0.08018115162849426,
0.06864900887012482,
-0.04510096460580826,
-0.18003050982952118,
0.11458763480186462,
-0.27065834403038025,
-0.089575856924057,
-0.032025981694459915,
-0.1860702633857727,
0.11286218464374542,
-0.14870721101760864,
-0.13356193900108337,
-0.33797574043273926,
-0.12305005639791489,
-0.18013328313827515,
0.18868893384933472,
-0.0846380963921547,
-0.4715285003185272,
0.2822241485118866,
-0.14173224568367004,
-0.17618750035762787,
-0.15275147557258606,
0.309459388256073,
0.1175897940993309,
-0.401709645986557,
0.0657709464430809,
0.2813011705875397,
0.10666466504335403,
-0.1524035781621933,
0.07874245941638947,
0.12492633610963821,
0.008944902569055557,
0.05629953369498253,
-0.302839994430542,
0.18946681916713715,
0.07856997102499008,
-0.05954761058092117,
-0.15020838379859924,
-0.25280171632766724,
-0.2803092300891876,
-0.16041064262390137,
0.29789185523986816,
0.11448117345571518,
0.2624254524707794,
0.05514358729124069,
0.7147378921508789,
0.17724457383155823,
0.26171788573265076,
0.30359360575675964,
-0.06344053894281387,
-0.17699769139289856,
-0.07473118603229523,
-0.08165616542100906,
0.23428389430046082,
-0.010470966808497906,
-0.08770182728767395,
0.08562667667865753,
-0.06423366069793701,
0.07422839105129242,
0.1961473673582077,
-0.04608079791069031,
0.28450873494148254,
0.3147629201412201,
0.06308027356863022,
0.10151153057813644,
-0.1236991211771965,
-0.1513524055480957,
0.20208032429218292,
0.3011685013771057,
-0.45923376083374023,
0.010571463033556938,
-0.21424433588981628,
0.3537594676017761,
0.16349217295646667,
-0.1914823204278946,
0.01792893558740616,
-0.30200672149658203,
0.11172159016132355,
0.020630910992622375,
-0.4489186108112335,
0.6726170182228088,
0.1129419207572937,
-0.09832032024860382,
0.26291826367378235,
-0.06904898583889008,
-0.2771337032318115,
-0.3382045030593872,
-0.10354683548212051,
-0.015100168995559216,
0.24800212681293488,
-0.3345784842967987,
0.006139062345027924,
0.06078657507896423,
-0.13298633694648743,
-0.4706684648990631,
-0.05838959291577339,
0.08444236218929291,
-0.3291018009185791,
0.06661887466907501,
-0.013438627123832703,
0.11166262626647949,
-0.43123435974121094,
-0.2523396909236908,
0.2348221093416214,
-0.5775443315505981,
-0.18184521794319153,
0.16165097057819366,
0.04740109667181969,
-0.15504543483257294,
-0.3508542478084564,
-0.40302905440330505,
0.0671912208199501,
-0.30094900727272034,
0.34753817319869995,
-0.3055659830570221,
0.2799089550971985,
0.12943612039089203,
0.14411886036396027,
-0.04313983395695686,
0.15592165291309357,
-0.17598217725753784,
-0.2834259867668152,
-0.20165368914604187,
0.45049116015434265,
-0.13284997642040253,
-0.38418713212013245,
0.06741108000278473,
0.12974640727043152,
-0.27641093730926514,
0.4289776682853699,
-0.1221352219581604,
0.14535526931285858,
-0.1001264676451683,
0.006962478160858154,
-0.03703057020902634,
0.10412265360355377,
0.390653133392334,
0.25429418683052063,
-0.2002355456352234,
-0.3169418275356293,
-0.31794437766075134,
0.27641546726226807,
0.12295607477426529,
0.24141961336135864,
0.24495261907577515,
0.39032888412475586,
0.21349051594734192,
0.7379150986671448,
0.22761815786361694,
-0.45016294717788696,
0.23996801674365997,
-0.07460788637399673,
-0.04964514449238777,
-0.046279408037662506,
-0.3574487566947937,
-0.15108956396579742,
-0.23663729429244995,
0.08624234050512314,
0.09999287873506546,
-0.1423996090888977,
-0.37305691838264465,
-0.08106990158557892,
0.21463890373706818,
-0.42321255803108215,
-0.34865301847457886,
0.36519891023635864,
-0.49979519844055176,
0.2146053910255432,
0.009365737438201904,
0.2035808563232422,
-0.1562967598438263,
-0.07390722632408142,
0.24994105100631714,
-0.14000001549720764,
0.582371711730957,
-0.02574399672448635,
0.30706149339675903,
0.2487322986125946,
-0.17356693744659424,
0.3476097583770752,
0.1395186334848404,
0.3756348192691803,
-0.10525795072317123,
-0.29404759407043457,
-0.1542847454547882,
0.04918766766786575,
0.39821165800094604,
-0.42157602310180664,
0.05701422691345215,
0.12248948216438293,
-0.12519218027591705,
-0.36059507727622986,
-0.008815690875053406,
-0.19837923347949982,
0.5907673239707947,
0.19614292681217194,
0.27677300572395325,
-0.33813512325286865,
-0.04062609747052193,
0.021336782723665237,
-0.1778164952993393,
-0.025599466636776924,
0.059888627380132675,
-0.13504621386528015,
-0.1315859854221344,
-0.36804214119911194,
0.14797906577587128,
0.287878155708313,
-0.08425456285476685,
-0.10915523767471313,
0.04378486052155495,
-0.06726919114589691,
-0.12605395913124084,
-0.038403451442718506,
-0.06006574630737305,
0.26301106810569763,
0.0009619303746148944,
0.27642086148262024,
0.03919502720236778,
0.2729085683822632,
0.033816415816545486,
0.32184725999832153,
-0.016662266105413437,
-0.006973057985305786,
0.14116516709327698,
-0.14138516783714294,
-0.0576736256480217,
0.4168430268764496,
-0.07968965172767639,
-0.3253708481788635,
-0.06009867787361145,
0.10825802385807037,
-0.04756150394678116,
-0.11716397851705551,
0.38295605778694153,
-0.10377510637044907,
-0.1980566680431366,
-0.21554838120937347,
0.29444098472595215,
0.07889696955680847,
-0.2212667167186737,
0.7028278112411499,
-0.2803118824958801,
-0.18118301033973694,
0.5637649297714233,
0.26616907119750977,
0.9623612761497498,
-0.10908465087413788,
-0.12888415157794952,
-0.2031727433204651,
0.15219244360923767,
-0.23374135792255402,
0.005713660269975662,
0.013332292437553406,
-0.4082984924316406,
-0.3007442057132721,
0.059592850506305695,
-0.14568239450454712,
0.09131842851638794,
0.367215633392334,
-0.32528579235076904,
-0.038436926901340485,
-0.047999538481235504,
0.2936420440673828,
0.06758856028318405,
0.05768362432718277,
-0.08812572062015533,
-0.17809940874576569,
0.20382845401763916,
0.18294258415699005,
0.006212703883647919,
0.146973118185997,
0.09862592071294785,
-0.14408336579799652,
-0.13261786103248596,
-0.35675448179244995,
-0.48438113927841187,
0.10505881160497665,
-0.3810652792453766,
0.4855244755744934,
-0.29265180230140686,
-0.030864741653203964,
0.1349952667951584,
0.16268318891525269,
-0.04242797940969467,
0.004502065479755402,
-0.1951444298028946,
0.029745668172836304,
0.3003461956977844,
0.22427326440811157,
-0.1213078498840332,
-0.08946966379880905,
0.3141744136810303,
0.11226966232061386,
-0.24254068732261658,
-0.06525451689958572,
-0.07791335880756378,
-0.3349608778953552,
-0.07279527932405472,
0.08518802374601364,
-0.11770284175872803,
-0.39265739917755127,
-0.02101140096783638,
0.013671688735485077,
-0.26244160532951355,
-0.1150912195444107,
0.1490170955657959,
0.056473564356565475,
-0.004843353293836117,
0.5381250381469727,
0.027542881667613983,
-0.2899218797683716,
0.1962755173444748,
0.5137745141983032,
-0.09180805832147598,
0.062286898493766785,
0.20845262706279755,
-0.07621511071920395,
-0.2661716341972351,
-0.173725426197052,
0.09840769320726395,
-0.08351856470108032,
-0.439707487821579,
0.30653995275497437,
-0.27880167961120605,
0.11053295433521271,
-0.05511854588985443,
0.17050285637378693,
-0.05650448799133301,
0.4013582766056061,
-0.09632154554128647,
-0.23622430860996246,
-0.1244746521115303,
0.32656776905059814,
-0.09764683246612549,
0.36518633365631104,
-0.3026074469089508,
0.19844171404838562,
0.07833699136972427,
0.2382933497428894,
-0.3469749689102173,
0.31430718302726746,
0.009652970358729362,
0.1903623640537262,
0.08373585343360901,
0.09218418598175049,
0.2097337245941162,
-0.13308085501194,
0.01822197623550892,
0.41022324562072754,
-0.2925857901573181,
-0.16247904300689697,
-0.14927372336387634,
0.16469702124595642,
0.0995907187461853,
-0.01362713985145092,
-0.19331791996955872,
-0.1747591346502304,
-0.04096778854727745,
-0.25303229689598083,
0.04066484048962593,
0.40429288148880005,
-0.15921373665332794,
0.31886234879493713,
0.3605361878871918,
-0.09157770127058029,
0.057939670979976654,
-0.18037958443164825,
-0.34263747930526733,
0.24338768422603607,
-0.1070735901594162,
0.1013285219669342,
0.22260048985481262,
0.04201921075582504,
-0.23307813704013824,
-0.06756938248872757,
0.013231836259365082,
0.2160000503063202,
0.3674168884754181,
-0.04434621334075928,
-0.021238308399915695,
0.17204995453357697,
0.21698124706745148,
0.11397893726825714,
-0.4024491608142853,
-0.28697773814201355,
0.044331345707178116,
0.16953180730342865,
-0.16137002408504486,
0.11332453787326813,
0.2375064194202423,
0.06378960609436035,
-0.11625437438488007,
-0.046588294208049774,
0.14572753012180328,
-0.10254596918821335,
-0.19871054589748383,
0.08580711483955383,
0.3201598823070526,
-0.37454456090927124,
0.01160205714404583,
0.27203842997550964,
-0.1885583996772766,
0.16011030972003937,
0.18057523667812347,
-0.2688794732093811,
0.3665269911289215,
0.31499218940734863,
-0.20497912168502808,
0.27319079637527466,
0.29553836584091187,
0.23523595929145813,
-0.09397847205400467,
-0.27012479305267334,
0.26191845536231995,
0.1385016143321991,
-0.1759493052959442,
0.17022456228733063,
0.1888437271118164,
0.216101735830307,
-0.14634647965431213,
-0.15492574870586395,
-0.04193461686372757,
0.5166550278663635,
-0.2156643271446228,
0.10210603475570679,
0.0016633197665214539,
-0.18358930945396423,
-0.19232037663459778,
-0.04790028929710388,
-0.1773385852575302,
0.24496261775493622,
0.8807259798049927,
0.30622267723083496,
0.007299177348613739,
0.1109195351600647,
-0.20626488327980042,
-0.13483113050460815,
0.5976921916007996,
-0.2621082067489624,
0.10522627085447311,
0.15000051259994507,
-0.12382571399211884,
-0.09234079718589783,
0.41231298446655273,
0.4027070701122284,
0.3519091010093689,
-0.24519580602645874,
0.32563158869743347,
-0.0787602961063385,
-0.03326963260769844,
0.020501505583524704,
0.447877436876297,
0.09444224834442139,
-0.28762486577033997,
0.1678481101989746,
0.08111058920621872,
-0.07491938024759293,
-0.09844960272312164,
0.07186871021986008,
0.5429784655570984,
0.36193332076072693,
0.2970285713672638,
-0.07115081697702408,
-0.1322275698184967,
0.15780487656593323,
-0.11408215016126633,
0.11067498475313187,
-0.2747194170951843,
0.4042600393295288,
-0.08263102918863297,
0.24022912979125977,
-0.19802027940750122,
0.11398172378540039,
0.07981571555137634,
0.4130673408508301,
0.27556052803993225,
-0.20960891246795654,
-0.25177764892578125,
0.011852540075778961,
-0.3321635127067566,
0.2865178883075714,
0.003136076033115387,
0.22157800197601318,
-0.05873876065015793,
0.05343028903007507,
0.11827446520328522,
0.28057393431663513,
0.17569077014923096,
-0.09264788031578064,
-0.16386258602142334,
0.49067890644073486,
-0.3347916305065155,
0.08713287860155106,
-0.16007213294506073,
0.23211455345153809,
0.292389839887619,
-0.30157890915870667,
-0.0030316226184368134,
-0.1533670723438263,
0.17595970630645752,
-0.29188376665115356,
-0.3474545180797577,
0.1404338777065277,
0.00012460723519325256,
0.7782291769981384,
0.2937084436416626,
0.12261392176151276,
-0.23804974555969238,
-0.09256363660097122,
-0.08460824191570282,
-0.28647008538246155,
0.00194622203707695,
0.25814419984817505,
0.1778382509946823,
0.18043732643127441,
-0.0751575380563736,
-0.3061896860599518,
-0.2593230903148651,
0.0009526384528726339,
-0.31038588285446167,
0.2231786996126175,
-0.2939608097076416,
-0.028414703905582428,
-0.08230595290660858,
-0.18077264726161957,
-0.28263136744499207,
0.28873199224472046,
-0.09424898028373718,
0.2609633207321167,
-0.1877354383468628,
-0.5564242601394653,
0.73199862241745,
-0.3631497621536255,
-0.28655722737312317,
0.07025983929634094,
0.09279748797416687,
-0.26227661967277527,
-0.026746300980448723,
-0.5045552253723145,
-0.2218610644340515,
0.25179383158683777,
0.08704270422458649,
-0.5250051021575928,
-0.10760881006717682,
-0.037658657878637314,
-0.06330898404121399,
-0.10554943978786469,
0.4236631691455841,
0.036686841398477554,
-0.19044363498687744,
-0.015962963923811913,
-0.1572788506746292
] |
https://github.com/huggingface/datasets/issues/5536 | Failure to hash function when using .map() | @mengban I cannot reproduce the issue even with these versions installed. It would help if you could provide info about your system and the `pip list` output. | ### Describe the bug
_Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed._
This issue with `.map()` happens for me consistently, as also described in closed issue #4506
Dataset indices can be individually serialized using dill and pickle without any errors. I'm using tiktoken to encode in the function passed to map(). Similarly, indices can be individually encoded without error.
### Steps to reproduce the bug
```py
from datasets import load_dataset
import tiktoken
dataset = load_dataset("stas/openwebtext-10k")
enc = tiktoken.get_encoding("gpt2")
tokenized = dataset.map(
process,
remove_columns=['text'],
desc="tokenizing the OWT splits",
)
def process(example):
ids = enc.encode(example['text'])
ids.append(enc.eot_token)
out = {'ids': ids, 'len': len(ids)}
return out
```
### Expected behavior
Should encode simple text objects.
### Environment info
Python versions tried: both 3.8 and 3.10.10
`PYTHONUTF8=1` as env variable
Datasets tried:
- stas/openwebtext-10k
- rotten_tomatoes
- local text file
OS: Ubuntu Linux 20.04
Package versions:
- torch 1.13.1
- dill 0.3.4 (if using 0.3.6 - same issue)
- datasets 2.9.0
- tiktoken 0.2.0
| 27 | Failure to hash function when using .map()
### Describe the bug
_Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed._
This issue with `.map()` happens for me consistently, as also described in closed issue #4506
Dataset indices can be individually serialized using dill and pickle without any errors. I'm using tiktoken to encode in the function passed to map(). Similarly, indices can be individually encoded without error.
### Steps to reproduce the bug
```py
from datasets import load_dataset
import tiktoken
dataset = load_dataset("stas/openwebtext-10k")
enc = tiktoken.get_encoding("gpt2")
tokenized = dataset.map(
process,
remove_columns=['text'],
desc="tokenizing the OWT splits",
)
def process(example):
ids = enc.encode(example['text'])
ids.append(enc.eot_token)
out = {'ids': ids, 'len': len(ids)}
return out
```
### Expected behavior
Should encode simple text objects.
### Environment info
Python versions tried: both 3.8 and 3.10.10
`PYTHONUTF8=1` as env variable
Datasets tried:
- stas/openwebtext-10k
- rotten_tomatoes
- local text file
OS: Ubuntu Linux 20.04
Package versions:
- torch 1.13.1
- dill 0.3.4 (if using 0.3.6 - same issue)
- datasets 2.9.0
- tiktoken 0.2.0
@mengban I cannot reproduce the issue even with these versions installed. It would help if you could provide info about your system and the `pip list` output. | [
-0.2688886821269989,
0.04557964205741882,
0.023118413984775543,
0.06588529795408249,
0.38799339532852173,
0.08951503783464432,
0.5108284950256348,
0.3961569368839264,
0.2477157711982727,
0.05667120963335037,
0.11045648902654648,
0.6107147932052612,
-0.2555908262729645,
-0.08592642843723297,
-0.15446865558624268,
0.09003917872905731,
0.019114121794700623,
-0.05661708116531372,
-0.28266599774360657,
-0.15512970089912415,
-0.4168316125869751,
0.10793721675872803,
-0.17308034002780914,
0.3296276926994324,
-0.3503023087978363,
-0.15112800896167755,
0.0876917913556099,
-0.07984834164381027,
0.0017802044749259949,
-0.2594296634197235,
-0.08367384970188141,
-0.36397218704223633,
-0.11995446681976318,
0.613192081451416,
-0.0001097565982490778,
0.07015396654605865,
0.25881385803222656,
-0.18543069064617157,
-0.0771569013595581,
-0.4609082341194153,
-0.19557133316993713,
-0.13250505924224854,
-0.032782331109046936,
-0.27935072779655457,
0.16948428750038147,
-0.2959984540939331,
0.20677940547466278,
-0.6079224944114685,
0.3242363929748535,
0.10680808871984482,
0.22035406529903412,
0.019327621906995773,
0.15844465792179108,
0.19741567969322205,
0.40559518337249756,
0.006587393581867218,
-0.29768797755241394,
0.03835266828536987,
0.08289414644241333,
0.05296884477138519,
-0.329143762588501,
0.32186153531074524,
-0.020886071026325226,
0.052450522780418396,
0.07128004729747772,
0.05259688198566437,
0.24786141514778137,
-0.45994943380355835,
0.20690351724624634,
-0.015229426324367523,
0.20491325855255127,
-0.3996364176273346,
-0.44220101833343506,
0.06873378902673721,
-0.2829549312591553,
-0.020417505875229836,
0.29270872473716736,
0.16848427057266235,
0.09546554088592529,
0.12350310385227203,
-0.3773760497570038,
0.15324386954307556,
0.14681042730808258,
0.22193944454193115,
0.2772042453289032,
0.2050093412399292,
0.10154186189174652,
0.3201598823070526,
0.07894504815340042,
-0.20634078979492188,
-0.09074054658412933,
-0.01547330617904663,
0.05390547960996628,
0.25804129242897034,
-0.19840364158153534,
-0.0230969600379467,
0.16761799156665802,
-0.4490833580493927,
0.16080313920974731,
0.07786247134208679,
0.09389451146125793,
0.11522859334945679,
-0.008156080730259418,
0.17885085940361023,
0.23595063388347626,
0.24636609852313995,
0.198043555021286,
0.4019710421562195,
0.19320440292358398,
-0.4428809583187103,
-0.1755298674106598,
0.03595757856965065,
0.13817664980888367,
-0.207657590508461,
0.20438465476036072,
0.1777392327785492,
0.33257389068603516,
0.01571936532855034,
-0.0976271703839302,
0.13163046538829803,
-0.49238237738609314,
-0.14763346314430237,
-0.22665999829769135,
0.18791013956069946,
0.32656338810920715,
-0.0780390277504921,
0.23729370534420013,
0.0007044598460197449,
-0.00752963125705719,
0.18708394467830658,
-0.26308125257492065,
-0.1285322904586792,
-0.28586655855178833,
0.16392889618873596,
0.034819018095731735,
-0.13099928200244904,
0.20035164058208466,
0.03557159751653671,
0.012693718075752258,
-0.0609777569770813,
-0.009755421429872513,
-0.1267557144165039,
0.5320902466773987,
0.2057017683982849,
-0.1569863110780716,
0.33160579204559326,
0.14635694026947021,
0.15957848727703094,
-0.0712444931268692,
0.2691957950592041,
-0.3990083932876587,
-0.2606505751609802,
-0.07876238971948624,
0.09109360724687576,
-0.0029433052986860275,
0.25185513496398926,
0.10565517842769623,
0.050234392285346985,
0.500243604183197,
-0.2258002758026123,
0.08409945666790009,
-0.12978734076023102,
-0.2989739179611206,
-0.2640991508960724,
0.011500133201479912,
0.35633426904678345,
0.1347685307264328,
-0.0687517449259758,
0.0421060249209404,
0.17874449491500854,
0.11972227692604065,
0.3732669949531555,
-0.25061917304992676,
0.009227856993675232,
-0.17068903148174286,
0.49267280101776123,
0.20637843012809753,
0.004936195909976959,
-0.4727453887462616,
0.40178555250167847,
-0.004085935652256012,
-0.018033962696790695,
-0.29041698575019836,
-0.09867149591445923,
0.31845563650131226,
-0.3179362416267395,
-0.06759689748287201,
-0.015558123588562012,
0.039513688534498215,
0.22649234533309937,
-0.41296815872192383,
-0.18015341460704803,
0.31177669763565063,
-0.30325114727020264,
0.11231555044651031,
-0.0824287161231041,
0.06625892221927643,
-0.15659381449222565,
0.13069230318069458,
-0.025297295302152634,
0.36260131001472473,
0.02203938737511635,
0.11401818692684174,
-0.27618408203125,
0.18230710923671722,
-0.16420409083366394,
-0.23720988631248474,
0.13668593764305115,
-0.07978515326976776,
-0.019124537706375122,
-0.30901777744293213,
0.012119628489017487,
0.03794519975781441,
0.04376571625471115,
-0.07851181924343109,
-0.08883905410766602,
0.062389783561229706,
-0.03580638766288757,
-0.1780150681734085,
0.11183817684650421,
-0.26600536704063416,
-0.08904869109392166,
-0.037525810301303864,
-0.1882588416337967,
0.10300153493881226,
-0.14501313865184784,
-0.139426127076149,
-0.3364529609680176,
-0.12620338797569275,
-0.17351427674293518,
0.19917723536491394,
-0.0937560498714447,
-0.4747374355792999,
0.27833864092826843,
-0.13632676005363464,
-0.1775963455438614,
-0.1543886959552765,
0.31547078490257263,
0.11550098657608032,
-0.4012843072414398,
0.06688068807125092,
0.28597813844680786,
0.11064635217189789,
-0.14312249422073364,
0.08571603894233704,
0.11805935949087143,
0.023164888843894005,
0.05351769179105759,
-0.31145089864730835,
0.18851135671138763,
0.06994695961475372,
-0.05760888010263443,
-0.1493816077709198,
-0.2446015328168869,
-0.27644866704940796,
-0.15617336332798004,
0.3098117709159851,
0.11908981204032898,
0.2559022009372711,
0.05646437406539917,
0.7184545993804932,
0.16693082451820374,
0.260222852230072,
0.30914124846458435,
-0.052110858261585236,
-0.17379561066627502,
-0.07525131106376648,
-0.09084995090961456,
0.23580311238765717,
-0.013247336260974407,
-0.0960543155670166,
0.08423355221748352,
-0.059218622744083405,
0.08175342530012131,
0.19614028930664062,
-0.04410741478204727,
0.2879718840122223,
0.3245861828327179,
0.05639955401420593,
0.12049679458141327,
-0.11481647193431854,
-0.16452765464782715,
0.19375450909137726,
0.3102441132068634,
-0.47236645221710205,
0.012320073321461678,
-0.2149219661951065,
0.36408036947250366,
0.15964998304843903,
-0.18572703003883362,
0.021113771945238113,
-0.29174283146858215,
0.10292595624923706,
0.01096830889582634,
-0.43880003690719604,
0.6723371148109436,
0.11786217987537384,
-0.09417454898357391,
0.27059441804885864,
-0.0667915940284729,
-0.285258948802948,
-0.32326650619506836,
-0.1088031753897667,
-0.024706916883587837,
0.251565158367157,
-0.33400383591651917,
0.011300962418317795,
0.059896014630794525,
-0.1438014656305313,
-0.4715965688228607,
-0.05905693396925926,
0.08116132766008377,
-0.3330467939376831,
0.07268920540809631,
-0.013828203082084656,
0.10996958613395691,
-0.43103301525115967,
-0.26274123787879944,
0.2248915731906891,
-0.574499785900116,
-0.19180963933467865,
0.1530909240245819,
0.04736663028597832,
-0.14607729017734528,
-0.34418681263923645,
-0.41530898213386536,
0.0625012144446373,
-0.30383536219596863,
0.3426856994628906,
-0.3060329258441925,
0.2869376540184021,
0.13172368705272675,
0.1419631391763687,
-0.03452693670988083,
0.16901838779449463,
-0.1639946550130844,
-0.28064262866973877,
-0.20662887394428253,
0.4519006609916687,
-0.13104890286922455,
-0.3874964416027069,
0.060587409883737564,
0.12460722029209137,
-0.27660179138183594,
0.4274412989616394,
-0.12703686952590942,
0.1460084617137909,
-0.09167658537626266,
0.00481361523270607,
-0.056274957954883575,
0.10721737146377563,
0.39642271399497986,
0.2566041648387909,
-0.1922670304775238,
-0.31029635667800903,
-0.3187791109085083,
0.2691971957683563,
0.1164625808596611,
0.24183723330497742,
0.24825450778007507,
0.4030427932739258,
0.21645328402519226,
0.7501887679100037,
0.23155105113983154,
-0.4444485008716583,
0.23904995620250702,
-0.07183170318603516,
-0.05472920462489128,
-0.03875310719013214,
-0.3640541732311249,
-0.14965999126434326,
-0.23491209745407104,
0.08036766946315765,
0.10315362364053726,
-0.14841419458389282,
-0.36431562900543213,
-0.07731135189533234,
0.20910033583641052,
-0.43700677156448364,
-0.34245142340660095,
0.37073734402656555,
-0.5050193667411804,
0.21365493535995483,
-0.002859096974134445,
0.20126917958259583,
-0.15400344133377075,
-0.059525422751903534,
0.2480548918247223,
-0.13111020624637604,
0.5796167850494385,
-0.026047443971037865,
0.30151912569999695,
0.24916031956672668,
-0.1814488172531128,
0.35220491886138916,
0.1379614621400833,
0.3835577964782715,
-0.11331886053085327,
-0.2908656597137451,
-0.14703001081943512,
0.04584328085184097,
0.40720218420028687,
-0.41915974020957947,
0.05971279740333557,
0.12492203712463379,
-0.12566399574279785,
-0.3604334592819214,
-0.014089195057749748,
-0.1968526691198349,
0.5862385034561157,
0.20285695791244507,
0.2797771096229553,
-0.3424473702907562,
-0.04566379263997078,
0.030681412667036057,
-0.18271128833293915,
-0.025719482451677322,
0.05917307361960411,
-0.14048649370670319,
-0.14167919754981995,
-0.37759697437286377,
0.15463796257972717,
0.28346508741378784,
-0.07643791288137436,
-0.11361900717020035,
0.047141481190919876,
-0.05900419503450394,
-0.1269330382347107,
-0.03210364282131195,
-0.07199008762836456,
0.25737398862838745,
0.006172449793666601,
0.27029159665107727,
0.03116479702293873,
0.2745586335659027,
0.03303959593176842,
0.3214341402053833,
-0.01830621436238289,
-0.01042579859495163,
0.1464475393295288,
-0.13804461061954498,
-0.05237353593111038,
0.41822171211242676,
-0.07674197107553482,
-0.3227989375591278,
-0.06391727179288864,
0.12091064453125,
-0.03882351145148277,
-0.11964916437864304,
0.3856479525566101,
-0.10257868468761444,
-0.20592935383319855,
-0.2132902890443802,
0.28906530141830444,
0.08205436170101166,
-0.2169915735721588,
0.706314206123352,
-0.2919212579727173,
-0.1816646009683609,
0.5671279430389404,
0.2721807658672333,
0.9859330058097839,
-0.1086706817150116,
-0.1271314173936844,
-0.19733873009681702,
0.15342403948307037,
-0.22867977619171143,
-0.0106298066675663,
0.0015487316995859146,
-0.4090714454650879,
-0.302824467420578,
0.05635920166969299,
-0.1406313180923462,
0.09624668210744858,
0.36233288049697876,
-0.3295324742794037,
-0.04256969317793846,
-0.05743376165628433,
0.2829417586326599,
0.07300854474306107,
0.06074783205986023,
-0.088880755007267,
-0.16447100043296814,
0.20219163596630096,
0.17238542437553406,
0.00542299821972847,
0.15616491436958313,
0.0995357558131218,
-0.14328670501708984,
-0.14661045372486115,
-0.3693165183067322,
-0.48392999172210693,
0.10188456624746323,
-0.3840578496456146,
0.48500072956085205,
-0.28939929604530334,
-0.04240581765770912,
0.13555186986923218,
0.16499273478984833,
-0.04354575276374817,
0.006270807236433029,
-0.19277827441692352,
0.010423405095934868,
0.29214033484458923,
0.22218573093414307,
-0.11613640189170837,
-0.10143306106328964,
0.31695815920829773,
0.1125609502196312,
-0.23843812942504883,
-0.061005689203739166,
-0.0764184221625328,
-0.34015172719955444,
-0.07087820768356323,
0.084001824259758,
-0.1003444492816925,
-0.39997950196266174,
-0.02324555069208145,
0.01023814082145691,
-0.2679654657840729,
-0.11455030739307404,
0.1418735235929489,
0.05141393840312958,
-0.012057538144290447,
0.5360251665115356,
0.0254515390843153,
-0.2931409478187561,
0.19911478459835052,
0.5140896439552307,
-0.08309765160083771,
0.06506025791168213,
0.21060332655906677,
-0.08209925889968872,
-0.2645549774169922,
-0.169234961271286,
0.10224848240613937,
-0.0745948776602745,
-0.43866631388664246,
0.3025316298007965,
-0.2811127305030823,
0.11868400871753693,
-0.0708494484424591,
0.1740311086177826,
-0.04479701817035675,
0.41279739141464233,
-0.10445451736450195,
-0.2448192536830902,
-0.12230969965457916,
0.33286792039871216,
-0.09795236587524414,
0.36609306931495667,
-0.299251914024353,
0.2073563188314438,
0.08339735865592957,
0.25073176622390747,
-0.33857905864715576,
0.31303441524505615,
-0.002671966329216957,
0.18942292034626007,
0.10320757329463959,
0.09266342222690582,
0.20048631727695465,
-0.13206519186496735,
0.013592908158898354,
0.40522533655166626,
-0.2946697175502777,
-0.15431860089302063,
-0.15606537461280823,
0.16745489835739136,
0.10036811977624893,
-0.011860271915793419,
-0.19018442928791046,
-0.18071378767490387,
-0.04067426547408104,
-0.24930068850517273,
0.037220489233732224,
0.4146629273891449,
-0.15047916769981384,
0.31754544377326965,
0.36509382724761963,
-0.08339745551347733,
0.04670076072216034,
-0.17740921676158905,
-0.35065722465515137,
0.24525432288646698,
-0.09842302650213242,
0.10487864911556244,
0.22731353342533112,
0.03889719396829605,
-0.25070473551750183,
-0.07029706984758377,
0.020943783223628998,
0.2139008343219757,
0.3597889542579651,
-0.04494863003492355,
-0.019298190250992775,
0.1688467264175415,
0.20461015403270721,
0.1158934161067009,
-0.41893184185028076,
-0.2886985242366791,
0.046880923211574554,
0.15962201356887817,
-0.16283060610294342,
0.10678271949291229,
0.2377297431230545,
0.051136478781700134,
-0.12648098170757294,
-0.0353197380900383,
0.14111976325511932,
-0.09751184284687042,
-0.200017049908638,
0.08762147277593613,
0.3161175549030304,
-0.37098705768585205,
0.018673377111554146,
0.2736568748950958,
-0.19621829688549042,
0.16642484068870544,
0.181573286652565,
-0.2707042098045349,
0.3560176491737366,
0.30704885721206665,
-0.20044851303100586,
0.27815333008766174,
0.28523027896881104,
0.24297773838043213,
-0.08948265761137009,
-0.27433618903160095,
0.27761030197143555,
0.14069421589374542,
-0.18376237154006958,
0.1693057417869568,
0.1850346028804779,
0.21383801102638245,
-0.13361243903636932,
-0.15578539669513702,
-0.027584398165345192,
0.5214580297470093,
-0.21998673677444458,
0.10489201545715332,
0.0023371800780296326,
-0.18024024367332458,
-0.19210663437843323,
-0.04718806594610214,
-0.18082305788993835,
0.24131540954113007,
0.8859692811965942,
0.3059208393096924,
-0.008768461644649506,
0.12515410780906677,
-0.20971041917800903,
-0.13514584302902222,
0.59880530834198,
-0.26355552673339844,
0.10369345545768738,
0.1469595730304718,
-0.12013441324234009,
-0.10686750710010529,
0.41748932003974915,
0.4116009771823883,
0.36090588569641113,
-0.2381596863269806,
0.31791213154792786,
-0.05940868332982063,
-0.035106413066387177,
0.021149519830942154,
0.44570496678352356,
0.09508607536554337,
-0.28872931003570557,
0.16382378339767456,
0.07569726556539536,
-0.07670328766107559,
-0.09805989265441895,
0.07803818583488464,
0.5330598950386047,
0.3596821129322052,
0.2995424270629883,
-0.0654817447066307,
-0.14046728610992432,
0.16507074236869812,
-0.10485678166151047,
0.09791211038827896,
-0.26858773827552795,
0.4077586829662323,
-0.07657845318317413,
0.24289947748184204,
-0.2018783986568451,
0.10997040569782257,
0.08196359872817993,
0.4017229676246643,
0.27787187695503235,
-0.20648208260536194,
-0.25858592987060547,
0.015084989368915558,
-0.3322463631629944,
0.2896062135696411,
0.012736201286315918,
0.21149952709674835,
-0.05559346079826355,
0.051696933805942535,
0.11339525133371353,
0.2925076484680176,
0.1779811680316925,
-0.09528166800737381,
-0.15863832831382751,
0.5063270330429077,
-0.3291569650173187,
0.09608787298202515,
-0.16770881414413452,
0.24301281571388245,
0.29190945625305176,
-0.30789992213249207,
0.007219687104225159,
-0.14929567277431488,
0.16817548871040344,
-0.29943132400512695,
-0.34644123911857605,
0.14611703157424927,
0.01056155189871788,
0.7844631671905518,
0.2972213327884674,
0.12864945828914642,
-0.2436971366405487,
-0.09045714884996414,
-0.0766824334859848,
-0.2693369686603546,
0.0030417805537581444,
0.2625091075897217,
0.18735116720199585,
0.1784764677286148,
-0.08042115718126297,
-0.3186274468898773,
-0.26025861501693726,
0.008483421057462692,
-0.3107494115829468,
0.23162321746349335,
-0.2852945923805237,
-0.021886728703975677,
-0.08033272624015808,
-0.18438005447387695,
-0.2830861806869507,
0.2883205711841583,
-0.08939574658870697,
0.25790074467658997,
-0.2033979594707489,
-0.5549542903900146,
0.7396804690361023,
-0.3621402084827423,
-0.28928735852241516,
0.05645937845110893,
0.1050211638212204,
-0.2625196874141693,
-0.02170548401772976,
-0.508389413356781,
-0.23007577657699585,
0.2587220072746277,
0.08800625801086426,
-0.5276178121566772,
-0.09298010170459747,
-0.037124957889318466,
-0.06232361122965813,
-0.1029299944639206,
0.4276920258998871,
0.025355221703648567,
-0.18641726672649384,
-0.014520647004246712,
-0.1729547530412674
] |
https://github.com/huggingface/datasets/issues/5536 | Failure to hash function when using .map() | @mariosasko Please take a look at this
```python
from typing import Any
from datasets import Dataset
import tiktoken
dataset = Dataset.from_list([{"n": str(i)} for i in range(20)])
enc = tiktoken.get_encoding("gpt2")
class A:
tokenizer = enc #tiktoken.get_encoding("gpt2")
def __call__(self, example) -> Any:
ids = self.tokenizer.encode(example["n"])
example["len"] = len(ids)
return example
a = A()
def process(example):
ids = a.tokenizer.encode(example["n"])
example["len"] = len(ids)
return example
# success
tokenized = dataset.map(process, desc="tiktoken", num_proc=2)
# raise TypeError: cannot pickle 'builtins.CoreBPE' object
tokenized = dataset.map(a, desc="tiktoken", num_proc=2)
```
pip list
```
datasets 2.14.4
tiktoken 0.4.0
``` | ### Describe the bug
_Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed._
This issue with `.map()` happens for me consistently, as also described in closed issue #4506
Dataset indices can be individually serialized using dill and pickle without any errors. I'm using tiktoken to encode in the function passed to map(). Similarly, indices can be individually encoded without error.
### Steps to reproduce the bug
```py
from datasets import load_dataset
import tiktoken
dataset = load_dataset("stas/openwebtext-10k")
enc = tiktoken.get_encoding("gpt2")
tokenized = dataset.map(
process,
remove_columns=['text'],
desc="tokenizing the OWT splits",
)
def process(example):
ids = enc.encode(example['text'])
ids.append(enc.eot_token)
out = {'ids': ids, 'len': len(ids)}
return out
```
### Expected behavior
Should encode simple text objects.
### Environment info
Python versions tried: both 3.8 and 3.10.10
`PYTHONUTF8=1` as env variable
Datasets tried:
- stas/openwebtext-10k
- rotten_tomatoes
- local text file
OS: Ubuntu Linux 20.04
Package versions:
- torch 1.13.1
- dill 0.3.4 (if using 0.3.6 - same issue)
- datasets 2.9.0
- tiktoken 0.2.0
| 89 | Failure to hash function when using .map()
### Describe the bug
_Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed._
This issue with `.map()` happens for me consistently, as also described in closed issue #4506
Dataset indices can be individually serialized using dill and pickle without any errors. I'm using tiktoken to encode in the function passed to map(). Similarly, indices can be individually encoded without error.
### Steps to reproduce the bug
```py
from datasets import load_dataset
import tiktoken
dataset = load_dataset("stas/openwebtext-10k")
enc = tiktoken.get_encoding("gpt2")
tokenized = dataset.map(
process,
remove_columns=['text'],
desc="tokenizing the OWT splits",
)
def process(example):
ids = enc.encode(example['text'])
ids.append(enc.eot_token)
out = {'ids': ids, 'len': len(ids)}
return out
```
### Expected behavior
Should encode simple text objects.
### Environment info
Python versions tried: both 3.8 and 3.10.10
`PYTHONUTF8=1` as env variable
Datasets tried:
- stas/openwebtext-10k
- rotten_tomatoes
- local text file
OS: Ubuntu Linux 20.04
Package versions:
- torch 1.13.1
- dill 0.3.4 (if using 0.3.6 - same issue)
- datasets 2.9.0
- tiktoken 0.2.0
@mariosasko Please take a look at this
```python
from typing import Any
from datasets import Dataset
import tiktoken
dataset = Dataset.from_list([{"n": str(i)} for i in range(20)])
enc = tiktoken.get_encoding("gpt2")
class A:
tokenizer = enc #tiktoken.get_encoding("gpt2")
def __call__(self, example) -> Any:
ids = self.tokenizer.encode(example["n"])
example["len"] = len(ids)
return example
a = A()
def process(example):
ids = a.tokenizer.encode(example["n"])
example["len"] = len(ids)
return example
# success
tokenized = dataset.map(process, desc="tiktoken", num_proc=2)
# raise TypeError: cannot pickle 'builtins.CoreBPE' object
tokenized = dataset.map(a, desc="tiktoken", num_proc=2)
```
pip list
```
datasets 2.14.4
tiktoken 0.4.0
``` | [
-0.2770145833492279,
0.05305543541908264,
0.020683731883764267,
0.06691960990428925,
0.3787440061569214,
0.09213656932115555,
0.5072981119155884,
0.40100032091140747,
0.2541043758392334,
0.05765489116311073,
0.10708295553922653,
0.604475736618042,
-0.25667130947113037,
-0.08517006039619446,
-0.15949280560016632,
0.09107951819896698,
0.01941961795091629,
-0.04846931993961334,
-0.2860177457332611,
-0.15501637756824493,
-0.42168039083480835,
0.10732188820838928,
-0.17270714044570923,
0.32928356528282166,
-0.34868916869163513,
-0.14690719544887543,
0.08686847984790802,
-0.0778120681643486,
0.002229752019047737,
-0.26484769582748413,
-0.0860806480050087,
-0.3651481866836548,
-0.11982212960720062,
0.6155363917350769,
-0.00010936430771835148,
0.06805786490440369,
0.26045316457748413,
-0.181920126080513,
-0.08122408390045166,
-0.4509003758430481,
-0.20858824253082275,
-0.13274765014648438,
-0.032832108438014984,
-0.27797701954841614,
0.1728706657886505,
-0.2984697222709656,
0.20889988541603088,
-0.6128364205360413,
0.3254427909851074,
0.1089516133069992,
0.22309741377830505,
0.0251733660697937,
0.15680401027202606,
0.18915000557899475,
0.4069134294986725,
0.008562199771404266,
-0.29752862453460693,
0.0364496111869812,
0.07765859365463257,
0.048984408378601074,
-0.32440486550331116,
0.327623575925827,
-0.020348690450191498,
0.05722244456410408,
0.06740610301494598,
0.052731771022081375,
0.24406671524047852,
-0.4535546898841858,
0.20703566074371338,
-0.013037070631980896,
0.19582736492156982,
-0.39664196968078613,
-0.4440135061740875,
0.06778959184885025,
-0.2846841514110565,
-0.019021078944206238,
0.28987738490104675,
0.17128995060920715,
0.0939965546131134,
0.12300290167331696,
-0.3784354329109192,
0.15406262874603271,
0.1456511914730072,
0.2189520001411438,
0.27608177065849304,
0.21016472578048706,
0.09977100044488907,
0.31822019815444946,
0.08126799017190933,
-0.20544348657131195,
-0.09069694578647614,
-0.014421951025724411,
0.05006203055381775,
0.25639984011650085,
-0.19375382363796234,
-0.023832960054278374,
0.16207246482372284,
-0.44495460391044617,
0.16054967045783997,
0.07131147384643555,
0.08943813294172287,
0.11064952611923218,
-0.0046980855986475945,
0.18162843585014343,
0.2401657998561859,
0.24330948293209076,
0.2011110782623291,
0.40029579401016235,
0.1933710277080536,
-0.441415011882782,
-0.17710568010807037,
0.03408869355916977,
0.13826140761375427,
-0.21107512712478638,
0.20875287055969238,
0.17694750428199768,
0.3300666809082031,
0.017184752970933914,
-0.09887538850307465,
0.12487602978944778,
-0.484645277261734,
-0.14610186219215393,
-0.2261534184217453,
0.18742600083351135,
0.3245075047016144,
-0.07596094161272049,
0.2303636223077774,
0.00013280287384986877,
-0.00776311568915844,
0.18646089732646942,
-0.26810646057128906,
-0.13228507339954376,
-0.2897714674472809,
0.16851361095905304,
0.03922310099005699,
-0.1269269734621048,
0.20013855397701263,
0.030933603644371033,
0.01671748235821724,
-0.05761786922812462,
-0.010158037766814232,
-0.12679654359817505,
0.5355974435806274,
0.21017302572727203,
-0.14818952977657318,
0.33008873462677,
0.14810003340244293,
0.1583918184041977,
-0.07314062863588333,
0.2678971290588379,
-0.3923684060573578,
-0.2618286609649658,
-0.07807789742946625,
0.09629233181476593,
-0.0071769170463085175,
0.24531300365924835,
0.10276557505130768,
0.046198174357414246,
0.49913057684898376,
-0.22746844589710236,
0.08068224787712097,
-0.13418348133563995,
-0.3008498549461365,
-0.26335713267326355,
0.009938744828104973,
0.3617159128189087,
0.1328105926513672,
-0.06823106110095978,
0.03377068042755127,
0.17243479192256927,
0.1152569130063057,
0.37926897406578064,
-0.25274521112442017,
0.002558499574661255,
-0.1737334430217743,
0.4927601218223572,
0.20067627727985382,
0.00780872255563736,
-0.46702778339385986,
0.4056282639503479,
-0.0009293779730796814,
-0.019652070477604866,
-0.29037031531333923,
-0.09664605557918549,
0.31590816378593445,
-0.3201970160007477,
-0.07429276406764984,
-0.017621774226427078,
0.03928648680448532,
0.22939994931221008,
-0.4118962585926056,
-0.18122230470180511,
0.31029850244522095,
-0.30203813314437866,
0.11314535140991211,
-0.07812514156103134,
0.06077801063656807,
-0.16262546181678772,
0.13107088208198547,
-0.020513396710157394,
0.3674547076225281,
0.017032578587532043,
0.1177489310503006,
-0.27299684286117554,
0.18154597282409668,
-0.16631054878234863,
-0.23702102899551392,
0.1353224515914917,
-0.07966350764036179,
-0.023327209055423737,
-0.3093729019165039,
0.009100165218114853,
0.03283414617180824,
0.04697733372449875,
-0.07588669657707214,
-0.08318349719047546,
0.06502264738082886,
-0.03244015574455261,
-0.17659316956996918,
0.10639768838882446,
-0.27152004837989807,
-0.08941540867090225,
-0.037886448204517365,
-0.1879148781299591,
0.1028503030538559,
-0.14701026678085327,
-0.14163945615291595,
-0.33623605966567993,
-0.12558579444885254,
-0.18013235926628113,
0.19631901383399963,
-0.09062757343053818,
-0.46849215030670166,
0.2808658480644226,
-0.13692688941955566,
-0.1751849204301834,
-0.1444242298603058,
0.3153333067893982,
0.10843563824892044,
-0.4033743143081665,
0.07345417886972427,
0.2880222797393799,
0.11201029270887375,
-0.14127478003501892,
0.08007481694221497,
0.12394656240940094,
0.01412142813205719,
0.0541793555021286,
-0.3071884512901306,
0.1883402317762375,
0.07399794459342957,
-0.05341033264994621,
-0.149295374751091,
-0.24963811039924622,
-0.2832726240158081,
-0.15631866455078125,
0.3027476668357849,
0.11762285977602005,
0.25319811701774597,
0.05643030256032944,
0.7235464453697205,
0.16856740415096283,
0.25840798020362854,
0.30948880314826965,
-0.05544357746839523,
-0.17719945311546326,
-0.07779648154973984,
-0.08545292913913727,
0.2426239252090454,
-0.008999682031571865,
-0.09128952026367188,
0.08576597273349762,
-0.05951307713985443,
0.07699523121118546,
0.20004907250404358,
-0.04212894290685654,
0.2856660783290863,
0.3226270079612732,
0.05438942462205887,
0.11529932916164398,
-0.11451917886734009,
-0.1642826795578003,
0.19052529335021973,
0.3098093569278717,
-0.47134000062942505,
0.012887192890048027,
-0.2077406644821167,
0.3570306599140167,
0.1509784311056137,
-0.18744559586048126,
0.019834117963910103,
-0.2942267656326294,
0.10797389596700668,
0.007240720093250275,
-0.4438513219356537,
0.6701499223709106,
0.1170024573802948,
-0.08852069079875946,
0.26360559463500977,
-0.0661701112985611,
-0.2863367199897766,
-0.3272585868835449,
-0.10515015572309494,
-0.0202561616897583,
0.2512221336364746,
-0.3321355879306793,
0.007041797041893005,
0.06122603267431259,
-0.13968253135681152,
-0.4670717418193817,
-0.05238837003707886,
0.08058641105890274,
-0.33465081453323364,
0.06950277090072632,
-0.012403972446918488,
0.11121620982885361,
-0.42710041999816895,
-0.264980286359787,
0.22454361617565155,
-0.5800191164016724,
-0.1884339302778244,
0.15004871785640717,
0.04911739379167557,
-0.14861176908016205,
-0.3430764079093933,
-0.4191994369029999,
0.05946280062198639,
-0.3025555908679962,
0.34789425134658813,
-0.303728312253952,
0.28640908002853394,
0.12861615419387817,
0.1444963663816452,
-0.03336875140666962,
0.1656036078929901,
-0.16594277322292328,
-0.28164395689964294,
-0.2062092274427414,
0.45144641399383545,
-0.13393226265907288,
-0.38321512937545776,
0.06625756621360779,
0.128309428691864,
-0.2757946848869324,
0.4237237572669983,
-0.1272347867488861,
0.14814360439777374,
-0.09796840697526932,
-0.0005897283554077148,
-0.05131898075342178,
0.1067722961306572,
0.3975885510444641,
0.257426381111145,
-0.19841165840625763,
-0.3132745027542114,
-0.3150601387023926,
0.26935288310050964,
0.1132136881351471,
0.23209363222122192,
0.24145138263702393,
0.3950609266757965,
0.214125394821167,
0.7548603415489197,
0.23308420181274414,
-0.44402551651000977,
0.23368118703365326,
-0.07452588528394699,
-0.04918550327420235,
-0.04287492483854294,
-0.3642709255218506,
-0.15313921868801117,
-0.23355555534362793,
0.07616057991981506,
0.10384471714496613,
-0.14514568448066711,
-0.3661973178386688,
-0.07811145484447479,
0.21461611986160278,
-0.4353041648864746,
-0.3430808484554291,
0.3694581091403961,
-0.49228131771087646,
0.21265524625778198,
0.0030619241297245026,
0.1982991099357605,
-0.15441393852233887,
-0.061750318855047226,
0.24728122353553772,
-0.12956444919109344,
0.5788046717643738,
-0.026749635115265846,
0.30467689037323,
0.24936699867248535,
-0.17607638239860535,
0.3547157347202301,
0.13698473572731018,
0.3823307454586029,
-0.10847604274749756,
-0.2950456738471985,
-0.15152958035469055,
0.044631630182266235,
0.40688860416412354,
-0.42150935530662537,
0.06345316767692566,
0.12517324090003967,
-0.1221160963177681,
-0.3591180443763733,
-0.009208176285028458,
-0.20729048550128937,
0.5818536877632141,
0.1983252316713333,
0.282611608505249,
-0.33605456352233887,
-0.043313320726156235,
0.03457370400428772,
-0.17946021258831024,
-0.024899203330278397,
0.061516206711530685,
-0.141828253865242,
-0.13348132371902466,
-0.3728533089160919,
0.15642577409744263,
0.28681480884552,
-0.08174221962690353,
-0.11537636071443558,
0.049816738814115524,
-0.06528762727975845,
-0.12678378820419312,
-0.03269749879837036,
-0.0641649067401886,
0.2571988105773926,
0.007414141204208136,
0.2711446285247803,
0.03323063254356384,
0.27501001954078674,
0.035775139927864075,
0.32278162240982056,
-0.0226549431681633,
-0.013497039675712585,
0.14493247866630554,
-0.13563880324363708,
-0.04937874525785446,
0.4215385913848877,
-0.07775650918483734,
-0.32609254121780396,
-0.0592057928442955,
0.11923686414957047,
-0.03980940207839012,
-0.11425913125276566,
0.38344964385032654,
-0.10453171283006668,
-0.19956301152706146,
-0.21778886020183563,
0.29109248518943787,
0.08384272456169128,
-0.2204451560974121,
0.7047979831695557,
-0.27795928716659546,
-0.1819791942834854,
0.5636621713638306,
0.2718588411808014,
0.9848565459251404,
-0.10422883927822113,
-0.11982865631580353,
-0.19941890239715576,
0.14422564208507538,
-0.23000496625900269,
-0.0017375573515892029,
0.002409624867141247,
-0.4067305624485016,
-0.30255547165870667,
0.05944924056529999,
-0.14063377678394318,
0.09721203148365021,
0.36231136322021484,
-0.3356339633464813,
-0.040035683661699295,
-0.06385613232851028,
0.2879839837551117,
0.06812350451946259,
0.06356325000524521,
-0.08814741671085358,
-0.17070618271827698,
0.2020246386528015,
0.17686747014522552,
0.005106791853904724,
0.14905856549739838,
0.09737911075353622,
-0.1397705227136612,
-0.14096809923648834,
-0.360576868057251,
-0.48575055599212646,
0.10280748456716537,
-0.382222980260849,
0.48079627752304077,
-0.290804922580719,
-0.03429977968335152,
0.13699235022068024,
0.16783219575881958,
-0.04157012701034546,
0.009241685271263123,
-0.19342966377735138,
0.015919819474220276,
0.29300498962402344,
0.2225106656551361,
-0.1175597757101059,
-0.10027587413787842,
0.31732240319252014,
0.11533089727163315,
-0.23973703384399414,
-0.061520688235759735,
-0.07349071651697159,
-0.33525967597961426,
-0.07310082763433456,
0.08554212003946304,
-0.10658460855484009,
-0.4055691957473755,
-0.021130798384547234,
0.011687882244586945,
-0.2672877311706543,
-0.11611126363277435,
0.1457201987504959,
0.053120940923690796,
-0.01374203059822321,
0.5339192748069763,
0.030090270563960075,
-0.2981453239917755,
0.19726920127868652,
0.5126433372497559,
-0.08420758694410324,
0.06217123568058014,
0.2114640176296234,
-0.08457294851541519,
-0.2641808092594147,
-0.17530247569084167,
0.10418187826871872,
-0.07535668462514877,
-0.4410262107849121,
0.3061034083366394,
-0.2819136381149292,
0.11519400775432587,
-0.06478363275527954,
0.1737230271100998,
-0.04467765986919403,
0.4115181863307953,
-0.10185506939888,
-0.24442410469055176,
-0.11826246976852417,
0.33089810609817505,
-0.09494015574455261,
0.3671320378780365,
-0.3020929992198944,
0.19746701419353485,
0.07871448248624802,
0.24557964503765106,
-0.3439922630786896,
0.3123866319656372,
0.00000825338065624237,
0.1872280240058899,
0.09324253350496292,
0.0932609885931015,
0.20591607689857483,
-0.13761624693870544,
0.01747698150575161,
0.4087446928024292,
-0.29465004801750183,
-0.15922370553016663,
-0.15288665890693665,
0.16640512645244598,
0.09723880141973495,
-0.015900593250989914,
-0.1906702071428299,
-0.17561796307563782,
-0.04402148351073265,
-0.2504088282585144,
0.038858648389577866,
0.4114535450935364,
-0.15360692143440247,
0.32016879320144653,
0.36500728130340576,
-0.0872984454035759,
0.05099538713693619,
-0.18215402960777283,
-0.3492029905319214,
0.24574896693229675,
-0.10149925947189331,
0.10555745661258698,
0.22624042630195618,
0.035611554980278015,
-0.24066409468650818,
-0.06507363170385361,
0.02278962731361389,
0.22196456789970398,
0.3579190969467163,
-0.04385682940483093,
-0.02263680286705494,
0.1679650992155075,
0.21576423943042755,
0.11778740584850311,
-0.4103192090988159,
-0.2868501543998718,
0.049643486738204956,
0.16521014273166656,
-0.16449855268001556,
0.11023340374231339,
0.2357458919286728,
0.05346648767590523,
-0.12468992173671722,
-0.03330593556165695,
0.13953480124473572,
-0.08927062898874283,
-0.19786237180233002,
0.08556239306926727,
0.3184834122657776,
-0.371945858001709,
0.019434915855526924,
0.2716065049171448,
-0.19708029925823212,
0.1648479849100113,
0.18020270764827728,
-0.2641366124153137,
0.3632330894470215,
0.31183749437332153,
-0.20418494939804077,
0.2810852527618408,
0.29169517755508423,
0.24062079191207886,
-0.09011190384626389,
-0.2676529288291931,
0.2742716670036316,
0.14012625813484192,
-0.1834627091884613,
0.1748063564300537,
0.18359871208667755,
0.21883684396743774,
-0.14180690050125122,
-0.15412195026874542,
-0.03085871785879135,
0.5126678943634033,
-0.21577933430671692,
0.10026855766773224,
-0.0006267763674259186,
-0.17980988323688507,
-0.19970880448818207,
-0.04598045349121094,
-0.17985975742340088,
0.23964227735996246,
0.883521318435669,
0.3058401942253113,
-0.0020067840814590454,
0.12296104431152344,
-0.20295557379722595,
-0.1354459524154663,
0.5963994860649109,
-0.2646227180957794,
0.10171426832675934,
0.15059895813465118,
-0.11491291224956512,
-0.09919218719005585,
0.4199853241443634,
0.4117042124271393,
0.35468313097953796,
-0.23824092745780945,
0.32136109471321106,
-0.06425805389881134,
-0.03668966144323349,
0.018590707331895828,
0.44733721017837524,
0.0970340147614479,
-0.2827489674091339,
0.16262730956077576,
0.08127354830503464,
-0.07888392359018326,
-0.09862171113491058,
0.07511212676763535,
0.5345348119735718,
0.35744965076446533,
0.3001921772956848,
-0.06810320913791656,
-0.14029282331466675,
0.16267016530036926,
-0.10527793318033218,
0.10032462328672409,
-0.2756045460700989,
0.4066585898399353,
-0.08085809648036957,
0.24275827407836914,
-0.19806581735610962,
0.11158958077430725,
0.08309698104858398,
0.415169358253479,
0.2788357138633728,
-0.2034437656402588,
-0.2577419579029083,
0.012430720031261444,
-0.33423691987991333,
0.2849593758583069,
0.011348456144332886,
0.21044807136058807,
-0.05992373079061508,
0.054939448833465576,
0.11228553205728531,
0.28969383239746094,
0.1745002716779709,
-0.09155654907226562,
-0.15923990309238434,
0.5001022815704346,
-0.33102643489837646,
0.09378302097320557,
-0.15999747812747955,
0.23903784155845642,
0.2972760498523712,
-0.3057217001914978,
0.001991875469684601,
-0.15177053213119507,
0.17102894186973572,
-0.29268187284469604,
-0.34752121567726135,
0.145006462931633,
0.008885588496923447,
0.7831227779388428,
0.2957434356212616,
0.13131925463676453,
-0.2441677451133728,
-0.09117712080478668,
-0.0784236490726471,
-0.27653592824935913,
-0.0061036525294184685,
0.2585180401802063,
0.1867937445640564,
0.17836028337478638,
-0.0828525498509407,
-0.3143141269683838,
-0.25834670662879944,
0.005766461603343487,
-0.31025344133377075,
0.23271700739860535,
-0.28847819566726685,
-0.024105383083224297,
-0.08286971598863602,
-0.18525798618793488,
-0.28275030851364136,
0.2861838638782501,
-0.08992750942707062,
0.25687769055366516,
-0.20272916555404663,
-0.5522981286048889,
0.7404893636703491,
-0.3594586253166199,
-0.29268696904182434,
0.05612783506512642,
0.10679791122674942,
-0.25768473744392395,
-0.02451399900019169,
-0.5117170214653015,
-0.22652187943458557,
0.2569241225719452,
0.09004148840904236,
-0.5299142599105835,
-0.09692654013633728,
-0.04127636179327965,
-0.06511085480451584,
-0.10441705584526062,
0.4276721775531769,
0.02951738052070141,
-0.19150970876216888,
-0.015932254493236542,
-0.17209118604660034
] |
https://github.com/huggingface/datasets/issues/5536 | Failure to hash function when using .map() | Thanks @maxwellzh! Our `Hasher` works with this snippet, but the problem is running multiprocessing with a non-serializable `tiktoken.Encoding` object.
Inserting the following code before the `map` should fix this:
```python
import copyreg
def pickle_Encoding(enc):
return (functools.partial(tiktoken.core.Encoding, enc.name, pat_str=enc._pat_str, mergeable_ranks=enc._mergeable_ranks, special_tokens=enc._special_tokens), ())
copyreg.pickle(tiktoken.core.Encoding, pickle_Encoding)
```
But the best fix would be implementing `__reduce__` for `tiktoken.Encoding` or `tiktoken.CoreBPE`. If I find time, I'll try to fix this in the `tiktoken` repo. | ### Describe the bug
_Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed._
This issue with `.map()` happens for me consistently, as also described in closed issue #4506
Dataset indices can be individually serialized using dill and pickle without any errors. I'm using tiktoken to encode in the function passed to map(). Similarly, indices can be individually encoded without error.
### Steps to reproduce the bug
```py
from datasets import load_dataset
import tiktoken
dataset = load_dataset("stas/openwebtext-10k")
enc = tiktoken.get_encoding("gpt2")
tokenized = dataset.map(
process,
remove_columns=['text'],
desc="tokenizing the OWT splits",
)
def process(example):
ids = enc.encode(example['text'])
ids.append(enc.eot_token)
out = {'ids': ids, 'len': len(ids)}
return out
```
### Expected behavior
Should encode simple text objects.
### Environment info
Python versions tried: both 3.8 and 3.10.10
`PYTHONUTF8=1` as env variable
Datasets tried:
- stas/openwebtext-10k
- rotten_tomatoes
- local text file
OS: Ubuntu Linux 20.04
Package versions:
- torch 1.13.1
- dill 0.3.4 (if using 0.3.6 - same issue)
- datasets 2.9.0
- tiktoken 0.2.0
| 69 | Failure to hash function when using .map()
### Describe the bug
_Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed._
This issue with `.map()` happens for me consistently, as also described in closed issue #4506
Dataset indices can be individually serialized using dill and pickle without any errors. I'm using tiktoken to encode in the function passed to map(). Similarly, indices can be individually encoded without error.
### Steps to reproduce the bug
```py
from datasets import load_dataset
import tiktoken
dataset = load_dataset("stas/openwebtext-10k")
enc = tiktoken.get_encoding("gpt2")
tokenized = dataset.map(
process,
remove_columns=['text'],
desc="tokenizing the OWT splits",
)
def process(example):
ids = enc.encode(example['text'])
ids.append(enc.eot_token)
out = {'ids': ids, 'len': len(ids)}
return out
```
### Expected behavior
Should encode simple text objects.
### Environment info
Python versions tried: both 3.8 and 3.10.10
`PYTHONUTF8=1` as env variable
Datasets tried:
- stas/openwebtext-10k
- rotten_tomatoes
- local text file
OS: Ubuntu Linux 20.04
Package versions:
- torch 1.13.1
- dill 0.3.4 (if using 0.3.6 - same issue)
- datasets 2.9.0
- tiktoken 0.2.0
Thanks @maxwellzh! Our `Hasher` works with this snippet, but the problem is running multiprocessing with a non-serializable `tiktoken.Encoding` object.
Inserting the following code before the `map` should fix this:
```python
import copyreg
def pickle_Encoding(enc):
return (functools.partial(tiktoken.core.Encoding, enc.name, pat_str=enc._pat_str, mergeable_ranks=enc._mergeable_ranks, special_tokens=enc._special_tokens), ())
copyreg.pickle(tiktoken.core.Encoding, pickle_Encoding)
```
But the best fix would be implementing `__reduce__` for `tiktoken.Encoding` or `tiktoken.CoreBPE`. If I find time, I'll try to fix this in the `tiktoken` repo. | [
-0.26971200108528137,
0.04461166262626648,
0.025779619812965393,
0.06566739827394485,
0.38949358463287354,
0.09443282335996628,
0.5057995319366455,
0.4007117748260498,
0.24779275059700012,
0.053384825587272644,
0.12246813625097275,
0.6098890900611877,
-0.2580595314502716,
-0.076885886490345,
-0.1582462638616562,
0.08883477747440338,
0.022192493081092834,
-0.04916331171989441,
-0.2808365225791931,
-0.1550007462501526,
-0.4248787462711334,
0.10910321027040482,
-0.17725223302841187,
0.3370102643966675,
-0.33955705165863037,
-0.14939932525157928,
0.08345173299312592,
-0.08076339215040207,
-0.0019283890724182129,
-0.2560068666934967,
-0.08379293978214264,
-0.3681548237800598,
-0.11665790528059006,
0.6106473207473755,
-0.00010992454190272838,
0.06099303066730499,
0.26687002182006836,
-0.18347199261188507,
-0.07858622074127197,
-0.4572306275367737,
-0.2111733853816986,
-0.1285230964422226,
-0.03334897756576538,
-0.27516838908195496,
0.17222002148628235,
-0.29564282298088074,
0.20570702850818634,
-0.6118890643119812,
0.3217141628265381,
0.10329707711935043,
0.21982847154140472,
0.019361115992069244,
0.1566302627325058,
0.19523358345031738,
0.40391314029693604,
0.009558528661727905,
-0.29372450709342957,
0.03544606268405914,
0.08208555728197098,
0.04129114747047424,
-0.31656256318092346,
0.3265334665775299,
-0.017964405938982964,
0.04913639277219772,
0.07647573202848434,
0.054696135222911835,
0.2516497075557709,
-0.45604732632637024,
0.20415613055229187,
-0.018536023795604706,
0.20310218632221222,
-0.39592117071151733,
-0.4447234869003296,
0.07019653171300888,
-0.2855740785598755,
-0.02157190814614296,
0.29949015378952026,
0.17252399027347565,
0.09571745991706848,
0.12443102896213531,
-0.3769751191139221,
0.1484091579914093,
0.1434296816587448,
0.22574852406978607,
0.2705027163028717,
0.2021794617176056,
0.09968739002943039,
0.3234216272830963,
0.08062127232551575,
-0.20549462735652924,
-0.09231656044721603,
-0.020905129611492157,
0.04224149137735367,
0.2626526355743408,
-0.19953136146068573,
-0.028576180338859558,
0.15822428464889526,
-0.4388732612133026,
0.16270098090171814,
0.0766507089138031,
0.0894893929362297,
0.1168472170829773,
-0.011392301879823208,
0.1813960075378418,
0.24667149782180786,
0.2436012476682663,
0.20613035559654236,
0.40551871061325073,
0.1908000111579895,
-0.44901540875434875,
-0.17809508740901947,
0.029793014749884605,
0.1400667428970337,
-0.20524998009204865,
0.21228840947151184,
0.17510509490966797,
0.3210833668708801,
0.01318288967013359,
-0.09376569092273712,
0.1279217004776001,
-0.49275699257850647,
-0.1442534476518631,
-0.23137393593788147,
0.1859075278043747,
0.33093589544296265,
-0.0729592889547348,
0.24292291700839996,
0.0038436949253082275,
-0.003587947227060795,
0.1799560934305191,
-0.2615680396556854,
-0.13801653683185577,
-0.29237303137779236,
0.16902218759059906,
0.03229470178484917,
-0.12438194453716278,
0.20196692645549774,
0.03495975583791733,
0.012833662331104279,
-0.06266675889492035,
-0.0055229319259524345,
-0.12193213403224945,
0.5355054140090942,
0.20699132978916168,
-0.15794262290000916,
0.3362540602684021,
0.14509610831737518,
0.1602022349834442,
-0.0681009516119957,
0.27080902457237244,
-0.39549848437309265,
-0.25643327832221985,
-0.07877161353826523,
0.08893710374832153,
-0.012520929798483849,
0.2497393935918808,
0.09838922321796417,
0.04594235122203827,
0.5059420466423035,
-0.2278890311717987,
0.08419874310493469,
-0.13376355171203613,
-0.3070646822452545,
-0.2618316113948822,
0.004871312528848648,
0.3598294258117676,
0.1434304416179657,
-0.06843405216932297,
0.040372513234615326,
0.1815403401851654,
0.11595437675714493,
0.3709147870540619,
-0.25306403636932373,
0.001410067081451416,
-0.1779991239309311,
0.4865571856498718,
0.20973321795463562,
0.007874291390180588,
-0.46617746353149414,
0.41286441683769226,
-0.0034394562244415283,
-0.02050875872373581,
-0.3007354438304901,
-0.1006200760602951,
0.31140434741973877,
-0.3245229125022888,
-0.07267396152019501,
-0.012910164892673492,
0.03546123206615448,
0.23326227068901062,
-0.41040661931037903,
-0.18417532742023468,
0.312333881855011,
-0.30568450689315796,
0.11292307078838348,
-0.07442108541727066,
0.06665728986263275,
-0.15915916860103607,
0.13776278495788574,
-0.02693730965256691,
0.36644506454467773,
0.020365295931696892,
0.1200534999370575,
-0.2825164198875427,
0.18824997544288635,
-0.1686844527721405,
-0.23256075382232666,
0.1355116367340088,
-0.08071516454219818,
-0.025435633957386017,
-0.3086145520210266,
0.019023697823286057,
0.03867189213633537,
0.041422389447689056,
-0.08265805244445801,
-0.08019326627254486,
0.05720242112874985,
-0.04351699352264404,
-0.18166887760162354,
0.10766169428825378,
-0.26410147547721863,
-0.0853884294629097,
-0.037923723459243774,
-0.18260911107063293,
0.10416875779628754,
-0.14551106095314026,
-0.12678012251853943,
-0.33627110719680786,
-0.12659762799739838,
-0.18003547191619873,
0.1995798647403717,
-0.08697712421417236,
-0.4793111979961395,
0.27796676754951477,
-0.13288620114326477,
-0.17471598088741302,
-0.15379318594932556,
0.3203545808792114,
0.1160607784986496,
-0.40889695286750793,
0.07166354358196259,
0.28942856192588806,
0.11315546929836273,
-0.14818811416625977,
0.08520892262458801,
0.12216375768184662,
0.01911819912493229,
0.05584532395005226,
-0.31340116262435913,
0.1970105916261673,
0.06126665323972702,
-0.06008296459913254,
-0.1480066031217575,
-0.24287556111812592,
-0.28226304054260254,
-0.1625862717628479,
0.30278411507606506,
0.11479564756155014,
0.2563415467739105,
0.056271329522132874,
0.7168000340461731,
0.16664327681064606,
0.25558096170425415,
0.30423638224601746,
-0.06265725940465927,
-0.17069318890571594,
-0.07644924521446228,
-0.08643332123756409,
0.2438713014125824,
-0.012858450412750244,
-0.0980280190706253,
0.09097471833229065,
-0.05574943125247955,
0.08593553304672241,
0.20085091888904572,
-0.04230397194623947,
0.29592737555503845,
0.3124867379665375,
0.05999493598937988,
0.11529254913330078,
-0.10952558368444443,
-0.1525571197271347,
0.19326502084732056,
0.3085586428642273,
-0.47541651129722595,
0.014510096982121468,
-0.2135695368051529,
0.35669976472854614,
0.14754176139831543,
-0.1849105954170227,
0.019706185907125473,
-0.29234108328819275,
0.09925190359354019,
0.008173666894435883,
-0.4359241724014282,
0.6625413298606873,
0.11717964708805084,
-0.09677384793758392,
0.2680276930332184,
-0.07064726203680038,
-0.28249603509902954,
-0.32370567321777344,
-0.10388893634080887,
-0.028009852394461632,
0.25150763988494873,
-0.33009377121925354,
0.008028334006667137,
0.06838162243366241,
-0.141031414270401,
-0.47082436084747314,
-0.061245642602443695,
0.07972951978445053,
-0.3345414996147156,
0.0679473727941513,
-0.014061659574508667,
0.10885202139616013,
-0.4350951910018921,
-0.2500755488872528,
0.2255127876996994,
-0.5848108530044556,
-0.18809829652309418,
0.1566210240125656,
0.04887300729751587,
-0.1434653401374817,
-0.34426671266555786,
-0.4092184901237488,
0.06125621497631073,
-0.2946421504020691,
0.3443581461906433,
-0.3083776533603668,
0.2822123169898987,
0.13016055524349213,
0.14220596849918365,
-0.045256357640028,
0.16402415931224823,
-0.1729700118303299,
-0.2781316637992859,
-0.20703914761543274,
0.45216232538223267,
-0.12826690077781677,
-0.3867904245853424,
0.06581446528434753,
0.13175511360168457,
-0.28527140617370605,
0.42776262760162354,
-0.12446387857198715,
0.14758162200450897,
-0.09315582364797592,
-0.0019435100257396698,
-0.055733971297740936,
0.1108912006020546,
0.3916890621185303,
0.25536200404167175,
-0.1879643350839615,
-0.3171321451663971,
-0.31920304894447327,
0.2715776562690735,
0.12353431433439255,
0.2485436499118805,
0.2533293068408966,
0.40059423446655273,
0.21003542840480804,
0.7519208788871765,
0.23791763186454773,
-0.44710493087768555,
0.23342567682266235,
-0.07783031463623047,
-0.06307989358901978,
-0.036736875772476196,
-0.36166098713874817,
-0.15009279549121857,
-0.2370888590812683,
0.08179360628128052,
0.09756968170404434,
-0.14430555701255798,
-0.3687517046928406,
-0.07456295192241669,
0.2067030817270279,
-0.4320449233055115,
-0.3443138599395752,
0.36580517888069153,
-0.5087319612503052,
0.21546348929405212,
0.002052752301096916,
0.20141369104385376,
-0.15360796451568604,
-0.06661180406808853,
0.25678059458732605,
-0.13511958718299866,
0.5790266990661621,
-0.024431860074400902,
0.310374915599823,
0.24344144761562347,
-0.17526522278785706,
0.3504562973976135,
0.13845650851726532,
0.3865218162536621,
-0.10446397215127945,
-0.28901374340057373,
-0.15059293806552887,
0.049802880734205246,
0.41329365968704224,
-0.42672300338745117,
0.06555530428886414,
0.11861281096935272,
-0.12459438294172287,
-0.3607200086116791,
-0.009770993143320084,
-0.19476699829101562,
0.5878344178199768,
0.1918792724609375,
0.2838221490383148,
-0.3336251974105835,
-0.04071909189224243,
0.027522560209035873,
-0.1742769479751587,
-0.02911718189716339,
0.05431010201573372,
-0.14012670516967773,
-0.1340615302324295,
-0.37122249603271484,
0.15193310379981995,
0.28193923830986023,
-0.0821397677063942,
-0.11390704661607742,
0.04711918160319328,
-0.06144466996192932,
-0.12213394790887833,
-0.03364159166812897,
-0.07234742492437363,
0.25892388820648193,
-0.0038642771542072296,
0.27535730600357056,
0.03791922330856323,
0.277140736579895,
0.028122521936893463,
0.3282867968082428,
-0.010579708963632584,
-0.011821836233139038,
0.1382635533809662,
-0.14205490052700043,
-0.04180041700601578,
0.41746342182159424,
-0.07877085357904434,
-0.32030317187309265,
-0.06067551672458649,
0.11319966614246368,
-0.04189322516322136,
-0.1279793530702591,
0.3842901587486267,
-0.09844756126403809,
-0.2070959508419037,
-0.21579866111278534,
0.29480525851249695,
0.08612462878227234,
-0.21859882771968842,
0.7101247906684875,
-0.27842581272125244,
-0.1848679631948471,
0.5673160552978516,
0.2696058452129364,
0.9862919449806213,
-0.11011996865272522,
-0.13074882328510284,
-0.2023085653781891,
0.14742884039878845,
-0.23232239484786987,
0.0036082714796066284,
-0.0010926015675067902,
-0.4164349138736725,
-0.3041481375694275,
0.055560700595378876,
-0.14232057332992554,
0.09910593926906586,
0.36144042015075684,
-0.33429470658302307,
-0.042621150612831116,
-0.05703673139214516,
0.28571179509162903,
0.0761914849281311,
0.06015931814908981,
-0.087693952023983,
-0.1658732146024704,
0.20222905278205872,
0.17201600968837738,
0.01020042598247528,
0.14948129653930664,
0.09709183871746063,
-0.14935943484306335,
-0.14229311048984528,
-0.36721062660217285,
-0.4898194670677185,
0.10334558039903641,
-0.38537970185279846,
0.47850656509399414,
-0.2862904667854309,
-0.03661143034696579,
0.15547557175159454,
0.1658182442188263,
-0.038313522934913635,
0.0062883831560611725,
-0.20156538486480713,
0.015421869233250618,
0.29329556226730347,
0.2280617654323578,
-0.11562579870223999,
-0.09613058716058731,
0.3130980432033539,
0.1156584694981575,
-0.24443909525871277,
-0.05957704037427902,
-0.07432661205530167,
-0.33956271409988403,
-0.07276175171136856,
0.07761441916227341,
-0.1166372001171112,
-0.3970285952091217,
-0.020483598113059998,
0.014895908534526825,
-0.2615390121936798,
-0.113358274102211,
0.14102670550346375,
0.05916542559862137,
-0.015071602538228035,
0.5417150259017944,
0.028866276144981384,
-0.29671886563301086,
0.20158545672893524,
0.512863039970398,
-0.0875086635351181,
0.06080003082752228,
0.2098700851202011,
-0.08228345215320587,
-0.2590765357017517,
-0.17049148678779602,
0.10656075924634933,
-0.08170296251773834,
-0.43718421459198,
0.30674412846565247,
-0.2788422107696533,
0.12281839549541473,
-0.06322801113128662,
0.1750011146068573,
-0.0518474206328392,
0.4073295593261719,
-0.09799551218748093,
-0.24441659450531006,
-0.11806386709213257,
0.32903605699539185,
-0.10195660591125488,
0.3602229356765747,
-0.30644863843917847,
0.1979990154504776,
0.08276095241308212,
0.24103544652462006,
-0.3366532325744629,
0.3145127594470978,
0.011129653081297874,
0.18993540108203888,
0.09453165531158447,
0.10224533826112747,
0.20086385309696198,
-0.1400216519832611,
0.010034004226326942,
0.4059860110282898,
-0.2878133952617645,
-0.15247417986392975,
-0.1575126349925995,
0.16931627690792084,
0.101377934217453,
-0.009978353045880795,
-0.18776129186153412,
-0.1846396028995514,
-0.04229691997170448,
-0.24965542554855347,
0.04010108485817909,
0.41341274976730347,
-0.15866266191005707,
0.32062140107154846,
0.3687962591648102,
-0.0946241095662117,
0.04909959435462952,
-0.17693990468978882,
-0.34807461500167847,
0.2441624253988266,
-0.10407999902963638,
0.1040675938129425,
0.23067304491996765,
0.038215018808841705,
-0.2397678643465042,
-0.06560348719358444,
0.015948884189128876,
0.21591928601264954,
0.36610090732574463,
-0.04734175652265549,
-0.01770525611937046,
0.16820593178272247,
0.20548631250858307,
0.12056504189968109,
-0.4181165099143982,
-0.28271564841270447,
0.047913558781147,
0.15977634489536285,
-0.1599295735359192,
0.11334028840065002,
0.23971113562583923,
0.05668472871184349,
-0.13074131309986115,
-0.03201853483915329,
0.14164242148399353,
-0.10515718907117844,
-0.20367838442325592,
0.08070256561040878,
0.319975346326828,
-0.3744206428527832,
0.017781183123588562,
0.2736318111419678,
-0.19318778812885284,
0.16470348834991455,
0.18034213781356812,
-0.2684570848941803,
0.35698047280311584,
0.30987900495529175,
-0.1990194320678711,
0.2748689353466034,
0.2942877411842346,
0.23680004477500916,
-0.09451080113649368,
-0.26980966329574585,
0.2708894610404968,
0.13852092623710632,
-0.1863234043121338,
0.17078067362308502,
0.1898956447839737,
0.21641933917999268,
-0.13412486016750336,
-0.15925832092761993,
-0.030632762238383293,
0.513079822063446,
-0.20917963981628418,
0.1060025542974472,
0.0006543025374412537,
-0.17779460549354553,
-0.19625425338745117,
-0.04494437202811241,
-0.182756245136261,
0.2360464483499527,
0.8993507623672485,
0.30909132957458496,
-0.0038183629512786865,
0.11882134526968002,
-0.2101951539516449,
-0.12717962265014648,
0.6007356643676758,
-0.2655127942562103,
0.09679261595010757,
0.13558553159236908,
-0.1196756362915039,
-0.09490884840488434,
0.4124617576599121,
0.40859392285346985,
0.35996341705322266,
-0.24020716547966003,
0.3214520812034607,
-0.06557616591453552,
-0.034077227115631104,
0.026237040758132935,
0.452291876077652,
0.09588062018156052,
-0.284089595079422,
0.16026468575000763,
0.07321752607822418,
-0.07035822421312332,
-0.09727714955806732,
0.07748805731534958,
0.5397979021072388,
0.3511880040168762,
0.306603342294693,
-0.06938386708498001,
-0.13955983519554138,
0.16011621057987213,
-0.1046573743224144,
0.10065417736768723,
-0.2613190710544586,
0.4145500361919403,
-0.07364305108785629,
0.24128979444503784,
-0.19614313542842865,
0.10776269435882568,
0.08367423713207245,
0.4064282476902008,
0.28265100717544556,
-0.20085841417312622,
-0.2578061521053314,
0.01032944768667221,
-0.3301236927509308,
0.28518393635749817,
0.011122386902570724,
0.2134007215499878,
-0.053921133279800415,
0.04300602525472641,
0.11911537498235703,
0.28426095843315125,
0.18153074383735657,
-0.08737777173519135,
-0.15905961394309998,
0.5075644850730896,
-0.32910630106925964,
0.08477388322353363,
-0.16079246997833252,
0.24847520887851715,
0.29033613204956055,
-0.3074840307235718,
0.009799782186746597,
-0.1471453458070755,
0.16691318154335022,
-0.2988007068634033,
-0.3442383110523224,
0.13963593542575836,
0.002643890678882599,
0.7864585518836975,
0.29839134216308594,
0.12794075906276703,
-0.23927485942840576,
-0.08730034530162811,
-0.0816863477230072,
-0.2760392129421234,
-0.003417700994759798,
0.25628894567489624,
0.17863373458385468,
0.18016593158245087,
-0.08000044524669647,
-0.31080949306488037,
-0.26196223497390747,
-0.006514997221529484,
-0.31296485662460327,
0.23541021347045898,
-0.29301562905311584,
-0.01731194742023945,
-0.08423866331577301,
-0.18037468194961548,
-0.28753751516342163,
0.28455206751823425,
-0.09437879920005798,
0.2553573250770569,
-0.19564051926136017,
-0.5430887341499329,
0.736295223236084,
-0.3653905987739563,
-0.29564425349235535,
0.061337873339653015,
0.10558558255434036,
-0.2758784890174866,
-0.030450692400336266,
-0.5173934102058411,
-0.23330089449882507,
0.25850290060043335,
0.08567535877227783,
-0.5277931094169617,
-0.09236955642700195,
-0.03077034279704094,
-0.06229344755411148,
-0.09833209961652756,
0.4295694828033447,
0.027042817324399948,
-0.18277934193611145,
-0.014748681336641312,
-0.17081472277641296
] |
https://github.com/huggingface/datasets/issues/5536 | Failure to hash function when using .map() | I think the right way to fix this would be to have new tokenizer instance for each process. This applies to many other tokenizers that don't support multi-process or have bugs. To do this, first define tokenizer factory class like this:
```
class TikTokenFactory:
def __init__(self):
self._enc = None
self.eot_token = None
def encode_ordinary(self, text):
if self._enc is None:
self._enc = tiktoken.get_encoding("gpt2")
self.eot_token = self._enc.eot_token
return self._enc.encode_ordinary(text)
```
Now use this in `.map()` like this:
```
# tokenize the dataset
tokenized = dataset.map(
partial(process, TikTokenFactory()),
remove_columns=['text'],
desc="tokenizing the splits",
num_proc=max(1, cpu_count()//2),
)
```
A full working example is here: https://github.com/sytelus/nanoGPT/blob/refactor/nanogpt_common/hf_data_prepare.py | ### Describe the bug
_Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed._
This issue with `.map()` happens for me consistently, as also described in closed issue #4506
Dataset indices can be individually serialized using dill and pickle without any errors. I'm using tiktoken to encode in the function passed to map(). Similarly, indices can be individually encoded without error.
### Steps to reproduce the bug
```py
from datasets import load_dataset
import tiktoken
dataset = load_dataset("stas/openwebtext-10k")
enc = tiktoken.get_encoding("gpt2")
tokenized = dataset.map(
process,
remove_columns=['text'],
desc="tokenizing the OWT splits",
)
def process(example):
ids = enc.encode(example['text'])
ids.append(enc.eot_token)
out = {'ids': ids, 'len': len(ids)}
return out
```
### Expected behavior
Should encode simple text objects.
### Environment info
Python versions tried: both 3.8 and 3.10.10
`PYTHONUTF8=1` as env variable
Datasets tried:
- stas/openwebtext-10k
- rotten_tomatoes
- local text file
OS: Ubuntu Linux 20.04
Package versions:
- torch 1.13.1
- dill 0.3.4 (if using 0.3.6 - same issue)
- datasets 2.9.0
- tiktoken 0.2.0
| 100 | Failure to hash function when using .map()
### Describe the bug
_Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed._
This issue with `.map()` happens for me consistently, as also described in closed issue #4506
Dataset indices can be individually serialized using dill and pickle without any errors. I'm using tiktoken to encode in the function passed to map(). Similarly, indices can be individually encoded without error.
### Steps to reproduce the bug
```py
from datasets import load_dataset
import tiktoken
dataset = load_dataset("stas/openwebtext-10k")
enc = tiktoken.get_encoding("gpt2")
tokenized = dataset.map(
process,
remove_columns=['text'],
desc="tokenizing the OWT splits",
)
def process(example):
ids = enc.encode(example['text'])
ids.append(enc.eot_token)
out = {'ids': ids, 'len': len(ids)}
return out
```
### Expected behavior
Should encode simple text objects.
### Environment info
Python versions tried: both 3.8 and 3.10.10
`PYTHONUTF8=1` as env variable
Datasets tried:
- stas/openwebtext-10k
- rotten_tomatoes
- local text file
OS: Ubuntu Linux 20.04
Package versions:
- torch 1.13.1
- dill 0.3.4 (if using 0.3.6 - same issue)
- datasets 2.9.0
- tiktoken 0.2.0
I think the right way to fix this would be to have new tokenizer instance for each process. This applies to many other tokenizers that don't support multi-process or have bugs. To do this, first define tokenizer factory class like this:
```
class TikTokenFactory:
def __init__(self):
self._enc = None
self.eot_token = None
def encode_ordinary(self, text):
if self._enc is None:
self._enc = tiktoken.get_encoding("gpt2")
self.eot_token = self._enc.eot_token
return self._enc.encode_ordinary(text)
```
Now use this in `.map()` like this:
```
# tokenize the dataset
tokenized = dataset.map(
partial(process, TikTokenFactory()),
remove_columns=['text'],
desc="tokenizing the splits",
num_proc=max(1, cpu_count()//2),
)
```
A full working example is here: https://github.com/sytelus/nanoGPT/blob/refactor/nanogpt_common/hf_data_prepare.py | [
-0.27259427309036255,
0.05315922200679779,
0.023362349718809128,
0.06667378544807434,
0.3796428442001343,
0.08569327741861343,
0.5104526877403259,
0.3959410488605499,
0.24923396110534668,
0.050984837114810944,
0.10613124072551727,
0.6072448492050171,
-0.2558450400829315,
-0.07678712159395218,
-0.15920834243297577,
0.08517666906118393,
0.022698625922203064,
-0.057339608669281006,
-0.28157588839530945,
-0.15648511052131653,
-0.41331470012664795,
0.10364823788404465,
-0.17291565239429474,
0.3331299424171448,
-0.36072486639022827,
-0.15482097864151,
0.08229371160268784,
-0.07791084796190262,
0.003641772083938122,
-0.262320876121521,
-0.08609896898269653,
-0.35716989636421204,
-0.11766944825649261,
0.614246129989624,
-0.0001096202977350913,
0.06236065924167633,
0.25124701857566833,
-0.1847439557313919,
-0.07782325148582458,
-0.4490102529525757,
-0.18592214584350586,
-0.1422806829214096,
-0.029329176992177963,
-0.2827416956424713,
0.16524264216423035,
-0.30554208159446716,
0.2044418305158615,
-0.6098629236221313,
0.32652565836906433,
0.09695602208375931,
0.22124752402305603,
0.02537127584218979,
0.15189772844314575,
0.20184476673603058,
0.4195099174976349,
0.0026440322399139404,
-0.3002965748310089,
0.02919318899512291,
0.08191011846065521,
0.05591242015361786,
-0.3275950849056244,
0.329963356256485,
-0.025383012369275093,
0.05605294182896614,
0.07454667240381241,
0.06421360373497009,
0.24160751700401306,
-0.46114638447761536,
0.19491618871688843,
-0.013487517833709717,
0.22451013326644897,
-0.4014536440372467,
-0.44255518913269043,
0.05826836824417114,
-0.28793078660964966,
-0.01931871473789215,
0.2917318642139435,
0.17063453793525696,
0.09357467293739319,
0.12544740736484528,
-0.37966305017471313,
0.15178415179252625,
0.14275695383548737,
0.2270474135875702,
0.27572181820869446,
0.20840251445770264,
0.1054348573088646,
0.31799107789993286,
0.0681876465678215,
-0.20719657838344574,
-0.09284740686416626,
-0.012200839817523956,
0.055929720401763916,
0.25358301401138306,
-0.18834732472896576,
-0.029176058247685432,
0.1631864607334137,
-0.44847795367240906,
0.1622922420501709,
0.08506341278553009,
0.099284328520298,
0.11416617035865784,
-0.012629362754523754,
0.17815229296684265,
0.24778307974338531,
0.2512851655483246,
0.20516949892044067,
0.394601970911026,
0.19984853267669678,
-0.4427312910556793,
-0.17434655129909515,
0.04056546837091446,
0.14020830392837524,
-0.20649224519729614,
0.20712661743164062,
0.17223119735717773,
0.33764058351516724,
0.013775203377008438,
-0.10178135335445404,
0.12976141273975372,
-0.4933726489543915,
-0.14681850373744965,
-0.22345508635044098,
0.18976712226867676,
0.31956496834754944,
-0.07027452439069748,
0.2439502626657486,
0.00007053837180137634,
-0.017795851454138756,
0.18438443541526794,
-0.26386743783950806,
-0.12960217893123627,
-0.2850819230079651,
0.17179624736309052,
0.033944886177778244,
-0.11918927729129791,
0.20113271474838257,
0.0387876033782959,
0.005609229207038879,
-0.052980244159698486,
-0.013680767267942429,
-0.1165110170841217,
0.5326686501502991,
0.20347268879413605,
-0.15750722587108612,
0.3323054611682892,
0.14687444269657135,
0.16239963471889496,
-0.07728151232004166,
0.27212291955947876,
-0.39443573355674744,
-0.2640502452850342,
-0.08479448407888412,
0.09076814353466034,
-0.00650312565267086,
0.24495123326778412,
0.11773302406072617,
0.05159957706928253,
0.5042810440063477,
-0.22980883717536926,
0.08610326051712036,
-0.12584970891475677,
-0.29796934127807617,
-0.26616159081459045,
0.013030795380473137,
0.3567589819431305,
0.12660494446754456,
-0.06868154555559158,
0.05123903602361679,
0.1757299154996872,
0.12074117362499237,
0.37089020013809204,
-0.24183593690395355,
0.010724298655986786,
-0.1742846518754959,
0.4821373224258423,
0.20450012385845184,
0.0034461207687854767,
-0.4687504470348358,
0.3976994752883911,
0.0036327168345451355,
-0.017047496512532234,
-0.2905482351779938,
-0.09655740112066269,
0.3136889338493347,
-0.3227539658546448,
-0.07299219071865082,
-0.015904724597930908,
0.04398544877767563,
0.22905400395393372,
-0.41644594073295593,
-0.17748220264911652,
0.31449997425079346,
-0.29687169194221497,
0.10688480734825134,
-0.08940895646810532,
0.06020623445510864,
-0.15556028485298157,
0.13346436619758606,
-0.025374483317136765,
0.36266955733299255,
0.012690791860222816,
0.11480005085468292,
-0.27240294218063354,
0.18442615866661072,
-0.16345414519309998,
-0.23497971892356873,
0.13602834939956665,
-0.08551237732172012,
-0.01732461154460907,
-0.3130118250846863,
0.00628325343132019,
0.03414886072278023,
0.04382001608610153,
-0.0774860829114914,
-0.08888605237007141,
0.06305132806301117,
-0.038734786212444305,
-0.18193575739860535,
0.11319024860858917,
-0.2644941806793213,
-0.09105159342288971,
-0.036591965705156326,
-0.17961528897285461,
0.10541878640651703,
-0.15095335245132446,
-0.1408076286315918,
-0.33060091733932495,
-0.12844911217689514,
-0.17234516143798828,
0.1976982057094574,
-0.099563367664814,
-0.4709450900554657,
0.2905673384666443,
-0.1367996633052826,
-0.18356557190418243,
-0.15724152326583862,
0.3270989656448364,
0.12409251183271408,
-0.39172711968421936,
0.07454214990139008,
0.28761130571365356,
0.10102762281894684,
-0.1452634632587433,
0.0792611613869667,
0.12486565858125687,
0.011802632361650467,
0.05625586956739426,
-0.31658172607421875,
0.19569504261016846,
0.06572216749191284,
-0.056941356509923935,
-0.14993835985660553,
-0.24814476072788239,
-0.2845020294189453,
-0.16392745077610016,
0.3016893267631531,
0.11552630364894867,
0.25806665420532227,
0.07073699682950974,
0.7191271185874939,
0.1692046970129013,
0.2641215920448303,
0.3043552041053772,
-0.056165166199207306,
-0.17342421412467957,
-0.06948751956224442,
-0.09451055526733398,
0.22986672818660736,
-0.006508083548396826,
-0.09341481328010559,
0.08355452120304108,
-0.0645797848701477,
0.08472583442926407,
0.19745324552059174,
-0.041189104318618774,
0.2747214138507843,
0.3209037780761719,
0.05655859410762787,
0.11603321880102158,
-0.11676941066980362,
-0.1542493999004364,
0.18850471079349518,
0.31007370352745056,
-0.46831583976745605,
0.017568038776516914,
-0.21333931386470795,
0.3519904613494873,
0.15822412073612213,
-0.18913736939430237,
0.011837299913167953,
-0.29652246832847595,
0.11715874820947647,
0.011801742017269135,
-0.44970348477363586,
0.6773601174354553,
0.11475276947021484,
-0.08863286674022675,
0.26744702458381653,
-0.06729301065206528,
-0.2737329602241516,
-0.3242287337779999,
-0.11385350674390793,
-0.022955667227506638,
0.2600652575492859,
-0.3291908800601959,
0.01665353961288929,
0.05168411135673523,
-0.13615751266479492,
-0.4684288501739502,
-0.05603949725627899,
0.08738499879837036,
-0.33419090509414673,
0.06491972506046295,
-0.014165081083774567,
0.11094576120376587,
-0.427267849445343,
-0.2660353183746338,
0.22342564165592194,
-0.5808352828025818,
-0.1877066195011139,
0.14780910313129425,
0.05209745094180107,
-0.15246665477752686,
-0.3422233760356903,
-0.42469534277915955,
0.06614037603139877,
-0.3070051670074463,
0.34092891216278076,
-0.29744067788124084,
0.29148149490356445,
0.13525177538394928,
0.14242325723171234,
-0.03747376799583435,
0.17583529651165009,
-0.1605680286884308,
-0.2795136272907257,
-0.2160770297050476,
0.45591291785240173,
-0.12928417325019836,
-0.3865679204463959,
0.06771345436573029,
0.12745380401611328,
-0.28356820344924927,
0.4276773929595947,
-0.125641867518425,
0.14876410365104675,
-0.08797667175531387,
0.005435377359390259,
-0.05209138244390488,
0.11376731097698212,
0.4093363285064697,
0.25540974736213684,
-0.1945033222436905,
-0.31527477502822876,
-0.3070378005504608,
0.27656877040863037,
0.11588095128536224,
0.2517455220222473,
0.24547311663627625,
0.38485187292099,
0.21729031205177307,
0.7543435096740723,
0.22163382172584534,
-0.4399004876613617,
0.23946742713451385,
-0.07083529233932495,
-0.05068637803196907,
-0.03681005537509918,
-0.36214205622673035,
-0.15143732726573944,
-0.2440904974937439,
0.07666490972042084,
0.11360011249780655,
-0.1374223232269287,
-0.36341890692710876,
-0.0797758400440216,
0.21115656197071075,
-0.4338443875312805,
-0.3506694734096527,
0.3715881109237671,
-0.5142645835876465,
0.20711708068847656,
-0.004188524559140205,
0.20498400926589966,
-0.15865226089954376,
-0.06269009411334991,
0.25260862708091736,
-0.1347852349281311,
0.5832822918891907,
-0.025116870179772377,
0.2969111204147339,
0.2648128867149353,
-0.1801641583442688,
0.3552238345146179,
0.1413150131702423,
0.37507107853889465,
-0.1114029586315155,
-0.30634433031082153,
-0.14044299721717834,
0.048788882791996,
0.40216296911239624,
-0.41300809383392334,
0.04716916382312775,
0.12250928580760956,
-0.11480818688869476,
-0.3629874289035797,
-0.021655647084116936,
-0.1938847154378891,
0.5897644758224487,
0.20354464650154114,
0.2715143859386444,
-0.3483458161354065,
-0.046824462711811066,
0.03239745274186134,
-0.1794072985649109,
-0.030997786670923233,
0.05875963345170021,
-0.13320335745811462,
-0.13793593645095825,
-0.3801330626010895,
0.15305915474891663,
0.28393468260765076,
-0.0827770084142685,
-0.11258439719676971,
0.05643715336918831,
-0.05767662823200226,
-0.12466730177402496,
-0.02855198085308075,
-0.06590774655342102,
0.26585283875465393,
-0.004518961999565363,
0.2707897126674652,
0.03117825835943222,
0.29141920804977417,
0.03339064121246338,
0.32822349667549133,
-0.014896269887685776,
-0.008127070963382721,
0.13738417625427246,
-0.1401360034942627,
-0.044590286910533905,
0.4209701120853424,
-0.07170113176107407,
-0.3270966708660126,
-0.07733506709337234,
0.11960865557193756,
-0.042481470853090286,
-0.10970979183912277,
0.3842872381210327,
-0.11024903506040573,
-0.20553989708423615,
-0.21669739484786987,
0.297722190618515,
0.07868944108486176,
-0.22456207871437073,
0.7101861834526062,
-0.2841297388076782,
-0.18087001144886017,
0.5730534195899963,
0.2760038375854492,
0.9966192245483398,
-0.1014920175075531,
-0.11767303943634033,
-0.19352731108665466,
0.1505672037601471,
-0.21635587513446808,
-0.02463897317647934,
-0.0045419298112392426,
-0.4093795120716095,
-0.29911255836486816,
0.05989602208137512,
-0.13444916903972626,
0.08670490980148315,
0.3635576367378235,
-0.3339662253856659,
-0.0372500866651535,
-0.05896037817001343,
0.28237971663475037,
0.06467613577842712,
0.06268741935491562,
-0.09571903198957443,
-0.17137515544891357,
0.20816272497177124,
0.17305251955986023,
0.002960771322250366,
0.15611694753170013,
0.09549029916524887,
-0.14742876589298248,
-0.1485217809677124,
-0.3631232976913452,
-0.4838051199913025,
0.09824960678815842,
-0.3843517601490021,
0.4774841070175171,
-0.2924792766571045,
-0.05142699554562569,
0.1335391104221344,
0.16987764835357666,
-0.03693258762359619,
0.0025440938770771027,
-0.19268003106117249,
0.009013088420033455,
0.2928350567817688,
0.21980322897434235,
-0.12208836525678635,
-0.10312595218420029,
0.3286140263080597,
0.11328896135091782,
-0.2374880164861679,
-0.07196887582540512,
-0.07176119834184647,
-0.3360477685928345,
-0.07609490305185318,
0.07881691306829453,
-0.09084513783454895,
-0.40959030389785767,
-0.02042018249630928,
0.014971606433391571,
-0.26122719049453735,
-0.11572861671447754,
0.14377553761005402,
0.05615781992673874,
-0.01741962321102619,
0.5360851287841797,
0.022913029417395592,
-0.2824714779853821,
0.19366225600242615,
0.5052512288093567,
-0.08510047942399979,
0.06164972484111786,
0.2135760337114334,
-0.07469820231199265,
-0.26687994599342346,
-0.16899517178535461,
0.10767928510904312,
-0.07416845113039017,
-0.44203150272369385,
0.29813873767852783,
-0.28037187457084656,
0.11242415010929108,
-0.07715803384780884,
0.18389782309532166,
-0.04181554168462753,
0.40824824571609497,
-0.10050445050001144,
-0.23829685151576996,
-0.12695029377937317,
0.3363719582557678,
-0.09486451745033264,
0.3765562176704407,
-0.3082400858402252,
0.20538276433944702,
0.07645227015018463,
0.2463488131761551,
-0.3408765494823456,
0.3096983730792999,
0.0034104492515325546,
0.18168985843658447,
0.10611682385206223,
0.0920242965221405,
0.1979418694972992,
-0.14369958639144897,
0.011470289900898933,
0.40307843685150146,
-0.29171767830848694,
-0.1554218828678131,
-0.15754596889019012,
0.16972549259662628,
0.10015465319156647,
-0.021305730566382408,
-0.1890120953321457,
-0.1737964153289795,
-0.03657546639442444,
-0.25611481070518494,
0.039863914251327515,
0.4182054102420807,
-0.14817146956920624,
0.3190370500087738,
0.36854827404022217,
-0.0827239528298378,
0.04530470073223114,
-0.18206684291362762,
-0.3414856195449829,
0.2551250457763672,
-0.09724657237529755,
0.10309959948062897,
0.22088095545768738,
0.0311853289604187,
-0.2385871410369873,
-0.06060158461332321,
0.01841408759355545,
0.2164660394191742,
0.36180898547172546,
-0.0436682403087616,
-0.01920161210000515,
0.1707577407360077,
0.2140331119298935,
0.1202700138092041,
-0.406240850687027,
-0.2900093197822571,
0.05264195799827576,
0.16350221633911133,
-0.17205552756786346,
0.10764077305793762,
0.236328125,
0.04774339869618416,
-0.12937967479228973,
-0.033483512699604034,
0.14489427208900452,
-0.09280406683683395,
-0.20542658865451813,
0.09209799021482468,
0.3174532353878021,
-0.37162965536117554,
0.021814392879605293,
0.27317601442337036,
-0.20203153789043427,
0.1652795970439911,
0.1787615269422531,
-0.2671729326248169,
0.3612024784088135,
0.29955989122390747,
-0.201418936252594,
0.27613791823387146,
0.29446256160736084,
0.24274425208568573,
-0.09243301302194595,
-0.2663104832172394,
0.2668483555316925,
0.13379232585430145,
-0.16770920157432556,
0.1741502285003662,
0.18754971027374268,
0.2225193977355957,
-0.14122909307479858,
-0.16297690570354462,
-0.031166110187768936,
0.5210496783256531,
-0.21662282943725586,
0.10601794719696045,
0.0030448921024799347,
-0.18520289659500122,
-0.19441372156143188,
-0.04938385635614395,
-0.182996466755867,
0.2289993017911911,
0.8682126998901367,
0.3008630573749542,
-0.005032166838645935,
0.11350762844085693,
-0.20005729794502258,
-0.13958430290222168,
0.6080020070075989,
-0.26259735226631165,
0.10405165702104568,
0.1572674959897995,
-0.12326815724372864,
-0.10190440714359283,
0.41405239701271057,
0.4139547348022461,
0.35525286197662354,
-0.251057505607605,
0.31857922673225403,
-0.0731775313615799,
-0.030934499576687813,
0.022150233387947083,
0.4442058503627777,
0.08702130615711212,
-0.2953728437423706,
0.16662800312042236,
0.07280810922384262,
-0.07762234658002853,
-0.09091924130916595,
0.07237754017114639,
0.5291840434074402,
0.3625034689903259,
0.302908718585968,
-0.06903396546840668,
-0.1461096704006195,
0.1579476296901703,
-0.10959751158952713,
0.10317374020814896,
-0.27752193808555603,
0.39895305037498474,
-0.07449285686016083,
0.24584391713142395,
-0.20176108181476593,
0.1104939877986908,
0.07609879225492477,
0.4022926986217499,
0.27774345874786377,
-0.19910213351249695,
-0.25646770000457764,
0.0189884752035141,
-0.33566224575042725,
0.28617414832115173,
0.013097789138555527,
0.204645574092865,
-0.0562877282500267,
0.05229390412569046,
0.12269051373004913,
0.2936165928840637,
0.17582614719867706,
-0.07775513082742691,
-0.16355881094932556,
0.5037509202957153,
-0.3355553448200226,
0.09416015446186066,
-0.17097653448581696,
0.24153763055801392,
0.29312264919281006,
-0.3049982190132141,
0.006725754588842392,
-0.15079736709594727,
0.16661199927330017,
-0.29174870252609253,
-0.3438020944595337,
0.14894498884677887,
0.007101863622665405,
0.775802731513977,
0.29652464389801025,
0.12960243225097656,
-0.24099072813987732,
-0.09045612812042236,
-0.08014583587646484,
-0.27712997794151306,
-0.009562642313539982,
0.2615410089492798,
0.18444044888019562,
0.1851210594177246,
-0.0802466943860054,
-0.32122620940208435,
-0.25616225600242615,
0.015904664993286133,
-0.3048824071884155,
0.2294212430715561,
-0.28198879957199097,
-0.028447240591049194,
-0.07979986816644669,
-0.18236000835895538,
-0.2765297293663025,
0.2849745750427246,
-0.09399627149105072,
0.25945836305618286,
-0.2010336071252823,
-0.5635216236114502,
0.7408531308174133,
-0.3572486340999603,
-0.2866348922252655,
0.067291758954525,
0.10026415437459946,
-0.24705934524536133,
-0.012381179258227348,
-0.5152195692062378,
-0.23107090592384338,
0.2557704448699951,
0.08156807720661163,
-0.5286651849746704,
-0.09467069804668427,
-0.03401261195540428,
-0.06998398900032043,
-0.10618248581886292,
0.43721240758895874,
0.022292986512184143,
-0.18668168783187866,
-0.020125828683376312,
-0.17328999936580658
] |
https://github.com/huggingface/datasets/issues/5534 | map() breaks at certain dataset size when using Array3D | Hi! This code works for me locally or in Colab. What's the output of `python -c "import pyarrow as pa; print(pa.__version__)"` when you run it inside your environment? | ### Describe the bug
`map()` magically breaks when using a `Array3D` feature and mapping it. I created a very simple dummy dataset (see below). When filtering it down to 95 elements I can apply map, but it breaks when filtering it down to just 96 entries with the following exception:
```
Traceback (most recent call last):
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3255, in _map_single
writer.finalize() # close_stream=bool(buf_writer is None)) # We only close if we are writing in a file
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_writer.py", line 581, in finalize
self.write_examples_on_file()
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_writer.py", line 440, in write_examples_on_file
batch_examples[col] = array_concat(arrays)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1931, in array_concat
return _concat_arrays(arrays)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1901, in _concat_arrays
return array_type.wrap_array(_concat_arrays([array.storage for array in arrays]))
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1922, in _concat_arrays
_concat_arrays([array.values for array in arrays]),
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1922, in _concat_arrays
_concat_arrays([array.values for array in arrays]),
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1920, in _concat_arrays
return pa.ListArray.from_arrays(
File "pyarrow/array.pxi", line 1997, in pyarrow.lib.ListArray.from_arrays
File "pyarrow/array.pxi", line 1527, in pyarrow.lib.Array.validate
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Negative offsets in list array
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2815, in map
return self._map_single(
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 546, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 513, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/fingerprint.py", line 480, in wrapper
out = func(self, *args, **kwargs)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3259, in _map_single
writer.finalize()
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_writer.py", line 581, in finalize
self.write_examples_on_file()
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_writer.py", line 440, in write_examples_on_file
batch_examples[col] = array_concat(arrays)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1931, in array_concat
return _concat_arrays(arrays)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1901, in _concat_arrays
return array_type.wrap_array(_concat_arrays([array.storage for array in arrays]))
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1922, in _concat_arrays
_concat_arrays([array.values for array in arrays]),
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1922, in _concat_arrays
_concat_arrays([array.values for array in arrays]),
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1920, in _concat_arrays
return pa.ListArray.from_arrays(
File "pyarrow/array.pxi", line 1997, in pyarrow.lib.ListArray.from_arrays
File "pyarrow/array.pxi", line 1527, in pyarrow.lib.Array.validate
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Negative offsets in list array
```
### Steps to reproduce the bug
1. put following dataset loading script into: debug/debug.py
```python
import datasets
import numpy as np
class DEBUG(datasets.GeneratorBasedBuilder):
"""DEBUG dataset."""
def _info(self):
return datasets.DatasetInfo(
features=datasets.Features(
{
"id": datasets.Value("uint8"),
"img_data": datasets.Array3D(shape=(3, 224, 224), dtype="uint8"),
},
),
supervised_keys=None,
)
def _split_generators(self, dl_manager):
return [datasets.SplitGenerator(name=datasets.Split.TRAIN)]
def _generate_examples(self):
for i in range(149):
image_np = np.zeros(shape=(3, 224, 224), dtype=np.int8).tolist()
yield f"id_{i}", {"id": i, "img_data": image_np}
```
2. try the following code:
```python
import datasets
def add_dummy_col(ex):
ex["dummy"] = "test"
return ex
ds = datasets.load_dataset(path="debug", split="train")
# works
ds_filtered_works = ds.filter(lambda example: example["id"] < 95)
print(f"filtered result size: {len(ds_filtered_works)}")
# output:
# filtered result size: 95
ds_mapped_works = ds_filtered_works.map(add_dummy_col)
# fails
ds_filtered_error = ds.filter(lambda example: example["id"] < 96)
print(f"filtered result size: {len(ds_filtered_error)}")
# output:
# filtered result size: 96
ds_mapped_error = ds_filtered_error.map(add_dummy_col)
```
### Expected behavior
The example code does not fail.
### Environment info
Python 3.9.16 (main, Jan 11 2023, 16:05:54); [GCC 11.2.0] :: Anaconda, Inc. on linux
datasets 2.9.0 | 28 | map() breaks at certain dataset size when using Array3D
### Describe the bug
`map()` magically breaks when using a `Array3D` feature and mapping it. I created a very simple dummy dataset (see below). When filtering it down to 95 elements I can apply map, but it breaks when filtering it down to just 96 entries with the following exception:
```
Traceback (most recent call last):
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3255, in _map_single
writer.finalize() # close_stream=bool(buf_writer is None)) # We only close if we are writing in a file
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_writer.py", line 581, in finalize
self.write_examples_on_file()
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_writer.py", line 440, in write_examples_on_file
batch_examples[col] = array_concat(arrays)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1931, in array_concat
return _concat_arrays(arrays)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1901, in _concat_arrays
return array_type.wrap_array(_concat_arrays([array.storage for array in arrays]))
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1922, in _concat_arrays
_concat_arrays([array.values for array in arrays]),
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1922, in _concat_arrays
_concat_arrays([array.values for array in arrays]),
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1920, in _concat_arrays
return pa.ListArray.from_arrays(
File "pyarrow/array.pxi", line 1997, in pyarrow.lib.ListArray.from_arrays
File "pyarrow/array.pxi", line 1527, in pyarrow.lib.Array.validate
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Negative offsets in list array
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2815, in map
return self._map_single(
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 546, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 513, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/fingerprint.py", line 480, in wrapper
out = func(self, *args, **kwargs)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3259, in _map_single
writer.finalize()
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_writer.py", line 581, in finalize
self.write_examples_on_file()
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_writer.py", line 440, in write_examples_on_file
batch_examples[col] = array_concat(arrays)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1931, in array_concat
return _concat_arrays(arrays)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1901, in _concat_arrays
return array_type.wrap_array(_concat_arrays([array.storage for array in arrays]))
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1922, in _concat_arrays
_concat_arrays([array.values for array in arrays]),
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1922, in _concat_arrays
_concat_arrays([array.values for array in arrays]),
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1920, in _concat_arrays
return pa.ListArray.from_arrays(
File "pyarrow/array.pxi", line 1997, in pyarrow.lib.ListArray.from_arrays
File "pyarrow/array.pxi", line 1527, in pyarrow.lib.Array.validate
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Negative offsets in list array
```
### Steps to reproduce the bug
1. put following dataset loading script into: debug/debug.py
```python
import datasets
import numpy as np
class DEBUG(datasets.GeneratorBasedBuilder):
"""DEBUG dataset."""
def _info(self):
return datasets.DatasetInfo(
features=datasets.Features(
{
"id": datasets.Value("uint8"),
"img_data": datasets.Array3D(shape=(3, 224, 224), dtype="uint8"),
},
),
supervised_keys=None,
)
def _split_generators(self, dl_manager):
return [datasets.SplitGenerator(name=datasets.Split.TRAIN)]
def _generate_examples(self):
for i in range(149):
image_np = np.zeros(shape=(3, 224, 224), dtype=np.int8).tolist()
yield f"id_{i}", {"id": i, "img_data": image_np}
```
2. try the following code:
```python
import datasets
def add_dummy_col(ex):
ex["dummy"] = "test"
return ex
ds = datasets.load_dataset(path="debug", split="train")
# works
ds_filtered_works = ds.filter(lambda example: example["id"] < 95)
print(f"filtered result size: {len(ds_filtered_works)}")
# output:
# filtered result size: 95
ds_mapped_works = ds_filtered_works.map(add_dummy_col)
# fails
ds_filtered_error = ds.filter(lambda example: example["id"] < 96)
print(f"filtered result size: {len(ds_filtered_error)}")
# output:
# filtered result size: 96
ds_mapped_error = ds_filtered_error.map(add_dummy_col)
```
### Expected behavior
The example code does not fail.
### Environment info
Python 3.9.16 (main, Jan 11 2023, 16:05:54); [GCC 11.2.0] :: Anaconda, Inc. on linux
datasets 2.9.0
Hi! This code works for me locally or in Colab. What's the output of `python -c "import pyarrow as pa; print(pa.__version__)"` when you run it inside your environment? | [
-0.1609809696674347,
0.006780028343200684,
-0.03623750060796738,
0.21349231898784637,
0.09646676480770111,
-0.09540200978517532,
0.3490159511566162,
0.3220602869987488,
0.10199400782585144,
0.026630543172359467,
0.29777562618255615,
0.08814723044633865,
0.16820955276489258,
0.18610551953315735,
0.09976285696029663,
0.016904287040233612,
0.06657663732767105,
0.0888766199350357,
0.14988258481025696,
0.3137640953063965,
-0.2672036290168762,
0.07809093594551086,
-0.37129855155944824,
-0.08015990257263184,
0.23893381655216217,
-0.02367718331515789,
0.17979326844215393,
-0.1334700584411621,
-0.05388770252466202,
-0.10612475872039795,
0.12296333909034729,
-0.17100393772125244,
-0.021240927278995514,
0.5086191892623901,
-0.0001154391429736279,
-0.17295309901237488,
0.28395670652389526,
-0.18407800793647766,
0.03200143575668335,
0.12439004331827164,
-0.4245286285877228,
-0.37054893374443054,
-0.043995268642902374,
-0.16748878359794617,
0.2314578890800476,
0.16142794489860535,
-0.18591664731502533,
-0.39941951632499695,
0.2068365067243576,
0.29142627120018005,
0.22460788488388062,
0.16245916485786438,
0.3106510043144226,
-0.014742482453584671,
0.09129811823368073,
0.6154147982597351,
-0.2630464732646942,
0.11844679713249207,
0.3713873326778412,
-0.29490774869918823,
0.11826877295970917,
0.31337860226631165,
-0.3061590790748596,
0.08891065418720245,
0.35118815302848816,
-0.2642804682254791,
0.20584702491760254,
-0.3190669119358063,
0.3979032039642334,
0.23133113980293274,
0.2967633903026581,
-0.27954432368278503,
-0.19280749559402466,
-0.18383213877677917,
-0.38571903109550476,
0.09450193494558334,
-0.20015698671340942,
0.20277541875839233,
-0.19961515069007874,
-0.20813456177711487,
-0.6706724762916565,
-0.10496868938207626,
-0.021012429147958755,
0.4440087676048279,
-0.2402951866388321,
0.10107044875621796,
-0.15498048067092896,
0.2962493300437927,
0.23391345143318176,
-0.3090907335281372,
0.2460164576768875,
0.03824031352996826,
-0.17836643755435944,
0.1329365372657776,
0.04131268709897995,
-0.18289536237716675,
0.20065301656723022,
0.038597967475652695,
0.3573424816131592,
-0.6032798886299133,
0.24634824693202972,
0.2273869812488556,
0.32636699080467224,
0.20525088906288147,
0.25056278705596924,
0.06034552678465843,
0.273391991853714,
0.299030065536499,
0.05799643322825432,
-0.013983074575662613,
-0.07595813274383545,
-0.13899356126785278,
0.3083781898021698,
-0.1476258933544159,
-0.045784734189510345,
-0.1671966016292572,
0.04859330505132675,
-0.0422687791287899,
0.023451661691069603,
-0.011044272221624851,
-0.4181547164916992,
0.21438424289226532,
0.08302652090787888,
0.2643972933292389,
0.5146888494491577,
0.173263281583786,
-0.11625262349843979,
0.2618694007396698,
-0.20285043120384216,
-0.12914086878299713,
-0.05911220982670784,
-0.1924923062324524,
-0.10238225758075714,
-0.19997581839561462,
0.26762861013412476,
0.46959394216537476,
0.13824394345283508,
-0.2751094102859497,
0.0014157146215438843,
-0.0814095288515091,
0.26883333921432495,
-0.26898661255836487,
0.5067262053489685,
0.29517725110054016,
0.007662124931812286,
0.29461562633514404,
0.09861065447330475,
0.21900542080402374,
-0.14773690700531006,
0.26123765110969543,
-0.17063474655151367,
-0.02351287752389908,
0.01016613095998764,
0.16861985623836517,
0.06964940577745438,
0.3287025988101959,
0.02687554806470871,
0.12154607474803925,
0.4424385130405426,
-0.6091936826705933,
0.1672908216714859,
-0.399114191532135,
-0.4598844051361084,
-0.32209837436676025,
0.06825023889541626,
0.43086880445480347,
-0.6774109601974487,
0.20609155297279358,
-0.43487274646759033,
0.22890447080135345,
-0.154005229473114,
0.15325860679149628,
-0.33172473311424255,
0.010083034634590149,
-0.09114008396863937,
0.08207586407661438,
0.16931891441345215,
-0.0954742431640625,
-0.5963466167449951,
0.40885284543037415,
0.18297232687473297,
-0.051622722297906876,
-0.442848801612854,
-0.09981749951839447,
0.33609041571617126,
-0.2525709271430969,
-0.01536087691783905,
0.35839009284973145,
-0.27483323216438293,
0.10000253468751907,
-0.1117381602525711,
0.08728346973657608,
0.21258807182312012,
-0.25696054100990295,
0.0013282671570777893,
-0.07540684193372726,
0.30627530813217163,
-0.07167292386293411,
0.12425237149000168,
0.03736454248428345,
0.16135525703430176,
0.2283962368965149,
-0.02246696874499321,
-0.3612414002418518,
0.09777461737394333,
0.0058596134185791016,
-0.5015106797218323,
0.22016343474388123,
-0.010199442505836487,
-0.4962227940559387,
-0.043989717960357666,
0.14400386810302734,
0.056482285261154175,
0.15895383059978485,
0.22544832527637482,
0.009371468797326088,
0.08939895778894424,
-0.13609614968299866,
0.02423379197716713,
-0.13262693583965302,
0.2847980260848999,
-0.42598599195480347,
0.37434589862823486,
0.0020856251940131187,
-0.225493386387825,
0.051243655383586884,
0.0648447647690773,
-0.23640941083431244,
-0.2664054036140442,
-0.002862386405467987,
0.28690335154533386,
-0.24525666236877441,
-0.13794445991516113,
0.28865453600883484,
0.18633513152599335,
-0.11917276680469513,
-0.43163836002349854,
0.012158408761024475,
0.221358060836792,
-0.12220726907253265,
0.2789781987667084,
0.3167308270931244,
0.21956585347652435,
-0.26621055603027344,
0.046547695994377136,
0.06603336334228516,
-0.10200004279613495,
0.34224027395248413,
0.0006370618939399719,
0.25419852137565613,
-0.1307438611984253,
0.016404155641794205,
0.08763696253299713,
-0.4090384840965271,
-0.034878116101026535,
0.0698172003030777,
0.08416837453842163,
-0.037521764636039734,
0.24677440524101257,
0.19313371181488037,
0.30449408292770386,
-0.0920964926481247,
0.1935667097568512,
0.1089952141046524,
-0.23844999074935913,
0.1910303831100464,
0.23633328080177307,
0.22678504884243011,
0.32145482301712036,
0.09820470213890076,
0.008948396891355515,
-0.24566587805747986,
0.22130486369132996,
-0.021459680050611496,
0.23545530438423157,
0.2814677357673645,
0.2987057864665985,
-0.041985511779785156,
0.2932181656360626,
-0.02661353349685669,
-0.1634039431810379,
-0.12805815041065216,
0.12962527573108673,
-0.0730285719037056,
-0.185859814286232,
0.30593323707580566,
0.02770562283694744,
-0.36982378363609314,
-0.06027091294527054,
-0.515903115272522,
-0.37596622109413147,
-0.24428926408290863,
-0.20448769629001617,
-0.03603145107626915,
-0.31661489605903625,
-0.0561511367559433,
-0.11808359622955322,
-0.24686528742313385,
0.20335158705711365,
-0.016339050605893135,
0.15564826130867004,
-0.08105629682540894,
-0.18446311354637146,
0.04636938497424126,
0.29583001136779785,
-0.056847065687179565,
0.16876927018165588,
0.22576424479484558,
-0.0006774552166461945,
-0.07164248824119568,
-0.34288859367370605,
-0.00506896898150444,
-0.01626000925898552,
0.24297258257865906,
0.16185235977172852,
0.19691921770572662,
-0.1250360906124115,
0.083598293364048,
0.20801784098148346,
-0.3280918598175049,
0.11858172714710236,
0.21526159346103668,
0.3720899522304535,
-0.08472525328397751,
-0.3218948543071747,
0.1883947104215622,
0.05884537845849991,
-0.3494912385940552,
0.018044855445623398,
-0.17364798486232758,
0.30850839614868164,
0.07374285161495209,
0.3021160960197449,
0.004800716415047646,
-0.01253657415509224,
-0.27025797963142395,
0.09852712601423264,
0.2955997586250305,
0.133820578455925,
-0.049195047467947006,
-0.2023242861032486,
0.0390898622572422,
0.04206732660531998,
-0.15521752834320068,
0.4020676612854004,
-0.1656632125377655,
-0.02415088564157486,
-0.15073725581169128,
-0.2949719727039337,
-0.0880545973777771,
0.022819213569164276,
0.34307700395584106,
-0.06118609383702278,
0.05101807415485382,
-0.19824814796447754,
-0.3769925534725189,
0.032285526394844055,
0.3134959042072296,
0.15073752403259277,
0.001992899924516678,
0.5993713140487671,
0.02584884688258171,
0.3858213424682617,
0.1761239469051361,
-0.06142313405871391,
0.26363664865493774,
0.25750625133514404,
0.10780593752861023,
-0.2430919110774994,
-0.2783624827861786,
0.15228775143623352,
-0.24447885155677795,
-0.1331098973751068,
-0.1199583113193512,
0.046917304396629333,
-0.6154621243476868,
-0.09860661625862122,
0.041273344308137894,
-0.1319778859615326,
-0.2205807864665985,
0.11084190011024475,
-0.07665156573057175,
0.2814258337020874,
-0.060381609946489334,
0.3492882251739502,
-0.04713425785303116,
-0.09569405764341354,
-0.011158403009176254,
-0.4575745463371277,
0.18534140288829803,
0.06268981844186783,
-0.179556205868721,
-0.11689439415931702,
-0.2767468988895416,
0.4214606285095215,
0.05681740120053291,
0.6528871059417725,
-0.0913250520825386,
-0.06920874118804932,
-0.22194688022136688,
0.23073305189609528,
1.0717202425003052,
-0.5372605323791504,
-0.010408177971839905,
0.11072804033756256,
0.06836759299039841,
-0.8002566695213318,
0.12432940304279327,
-0.1163024753332138,
0.1980922520160675,
0.2113073617219925,
0.0750354677438736,
0.0019097179174423218,
0.2525254189968109,
-0.17060048878192902,
0.15916314721107483,
0.08376260101795197,
0.012205158360302448,
-0.005177423357963562,
0.017054647207260132,
-0.11439095437526703,
-0.04601956158876419,
0.12890110909938812,
-0.15396898984909058,
0.5434598922729492,
-0.2850315570831299,
-0.04089394211769104,
-0.381681352853775,
-0.1782308667898178,
0.08088068664073944,
0.34044063091278076,
-0.018625671043992043,
0.04511566832661629,
0.17163418233394623,
0.1599937379360199,
0.21793179214000702,
0.22233186662197113,
0.06329817324876785,
0.09930505603551865,
0.032232560217380524,
0.1580178141593933,
0.2535395920276642,
0.4709613025188446,
0.18336810171604156,
-0.06917587667703629,
-0.08971793204545975,
0.05474782735109329,
-0.17948248982429504,
-0.0868537649512291,
0.10321081429719925,
-0.21671083569526672,
-0.3442390263080597,
-0.007559517398476601,
0.168866366147995,
-0.20546892285346985,
0.020963743329048157,
0.3699284493923187,
-0.20776118338108063,
-0.4068904519081116,
0.5369426012039185,
0.1561325192451477,
0.6581884622573853,
-0.1519242525100708,
-0.027483824640512466,
-0.21614041924476624,
-0.1413707435131073,
-0.06899535655975342,
0.21390683948993683,
0.20930616557598114,
-0.15586328506469727,
-0.10700781643390656,
-0.15850727260112762,
-0.22525425255298615,
0.19838905334472656,
0.16281965374946594,
-0.29881787300109863,
0.17754223942756653,
0.14971357583999634,
0.10252055525779724,
-0.09067009389400482,
-0.26986968517303467,
0.16447623074054718,
-0.2200498729944229,
-0.19038636982440948,
0.11759553849697113,
0.010545976459980011,
-0.080482617020607,
-0.05299689248204231,
-0.24355478584766388,
0.09094482660293579,
-0.3291586637496948,
-0.20084264874458313,
-0.019644618034362793,
-0.7418710589408875,
0.06825301051139832,
0.17623737454414368,
-0.2794078588485718,
0.2531541585922241,
-0.04113531485199928,
-0.47476935386657715,
0.38877007365226746,
-0.2614634931087494,
-0.058098677545785904,
0.38029390573501587,
-0.0057020471431314945,
0.1469401866197586,
-0.14001674950122833,
-0.14865079522132874,
0.13034436106681824,
-0.04667402803897858,
0.10076101124286652,
0.01705111190676689,
0.11239497363567352,
-0.19883929193019867,
0.32715821266174316,
0.29015886783599854,
-0.27075597643852234,
-0.40790659189224243,
-0.3721560835838318,
-0.13620002567768097,
0.03194369003176689,
0.0705532506108284,
-0.042623646557331085,
-0.02336198464035988,
0.10619867593050003,
-0.33225271105766296,
-0.0720893070101738,
-0.11508418619632721,
0.3173656165599823,
-0.23161441087722778,
0.21980708837509155,
0.04105225205421448,
0.20792977511882782,
-0.16572879254817963,
-0.1785334348678589,
0.26439061760902405,
0.08594566583633423,
0.020370125770568848,
-0.024997595697641373,
-0.28834620118141174,
-0.18594297766685486,
0.16739621758460999,
-0.1333615481853485,
-0.028575457632541656,
0.03245321288704872,
-0.22447673976421356,
-0.5071141719818115,
-0.023866208270192146,
0.09194877743721008,
0.1750708371400833,
0.012828685343265533,
-0.18001049757003784,
-0.33356156945228577,
0.02930351160466671,
0.3388083279132843,
-0.21353259682655334,
0.2373816817998886,
0.2681388854980469,
0.33106493949890137,
-0.5360870361328125,
-0.004370581358671188,
-0.1496574878692627,
-0.2933671176433563,
0.014634249731898308,
0.2153066098690033,
-0.26593491435050964,
-0.12071128189563751,
0.05630943551659584,
0.10995133966207504,
0.06742887198925018,
-0.32143622636795044,
0.18689647316932678,
-0.3392127752304077,
0.00021635182201862335,
-0.3445305824279785,
0.12263351678848267,
-0.15082824230194092,
-0.19924654066562653,
-0.09749253839254379,
0.14580775797367096,
-0.17410480976104736,
0.06930723786354065,
0.10468896478414536,
-0.1284608095884323,
-0.016475096344947815,
0.26828181743621826,
0.29506075382232666,
0.21439369022846222,
-0.015853747725486755,
-0.08160515129566193,
0.014578133821487427,
-0.30829429626464844,
-0.19626262784004211,
0.37086719274520874,
-0.23521079123020172,
0.0775737464427948,
0.3172169625759125,
0.4369165301322937,
0.06507183611392975,
-0.5209674835205078,
0.0936085507273674,
0.01257815770804882,
0.17824438214302063,
-0.017745627090334892,
-0.2569306492805481,
0.5185834765434265,
0.27450504899024963,
0.1859758049249649,
0.432468980550766,
0.023315738886594772,
-0.3890783488750458,
-0.07322481274604797,
0.1640472412109375,
0.0008572184015065432,
0.26010698080062866,
-0.039445843547582626,
0.6049032807350159,
-0.2108549028635025,
-0.03357822075486183,
0.09502045810222626,
0.08500727266073227,
0.5228585004806519,
0.5042372941970825,
0.304094135761261,
0.45326530933380127,
0.19112807512283325,
0.181727796792984,
0.05978715419769287,
-0.41686391830444336,
0.21227771043777466,
0.10685364902019501,
0.14038926362991333,
0.4361279606819153,
-0.036444805562496185,
-0.2753985524177551,
-0.2076951116323471,
-0.17013408243656158,
-0.10626406967639923,
-0.2778283953666687,
-0.2478047013282776,
0.015296446159482002,
0.31365838646888733,
-0.11223919689655304,
0.1783376932144165,
-0.014270134270191193,
-0.03174740448594093,
-0.34020501375198364,
0.508258581161499,
0.10480068624019623,
-0.10048657655715942,
-0.036748431622982025,
0.21541452407836914,
-0.06833250820636749,
0.05331030860543251,
-0.35493582487106323,
0.3460351526737213,
-0.31529104709625244,
-0.05467595160007477,
-0.17782650887966156,
0.0747104361653328,
0.32984864711761475,
0.37532585859298706,
-0.3147587180137634,
0.2346702516078949,
0.19589440524578094,
-0.23517754673957825,
-0.16910463571548462,
0.11296805739402771,
0.09313954412937164,
0.4102211594581604,
0.2556665539741516,
0.04815150797367096,
-0.03533504158258438,
-0.22673265635967255,
0.2677775025367737,
0.23597794771194458,
-0.19797252118587494,
-0.009755082428455353,
-0.5865908861160278,
-0.021171055734157562,
-0.15698787569999695,
-0.10588514059782028,
-0.1835787296295166,
0.026305779814720154,
0.47472822666168213,
-0.2701747715473175,
0.11920437961816788,
-0.005080976989120245,
0.019651789218187332,
-0.2289419174194336,
0.37548312544822693,
0.09905649721622467,
-0.06417598575353622,
-0.44579392671585083,
-0.16750094294548035,
-0.08356047421693802,
0.24655112624168396,
-0.588866114616394,
0.25730225443840027,
0.3774237036705017,
0.006766472011804581,
0.18972645699977875,
0.08487427234649658,
0.19326269626617432,
0.1288667917251587,
-0.12014535069465637,
0.31541964411735535,
-0.08162087202072144,
-0.22788293659687042,
-0.15874320268630981,
-0.08972465991973877,
0.11170646548271179,
-0.47072848677635193,
0.4955458641052246,
-0.5262969732284546,
-0.00011242181062698364,
0.05859600380063057,
-0.09783969819545746,
0.08974696695804596,
0.2902357876300812,
0.29599618911743164,
0.23032699525356293,
0.19184857606887817,
0.0024318285286426544,
0.07393021881580353,
-0.1334584355354309,
-0.017729204148054123,
-0.03981597721576691,
0.42839398980140686,
0.11455574631690979,
0.22471590340137482,
-0.274193674325943,
0.016056591644883156,
-0.06741110980510712,
0.1598648726940155,
-0.09190899133682251,
0.2389337420463562,
0.06899657100439072,
-0.04221464693546295,
-0.1542280614376068,
-0.031265366822481155,
0.06723672896623611,
0.04628854617476463,
-0.14825378358364105,
0.055873990058898926,
-0.010285183787345886,
-0.19683517515659332,
0.3047220706939697,
-0.36483725905418396,
-0.3212844431400299,
0.1509166806936264,
0.20151552557945251,
-0.43294233083724976,
-0.19957801699638367,
-0.5467274785041809,
-0.14494623243808746,
0.14351773262023926,
-0.09388092905282974,
-0.289010226726532,
-0.14085930585861206,
-0.33500659465789795,
-0.173071026802063,
0.014592062681913376,
0.7014437913894653,
0.15440095961093903,
-0.2162228226661682,
0.18146714568138123,
0.036710016429424286
] |
https://github.com/huggingface/datasets/issues/5534 | map() breaks at certain dataset size when using Array3D | Thanks for looking into this!
The output of `python -c "import pyarrow as pa; print(pa.__version__)"` is:
```
11.0.0
```
I did the following to setup the environment:
```
conda create -n datasets_debug python=3.9
conda activate datasets_debug
pip install datasets==2.9.0
```
I just tested this on another machine (Ubuntu 18.04.6 LTS) with the same result as mentioned in the issue description.
| ### Describe the bug
`map()` magically breaks when using a `Array3D` feature and mapping it. I created a very simple dummy dataset (see below). When filtering it down to 95 elements I can apply map, but it breaks when filtering it down to just 96 entries with the following exception:
```
Traceback (most recent call last):
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3255, in _map_single
writer.finalize() # close_stream=bool(buf_writer is None)) # We only close if we are writing in a file
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_writer.py", line 581, in finalize
self.write_examples_on_file()
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_writer.py", line 440, in write_examples_on_file
batch_examples[col] = array_concat(arrays)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1931, in array_concat
return _concat_arrays(arrays)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1901, in _concat_arrays
return array_type.wrap_array(_concat_arrays([array.storage for array in arrays]))
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1922, in _concat_arrays
_concat_arrays([array.values for array in arrays]),
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1922, in _concat_arrays
_concat_arrays([array.values for array in arrays]),
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1920, in _concat_arrays
return pa.ListArray.from_arrays(
File "pyarrow/array.pxi", line 1997, in pyarrow.lib.ListArray.from_arrays
File "pyarrow/array.pxi", line 1527, in pyarrow.lib.Array.validate
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Negative offsets in list array
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2815, in map
return self._map_single(
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 546, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 513, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/fingerprint.py", line 480, in wrapper
out = func(self, *args, **kwargs)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3259, in _map_single
writer.finalize()
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_writer.py", line 581, in finalize
self.write_examples_on_file()
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_writer.py", line 440, in write_examples_on_file
batch_examples[col] = array_concat(arrays)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1931, in array_concat
return _concat_arrays(arrays)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1901, in _concat_arrays
return array_type.wrap_array(_concat_arrays([array.storage for array in arrays]))
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1922, in _concat_arrays
_concat_arrays([array.values for array in arrays]),
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1922, in _concat_arrays
_concat_arrays([array.values for array in arrays]),
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1920, in _concat_arrays
return pa.ListArray.from_arrays(
File "pyarrow/array.pxi", line 1997, in pyarrow.lib.ListArray.from_arrays
File "pyarrow/array.pxi", line 1527, in pyarrow.lib.Array.validate
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Negative offsets in list array
```
### Steps to reproduce the bug
1. put following dataset loading script into: debug/debug.py
```python
import datasets
import numpy as np
class DEBUG(datasets.GeneratorBasedBuilder):
"""DEBUG dataset."""
def _info(self):
return datasets.DatasetInfo(
features=datasets.Features(
{
"id": datasets.Value("uint8"),
"img_data": datasets.Array3D(shape=(3, 224, 224), dtype="uint8"),
},
),
supervised_keys=None,
)
def _split_generators(self, dl_manager):
return [datasets.SplitGenerator(name=datasets.Split.TRAIN)]
def _generate_examples(self):
for i in range(149):
image_np = np.zeros(shape=(3, 224, 224), dtype=np.int8).tolist()
yield f"id_{i}", {"id": i, "img_data": image_np}
```
2. try the following code:
```python
import datasets
def add_dummy_col(ex):
ex["dummy"] = "test"
return ex
ds = datasets.load_dataset(path="debug", split="train")
# works
ds_filtered_works = ds.filter(lambda example: example["id"] < 95)
print(f"filtered result size: {len(ds_filtered_works)}")
# output:
# filtered result size: 95
ds_mapped_works = ds_filtered_works.map(add_dummy_col)
# fails
ds_filtered_error = ds.filter(lambda example: example["id"] < 96)
print(f"filtered result size: {len(ds_filtered_error)}")
# output:
# filtered result size: 96
ds_mapped_error = ds_filtered_error.map(add_dummy_col)
```
### Expected behavior
The example code does not fail.
### Environment info
Python 3.9.16 (main, Jan 11 2023, 16:05:54); [GCC 11.2.0] :: Anaconda, Inc. on linux
datasets 2.9.0 | 60 | map() breaks at certain dataset size when using Array3D
### Describe the bug
`map()` magically breaks when using a `Array3D` feature and mapping it. I created a very simple dummy dataset (see below). When filtering it down to 95 elements I can apply map, but it breaks when filtering it down to just 96 entries with the following exception:
```
Traceback (most recent call last):
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3255, in _map_single
writer.finalize() # close_stream=bool(buf_writer is None)) # We only close if we are writing in a file
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_writer.py", line 581, in finalize
self.write_examples_on_file()
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_writer.py", line 440, in write_examples_on_file
batch_examples[col] = array_concat(arrays)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1931, in array_concat
return _concat_arrays(arrays)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1901, in _concat_arrays
return array_type.wrap_array(_concat_arrays([array.storage for array in arrays]))
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1922, in _concat_arrays
_concat_arrays([array.values for array in arrays]),
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1922, in _concat_arrays
_concat_arrays([array.values for array in arrays]),
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1920, in _concat_arrays
return pa.ListArray.from_arrays(
File "pyarrow/array.pxi", line 1997, in pyarrow.lib.ListArray.from_arrays
File "pyarrow/array.pxi", line 1527, in pyarrow.lib.Array.validate
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Negative offsets in list array
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2815, in map
return self._map_single(
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 546, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 513, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/fingerprint.py", line 480, in wrapper
out = func(self, *args, **kwargs)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3259, in _map_single
writer.finalize()
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_writer.py", line 581, in finalize
self.write_examples_on_file()
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/arrow_writer.py", line 440, in write_examples_on_file
batch_examples[col] = array_concat(arrays)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1931, in array_concat
return _concat_arrays(arrays)
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1901, in _concat_arrays
return array_type.wrap_array(_concat_arrays([array.storage for array in arrays]))
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1922, in _concat_arrays
_concat_arrays([array.values for array in arrays]),
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1922, in _concat_arrays
_concat_arrays([array.values for array in arrays]),
File "/home/arbi01/miniconda3/envs/tmp9/lib/python3.9/site-packages/datasets/table.py", line 1920, in _concat_arrays
return pa.ListArray.from_arrays(
File "pyarrow/array.pxi", line 1997, in pyarrow.lib.ListArray.from_arrays
File "pyarrow/array.pxi", line 1527, in pyarrow.lib.Array.validate
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Negative offsets in list array
```
### Steps to reproduce the bug
1. put following dataset loading script into: debug/debug.py
```python
import datasets
import numpy as np
class DEBUG(datasets.GeneratorBasedBuilder):
"""DEBUG dataset."""
def _info(self):
return datasets.DatasetInfo(
features=datasets.Features(
{
"id": datasets.Value("uint8"),
"img_data": datasets.Array3D(shape=(3, 224, 224), dtype="uint8"),
},
),
supervised_keys=None,
)
def _split_generators(self, dl_manager):
return [datasets.SplitGenerator(name=datasets.Split.TRAIN)]
def _generate_examples(self):
for i in range(149):
image_np = np.zeros(shape=(3, 224, 224), dtype=np.int8).tolist()
yield f"id_{i}", {"id": i, "img_data": image_np}
```
2. try the following code:
```python
import datasets
def add_dummy_col(ex):
ex["dummy"] = "test"
return ex
ds = datasets.load_dataset(path="debug", split="train")
# works
ds_filtered_works = ds.filter(lambda example: example["id"] < 95)
print(f"filtered result size: {len(ds_filtered_works)}")
# output:
# filtered result size: 95
ds_mapped_works = ds_filtered_works.map(add_dummy_col)
# fails
ds_filtered_error = ds.filter(lambda example: example["id"] < 96)
print(f"filtered result size: {len(ds_filtered_error)}")
# output:
# filtered result size: 96
ds_mapped_error = ds_filtered_error.map(add_dummy_col)
```
### Expected behavior
The example code does not fail.
### Environment info
Python 3.9.16 (main, Jan 11 2023, 16:05:54); [GCC 11.2.0] :: Anaconda, Inc. on linux
datasets 2.9.0
Thanks for looking into this!
The output of `python -c "import pyarrow as pa; print(pa.__version__)"` is:
```
11.0.0
```
I did the following to setup the environment:
```
conda create -n datasets_debug python=3.9
conda activate datasets_debug
pip install datasets==2.9.0
```
I just tested this on another machine (Ubuntu 18.04.6 LTS) with the same result as mentioned in the issue description.
| [
-0.1609809696674347,
0.006780028343200684,
-0.03623750060796738,
0.21349231898784637,
0.09646676480770111,
-0.09540200978517532,
0.3490159511566162,
0.3220602869987488,
0.10199400782585144,
0.026630543172359467,
0.29777562618255615,
0.08814723044633865,
0.16820955276489258,
0.18610551953315735,
0.09976285696029663,
0.016904287040233612,
0.06657663732767105,
0.0888766199350357,
0.14988258481025696,
0.3137640953063965,
-0.2672036290168762,
0.07809093594551086,
-0.37129855155944824,
-0.08015990257263184,
0.23893381655216217,
-0.02367718331515789,
0.17979326844215393,
-0.1334700584411621,
-0.05388770252466202,
-0.10612475872039795,
0.12296333909034729,
-0.17100393772125244,
-0.021240927278995514,
0.5086191892623901,
-0.0001154391429736279,
-0.17295309901237488,
0.28395670652389526,
-0.18407800793647766,
0.03200143575668335,
0.12439004331827164,
-0.4245286285877228,
-0.37054893374443054,
-0.043995268642902374,
-0.16748878359794617,
0.2314578890800476,
0.16142794489860535,
-0.18591664731502533,
-0.39941951632499695,
0.2068365067243576,
0.29142627120018005,
0.22460788488388062,
0.16245916485786438,
0.3106510043144226,
-0.014742482453584671,
0.09129811823368073,
0.6154147982597351,
-0.2630464732646942,
0.11844679713249207,
0.3713873326778412,
-0.29490774869918823,
0.11826877295970917,
0.31337860226631165,
-0.3061590790748596,
0.08891065418720245,
0.35118815302848816,
-0.2642804682254791,
0.20584702491760254,
-0.3190669119358063,
0.3979032039642334,
0.23133113980293274,
0.2967633903026581,
-0.27954432368278503,
-0.19280749559402466,
-0.18383213877677917,
-0.38571903109550476,
0.09450193494558334,
-0.20015698671340942,
0.20277541875839233,
-0.19961515069007874,
-0.20813456177711487,
-0.6706724762916565,
-0.10496868938207626,
-0.021012429147958755,
0.4440087676048279,
-0.2402951866388321,
0.10107044875621796,
-0.15498048067092896,
0.2962493300437927,
0.23391345143318176,
-0.3090907335281372,
0.2460164576768875,
0.03824031352996826,
-0.17836643755435944,
0.1329365372657776,
0.04131268709897995,
-0.18289536237716675,
0.20065301656723022,
0.038597967475652695,
0.3573424816131592,
-0.6032798886299133,
0.24634824693202972,
0.2273869812488556,
0.32636699080467224,
0.20525088906288147,
0.25056278705596924,
0.06034552678465843,
0.273391991853714,
0.299030065536499,
0.05799643322825432,
-0.013983074575662613,
-0.07595813274383545,
-0.13899356126785278,
0.3083781898021698,
-0.1476258933544159,
-0.045784734189510345,
-0.1671966016292572,
0.04859330505132675,
-0.0422687791287899,
0.023451661691069603,
-0.011044272221624851,
-0.4181547164916992,
0.21438424289226532,
0.08302652090787888,
0.2643972933292389,
0.5146888494491577,
0.173263281583786,
-0.11625262349843979,
0.2618694007396698,
-0.20285043120384216,
-0.12914086878299713,
-0.05911220982670784,
-0.1924923062324524,
-0.10238225758075714,
-0.19997581839561462,
0.26762861013412476,
0.46959394216537476,
0.13824394345283508,
-0.2751094102859497,
0.0014157146215438843,
-0.0814095288515091,
0.26883333921432495,
-0.26898661255836487,
0.5067262053489685,
0.29517725110054016,
0.007662124931812286,
0.29461562633514404,
0.09861065447330475,
0.21900542080402374,
-0.14773690700531006,
0.26123765110969543,
-0.17063474655151367,
-0.02351287752389908,
0.01016613095998764,
0.16861985623836517,
0.06964940577745438,
0.3287025988101959,
0.02687554806470871,
0.12154607474803925,
0.4424385130405426,
-0.6091936826705933,
0.1672908216714859,
-0.399114191532135,
-0.4598844051361084,
-0.32209837436676025,
0.06825023889541626,
0.43086880445480347,
-0.6774109601974487,
0.20609155297279358,
-0.43487274646759033,
0.22890447080135345,
-0.154005229473114,
0.15325860679149628,
-0.33172473311424255,
0.010083034634590149,
-0.09114008396863937,
0.08207586407661438,
0.16931891441345215,
-0.0954742431640625,
-0.5963466167449951,
0.40885284543037415,
0.18297232687473297,
-0.051622722297906876,
-0.442848801612854,
-0.09981749951839447,
0.33609041571617126,
-0.2525709271430969,
-0.01536087691783905,
0.35839009284973145,
-0.27483323216438293,
0.10000253468751907,
-0.1117381602525711,
0.08728346973657608,
0.21258807182312012,
-0.25696054100990295,
0.0013282671570777893,
-0.07540684193372726,
0.30627530813217163,
-0.07167292386293411,
0.12425237149000168,
0.03736454248428345,
0.16135525703430176,
0.2283962368965149,
-0.02246696874499321,
-0.3612414002418518,
0.09777461737394333,
0.0058596134185791016,
-0.5015106797218323,
0.22016343474388123,
-0.010199442505836487,
-0.4962227940559387,
-0.043989717960357666,
0.14400386810302734,
0.056482285261154175,
0.15895383059978485,
0.22544832527637482,
0.009371468797326088,
0.08939895778894424,
-0.13609614968299866,
0.02423379197716713,
-0.13262693583965302,
0.2847980260848999,
-0.42598599195480347,
0.37434589862823486,
0.0020856251940131187,
-0.225493386387825,
0.051243655383586884,
0.0648447647690773,
-0.23640941083431244,
-0.2664054036140442,
-0.002862386405467987,
0.28690335154533386,
-0.24525666236877441,
-0.13794445991516113,
0.28865453600883484,
0.18633513152599335,
-0.11917276680469513,
-0.43163836002349854,
0.012158408761024475,
0.221358060836792,
-0.12220726907253265,
0.2789781987667084,
0.3167308270931244,
0.21956585347652435,
-0.26621055603027344,
0.046547695994377136,
0.06603336334228516,
-0.10200004279613495,
0.34224027395248413,
0.0006370618939399719,
0.25419852137565613,
-0.1307438611984253,
0.016404155641794205,
0.08763696253299713,
-0.4090384840965271,
-0.034878116101026535,
0.0698172003030777,
0.08416837453842163,
-0.037521764636039734,
0.24677440524101257,
0.19313371181488037,
0.30449408292770386,
-0.0920964926481247,
0.1935667097568512,
0.1089952141046524,
-0.23844999074935913,
0.1910303831100464,
0.23633328080177307,
0.22678504884243011,
0.32145482301712036,
0.09820470213890076,
0.008948396891355515,
-0.24566587805747986,
0.22130486369132996,
-0.021459680050611496,
0.23545530438423157,
0.2814677357673645,
0.2987057864665985,
-0.041985511779785156,
0.2932181656360626,
-0.02661353349685669,
-0.1634039431810379,
-0.12805815041065216,
0.12962527573108673,
-0.0730285719037056,
-0.185859814286232,
0.30593323707580566,
0.02770562283694744,
-0.36982378363609314,
-0.06027091294527054,
-0.515903115272522,
-0.37596622109413147,
-0.24428926408290863,
-0.20448769629001617,
-0.03603145107626915,
-0.31661489605903625,
-0.0561511367559433,
-0.11808359622955322,
-0.24686528742313385,
0.20335158705711365,
-0.016339050605893135,
0.15564826130867004,
-0.08105629682540894,
-0.18446311354637146,
0.04636938497424126,
0.29583001136779785,
-0.056847065687179565,
0.16876927018165588,
0.22576424479484558,
-0.0006774552166461945,
-0.07164248824119568,
-0.34288859367370605,
-0.00506896898150444,
-0.01626000925898552,
0.24297258257865906,
0.16185235977172852,
0.19691921770572662,
-0.1250360906124115,
0.083598293364048,
0.20801784098148346,
-0.3280918598175049,
0.11858172714710236,
0.21526159346103668,
0.3720899522304535,
-0.08472525328397751,
-0.3218948543071747,
0.1883947104215622,
0.05884537845849991,
-0.3494912385940552,
0.018044855445623398,
-0.17364798486232758,
0.30850839614868164,
0.07374285161495209,
0.3021160960197449,
0.004800716415047646,
-0.01253657415509224,
-0.27025797963142395,
0.09852712601423264,
0.2955997586250305,
0.133820578455925,
-0.049195047467947006,
-0.2023242861032486,
0.0390898622572422,
0.04206732660531998,
-0.15521752834320068,
0.4020676612854004,
-0.1656632125377655,
-0.02415088564157486,
-0.15073725581169128,
-0.2949719727039337,
-0.0880545973777771,
0.022819213569164276,
0.34307700395584106,
-0.06118609383702278,
0.05101807415485382,
-0.19824814796447754,
-0.3769925534725189,
0.032285526394844055,
0.3134959042072296,
0.15073752403259277,
0.001992899924516678,
0.5993713140487671,
0.02584884688258171,
0.3858213424682617,
0.1761239469051361,
-0.06142313405871391,
0.26363664865493774,
0.25750625133514404,
0.10780593752861023,
-0.2430919110774994,
-0.2783624827861786,
0.15228775143623352,
-0.24447885155677795,
-0.1331098973751068,
-0.1199583113193512,
0.046917304396629333,
-0.6154621243476868,
-0.09860661625862122,
0.041273344308137894,
-0.1319778859615326,
-0.2205807864665985,
0.11084190011024475,
-0.07665156573057175,
0.2814258337020874,
-0.060381609946489334,
0.3492882251739502,
-0.04713425785303116,
-0.09569405764341354,
-0.011158403009176254,
-0.4575745463371277,
0.18534140288829803,
0.06268981844186783,
-0.179556205868721,
-0.11689439415931702,
-0.2767468988895416,
0.4214606285095215,
0.05681740120053291,
0.6528871059417725,
-0.0913250520825386,
-0.06920874118804932,
-0.22194688022136688,
0.23073305189609528,
1.0717202425003052,
-0.5372605323791504,
-0.010408177971839905,
0.11072804033756256,
0.06836759299039841,
-0.8002566695213318,
0.12432940304279327,
-0.1163024753332138,
0.1980922520160675,
0.2113073617219925,
0.0750354677438736,
0.0019097179174423218,
0.2525254189968109,
-0.17060048878192902,
0.15916314721107483,
0.08376260101795197,
0.012205158360302448,
-0.005177423357963562,
0.017054647207260132,
-0.11439095437526703,
-0.04601956158876419,
0.12890110909938812,
-0.15396898984909058,
0.5434598922729492,
-0.2850315570831299,
-0.04089394211769104,
-0.381681352853775,
-0.1782308667898178,
0.08088068664073944,
0.34044063091278076,
-0.018625671043992043,
0.04511566832661629,
0.17163418233394623,
0.1599937379360199,
0.21793179214000702,
0.22233186662197113,
0.06329817324876785,
0.09930505603551865,
0.032232560217380524,
0.1580178141593933,
0.2535395920276642,
0.4709613025188446,
0.18336810171604156,
-0.06917587667703629,
-0.08971793204545975,
0.05474782735109329,
-0.17948248982429504,
-0.0868537649512291,
0.10321081429719925,
-0.21671083569526672,
-0.3442390263080597,
-0.007559517398476601,
0.168866366147995,
-0.20546892285346985,
0.020963743329048157,
0.3699284493923187,
-0.20776118338108063,
-0.4068904519081116,
0.5369426012039185,
0.1561325192451477,
0.6581884622573853,
-0.1519242525100708,
-0.027483824640512466,
-0.21614041924476624,
-0.1413707435131073,
-0.06899535655975342,
0.21390683948993683,
0.20930616557598114,
-0.15586328506469727,
-0.10700781643390656,
-0.15850727260112762,
-0.22525425255298615,
0.19838905334472656,
0.16281965374946594,
-0.29881787300109863,
0.17754223942756653,
0.14971357583999634,
0.10252055525779724,
-0.09067009389400482,
-0.26986968517303467,
0.16447623074054718,
-0.2200498729944229,
-0.19038636982440948,
0.11759553849697113,
0.010545976459980011,
-0.080482617020607,
-0.05299689248204231,
-0.24355478584766388,
0.09094482660293579,
-0.3291586637496948,
-0.20084264874458313,
-0.019644618034362793,
-0.7418710589408875,
0.06825301051139832,
0.17623737454414368,
-0.2794078588485718,
0.2531541585922241,
-0.04113531485199928,
-0.47476935386657715,
0.38877007365226746,
-0.2614634931087494,
-0.058098677545785904,
0.38029390573501587,
-0.0057020471431314945,
0.1469401866197586,
-0.14001674950122833,
-0.14865079522132874,
0.13034436106681824,
-0.04667402803897858,
0.10076101124286652,
0.01705111190676689,
0.11239497363567352,
-0.19883929193019867,
0.32715821266174316,
0.29015886783599854,
-0.27075597643852234,
-0.40790659189224243,
-0.3721560835838318,
-0.13620002567768097,
0.03194369003176689,
0.0705532506108284,
-0.042623646557331085,
-0.02336198464035988,
0.10619867593050003,
-0.33225271105766296,
-0.0720893070101738,
-0.11508418619632721,
0.3173656165599823,
-0.23161441087722778,
0.21980708837509155,
0.04105225205421448,
0.20792977511882782,
-0.16572879254817963,
-0.1785334348678589,
0.26439061760902405,
0.08594566583633423,
0.020370125770568848,
-0.024997595697641373,
-0.28834620118141174,
-0.18594297766685486,
0.16739621758460999,
-0.1333615481853485,
-0.028575457632541656,
0.03245321288704872,
-0.22447673976421356,
-0.5071141719818115,
-0.023866208270192146,
0.09194877743721008,
0.1750708371400833,
0.012828685343265533,
-0.18001049757003784,
-0.33356156945228577,
0.02930351160466671,
0.3388083279132843,
-0.21353259682655334,
0.2373816817998886,
0.2681388854980469,
0.33106493949890137,
-0.5360870361328125,
-0.004370581358671188,
-0.1496574878692627,
-0.2933671176433563,
0.014634249731898308,
0.2153066098690033,
-0.26593491435050964,
-0.12071128189563751,
0.05630943551659584,
0.10995133966207504,
0.06742887198925018,
-0.32143622636795044,
0.18689647316932678,
-0.3392127752304077,
0.00021635182201862335,
-0.3445305824279785,
0.12263351678848267,
-0.15082824230194092,
-0.19924654066562653,
-0.09749253839254379,
0.14580775797367096,
-0.17410480976104736,
0.06930723786354065,
0.10468896478414536,
-0.1284608095884323,
-0.016475096344947815,
0.26828181743621826,
0.29506075382232666,
0.21439369022846222,
-0.015853747725486755,
-0.08160515129566193,
0.014578133821487427,
-0.30829429626464844,
-0.19626262784004211,
0.37086719274520874,
-0.23521079123020172,
0.0775737464427948,
0.3172169625759125,
0.4369165301322937,
0.06507183611392975,
-0.5209674835205078,
0.0936085507273674,
0.01257815770804882,
0.17824438214302063,
-0.017745627090334892,
-0.2569306492805481,
0.5185834765434265,
0.27450504899024963,
0.1859758049249649,
0.432468980550766,
0.023315738886594772,
-0.3890783488750458,
-0.07322481274604797,
0.1640472412109375,
0.0008572184015065432,
0.26010698080062866,
-0.039445843547582626,
0.6049032807350159,
-0.2108549028635025,
-0.03357822075486183,
0.09502045810222626,
0.08500727266073227,
0.5228585004806519,
0.5042372941970825,
0.304094135761261,
0.45326530933380127,
0.19112807512283325,
0.181727796792984,
0.05978715419769287,
-0.41686391830444336,
0.21227771043777466,
0.10685364902019501,
0.14038926362991333,
0.4361279606819153,
-0.036444805562496185,
-0.2753985524177551,
-0.2076951116323471,
-0.17013408243656158,
-0.10626406967639923,
-0.2778283953666687,
-0.2478047013282776,
0.015296446159482002,
0.31365838646888733,
-0.11223919689655304,
0.1783376932144165,
-0.014270134270191193,
-0.03174740448594093,
-0.34020501375198364,
0.508258581161499,
0.10480068624019623,
-0.10048657655715942,
-0.036748431622982025,
0.21541452407836914,
-0.06833250820636749,
0.05331030860543251,
-0.35493582487106323,
0.3460351526737213,
-0.31529104709625244,
-0.05467595160007477,
-0.17782650887966156,
0.0747104361653328,
0.32984864711761475,
0.37532585859298706,
-0.3147587180137634,
0.2346702516078949,
0.19589440524578094,
-0.23517754673957825,
-0.16910463571548462,
0.11296805739402771,
0.09313954412937164,
0.4102211594581604,
0.2556665539741516,
0.04815150797367096,
-0.03533504158258438,
-0.22673265635967255,
0.2677775025367737,
0.23597794771194458,
-0.19797252118587494,
-0.009755082428455353,
-0.5865908861160278,
-0.021171055734157562,
-0.15698787569999695,
-0.10588514059782028,
-0.1835787296295166,
0.026305779814720154,
0.47472822666168213,
-0.2701747715473175,
0.11920437961816788,
-0.005080976989120245,
0.019651789218187332,
-0.2289419174194336,
0.37548312544822693,
0.09905649721622467,
-0.06417598575353622,
-0.44579392671585083,
-0.16750094294548035,
-0.08356047421693802,
0.24655112624168396,
-0.588866114616394,
0.25730225443840027,
0.3774237036705017,
0.006766472011804581,
0.18972645699977875,
0.08487427234649658,
0.19326269626617432,
0.1288667917251587,
-0.12014535069465637,
0.31541964411735535,
-0.08162087202072144,
-0.22788293659687042,
-0.15874320268630981,
-0.08972465991973877,
0.11170646548271179,
-0.47072848677635193,
0.4955458641052246,
-0.5262969732284546,
-0.00011242181062698364,
0.05859600380063057,
-0.09783969819545746,
0.08974696695804596,
0.2902357876300812,
0.29599618911743164,
0.23032699525356293,
0.19184857606887817,
0.0024318285286426544,
0.07393021881580353,
-0.1334584355354309,
-0.017729204148054123,
-0.03981597721576691,
0.42839398980140686,
0.11455574631690979,
0.22471590340137482,
-0.274193674325943,
0.016056591644883156,
-0.06741110980510712,
0.1598648726940155,
-0.09190899133682251,
0.2389337420463562,
0.06899657100439072,
-0.04221464693546295,
-0.1542280614376068,
-0.031265366822481155,
0.06723672896623611,
0.04628854617476463,
-0.14825378358364105,
0.055873990058898926,
-0.010285183787345886,
-0.19683517515659332,
0.3047220706939697,
-0.36483725905418396,
-0.3212844431400299,
0.1509166806936264,
0.20151552557945251,
-0.43294233083724976,
-0.19957801699638367,
-0.5467274785041809,
-0.14494623243808746,
0.14351773262023926,
-0.09388092905282974,
-0.289010226726532,
-0.14085930585861206,
-0.33500659465789795,
-0.173071026802063,
0.014592062681913376,
0.7014437913894653,
0.15440095961093903,
-0.2162228226661682,
0.18146714568138123,
0.036710016429424286
] |
https://github.com/huggingface/datasets/issues/5532 | train_test_split in arrow_dataset does not ensure to keep single classes in test set | Hi! You can get this behavior by specifying `stratify_by_column="label"` in `train_test_split`.
This is the full example:
```python
import numpy as np
from datasets import Dataset, ClassLabel
data = [
{'label': 0, 'text': "example1"},
{'label': 1, 'text': "example2"},
{'label': 1, 'text': "example3"},
{'label': 1, 'text': "example4"},
{'label': 0, 'text': "example5"},
{'label': 1, 'text': "example6"},
{'label': 2, 'text': "example7"},
{'label': 2, 'text': "example8"}
]
for _ in range(10):
data_set = Dataset.from_list(data)
data_set = data_set.cast_column("label", ClassLabel(num_classes=3))
data_set = data_set.train_test_split(test_size=0.5, stratify_by_column="label")
unique_labels_train = np.unique(data_set["train"][:]["label"])
unique_labels_test = np.unique(data_set["test"][:]["label"])
assert len(unique_labels_train) >= len(unique_labels_test)
```
| ### Describe the bug
When I have a dataset with very few (e.g. 1) examples per class and I call the train_test_split function on it, sometimes the single class will be in the test set. thus will never be considered for training.
### Steps to reproduce the bug
```
import numpy as np
from datasets import Dataset
data = [
{'label': 0, 'text': "example1"},
{'label': 1, 'text': "example2"},
{'label': 1, 'text': "example3"},
{'label': 1, 'text': "example4"},
{'label': 0, 'text': "example5"},
{'label': 1, 'text': "example6"},
{'label': 2, 'text': "example7"},
{'label': 2, 'text': "example8"}
]
for _ in range(10):
data_set = Dataset.from_list(data)
data_set = data_set.train_test_split(test_size=0.5)
data_set["train"]
unique_labels_train = np.unique(data_set["train"][:]["label"])
unique_labels_test = np.unique(data_set["test"][:]["label"])
assert len(unique_labels_train) >= len(unique_labels_test)
```
### Expected behavior
I expect to have every available class at least once in my training set.
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.15.65+-x86_64-with-debian-bullseye-sid
- Python version: 3.7.12
- PyArrow version: 11.0.0
- Pandas version: 1.3.5
| 88 | train_test_split in arrow_dataset does not ensure to keep single classes in test set
### Describe the bug
When I have a dataset with very few (e.g. 1) examples per class and I call the train_test_split function on it, sometimes the single class will be in the test set. thus will never be considered for training.
### Steps to reproduce the bug
```
import numpy as np
from datasets import Dataset
data = [
{'label': 0, 'text': "example1"},
{'label': 1, 'text': "example2"},
{'label': 1, 'text': "example3"},
{'label': 1, 'text': "example4"},
{'label': 0, 'text': "example5"},
{'label': 1, 'text': "example6"},
{'label': 2, 'text': "example7"},
{'label': 2, 'text': "example8"}
]
for _ in range(10):
data_set = Dataset.from_list(data)
data_set = data_set.train_test_split(test_size=0.5)
data_set["train"]
unique_labels_train = np.unique(data_set["train"][:]["label"])
unique_labels_test = np.unique(data_set["test"][:]["label"])
assert len(unique_labels_train) >= len(unique_labels_test)
```
### Expected behavior
I expect to have every available class at least once in my training set.
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.15.65+-x86_64-with-debian-bullseye-sid
- Python version: 3.7.12
- PyArrow version: 11.0.0
- Pandas version: 1.3.5
Hi! You can get this behavior by specifying `stratify_by_column="label"` in `train_test_split`.
This is the full example:
```python
import numpy as np
from datasets import Dataset, ClassLabel
data = [
{'label': 0, 'text': "example1"},
{'label': 1, 'text': "example2"},
{'label': 1, 'text': "example3"},
{'label': 1, 'text': "example4"},
{'label': 0, 'text': "example5"},
{'label': 1, 'text': "example6"},
{'label': 2, 'text': "example7"},
{'label': 2, 'text': "example8"}
]
for _ in range(10):
data_set = Dataset.from_list(data)
data_set = data_set.cast_column("label", ClassLabel(num_classes=3))
data_set = data_set.train_test_split(test_size=0.5, stratify_by_column="label")
unique_labels_train = np.unique(data_set["train"][:]["label"])
unique_labels_test = np.unique(data_set["test"][:]["label"])
assert len(unique_labels_train) >= len(unique_labels_test)
```
| [
-0.19253776967525482,
0.057643428444862366,
-0.0064346082508563995,
0.3102373778820038,
0.28909188508987427,
0.09748195856809616,
0.5350439548492432,
0.2346283197402954,
-0.21000729501247406,
0.029851071536540985,
0.35186734795570374,
0.5292766094207764,
-0.1724994033575058,
-0.07975241541862488,
0.10852516442537308,
-0.31427258253097534,
0.0630214661359787,
0.13598647713661194,
0.167061448097229,
-0.2161206603050232,
-0.17326335608959198,
-0.002650626003742218,
-0.45878928899765015,
-0.03429080545902252,
-0.4746687710285187,
-0.28242775797843933,
-0.09479957818984985,
-0.14969655871391296,
0.09342096745967865,
-0.29648685455322266,
0.44725266098976135,
-0.23842006921768188,
-0.09420914947986603,
0.34591764211654663,
-0.00011557072139112279,
0.03800542652606964,
0.08408331871032715,
-0.117795430123806,
-0.16365556418895721,
-0.18986226618289948,
-0.19808435440063477,
-0.25048381090164185,
0.23997212946414948,
-0.18899285793304443,
0.012458860874176025,
-0.18508939445018768,
-0.29524627327919006,
-0.33313390612602234,
0.3783351182937622,
0.1651642918586731,
0.15227419137954712,
0.04754944145679474,
-0.21529188752174377,
0.04341580718755722,
0.1415177285671234,
0.06423822790384293,
-0.1354997307062149,
-0.0776587575674057,
-0.17757898569107056,
-0.011002052575349808,
-0.03127656131982803,
0.4518466889858246,
0.11974743008613586,
0.21760864555835724,
-0.13350561261177063,
0.06289684772491455,
-0.34518131613731384,
-0.25034940242767334,
-0.23351457715034485,
0.2959420382976532,
0.22561657428741455,
-0.16535863280296326,
-0.3433168828487396,
-0.2404630184173584,
0.26762402057647705,
-0.4379964768886566,
0.09586814045906067,
0.20016559958457947,
-0.0287704449146986,
0.1532031148672104,
-0.10975474864244461,
0.13956958055496216,
-0.11483384668827057,
0.3651650547981262,
0.13833315670490265,
0.13371847569942474,
0.1478257030248642,
0.22552448511123657,
0.04296201467514038,
0.15569263696670532,
0.029611539095640182,
-0.009030994027853012,
0.010672375559806824,
0.1416069120168686,
-0.44682371616363525,
-0.07101812213659286,
-0.12547343969345093,
-0.27415046095848083,
0.18198731541633606,
0.38784557580947876,
0.0717332661151886,
0.1296454221010208,
0.06745917350053787,
-0.020046137273311615,
0.42574542760849,
0.16440384089946747,
0.18970374763011932,
0.5844261646270752,
0.21096062660217285,
-0.12334396690130234,
-0.22015859186649323,
0.09101936966180801,
-0.05981875956058502,
-0.06305211037397385,
0.6085761189460754,
-0.07325589656829834,
0.16186462342739105,
0.05391528084874153,
-0.21774131059646606,
0.027483083307743073,
-0.7370021343231201,
0.07649119943380356,
0.03382977098226547,
0.15229341387748718,
0.40914079546928406,
0.260958194732666,
-0.028999168425798416,
0.19935321807861328,
-0.156208798289299,
-0.22380614280700684,
-0.22812680900096893,
0.10442046821117401,
-0.13952815532684326,
0.007515261881053448,
0.18642988801002502,
0.1032429188489914,
0.21532666683197021,
0.24516035616397858,
-0.041110552847385406,
-0.4339049458503723,
0.08111611008644104,
-0.1774982362985611,
0.18817391991615295,
0.1487344354391098,
-0.3533220589160919,
0.31371626257896423,
0.04959436133503914,
0.15491437911987305,
-0.09986060112714767,
0.07316654175519943,
-0.12488465756177902,
-0.32665881514549255,
0.2450644075870514,
0.14464552700519562,
0.11493173241615295,
0.1830289363861084,
0.100532166659832,
0.09652954339981079,
0.33055511116981506,
0.004278089851140976,
0.39573588967323303,
-0.40759581327438354,
-0.16744494438171387,
-0.10493028908967972,
0.1512272208929062,
0.10481057316064835,
-0.04178129881620407,
-0.1659126579761505,
-0.11956749111413956,
0.20467033982276917,
0.1820555031299591,
0.14012928307056427,
-0.1724218875169754,
-0.08323336392641068,
-0.04588887095451355,
0.16441094875335693,
0.6460033059120178,
-0.0626276284456253,
-0.43979761004447937,
-0.06345032155513763,
-0.19484254717826843,
0.009202377870678902,
-0.026992537081241608,
0.2059025913476944,
0.03333352506160736,
0.13577139377593994,
-0.10455536842346191,
0.36835813522338867,
-0.11935895681381226,
-0.11008750647306442,
-0.21957871317863464,
0.016856281086802483,
0.11693279445171356,
-0.010869950987398624,
0.02075151726603508,
-0.5226251482963562,
-0.19541406631469727,
0.16546180844306946,
0.432983934879303,
0.1409551352262497,
0.11528465151786804,
0.009989289566874504,
0.301989883184433,
-0.3616213798522949,
0.1438889503479004,
-0.20925945043563843,
-0.3238653838634491,
0.22263020277023315,
0.22965416312217712,
-0.2186407744884491,
0.0992140844464302,
-0.25482863187789917,
-0.0404859334230423,
-0.01798776164650917,
-0.21868900954723358,
-0.2401907742023468,
0.05804070085287094,
-0.035644471645355225,
-0.04276127368211746,
0.05149681493639946,
-0.1466071605682373,
0.1471485197544098,
-0.22661472856998444,
0.24496500194072723,
0.16466113924980164,
0.21837365627288818,
0.12315653264522552,
-0.19569061696529388,
-0.0546640083193779,
0.1933046579360962,
0.05520674213767052,
-0.2175549864768982,
-0.1292504370212555,
0.45421427488327026,
0.521214485168457,
-0.42125076055526733,
-0.31932181119918823,
-0.5422446131706238,
0.32065123319625854,
-0.3555997312068939,
-0.43885886669158936,
0.27182042598724365,
0.01727379858493805,
-0.0544811487197876,
-0.25682902336120605,
0.40736204385757446,
-0.07441820204257965,
0.1878535896539688,
-0.14779138565063477,
0.19917619228363037,
0.00535937212407589,
-0.03176197037100792,
0.16457855701446533,
-0.17557314038276672,
-0.12476377189159393,
-0.3767678141593933,
0.2019776701927185,
0.234541118144989,
-0.3983955383300781,
0.16838303208351135,
0.3048209846019745,
0.12264548242092133,
0.14717665314674377,
-0.11720111221075058,
-0.09993749111890793,
0.037248022854328156,
0.2805543839931488,
0.44476601481437683,
0.4016357660293579,
0.1547728031873703,
0.10474376380443573,
-0.36191579699516296,
-0.08516295254230499,
-0.11048661172389984,
0.13668449223041534,
0.20089879631996155,
0.2874363362789154,
0.09355016052722931,
0.10188530385494232,
0.01813316158950329,
-0.10709093511104584,
0.010016318410634995,
0.21244093775749207,
0.050278522074222565,
-0.2420625537633896,
0.17802369594573975,
-0.4288015365600586,
0.12075605243444443,
-0.17986419796943665,
-0.038063038140535355,
0.03378886356949806,
-0.14782153069972992,
0.24124780297279358,
-0.26948830485343933,
-0.12907133996486664,
0.3920660614967346,
-0.227145716547966,
0.19226989150047302,
0.09642539918422699,
-0.3038402497768402,
0.017641082406044006,
0.032800573855638504,
-0.38102245330810547,
0.022107157856225967,
0.04223593696951866,
0.12418362498283386,
0.23146766424179077,
0.31223198771476746,
-0.4065227508544922,
0.1858396977186203,
0.00753360241651535,
-0.09846554696559906,
-0.042929597198963165,
0.05336667597293854,
0.03408825024962425,
-0.28545916080474854,
-0.31577831506729126,
-0.0551605150103569,
-0.07562580704689026,
-0.343745619058609,
-0.10700781643390656,
0.06467626988887787,
0.2769528925418854,
0.22670695185661316,
-0.2546616196632385,
-0.5919457674026489,
-0.11619298905134201,
-0.025845002382993698,
0.037031978368759155,
0.000021774321794509888,
0.04931434243917465,
-0.07489655911922455,
0.07852478325366974,
0.02170233428478241,
-0.06906408071517944,
-0.1751282811164856,
-0.12842246890068054,
0.3513167202472687,
0.17244338989257812,
0.1453000009059906,
-0.15846532583236694,
-0.09560789912939072,
-0.3985303044319153,
-0.03886348381638527,
-0.10152897983789444,
-0.176968514919281,
-0.12289448827505112,
0.015845883637666702,
0.2598035931587219,
-0.30755770206451416,
-0.11532548069953918,
0.1578679382801056,
-0.08915135264396667,
-0.0472593680024147,
-0.0909322127699852,
0.0715244859457016,
0.3654770255088806,
-0.1017136350274086,
0.17820855975151062,
-0.39122021198272705,
0.008958430960774422,
0.08503900468349457,
0.7631152868270874,
0.4846574664115906,
-0.26037654280662537,
-0.14034461975097656,
-0.16333027184009552,
-0.043052125722169876,
0.14282752573490143,
-0.07189274579286575,
0.010218965820968151,
-0.11821123957633972,
-0.05455873906612396,
-0.045521125197410583,
0.05380203574895859,
-0.02812882326543331,
0.18434076011180878,
0.1944567859172821,
0.14276838302612305,
-0.47464519739151,
0.14049139618873596,
-0.20446136593818665,
-0.004329174757003784,
-0.07526286691427231,
0.1536746323108673,
0.24542838335037231,
-0.1901852786540985,
-0.11898878216743469,
-0.12022422254085541,
-0.17355352640151978,
0.04362654685974121,
-0.14434276521205902,
0.057295721024274826,
0.08229213953018188,
0.010387293994426727,
0.22459526360034943,
0.5260550379753113,
0.12739354372024536,
-0.0851387083530426,
0.1759609580039978,
0.3767995536327362,
0.4598665237426758,
-0.09672287851572037,
0.0021291933953762054,
0.1475309282541275,
0.09328345954418182,
-0.23082032799720764,
-0.12310680747032166,
-0.26522061228752136,
0.028507959097623825,
0.11699569225311279,
0.027159955352544785,
-0.08849579095840454,
-0.15719863772392273,
0.44092342257499695,
0.08025966584682465,
0.006748426705598831,
-0.11972741782665253,
-0.15547768771648407,
0.02312704175710678,
0.13867036998271942,
0.5595564246177673,
0.3774721026420593,
0.09912846982479095,
-0.19666844606399536,
-0.3477097153663635,
-0.25902166962623596,
-0.35576409101486206,
0.06405292451381683,
-0.03801007568836212,
0.3520537316799164,
-0.03783347085118294,
0.23067590594291687,
0.21538639068603516,
-0.19028352200984955,
0.24808445572853088,
0.6023169755935669,
-0.34730836749076843,
-0.20279374718666077,
-0.09656111896038055,
-0.11275705695152283,
0.40760040283203125,
0.3635675311088562,
-0.23723658919334412,
0.07441370189189911,
-0.40220361948013306,
0.03646507486701012,
0.1337006539106369,
0.03418821468949318,
0.16630025207996368,
-0.09428150951862335,
-0.10892971605062485,
-0.1386677324771881,
0.5269469618797302,
-0.013606434687972069,
-0.060406215488910675,
0.6490947604179382,
-0.04567430913448334,
-0.19426025450229645,
0.43918997049331665,
0.05744939669966698,
0.6566957831382751,
0.17697790265083313,
0.13000594079494476,
0.21667161583900452,
-0.1209191158413887,
0.41762831807136536,
0.06877771019935608,
0.361089825630188,
-0.35588520765304565,
-0.17275448143482208,
0.0045310091227293015,
-0.14780430495738983,
-0.10778520256280899,
0.20676074922084808,
-0.02136976458132267,
0.14660413563251495,
-0.14298377931118011,
0.1364973932504654,
-0.05228578299283981,
-0.0013566426932811737,
0.1783161759376526,
-0.08158734440803528,
-0.010551964864134789,
0.046160317957401276,
0.05457278713583946,
0.09144648164510727,
0.09985233098268509,
0.04095469042658806,
-0.24298031628131866,
-0.28379321098327637,
-0.18127070367336273,
-0.09619332104921341,
-0.4145866930484772,
0.33063840866088867,
0.2429652363061905,
-0.5387904047966003,
0.3130790889263153,
0.24882422387599945,
-0.18711934983730316,
-0.057868096977472305,
0.07833393663167953,
0.09432079643011093,
0.3241232633590698,
0.3614959120750427,
0.07086125761270523,
-0.18502044677734375,
0.49199622869491577,
0.16316932439804077,
-0.17953456938266754,
-0.049596935510635376,
-0.3696786165237427,
0.11187124252319336,
0.09445112943649292,
0.3024027347564697,
0.13485002517700195,
-0.3074999451637268,
0.06810158491134644,
-0.06566034257411957,
0.01969962567090988,
-0.5693631768226624,
0.11984780430793762,
0.06920916587114334,
-0.1586754024028778,
0.18908825516700745,
-0.011196348816156387,
-0.12880219519138336,
0.026912126690149307,
0.12035675346851349,
0.1313844621181488,
0.2606803774833679,
0.4065342843532562,
-0.18598024547100067,
-0.004034768790006638,
-0.3456442952156067,
0.6425586938858032,
0.584588348865509,
-0.4284818470478058,
0.40999680757522583,
-0.2267516702413559,
0.2023153156042099,
0.07885986566543579,
0.11923465132713318,
0.1228342056274414,
0.24946850538253784,
-0.11627520620822906,
-0.2003316581249237,
0.01853279210627079,
0.03739112615585327,
0.13542397320270538,
0.2153911590576172,
-0.4148303270339966,
0.09533180296421051,
0.16466766595840454,
0.4081573486328125,
-0.21458643674850464,
-0.047120101749897,
-0.1649903804063797,
0.14670312404632568,
-0.27716872096061707,
0.25488853454589844,
0.052159927785396576,
-0.10375948250293732,
0.1035315990447998,
0.042404428124427795,
0.07361435145139694,
-0.18207243084907532,
-0.18746009469032288,
0.10103249549865723,
-0.09103712439537048,
0.352270245552063,
0.1517929881811142,
-0.08694147318601608,
0.05611960217356682,
-0.04569881036877632,
0.05001542344689369,
-0.22634747624397278,
0.01319122314453125,
0.24860192835330963,
0.2285938858985901,
-0.07119562476873398,
-0.24325187504291534,
-0.07719535380601883,
-0.4960424602031708,
-0.08796489238739014,
0.18968570232391357,
0.21403983235359192,
0.595587432384491,
-0.024892285466194153,
-0.21147650480270386,
-0.3222820460796356,
-0.35255324840545654,
-0.1267639696598053,
-0.1393853724002838,
-0.31784647703170776,
-0.10617010295391083,
-0.03022349439561367,
0.14849840104579926,
0.5158771276473999,
-0.27195775508880615,
-0.007843137718737125,
-0.07344919443130493,
0.18392036855220795,
-0.37884819507598877,
-0.062153641134500504,
0.006455797702074051,
0.14163002371788025,
0.021056536585092545,
0.3796423673629761,
-0.024552863091230392,
-0.14753583073616028,
-0.38120925426483154,
0.06215240806341171,
-0.07851982861757278,
-0.14918357133865356,
0.5392634272575378,
0.49881812930107117,
-0.1584303379058838,
-0.017649400979280472,
0.30424433946609497,
-0.3825678527355194,
0.2330811619758606,
0.23515114188194275,
-0.1383659839630127,
0.6543501615524292,
0.11445535719394684,
0.04304013401269913,
0.04538517817854881,
-0.14652758836746216,
-0.0752006322145462,
-0.019507065415382385,
-0.36519163846969604,
-0.10100185126066208,
0.04331965371966362,
0.6030988693237305,
-0.4980924725532532,
-0.3474868834018707,
0.06299465149641037,
-0.2281915694475174,
-0.13970553874969482,
0.11551263928413391,
0.020138930529356003,
-0.010953277349472046,
-0.2932426631450653,
-0.1669774204492569,
0.05697282403707504,
-0.27976518869400024,
0.5417814254760742,
0.18229356408119202,
-0.06768544018268585,
-0.4062013328075409,
-0.203230619430542,
0.1712399125099182,
0.24287045001983643,
-0.26275524497032166,
0.0580231212079525,
0.08906436711549759,
-0.10515187680721283,
-0.13619299232959747,
-0.21147780120372772,
0.19820532202720642,
0.03586890920996666,
0.0891038328409195,
-0.17863424122333527,
0.2035326361656189,
-0.052200473845005035,
0.18777690827846527,
0.05682912841439247,
0.11957308650016785,
-0.22679142653942108,
0.21589608490467072,
0.060188569128513336,
-0.06575604528188705,
0.12997868657112122,
0.34363844990730286,
0.0396704263985157,
-0.523036777973175,
0.7341839075088501,
-0.15824511647224426,
-0.12785986065864563,
-0.2576734125614166,
-0.045189179480075836,
0.39879679679870605,
0.027481161057949066,
0.302432119846344,
-0.08380265533924103,
-0.09872601926326752,
-0.10456845909357071,
0.0350118950009346,
-0.06401702761650085,
0.28028804063796997,
-0.19359122216701508,
-0.2296106219291687,
-0.2560618817806244,
-0.014173842966556549,
-0.5394563674926758,
0.1663418412208557,
-0.38457736372947693,
-0.4654321074485779,
0.24220173060894012,
0.27674809098243713,
-0.17881521582603455,
0.04740225151181221,
0.3269807696342468,
0.22493645548820496,
0.2775929868221283,
0.3046497404575348,
-0.5243911147117615,
0.0994466245174408,
-0.29696911573410034,
-0.008953956887125969,
0.1867666244506836,
-0.4752718210220337,
0.16459833085536957,
-0.2637293338775635,
-0.12308365106582642,
0.3934559226036072,
-0.34599530696868896,
0.46023130416870117,
0.17314384877681732,
0.3990691006183624,
-0.030981214717030525,
0.10202576220035553,
0.22753775119781494,
0.21279649436473846,
-0.029232796281576157,
-0.07354322820901871,
-0.41315022110939026,
0.40055984258651733,
-0.02011149749159813,
0.4042989909648895,
-0.18161407113075256,
-0.035833653062582016,
-0.04125044867396355,
0.017102647572755814,
0.1684807986021042,
-0.056501589715480804,
-0.08094252645969391,
0.27667221426963806,
-0.2231471836566925,
0.5154456496238708,
0.3279898762702942,
0.13528135418891907,
-0.3219129145145416,
-0.1787508875131607,
-0.27899402379989624,
-0.5367431044578552,
0.2259984165430069,
-0.3131406307220459,
-0.30515554547309875,
-0.22362248599529266,
0.5206974744796753,
0.2739338278770447,
-0.11993744224309921,
-0.6253865957260132,
-0.39526936411857605,
0.4780602753162384,
0.005643734708428383,
-0.21135151386260986,
-0.021994799375534058,
0.17795056104660034,
0.19151386618614197,
0.0046147555112838745,
0.3462793231010437,
-0.08990666270256042,
-0.06814645975828171,
0.3426661193370819,
-0.4431419372558594
] |
https://github.com/huggingface/datasets/issues/5525 | TypeError: Couldn't cast array of type string to null | Thanks for reporting, @TJ-Solergibert.
We cannot access your Colab notebook: `There was an error loading this notebook. Ensure that the file is accessible and try again.`
Could you please make it publicly accessible?
| ### Describe the bug
Processing a dataset I alredy uploaded to the Hub (https://huggingface.co/datasets/tj-solergibert/Europarl-ST) I found that for some splits and some languages (test split, source_lang = "nl") after applying a map function I get the mentioned error.
I alredy tried reseting the shorter strings (reset_cortas function). It only happends with NL, PL, RO and PT. It does not make sense since when processing the other languages I also use the corpus of those that fail and it does not cause any errors.
I suspect that the error may be in this direction:
We use cast_array_to_feature to support casting to custom types like Audio and Image # Also, when trying type "string", we don't want to convert integers or floats to "string". # We only do it if trying_type is False - since this is what the user asks for.
### Steps to reproduce the bug
Here I link a colab notebook to reproduce the error:
https://colab.research.google.com/drive/1JCrS7FlGfu_kFqChMrwKZ_bpabnIMqbP?authuser=1#scrollTo=FBAvlhMxIzpA
### Expected behavior
Data processing does not fail. A correct example can be seen here: https://huggingface.co/datasets/tj-solergibert/Europarl-ST-processed-mt-en
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.10.147+-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 9.0.0
- Pandas version: 1.3.5 | 33 | TypeError: Couldn't cast array of type string to null
### Describe the bug
Processing a dataset I alredy uploaded to the Hub (https://huggingface.co/datasets/tj-solergibert/Europarl-ST) I found that for some splits and some languages (test split, source_lang = "nl") after applying a map function I get the mentioned error.
I alredy tried reseting the shorter strings (reset_cortas function). It only happends with NL, PL, RO and PT. It does not make sense since when processing the other languages I also use the corpus of those that fail and it does not cause any errors.
I suspect that the error may be in this direction:
We use cast_array_to_feature to support casting to custom types like Audio and Image # Also, when trying type "string", we don't want to convert integers or floats to "string". # We only do it if trying_type is False - since this is what the user asks for.
### Steps to reproduce the bug
Here I link a colab notebook to reproduce the error:
https://colab.research.google.com/drive/1JCrS7FlGfu_kFqChMrwKZ_bpabnIMqbP?authuser=1#scrollTo=FBAvlhMxIzpA
### Expected behavior
Data processing does not fail. A correct example can be seen here: https://huggingface.co/datasets/tj-solergibert/Europarl-ST-processed-mt-en
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.10.147+-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 9.0.0
- Pandas version: 1.3.5
Thanks for reporting, @TJ-Solergibert.
We cannot access your Colab notebook: `There was an error loading this notebook. Ensure that the file is accessible and try again.`
Could you please make it publicly accessible?
| [
-0.13287143409252167,
-0.4693015217781067,
0.024292074143886566,
0.4132038354873657,
0.41335421800613403,
-0.03989054635167122,
0.5205761790275574,
0.29646357893943787,
0.12481804192066193,
0.25412851572036743,
-0.13308405876159668,
0.3707171678543091,
-0.2303478866815567,
0.14031367003917694,
-0.19324341416358948,
-0.13818533718585968,
0.16137850284576416,
0.14912520349025726,
0.02549673244357109,
0.037518613040447235,
-0.18233487010002136,
0.18813835084438324,
-0.5480574369430542,
0.11982830613851547,
-0.33361831307411194,
-0.19460609555244446,
0.13815008103847504,
0.005076732486486435,
-0.11612742394208908,
-0.04665273800492287,
0.03738342970609665,
-0.32286331057548523,
-0.11058664321899414,
0.38973093032836914,
-0.00012348439486231655,
-0.08256478607654572,
0.3082270622253418,
0.008911078795790672,
-0.09798838198184967,
-0.1294393092393875,
-0.47172170877456665,
0.1265539675951004,
0.014763571321964264,
-0.22581851482391357,
0.2899758815765381,
0.4272359013557434,
0.1154831126332283,
-0.49009642004966736,
0.11060313135385513,
0.39181607961654663,
0.10010500997304916,
0.3034608066082001,
-0.04581516608595848,
-0.0449751541018486,
0.118004709482193,
0.26019591093063354,
-0.26400333642959595,
-0.058887626975774765,
0.14842534065246582,
0.43511080741882324,
0.09948979318141937,
0.10832072794437408,
-0.27534952759742737,
-0.1083049327135086,
-0.03777739405632019,
-0.028829384595155716,
-0.32403621077537537,
-0.5891728401184082,
0.21554309129714966,
0.09255528450012207,
0.2963249087333679,
-0.2316611111164093,
-0.12383098155260086,
-0.037460170686244965,
0.22111506760120392,
0.12622718513011932,
0.14132045209407806,
0.2173459231853485,
0.04993143305182457,
0.09760318696498871,
-0.21189764142036438,
0.27383482456207275,
-0.10894492268562317,
0.09382159262895584,
-0.056048668920993805,
0.06263065338134766,
-0.11283103376626968,
0.11842559278011322,
-0.0010717697441577911,
-0.3891110420227051,
0.3970984220504761,
-0.400056928396225,
0.005374651402235031,
0.35584622621536255,
0.01971886307001114,
-0.15958063304424286,
-0.23098504543304443,
-0.060399897396564484,
-0.10382258147001266,
-0.44999462366104126,
0.04916352778673172,
0.29690906405448914,
-0.26137927174568176,
0.24923557043075562,
0.2489333599805832,
0.09546160697937012,
0.3409314751625061,
0.0720238983631134,
0.2565600275993347,
-0.044446930289268494,
-0.1820741444826126,
0.04338332638144493,
0.006791005842387676,
0.0031033270061016083,
-0.14848299324512482,
0.36054539680480957,
0.37773388624191284,
-0.1864834725856781,
-0.19198861718177795,
0.02502174861729145,
-0.38936537504196167,
0.22457151114940643,
0.1657174825668335,
0.07167758792638779,
-0.0019583331886678934,
0.45665255188941956,
0.16173623502254486,
0.14172931015491486,
-0.26750949025154114,
-0.2609037458896637,
-0.0897940844297409,
0.1247444748878479,
-0.018491987138986588,
-0.2227439433336258,
0.06606997549533844,
-0.04252634942531586,
-0.01088827196508646,
-0.09077687561511993,
-0.08623722195625305,
-0.3070926070213318,
-0.24079415202140808,
-0.3829626441001892,
0.02303124964237213,
0.1875939816236496,
0.10042217373847961,
0.21686068177223206,
0.18400511145591736,
-0.20831161737442017,
-0.1960412859916687,
0.31712156534194946,
-0.6081520318984985,
-0.09356853365898132,
-0.013748018071055412,
0.03262719139456749,
-0.22748734056949615,
0.2199021726846695,
-0.5180404782295227,
-0.1146329939365387,
0.22601091861724854,
-0.28197917342185974,
-0.005797058343887329,
-0.41324591636657715,
-0.18238870799541473,
-0.2810444235801697,
-0.06283438205718994,
0.28196975588798523,
-0.39180928468704224,
0.10341259837150574,
-0.4473256766796112,
0.08226462453603745,
0.39086267352104187,
0.3506973683834076,
0.043853502720594406,
0.41398853063583374,
-0.21472883224487305,
0.7664926052093506,
0.4103432595729828,
0.2379426658153534,
-0.1765531599521637,
0.045694801956415176,
-0.07479000836610794,
-0.17061352729797363,
-0.22096404433250427,
0.13043595850467682,
0.40126293897628784,
-0.09826704114675522,
0.038925010710954666,
0.2168043553829193,
-0.06909444183111191,
0.32491984963417053,
-0.36353445053100586,
-0.10928688198328018,
0.08823464810848236,
0.037453096359968185,
0.20576080679893494,
0.15276530385017395,
0.1960134506225586,
0.6219899654388428,
-0.03519277274608612,
-0.2681570053100586,
0.3661362826824188,
0.0248512364923954,
0.2717151641845703,
-0.29055100679397583,
-0.09670378267765045,
-0.3673102557659149,
-0.08384688943624496,
-0.016302088275551796,
-0.014313198626041412,
0.31011390686035156,
-0.0814271867275238,
0.0012126602232456207,
-0.3195475935935974,
0.058303721249103546,
0.036608777940273285,
0.33877047896385193,
-0.039704736322164536,
-0.014671750366687775,
-0.2009037435054779,
0.2390979379415512,
-0.2045671045780182,
0.16710218787193298,
-0.2808610200881958,
-0.07138285040855408,
-0.3142423629760742,
0.39253172278404236,
-0.26328715682029724,
-0.33810076117515564,
-0.343453049659729,
0.06280304491519928,
0.06501871347427368,
0.06681942194700241,
-0.2718104124069214,
0.17325405776500702,
0.2759644687175751,
-0.1451101452112198,
-0.1874295175075531,
-0.0696287751197815,
0.32129088044166565,
-0.641068696975708,
0.18965797126293182,
0.383448988199234,
0.4733060300350189,
-0.16502374410629272,
0.01443852111697197,
0.3957964777946472,
-0.25745487213134766,
0.22933104634284973,
-0.24750737845897675,
-0.06570771336555481,
0.10966354608535767,
0.06579574942588806,
0.043490298092365265,
-0.1465141922235489,
0.018772199749946594,
-0.20834751427173615,
-0.07106150686740875,
0.0674666166305542,
-0.2256944477558136,
0.018687210977077484,
0.5130835175514221,
0.011906251311302185,
0.40170523524284363,
0.27755606174468994,
-0.01600978523492813,
0.08754529803991318,
0.01921192742884159,
-0.21454760432243347,
0.3166733682155609,
-0.08739771693944931,
-0.01901128515601158,
0.024421965703368187,
0.09645955264568329,
-0.10965682566165924,
0.2612566649913788,
0.13786782324314117,
0.278835266828537,
0.10085580497980118,
0.06424380838871002,
0.03285478800535202,
-0.04338042065501213,
-0.18868301808834076,
0.0833410769701004,
0.284906268119812,
-0.43840306997299194,
-0.06256936490535736,
-0.38445818424224854,
-0.29957836866378784,
-0.19563628733158112,
0.09332673996686935,
-0.24379101395606995,
-0.402756005525589,
-0.1834706962108612,
0.05128684639930725,
-0.25704899430274963,
0.26219943165779114,
0.028670869767665863,
0.16291971504688263,
0.3066845238208771,
0.07611452043056488,
-0.1649457812309265,
0.10580144077539444,
-0.05285242199897766,
-0.04761587083339691,
0.519199788570404,
0.24890181422233582,
-0.3096533417701721,
-0.1556365191936493,
-0.0746440440416336,
0.05822509527206421,
-0.14184948801994324,
0.058393336832523346,
-0.22936464846134186,
0.09527210146188736,
0.12567251920700073,
0.4075232744216919,
-0.21318218111991882,
-0.32259854674339294,
0.15526188910007477,
-0.32567763328552246,
-0.34444111585617065,
0.3628441393375397,
0.10700620710849762,
-0.09836286306381226,
-0.3443085849285126,
-0.011461585760116577,
-0.07079644501209259,
-0.3934985399246216,
0.11927676945924759,
-0.4666633605957031,
0.24587678909301758,
0.043462708592414856,
0.3333373963832855,
0.2873480021953583,
0.10614920407533646,
-0.17020973563194275,
0.029819773510098457,
0.3028812110424042,
0.3735044002532959,
0.08913494646549225,
-0.19842574000358582,
0.04619910940527916,
0.09184680879116058,
-0.08381044864654541,
-0.06383277475833893,
-0.32921791076660156,
-0.09289465844631195,
-0.1540721356868744,
0.013410527259111404,
0.02807781845331192,
-0.12381213903427124,
0.273249089717865,
0.06155158206820488,
0.16273416578769684,
-0.03687933832406998,
-0.10625314712524414,
-0.2786826193332672,
0.2420502007007599,
0.2147725522518158,
0.19642096757888794,
0.2277527153491974,
0.14978709816932678,
-0.10367323458194733,
0.3183683753013611,
0.11227469146251678,
0.33539658784866333,
0.05669816583395004,
-0.03922105208039284,
-0.37557026743888855,
-0.31539812684059143,
-0.015395419672131538,
-0.055775731801986694,
-0.3281685709953308,
0.2777966856956482,
-0.1973896026611328,
-0.5146382451057434,
-0.016234518960118294,
-0.2377452850341797,
-0.3756016790866852,
-0.2734754681587219,
0.2659372091293335,
0.1843239665031433,
0.060991767793893814,
-0.27227333188056946,
-0.07443229109048843,
-0.014684293419122696,
-0.29601314663887024,
-0.07416744530200958,
0.10788695514202118,
-0.010874375700950623,
-0.19218887388706207,
-0.2515262961387634,
-0.4712115228176117,
-0.024161413311958313,
0.4732244610786438,
0.42805662751197815,
0.5433837175369263,
-0.15820276737213135,
-0.016861120238900185,
0.1363542079925537,
0.20126622915267944,
0.5563647150993347,
-0.33166244626045227,
0.13561123609542847,
0.24691778421401978,
0.2107829451560974,
-0.3288418650627136,
0.11039738357067108,
-0.2510506808757782,
0.05919273942708969,
0.4527938663959503,
0.3390960097312927,
-0.1292632520198822,
0.13530467450618744,
0.25556790828704834,
0.15042363107204437,
0.16021016240119934,
0.22395187616348267,
-0.013363644480705261,
-0.4440455734729767,
-0.20038367807865143,
0.05612802132964134,
0.32966938614845276,
0.47208505868911743,
0.11998910456895828,
0.171138733625412,
-0.212574303150177,
-0.28665536642074585,
0.10721363872289658,
-0.10411980748176575,
0.33192548155784607,
0.02543417364358902,
0.10264940559864044,
-0.5546431541442871,
-0.2721681594848633,
0.035450562834739685,
0.5052039623260498,
0.22653666138648987,
-0.022591091692447662,
0.2793309986591339,
-0.1022447869181633,
0.40000927448272705,
0.62998366355896,
-0.0066619631834328175,
0.16539213061332703,
0.060975175350904465,
0.21327954530715942,
-0.01565130427479744,
0.17662499845027924,
-0.07673468440771103,
-0.03512488305568695,
-0.3522176742553711,
0.05025599151849747,
0.07377621531486511,
-0.0290665440261364,
0.16173766553401947,
0.04541763290762901,
0.14242996275424957,
-0.34732764959335327,
0.6114144921302795,
0.26852884888648987,
1.266240119934082,
-0.11032843589782715,
0.12041057646274567,
-0.19673538208007812,
0.00719572976231575,
0.29705244302749634,
0.18509967625141144,
0.2936248183250427,
-0.3841632604598999,
-0.054944224655628204,
-0.1399095207452774,
0.06495699286460876,
0.2631694972515106,
-0.026922084391117096,
-0.39579907059669495,
-0.03676067292690277,
0.16214537620544434,
0.5380797982215881,
-0.08141177892684937,
-0.2626473903656006,
-0.35905611515045166,
-0.39446282386779785,
-0.26123321056365967,
0.012050695717334747,
-0.2851945757865906,
-0.011058870702981949,
0.1800926923751831,
-0.07326048612594604,
-0.3189395070075989,
-0.17177823185920715,
-0.4285659193992615,
0.11444658786058426,
0.03257258981466293,
0.09760520607233047,
-0.1277763694524765,
-0.05920571833848953,
0.31727078557014465,
0.40865030884742737,
0.21613046526908875,
0.5300794243812561,
-0.09831580519676208,
-0.0445808582007885,
-0.019712097942829132,
-0.09681755304336548,
0.05364637076854706,
-0.07864074409008026,
0.1553218811750412,
0.07356160879135132,
-0.11580661684274673,
-0.19885969161987305,
-0.058637019246816635,
0.03593705594539642,
0.003106623888015747,
0.1809426248073578,
-0.11609385907649994,
-0.3726760447025299,
-0.35855650901794434,
-0.058390527963638306,
-0.014207866042852402,
-0.07977640628814697,
0.03230801224708557,
-0.1750231832265854,
-0.1206691712141037,
0.3855871558189392,
0.0037468187510967255,
-0.3639107942581177,
0.12463738024234772,
0.566569447517395,
0.3588465452194214,
0.2898028492927551,
0.3445926904678345,
0.20387877523899078,
-0.23421737551689148,
-0.17343056201934814,
0.4097469449043274,
-0.16889481246471405,
-0.7342356443405151,
0.27242550253868103,
-0.4259718358516693,
-0.3447669744491577,
-0.05164703354239464,
0.4992269277572632,
0.008513253182172775,
0.41226187348365784,
-0.3854500949382782,
-0.31540894508361816,
-0.21502262353897095,
0.30897676944732666,
0.2841885983943939,
0.18471039831638336,
-0.12275291234254837,
0.3704831004142761,
0.09211015701293945,
-0.302072674036026,
-0.1575617641210556,
0.1846412867307663,
-0.6062824726104736,
0.34063905477523804,
-0.5554229021072388,
0.02017463743686676,
0.06649568676948547,
-0.21467004716396332,
-0.03212198615074158,
0.4753813147544861,
-0.172887921333313,
-0.04032759740948677,
0.007407946512103081,
0.21496020257472992,
0.2669316828250885,
-0.21503855288028717,
-0.056448888033628464,
-0.18510320782661438,
-0.1279897391796112,
-0.3312939703464508,
-0.13271482288837433,
0.302206814289093,
-0.11315058171749115,
-0.018749941140413284,
0.5210066437721252,
0.10349465906620026,
0.019217845052480698,
0.36405235528945923,
-0.08742956817150116,
0.32810282707214355,
-0.16460780799388885,
0.25323331356048584,
0.15377303957939148,
0.18952950835227966,
0.16940605640411377,
0.18653063476085663,
0.09448874741792679,
-0.04707258194684982,
0.33042454719543457,
-0.27889180183410645,
-0.041933998465538025,
0.0342356413602829,
0.18302680552005768,
-0.013446837663650513,
-0.19962191581726074,
-0.06970452517271042,
0.10193094611167908,
-0.03738053888082504,
0.011449776589870453,
-0.021525302901864052,
0.49337831139564514,
-0.04083174839615822,
-0.20022724568843842,
0.393258273601532,
0.0858389288187027,
0.08031675219535828,
0.13261441886425018,
0.04540117830038071,
0.6397628784179688,
-0.08909378945827484,
0.1104455292224884,
0.11412061750888824,
-0.11617423593997955,
0.16048523783683777,
0.06144639104604721,
-0.1742776781320572,
0.04124193638563156,
0.24719606339931488,
0.12270547449588776,
0.22253374755382538,
-0.04239976406097412,
0.27046331763267517,
0.11232197284698486,
-0.1323738396167755,
0.21209724247455597,
0.25228798389434814,
-0.09741367399692535,
0.29389816522598267,
0.03764663264155388,
-0.1878882348537445,
-0.5480418801307678,
-0.19012559950351715,
-0.045086655765771866,
0.19522804021835327,
-0.3844675123691559,
0.15018875896930695,
-0.2920997440814972,
-0.01087341457605362,
-0.21825768053531647,
-0.16027520596981049,
-0.02898283675312996,
0.15698322653770447,
0.44532379508018494,
0.21243302524089813,
-0.14526142179965973,
0.10684113204479218,
-0.2502020597457886,
0.26441219449043274,
0.28963398933410645,
-0.36523208022117615,
0.25469568371772766,
-0.07692557573318481,
0.2383471131324768,
0.07141759246587753,
0.547924816608429,
0.45086419582366943,
0.3543565571308136,
-0.27852973341941833,
-0.01697681099176407,
0.10968711972236633,
-0.14345309138298035,
0.09991620481014252,
0.26364865899086,
0.23881545662879944,
0.5288122892379761,
0.21271319687366486,
0.0006118025630712509,
-0.04431804642081261,
-0.04530313238501549,
0.004883289337158203,
0.24956990778446198,
0.08634179830551147,
0.31211739778518677,
-0.3583260178565979,
-0.039878107607364655,
-0.24863511323928833,
-0.07992056757211685,
-0.48584863543510437,
0.18678872287273407,
0.1638944149017334,
-0.454230934381485,
0.2367478907108307,
0.2188197821378708,
-0.009775926358997822,
0.061280667781829834,
0.36072856187820435,
0.3666161596775055,
-0.11184457689523697,
-0.23291784524917603,
-0.19260075688362122,
-0.10014203190803528,
0.2525278627872467,
-0.06707550585269928,
0.14535996317863464,
0.10736873000860214,
0.12383289635181427,
-0.05818329006433487,
0.04792330041527748,
-0.0703047662973404,
-0.15326906740665436,
-0.03428274393081665,
0.38909754157066345,
-0.2185124158859253,
-0.21098579466342926,
0.3048359751701355,
-0.1768602877855301,
-0.11338456720113754,
-0.47112393379211426,
0.38754093647003174,
-0.14103521406650543,
-0.045411836355924606,
0.20942534506320953,
-0.14734354615211487,
-0.04876149445772171,
-0.32101890444755554,
-0.08452469110488892,
0.11844544857740402,
0.29834288358688354,
-0.06864768266677856,
0.11474289745092392,
-0.03987773135304451,
-0.44408226013183594,
-0.08893345296382904,
0.135881245136261,
0.1944909691810608,
0.621467113494873,
-0.16018997132778168,
0.08728934824466705,
-0.1494378000497818,
0.04550992697477341,
-0.03258214890956879,
0.5131596922874451,
-0.21308079361915588,
0.23555104434490204,
-0.6737393140792847,
0.0967099741101265,
-0.10975928604602814,
-0.0736493244767189,
0.057490359991788864,
0.08008657395839691,
-0.2645918130874634,
-0.5217768549919128,
0.6028209924697876,
-0.05567864328622818,
-0.5019209980964661,
-0.0250653475522995,
-0.024466708302497864,
0.012715853750705719,
0.0397995300590992,
-0.8263834714889526,
-0.320926308631897,
0.15005609393119812,
-0.15985766053199768,
-0.23396189510822296,
-0.01934947445988655,
-0.16026750206947327,
-0.11750440299510956,
-0.13396495580673218,
0.05312119424343109,
0.08331179618835449,
-0.07085172086954117,
0.21893656253814697,
-0.15854395925998688
] |
https://github.com/huggingface/datasets/issues/5525 | TypeError: Couldn't cast array of type string to null | I swear it's public, I've checked the settings and I've been able to open it in incognito mode.
Notebook: https://colab.research.google.com/drive/1JCrS7FlGfu_kFqChMrwKZ_bpabnIMqbP?usp=sharing
Anyway, this is the code to reproduce the error:
```python3
from datasets import ClassLabel
from datasets import load_dataset
europarl_ds = load_dataset("tj-solergibert/Europarl-ST")
source_lang = "nl"
languages = list(europarl_ds["train"][0]["transcriptions"].keys())
ClassLabels = ClassLabel(num_classes = len(languages), names = languages)
def map_label2id(example):
example['dest_lang'] = ClassLabels.str2int(example['dest_lang'])
return example
def unfold_transcriptions(example):
for lang in languages:
example[lang] = example["transcriptions"][lang]
return example
def unroll(batch, src_lang, dest_langs):
source_t, dest_t, dest_l = [], [], []
for lang in dest_langs:
source_t += batch[src_lang]
dest_t += batch[lang]
dest_l += [lang]
return_dict = {"source_text": source_t, "dest_text": dest_t, "dest_lang": dest_l}
return return_dict
def preprocess_split(ds_split, src_lang):
dest_langs = [x for x in languages if x != src_lang]
ds_split = ds_split.map(unroll, fn_kwargs= {"src_lang": src_lang, "dest_langs": dest_langs}, batched = True, batch_size = 1, remove_columns= list(languages))
ds_split = ds_split.filter(lambda x: x["source_text"] != None and x["dest_text"] != None) # Remove incomplete translations
ds_split = ds_split.filter(lambda x: x["source_text"] != "None" and x["dest_text"] != "None")
ds_split = ds_split.map(map_label2id)
ds_split = ds_split.cast_column("dest_lang", ClassLabels)
return ds_split
def reset_cortas(example):
for lang in languages:
if isinstance(example[lang], str):
if example[lang].isnumeric () or len(example[lang]) <= 5:
example[lang] = "None"
return example
def clean_dataset(dataset):
# Remove columns
dataset = dataset.remove_columns(["original_speech", "original_language", "audio_path", "segment_start", "segment_end"])
# Unfold
dataset = dataset.map(unfold_transcriptions, remove_columns = ["transcriptions"])
dataset = dataset.map(reset_cortas)
return dataset
processed_europarl = clean_dataset(europarl_ds["test"])
new_train_ds = preprocess_split(processed_europarl, 'nl')
``` | ### Describe the bug
Processing a dataset I alredy uploaded to the Hub (https://huggingface.co/datasets/tj-solergibert/Europarl-ST) I found that for some splits and some languages (test split, source_lang = "nl") after applying a map function I get the mentioned error.
I alredy tried reseting the shorter strings (reset_cortas function). It only happends with NL, PL, RO and PT. It does not make sense since when processing the other languages I also use the corpus of those that fail and it does not cause any errors.
I suspect that the error may be in this direction:
We use cast_array_to_feature to support casting to custom types like Audio and Image # Also, when trying type "string", we don't want to convert integers or floats to "string". # We only do it if trying_type is False - since this is what the user asks for.
### Steps to reproduce the bug
Here I link a colab notebook to reproduce the error:
https://colab.research.google.com/drive/1JCrS7FlGfu_kFqChMrwKZ_bpabnIMqbP?authuser=1#scrollTo=FBAvlhMxIzpA
### Expected behavior
Data processing does not fail. A correct example can be seen here: https://huggingface.co/datasets/tj-solergibert/Europarl-ST-processed-mt-en
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.10.147+-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 9.0.0
- Pandas version: 1.3.5 | 226 | TypeError: Couldn't cast array of type string to null
### Describe the bug
Processing a dataset I alredy uploaded to the Hub (https://huggingface.co/datasets/tj-solergibert/Europarl-ST) I found that for some splits and some languages (test split, source_lang = "nl") after applying a map function I get the mentioned error.
I alredy tried reseting the shorter strings (reset_cortas function). It only happends with NL, PL, RO and PT. It does not make sense since when processing the other languages I also use the corpus of those that fail and it does not cause any errors.
I suspect that the error may be in this direction:
We use cast_array_to_feature to support casting to custom types like Audio and Image # Also, when trying type "string", we don't want to convert integers or floats to "string". # We only do it if trying_type is False - since this is what the user asks for.
### Steps to reproduce the bug
Here I link a colab notebook to reproduce the error:
https://colab.research.google.com/drive/1JCrS7FlGfu_kFqChMrwKZ_bpabnIMqbP?authuser=1#scrollTo=FBAvlhMxIzpA
### Expected behavior
Data processing does not fail. A correct example can be seen here: https://huggingface.co/datasets/tj-solergibert/Europarl-ST-processed-mt-en
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.10.147+-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 9.0.0
- Pandas version: 1.3.5
I swear it's public, I've checked the settings and I've been able to open it in incognito mode.
Notebook: https://colab.research.google.com/drive/1JCrS7FlGfu_kFqChMrwKZ_bpabnIMqbP?usp=sharing
Anyway, this is the code to reproduce the error:
```python3
from datasets import ClassLabel
from datasets import load_dataset
europarl_ds = load_dataset("tj-solergibert/Europarl-ST")
source_lang = "nl"
languages = list(europarl_ds["train"][0]["transcriptions"].keys())
ClassLabels = ClassLabel(num_classes = len(languages), names = languages)
def map_label2id(example):
example['dest_lang'] = ClassLabels.str2int(example['dest_lang'])
return example
def unfold_transcriptions(example):
for lang in languages:
example[lang] = example["transcriptions"][lang]
return example
def unroll(batch, src_lang, dest_langs):
source_t, dest_t, dest_l = [], [], []
for lang in dest_langs:
source_t += batch[src_lang]
dest_t += batch[lang]
dest_l += [lang]
return_dict = {"source_text": source_t, "dest_text": dest_t, "dest_lang": dest_l}
return return_dict
def preprocess_split(ds_split, src_lang):
dest_langs = [x for x in languages if x != src_lang]
ds_split = ds_split.map(unroll, fn_kwargs= {"src_lang": src_lang, "dest_langs": dest_langs}, batched = True, batch_size = 1, remove_columns= list(languages))
ds_split = ds_split.filter(lambda x: x["source_text"] != None and x["dest_text"] != None) # Remove incomplete translations
ds_split = ds_split.filter(lambda x: x["source_text"] != "None" and x["dest_text"] != "None")
ds_split = ds_split.map(map_label2id)
ds_split = ds_split.cast_column("dest_lang", ClassLabels)
return ds_split
def reset_cortas(example):
for lang in languages:
if isinstance(example[lang], str):
if example[lang].isnumeric () or len(example[lang]) <= 5:
example[lang] = "None"
return example
def clean_dataset(dataset):
# Remove columns
dataset = dataset.remove_columns(["original_speech", "original_language", "audio_path", "segment_start", "segment_end"])
# Unfold
dataset = dataset.map(unfold_transcriptions, remove_columns = ["transcriptions"])
dataset = dataset.map(reset_cortas)
return dataset
processed_europarl = clean_dataset(europarl_ds["test"])
new_train_ds = preprocess_split(processed_europarl, 'nl')
``` | [
-0.10379142314195633,
-0.4781437814235687,
0.025804750621318817,
0.38869935274124146,
0.45657652616500854,
-0.05794811621308327,
0.5366411805152893,
0.32976365089416504,
0.16466698050498962,
0.1949411928653717,
-0.0987226665019989,
0.36296314001083374,
-0.24442683160305023,
0.12203396111726761,
-0.22664234042167664,
-0.16255158185958862,
0.17968760430812836,
0.11208467930555344,
0.017054453492164612,
0.023361310362815857,
-0.16851726174354553,
0.19794915616512299,
-0.5043784379959106,
0.11865347623825073,
-0.33109939098358154,
-0.17673979699611664,
0.15632732212543488,
-0.027307681739330292,
-0.08668462187051773,
-0.04734494537115097,
0.02519938163459301,
-0.33083873987197876,
-0.14549797773361206,
0.3861633241176605,
-0.00012238834460731596,
-0.05388671159744263,
0.352753221988678,
0.0029086750000715256,
-0.04993977025151253,
-0.04590938985347748,
-0.4223647713661194,
0.12945620715618134,
-0.02219260111451149,
-0.22170832753181458,
0.2667219936847687,
0.4234173893928528,
0.06350907683372498,
-0.5466493368148804,
0.06594584137201309,
0.3912980556488037,
0.10365856438875198,
0.33363014459609985,
-0.06044191122055054,
-0.048062488436698914,
0.08261767774820328,
0.27262771129608154,
-0.23873551189899445,
-0.16019085049629211,
0.11442232877016068,
0.46381092071533203,
0.08060687780380249,
0.10201774537563324,
-0.2957957684993744,
-0.1255454421043396,
-0.046310342848300934,
-0.04278688132762909,
-0.3055732846260071,
-0.5767054557800293,
0.1861567497253418,
0.10785487294197083,
0.2764788866043091,
-0.24895840883255005,
-0.12771804630756378,
-0.06606922298669815,
0.16751624643802643,
0.14120012521743774,
0.11424631625413895,
0.17480957508087158,
0.0907062292098999,
0.06751564890146255,
-0.2558377981185913,
0.28302863240242004,
-0.09666058421134949,
0.08913347870111465,
-0.06884894520044327,
0.020602285861968994,
-0.10470529645681381,
0.1380215883255005,
-0.013799306005239487,
-0.40849488973617554,
0.30081844329833984,
-0.4403955042362213,
-0.020553994923830032,
0.35900384187698364,
-0.050831567496061325,
-0.20669539272785187,
-0.1519743800163269,
-0.12839052081108093,
-0.046871405094861984,
-0.3878687024116516,
-0.005553309805691242,
0.34395357966423035,
-0.2595290243625641,
0.2339753806591034,
0.2759256064891815,
0.10794052481651306,
0.342791885137558,
0.11482297629117966,
0.25020748376846313,
-0.08953532576560974,
-0.13085344433784485,
0.07973229885101318,
0.04762423783540726,
0.03561984375119209,
-0.10946103930473328,
0.3774281442165375,
0.4116438627243042,
-0.1590052843093872,
-0.1635461151599884,
0.09178975969552994,
-0.3605368733406067,
0.2517854571342468,
0.1538032442331314,
0.07386497408151627,
0.04130023345351219,
0.49425947666168213,
0.15982890129089355,
0.16900010406970978,
-0.28944453597068787,
-0.23618930578231812,
-0.10822635889053345,
0.11068741977214813,
0.056336354464292526,
-0.27142852544784546,
0.0795796811580658,
-0.027408644556999207,
-0.024535832926630974,
-0.04750623181462288,
-0.08235904574394226,
-0.3056831955909729,
-0.25272583961486816,
-0.3419255018234253,
0.0013050287961959839,
0.17701643705368042,
0.06053691729903221,
0.24339495599269867,
0.22631078958511353,
-0.1360076665878296,
-0.21296784281730652,
0.3013133406639099,
-0.613033652305603,
-0.084093376994133,
-0.025358987972140312,
0.04951464757323265,
-0.26921918988227844,
0.2044934183359146,
-0.4597531855106354,
-0.06788285076618195,
0.2467857003211975,
-0.24244153499603271,
0.03565414994955063,
-0.41587382555007935,
-0.15983960032463074,
-0.26304060220718384,
-0.056495167315006256,
0.30172228813171387,
-0.36861878633499146,
0.13196814060211182,
-0.42787444591522217,
0.02120727114379406,
0.36138680577278137,
0.3193018436431885,
0.08172781020402908,
0.39630717039108276,
-0.217707097530365,
0.8304876089096069,
0.37276312708854675,
0.23158970475196838,
-0.10675965994596481,
0.06194000318646431,
-0.04206527769565582,
-0.15377077460289001,
-0.2596657872200012,
0.15144464373588562,
0.37394198775291443,
-0.1000605896115303,
-0.09223154187202454,
0.24753522872924805,
-0.11369024217128754,
0.3470591604709625,
-0.3520727753639221,
-0.07456591725349426,
0.09743689000606537,
0.0610521100461483,
0.21314288675785065,
0.13372598588466644,
0.14155271649360657,
0.612750232219696,
-0.07200942188501358,
-0.26840707659721375,
0.40631622076034546,
0.05060478299856186,
0.2539844810962677,
-0.3118032217025757,
-0.06745248287916183,
-0.40923774242401123,
-0.13420304656028748,
0.00945349782705307,
-0.012151191011071205,
0.31859317421913147,
-0.04513636231422424,
0.011274393647909164,
-0.2740779221057892,
0.047203429043293,
-0.00947597250342369,
0.2864846885204315,
-0.02553132176399231,
-0.02209286391735077,
-0.1757814884185791,
0.2513865530490875,
-0.1944771111011505,
0.10743174701929092,
-0.2254091054201126,
-0.07398974150419235,
-0.3443533480167389,
0.4036860167980194,
-0.2552720308303833,
-0.34790724515914917,
-0.3321993350982666,
0.06522682309150696,
0.058400172740221024,
0.050734084099531174,
-0.25715649127960205,
0.2279682159423828,
0.260675847530365,
-0.08869725465774536,
-0.2021951675415039,
-0.10183916985988617,
0.2796606719493866,
-0.6704620718955994,
0.19532257318496704,
0.41675975918769836,
0.438711553812027,
-0.21084752678871155,
-0.06035391986370087,
0.3771439790725708,
-0.19466011226177216,
0.25059017539024353,
-0.2544301152229309,
-0.05106436833739281,
0.07536621391773224,
0.05332353338599205,
0.0525195375084877,
-0.1434103548526764,
0.012714669108390808,
-0.18490178883075714,
-0.1049087792634964,
0.05139458179473877,
-0.2431686371564865,
0.03396546095609665,
0.5631978511810303,
-0.0005202032625675201,
0.38861843943595886,
0.30033212900161743,
0.021679382771253586,
0.08143923431634903,
-0.03460341691970825,
-0.2586269974708557,
0.28943103551864624,
-0.09672065824270248,
-0.03227913752198219,
0.05791444331407547,
0.07098817080259323,
-0.07986301183700562,
0.24118727445602417,
0.13115254044532776,
0.2668696939945221,
0.1399109959602356,
0.055315397679805756,
0.0014751739799976349,
-0.06519082188606262,
-0.15457837283611298,
0.0992714911699295,
0.28583237528800964,
-0.4722658395767212,
-0.03477603569626808,
-0.41145700216293335,
-0.2324671745300293,
-0.16944405436515808,
0.123118557035923,
-0.2612839937210083,
-0.4334273338317871,
-0.1483870893716812,
0.022854885086417198,
-0.3019014894962311,
0.27471527457237244,
-0.05147593468427658,
0.11014168709516525,
0.34858039021492004,
0.022207658737897873,
-0.18798136711120605,
0.10457153618335724,
-0.05225216597318649,
-0.0406559519469738,
0.5001847147941589,
0.23685576021671295,
-0.2599760591983795,
-0.09916705638170242,
-0.10027018934488297,
0.016987258568406105,
-0.17101839184761047,
0.05911950394511223,
-0.2658078670501709,
0.08144141733646393,
0.17248424887657166,
0.4141985774040222,
-0.1526811420917511,
-0.27604615688323975,
0.20554856956005096,
-0.34983646869659424,
-0.3485209345817566,
0.4206010699272156,
0.126723974943161,
-0.060897886753082275,
-0.38866931200027466,
-0.07020971924066544,
-0.006853286176919937,
-0.4153311550617218,
0.10916530340909958,
-0.4804791808128357,
0.2472148835659027,
0.09258394688367844,
0.33939510583877563,
0.26657047867774963,
0.08877866715192795,
-0.2058543860912323,
0.004556320607662201,
0.3134949505329132,
0.3570011258125305,
0.07809531688690186,
-0.21657820045948029,
0.001011330634355545,
0.11046993732452393,
-0.09356614947319031,
-0.039063241332769394,
-0.3066621720790863,
-0.06986966729164124,
-0.1363336145877838,
0.03295092657208443,
0.04069177433848381,
-0.13406524062156677,
0.3090551495552063,
0.050177738070487976,
0.13416483998298645,
-0.05850332975387573,
-0.08201272785663605,
-0.2137065827846527,
0.19662055373191833,
0.14583243429660797,
0.2168726623058319,
0.2703133821487427,
0.15437743067741394,
-0.10559169948101044,
0.35573670268058777,
0.10136070847511292,
0.3438321352005005,
0.04756879806518555,
-0.00907982513308525,
-0.3656559884548187,
-0.28293555974960327,
0.014632695354521275,
-0.026678025722503662,
-0.2758788466453552,
0.23708897829055786,
-0.20445144176483154,
-0.5467453002929688,
0.03437841683626175,
-0.2005358636379242,
-0.3108116686344147,
-0.24302233755588531,
0.28134462237358093,
0.12182779610157013,
0.0454937107861042,
-0.3218367397785187,
-0.05758067965507507,
0.00431397557258606,
-0.2614436447620392,
-0.047302961349487305,
0.039950091391801834,
-0.025345057249069214,
-0.17409150302410126,
-0.34037497639656067,
-0.3920784294605255,
-0.020769648253917694,
0.4767497777938843,
0.4220479428768158,
0.5828320384025574,
-0.16154220700263977,
-0.023125436156988144,
0.09119006246328354,
0.16827934980392456,
0.5677860975265503,
-0.3809428811073303,
0.13404539227485657,
0.278289258480072,
0.23065835237503052,
-0.38667407631874084,
0.0996929258108139,
-0.23345482349395752,
0.0473015122115612,
0.42318660020828247,
0.3266018331050873,
-0.16753771901130676,
0.08284515142440796,
0.2535873055458069,
0.1490657925605774,
0.1751360446214676,
0.18691423535346985,
-0.00938696414232254,
-0.4211927056312561,
-0.20528577268123627,
0.06809055060148239,
0.3461710512638092,
0.4399595260620117,
0.09745106101036072,
0.13344398140907288,
-0.21070976555347443,
-0.3167876601219177,
0.09101864695549011,
-0.1673222929239273,
0.3286381661891937,
-0.036005932837724686,
0.11842505633831024,
-0.5584557056427002,
-0.2779180109500885,
-0.04159172624349594,
0.5003727674484253,
0.25180473923683167,
0.008274994790554047,
0.27627259492874146,
-0.09453646838665009,
0.3977726101875305,
0.5864591598510742,
0.020007777959108353,
0.1631094515323639,
0.03392897546291351,
0.22932462394237518,
-0.05279487743973732,
0.13224387168884277,
-0.038940444588661194,
-0.039084501564502716,
-0.3786943256855011,
0.08740204572677612,
0.0866408571600914,
-0.04683084413409233,
0.18172667920589447,
0.06839558482170105,
0.14239540696144104,
-0.35625550150871277,
0.5598902106285095,
0.27878034114837646,
1.2042667865753174,
-0.06939825415611267,
0.08022012561559677,
-0.162783682346344,
0.027476400136947632,
0.3281431794166565,
0.14765115082263947,
0.24894586205482483,
-0.3976774215698242,
0.0234505757689476,
-0.1458534598350525,
0.0527900792658329,
0.2540658414363861,
-0.03365398198366165,
-0.3820267617702484,
-0.006242575589567423,
0.1062263697385788,
0.5660948753356934,
-0.07010744512081146,
-0.22716180980205536,
-0.3821629285812378,
-0.4122522473335266,
-0.1945030689239502,
0.03964181989431381,
-0.27200621366500854,
-0.03710288926959038,
0.21234950423240662,
-0.09604321420192719,
-0.32432979345321655,
-0.20268577337265015,
-0.44287407398223877,
0.14941266179084778,
0.10067222267389297,
0.09266347438097,
-0.11174611747264862,
-0.038431938737630844,
0.3205403685569763,
0.3563999831676483,
0.22752206027507782,
0.49570679664611816,
-0.11368800699710846,
-0.04501201584935188,
-0.05559123307466507,
-0.04236762970685959,
0.06798706203699112,
-0.11856088787317276,
0.21221835911273956,
0.0646774172782898,
-0.12057817727327347,
-0.1966610848903656,
-0.05660688504576683,
0.03249698132276535,
-0.047585584223270416,
0.11835470050573349,
-0.12713775038719177,
-0.3504193425178528,
-0.3646947145462036,
-0.047121793031692505,
-0.037519942969083786,
-0.08255461603403091,
0.039342403411865234,
-0.14406786859035492,
-0.12756064534187317,
0.4031694531440735,
-0.04706709459424019,
-0.32025468349456787,
0.11308448016643524,
0.5361312627792358,
0.349942684173584,
0.30123811960220337,
0.31440186500549316,
0.24211452901363373,
-0.21359093487262726,
-0.18526625633239746,
0.4068622589111328,
-0.054086651653051376,
-0.7296870946884155,
0.2511806786060333,
-0.4686780571937561,
-0.381017804145813,
-0.06466294080018997,
0.4116378128528595,
-0.10791043937206268,
0.41175979375839233,
-0.3908950090408325,
-0.29199737310409546,
-0.22079327702522278,
0.2524668574333191,
0.25722742080688477,
0.24676501750946045,
-0.19861289858818054,
0.418325275182724,
0.08445023745298386,
-0.31436556577682495,
-0.15989801287651062,
0.15981332957744598,
-0.5909789800643921,
0.3330788314342499,
-0.5324071645736694,
0.026388749480247498,
0.06269592046737671,
-0.23247922956943512,
-0.02840777486562729,
0.4845009446144104,
-0.20327183604240417,
-0.048098042607307434,
0.014783557504415512,
0.20633302628993988,
0.276378333568573,
-0.22602327167987823,
0.001827065832912922,
-0.1351540982723236,
-0.14996393024921417,
-0.3143537938594818,
-0.13522931933403015,
0.29893603920936584,
-0.13834723830223083,
0.015371502377092838,
0.48311299085617065,
0.0966075211763382,
0.07486169040203094,
0.2757270634174347,
-0.09781350195407867,
0.3316802978515625,
-0.19360820949077606,
0.24652208387851715,
0.13619355857372284,
0.16667905449867249,
0.11115296930074692,
0.22337132692337036,
0.08457859605550766,
-0.059738099575042725,
0.3627242147922516,
-0.2685864567756653,
-0.055531322956085205,
0.06580553948879242,
0.22287242114543915,
0.02274932712316513,
-0.24643827974796295,
-0.08199728280305862,
0.05242106318473816,
-0.009756563231348991,
0.04614882171154022,
-0.007988541387021542,
0.4838719069957733,
-0.06982291489839554,
-0.1930607706308365,
0.3468078672885895,
0.07521210610866547,
0.07795079052448273,
0.15428441762924194,
0.08949989825487137,
0.6915789246559143,
-0.1836085021495819,
0.12075924873352051,
0.11239068955183029,
-0.14354369044303894,
0.1389980912208557,
0.05599697306752205,
-0.2320767343044281,
0.03776264190673828,
0.28489112854003906,
0.10379187762737274,
0.23599226772785187,
-0.03300091624259949,
0.2527271509170532,
0.13740409910678864,
-0.07247640937566757,
0.19966742396354675,
0.28258681297302246,
-0.0884929746389389,
0.32348933815956116,
0.033689361065626144,
-0.19457483291625977,
-0.5597022771835327,
-0.22342900931835175,
-0.03604815900325775,
0.2230703979730606,
-0.37816792726516724,
0.1768973469734192,
-0.30866584181785583,
-0.017864413559436798,
-0.21916675567626953,
-0.14214222133159637,
-0.021120931953191757,
0.13336887955665588,
0.43826931715011597,
0.21303021907806396,
-0.15754716098308563,
0.03704586997628212,
-0.23033368587493896,
0.1757383942604065,
0.3166409730911255,
-0.3777754604816437,
0.25465163588523865,
-0.0033559873700141907,
0.179418683052063,
0.09707076847553253,
0.5423510670661926,
0.4629225432872772,
0.3628835082054138,
-0.2567678391933441,
0.009342520497739315,
0.08706128597259521,
-0.15013258159160614,
0.14367951452732086,
0.2720898985862732,
0.15661703050136566,
0.48352038860321045,
0.19899672269821167,
0.0007065124809741974,
-0.04853745549917221,
-0.0775570422410965,
-0.007458996027708054,
0.27019280195236206,
0.07607415318489075,
0.38287293910980225,
-0.3483501672744751,
0.007417835295200348,
-0.22920119762420654,
-0.11039862781763077,
-0.46423301100730896,
0.13336199522018433,
0.20567834377288818,
-0.39833930134773254,
0.25247180461883545,
0.20070187747478485,
0.0013772379606962204,
0.04592752456665039,
0.32440006732940674,
0.2844131886959076,
-0.14952689409255981,
-0.2453644871711731,
-0.1231679916381836,
-0.10267043113708496,
0.22929006814956665,
-0.0283128060400486,
0.1477033942937851,
0.1269647479057312,
0.14740343391895294,
-0.0665229931473732,
0.03425796702504158,
-0.07642832398414612,
-0.16254763305187225,
-0.007179517298936844,
0.37600547075271606,
-0.20528052747249603,
-0.18234290182590485,
0.218124657869339,
-0.15687121450901031,
-0.0708211362361908,
-0.4841926395893097,
0.4156617820262909,
-0.0835842490196228,
-0.022397484630346298,
0.17850162088871002,
-0.11175087094306946,
-0.00807209126651287,
-0.3230881094932556,
-0.12635447084903717,
0.15584833920001984,
0.30612504482269287,
-0.06293464452028275,
0.0975249782204628,
-0.0789627879858017,
-0.4152877628803253,
-0.14988751709461212,
0.11076170206069946,
0.1523297280073166,
0.6250228881835938,
-0.141245499253273,
0.010630708187818527,
-0.17353889346122742,
0.027301479130983353,
-0.029155371710658073,
0.5341711640357971,
-0.2330019176006317,
0.26150718331336975,
-0.6651997566223145,
0.11680381745100021,
-0.08770351856946945,
-0.059825599193573,
0.08171147108078003,
0.1503250002861023,
-0.285072386264801,
-0.5621327757835388,
0.5883169174194336,
-0.03346218168735504,
-0.48442021012306213,
-0.012354297563433647,
-0.054741114377975464,
0.02567271515727043,
0.05496823042631149,
-0.8351160287857056,
-0.32352685928344727,
0.17136092483997345,
-0.13290613889694214,
-0.2295326441526413,
-0.0395016111433506,
-0.12472951412200928,
-0.12903808057308197,
-0.1227375715970993,
0.04695042967796326,
0.13079766929149628,
-0.05209583044052124,
0.3161410391330719,
-0.13197311758995056
] |
https://github.com/huggingface/datasets/issues/5525 | TypeError: Couldn't cast array of type string to null | Thanks, @TJ-Solergibert. I can access your notebook now. Maybe it was just a temporary issue.
At first sight, it seems something related to your data: maybe some of the examples do not have all the transcriptions for all the languages. Then, some of them are null when unrolled. And when trying to concatenate with the other rows containing strings, the cast issue is raised (the arrays to be concatenated have different types).
Do you think this could be the case? | ### Describe the bug
Processing a dataset I alredy uploaded to the Hub (https://huggingface.co/datasets/tj-solergibert/Europarl-ST) I found that for some splits and some languages (test split, source_lang = "nl") after applying a map function I get the mentioned error.
I alredy tried reseting the shorter strings (reset_cortas function). It only happends with NL, PL, RO and PT. It does not make sense since when processing the other languages I also use the corpus of those that fail and it does not cause any errors.
I suspect that the error may be in this direction:
We use cast_array_to_feature to support casting to custom types like Audio and Image # Also, when trying type "string", we don't want to convert integers or floats to "string". # We only do it if trying_type is False - since this is what the user asks for.
### Steps to reproduce the bug
Here I link a colab notebook to reproduce the error:
https://colab.research.google.com/drive/1JCrS7FlGfu_kFqChMrwKZ_bpabnIMqbP?authuser=1#scrollTo=FBAvlhMxIzpA
### Expected behavior
Data processing does not fail. A correct example can be seen here: https://huggingface.co/datasets/tj-solergibert/Europarl-ST-processed-mt-en
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.10.147+-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 9.0.0
- Pandas version: 1.3.5 | 80 | TypeError: Couldn't cast array of type string to null
### Describe the bug
Processing a dataset I alredy uploaded to the Hub (https://huggingface.co/datasets/tj-solergibert/Europarl-ST) I found that for some splits and some languages (test split, source_lang = "nl") after applying a map function I get the mentioned error.
I alredy tried reseting the shorter strings (reset_cortas function). It only happends with NL, PL, RO and PT. It does not make sense since when processing the other languages I also use the corpus of those that fail and it does not cause any errors.
I suspect that the error may be in this direction:
We use cast_array_to_feature to support casting to custom types like Audio and Image # Also, when trying type "string", we don't want to convert integers or floats to "string". # We only do it if trying_type is False - since this is what the user asks for.
### Steps to reproduce the bug
Here I link a colab notebook to reproduce the error:
https://colab.research.google.com/drive/1JCrS7FlGfu_kFqChMrwKZ_bpabnIMqbP?authuser=1#scrollTo=FBAvlhMxIzpA
### Expected behavior
Data processing does not fail. A correct example can be seen here: https://huggingface.co/datasets/tj-solergibert/Europarl-ST-processed-mt-en
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.10.147+-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 9.0.0
- Pandas version: 1.3.5
Thanks, @TJ-Solergibert. I can access your notebook now. Maybe it was just a temporary issue.
At first sight, it seems something related to your data: maybe some of the examples do not have all the transcriptions for all the languages. Then, some of them are null when unrolled. And when trying to concatenate with the other rows containing strings, the cast issue is raised (the arrays to be concatenated have different types).
Do you think this could be the case? | [
-0.1205771416425705,
-0.4795553982257843,
0.04174375161528587,
0.3527597188949585,
0.44321107864379883,
-0.04269907996058464,
0.4515949487686157,
0.3546943962574005,
0.11704607307910919,
0.26629024744033813,
-0.06308044493198395,
0.38186201453208923,
-0.19216518104076385,
0.021854707971215248,
-0.21398314833641052,
-0.15379606187343597,
0.19048568606376648,
0.19804035127162933,
0.013720482587814331,
-0.09496119618415833,
-0.19459110498428345,
0.25323566794395447,
-0.5064335465431213,
0.09876005351543427,
-0.37892860174179077,
-0.12787781655788422,
0.058607302606105804,
0.024906527251005173,
-0.04734288156032562,
-0.0023030005395412445,
-0.007940387353301048,
-0.3190609812736511,
-0.08835364878177643,
0.42395028471946716,
-0.0001168449452961795,
-0.14185947179794312,
0.3140479326248169,
-0.06494669616222382,
-0.045618705451488495,
-0.21089588105678558,
-0.2966347932815552,
0.06800352782011032,
-0.15339621901512146,
-0.20205414295196533,
0.2501339018344879,
0.27746474742889404,
0.005515808239579201,
-0.5179402828216553,
0.024296201765537262,
0.3732471466064453,
0.1308874785900116,
0.2792551517486572,
-0.03795025125145912,
-0.05341215804219246,
0.11232423782348633,
0.20679248869419098,
-0.16441069543361664,
-0.10518801212310791,
0.18975073099136353,
0.2851051390171051,
0.07042956352233887,
0.14568547904491425,
-0.26916664838790894,
-0.20730917155742645,
-0.13541942834854126,
0.048710841685533524,
-0.2791331708431244,
-0.6229287385940552,
0.18884292244911194,
0.20772302150726318,
0.28461867570877075,
-0.2368296980857849,
-0.17364230751991272,
-0.11740386486053467,
0.29762229323387146,
0.12172931432723999,
0.06013959273695946,
0.20152804255485535,
0.12730473279953003,
0.06414709985256195,
-0.18972183763980865,
0.38348153233528137,
-0.08558106422424316,
0.127868190407753,
-0.13182714581489563,
-0.06984935700893402,
-0.05790117383003235,
0.037704382091760635,
0.055281125009059906,
-0.4342671036720276,
0.32391759753227234,
-0.42873483896255493,
-0.027126681059598923,
0.41242095828056335,
-0.18305158615112305,
-0.18265791237354279,
-0.17057618498802185,
-0.13881826400756836,
-0.037980809807777405,
-0.43027323484420776,
0.018062584102153778,
0.35303011536598206,
-0.19356267154216766,
0.22063735127449036,
0.2292904257774353,
0.12380032241344452,
0.2692471146583557,
0.12021676450967789,
0.1942065954208374,
-0.18423834443092346,
-0.07874511182308197,
0.030875908210873604,
-0.03406786918640137,
0.03320097550749779,
-0.1697867512702942,
0.28171682357788086,
0.26253777742385864,
-0.13718606531620026,
-0.14214642345905304,
0.11768165975809097,
-0.37649691104888916,
0.25452420115470886,
0.12408605962991714,
0.13450448215007782,
0.06808235496282578,
0.5490151643753052,
0.20966945588588715,
0.23136040568351746,
-0.21685120463371277,
-0.20711618661880493,
-0.13620196282863617,
0.10813193023204803,
0.07255825400352478,
-0.20687106251716614,
0.09058639407157898,
-0.0953301191329956,
0.011120950803160667,
-0.03530576080083847,
0.011646702885627747,
-0.23427167534828186,
-0.3713347911834717,
-0.38985878229141235,
0.005022712051868439,
0.12691104412078857,
0.1339452564716339,
0.22281774878501892,
0.19355934858322144,
-0.15952396392822266,
-0.16855013370513916,
0.31970250606536865,
-0.5512505769729614,
-0.07603190094232559,
0.004596652463078499,
0.09344924986362457,
-0.22519631683826447,
0.19798600673675537,
-0.41547903418540955,
0.017908010631799698,
0.2559974789619446,
-0.19306419789791107,
0.015699028968811035,
-0.41186654567718506,
-0.11178720742464066,
-0.1587289422750473,
-0.0040755607187747955,
0.2739337086677551,
-0.38107720017433167,
0.04501369595527649,
-0.33539286255836487,
0.12312684953212738,
0.3620552122592926,
0.3954225778579712,
0.10184409469366074,
0.3846988379955292,
-0.1707819104194641,
0.9171943664550781,
0.4078308641910553,
0.22949886322021484,
-0.09228301793336868,
0.03512289747595787,
-0.04747224599123001,
-0.09341384470462799,
-0.18192452192306519,
-0.009005513042211533,
0.43948593735694885,
-0.08902578800916672,
0.04298844188451767,
0.22714053094387054,
-0.128224179148674,
0.3641469180583954,
-0.372209757566452,
-0.02773677557706833,
0.16827324032783508,
0.10551954805850983,
0.10486756265163422,
0.10541557520627975,
0.04346509650349617,
0.5414221286773682,
-0.04451882839202881,
-0.38210535049438477,
0.40849733352661133,
0.10413298010826111,
0.15027721226215363,
-0.28029125928878784,
-0.014998983591794968,
-0.36476436257362366,
-0.08243220299482346,
-0.019254719838500023,
-0.09097294509410858,
0.37486812472343445,
-0.07401376962661743,
0.004004519432783127,
-0.20928716659545898,
-0.013247629627585411,
0.05966951698064804,
0.38394448161125183,
0.03682814538478851,
-0.048774927854537964,
-0.13828304409980774,
0.26584336161613464,
-0.21989426016807556,
0.08068814873695374,
-0.27159813046455383,
-0.11987484246492386,
-0.39712387323379517,
0.43742796778678894,
-0.18665550649166107,
-0.3963695764541626,
-0.20127466320991516,
0.14878882467746735,
0.10186004638671875,
0.058601681143045425,
-0.17263510823249817,
0.24061158299446106,
0.17595496773719788,
-0.06187671422958374,
-0.30861198902130127,
-0.15059958398342133,
0.2839575409889221,
-0.5760846138000488,
0.16899222135543823,
0.332481324672699,
0.4682971239089966,
-0.2195667326450348,
-0.04166454076766968,
0.3717743158340454,
-0.09382453560829163,
0.22635823488235474,
-0.17430603504180908,
-0.07961832731962204,
0.12575389444828033,
0.003995396196842194,
0.0022122934460639954,
-0.14892181754112244,
0.1084950640797615,
-0.23674695193767548,
-0.07123473286628723,
0.07492300122976303,
-0.2613522410392761,
0.04928062483668327,
0.6657941341400146,
-0.09284685552120209,
0.3404599130153656,
0.3489840030670166,
-0.07428722828626633,
0.12042736262083054,
-0.13341109454631805,
-0.2919944226741791,
0.24051134288311005,
-0.0053871809504926205,
-0.007387127727270126,
-0.05973883718252182,
0.0973965972661972,
-0.09215833991765976,
0.24541562795639038,
0.08719231188297272,
0.18140843510627747,
0.2529818117618561,
0.023416411131620407,
-0.013109729625284672,
-0.14558181166648865,
-0.08815091103315353,
0.1105080172419548,
0.33666321635246277,
-0.4307454228401184,
-0.10519197583198547,
-0.4249173402786255,
-0.279571533203125,
-0.22154241800308228,
-0.03581559285521507,
-0.22156736254692078,
-0.37455400824546814,
-0.09666973352432251,
0.008043039590120316,
-0.2819015085697174,
0.3133426308631897,
0.0782356709241867,
0.1425946056842804,
0.30504468083381653,
0.08343886584043503,
-0.20451106131076813,
0.054430849850177765,
-0.09123239666223526,
0.00781916081905365,
0.42569032311439514,
0.22660411894321442,
-0.3710222542285919,
-0.0857396125793457,
-0.05220581963658333,
0.0562087818980217,
-0.13172389566898346,
0.029754508286714554,
-0.35649216175079346,
-0.0897112786769867,
0.09158171713352203,
0.35989314317703247,
-0.1072971522808075,
-0.34660619497299194,
0.16626012325286865,
-0.2750036120414734,
-0.37601932883262634,
0.5301642417907715,
0.2022509127855301,
-0.14137259125709534,
-0.38513511419296265,
-0.14669418334960938,
-0.056432321667671204,
-0.40865668654441833,
0.1493702530860901,
-0.5226343870162964,
0.23490598797798157,
0.005841183476150036,
0.3872028589248657,
0.24173685908317566,
0.10784948617219925,
-0.19684438407421112,
-0.022062886506319046,
0.3357163667678833,
0.4529673457145691,
0.08628526329994202,
-0.27118340134620667,
0.01338324323296547,
0.0685315951704979,
-0.0770597904920578,
-0.0222843699157238,
-0.22916316986083984,
0.026209797710180283,
-0.09788861125707626,
-0.055583272129297256,
0.0305611751973629,
-0.13687671720981598,
0.34851911664009094,
0.10948838293552399,
0.07885058224201202,
-0.06712613254785538,
-0.03734307363629341,
-0.24981728196144104,
0.23707574605941772,
0.19617177546024323,
0.12972243130207062,
0.28934669494628906,
0.10104593634605408,
-0.26083290576934814,
0.37486445903778076,
0.14795690774917603,
0.29106220602989197,
0.08778797835111618,
-0.042771171778440475,
-0.3893592059612274,
-0.25496530532836914,
0.02475595846772194,
-0.06043332815170288,
-0.12504857778549194,
0.35721224546432495,
-0.20898306369781494,
-0.5849959254264832,
0.032683342695236206,
-0.207562655210495,
-0.29690003395080566,
-0.2341192662715912,
0.39728933572769165,
0.0066792964935302734,
0.08103382587432861,
-0.38024887442588806,
-0.07470764219760895,
0.06852075457572937,
-0.1971656084060669,
-0.048923950642347336,
-0.06082063913345337,
0.037657156586647034,
-0.223204106092453,
-0.30175626277923584,
-0.3710205852985382,
-0.06245378404855728,
0.46233975887298584,
0.4141595661640167,
0.5508549213409424,
-0.1532353311777115,
-0.0825287401676178,
0.007166042923927307,
0.13435490429401398,
0.5704302191734314,
-0.3415660262107849,
0.014385540038347244,
0.35892388224601746,
0.1939622461795807,
-0.4384898245334625,
0.11956329643726349,
-0.23924145102500916,
-0.107762411236763,
0.4059949815273285,
0.3621686100959778,
-0.26657775044441223,
0.11200136691331863,
0.1767890304327011,
0.21981580555438995,
0.15357443690299988,
0.16686570644378662,
0.013730574399232864,
-0.3633670508861542,
-0.23363341391086578,
-0.008716605603694916,
0.3092876672744751,
0.4679604172706604,
0.014346751384437084,
0.1194840669631958,
-0.1589660793542862,
-0.35567915439605713,
0.15299399197101593,
-0.1491246223449707,
0.3709160089492798,
-0.024373788386583328,
0.14504754543304443,
-0.43898776173591614,
-0.3073568642139435,
0.0077980151399970055,
0.4748741388320923,
0.2329472303390503,
-0.06481581926345825,
0.2677929401397705,
-0.20562396943569183,
0.41074880957603455,
0.5644487142562866,
0.06657209992408752,
0.24251055717468262,
0.05154034495353699,
0.247445210814476,
-0.04720979183912277,
-0.00023448606953024864,
0.03772508352994919,
0.009732396341860294,
-0.3194766342639923,
0.049228355288505554,
0.06330197304487228,
-0.07417656481266022,
0.21323613822460175,
0.03708306699991226,
0.09543818235397339,
-0.35973313450813293,
0.6314487457275391,
0.13333448767662048,
1.1923255920410156,
0.03327465057373047,
0.06428399682044983,
-0.15749764442443848,
0.06270617246627808,
0.21656078100204468,
0.12290433049201965,
0.19011934101581573,
-0.32343941926956177,
-0.05190540850162506,
-0.17386072874069214,
0.15242108702659607,
0.24776765704154968,
0.08245858550071716,
-0.47430282831192017,
0.011986303143203259,
0.10610286891460419,
0.42020565271377563,
-0.0533391535282135,
-0.2607601284980774,
-0.37486112117767334,
-0.5309696197509766,
-0.2435060739517212,
0.0778166726231575,
-0.21556682884693146,
-0.08852612972259521,
0.29921120405197144,
-0.11827342212200165,
-0.3902302384376526,
-0.2339208871126175,
-0.41641050577163696,
0.1548559069633484,
0.12095550447702408,
0.015977637842297554,
-0.09146732091903687,
-0.12092214822769165,
0.2822365462779999,
0.3184594511985779,
0.2224620282649994,
0.4742160737514496,
-0.10423076152801514,
-0.08508333563804626,
0.04472728818655014,
-0.06795812398195267,
0.0468442477285862,
-0.14614470303058624,
0.1866828054189682,
0.02071969211101532,
-0.20465514063835144,
-0.09954694658517838,
-0.08119095116853714,
0.11788693070411682,
-0.004370197653770447,
0.11026224493980408,
-0.2216462343931198,
-0.3102635145187378,
-0.3532157838344574,
0.0549001544713974,
-0.022439587861299515,
-0.07405199110507965,
0.0948694497346878,
-0.15171225368976593,
-0.19398699700832367,
0.44458743929862976,
-0.07004953920841217,
-0.25909623503685,
0.03876741975545883,
0.5590623617172241,
0.3324020802974701,
0.32133349776268005,
0.41787171363830566,
0.17853061854839325,
-0.2548057436943054,
-0.1887548267841339,
0.28072589635849,
-0.03616869077086449,
-0.756883978843689,
0.15441709756851196,
-0.34484654664993286,
-0.36966031789779663,
-0.04019596427679062,
0.4005718231201172,
-0.06551899760961533,
0.380715936422348,
-0.4354023337364197,
-0.2783965468406677,
-0.21215057373046875,
0.3030811548233032,
0.4424104690551758,
0.23321567475795746,
-0.1930588185787201,
0.4348243474960327,
0.10732750594615936,
-0.17950689792633057,
-0.22949233651161194,
0.14621630311012268,
-0.6028191447257996,
0.38779696822166443,
-0.5358481407165527,
-0.06585587561130524,
0.07518171519041061,
-0.2605895400047302,
0.04118978977203369,
0.49218666553497314,
-0.13123448193073273,
-0.10123391449451447,
0.015834204852581024,
0.17226634919643402,
0.285204142332077,
-0.12620870769023895,
-0.010388528928160667,
-0.10434035211801529,
-0.1030493825674057,
-0.3371385633945465,
-0.12344011664390564,
0.2323741614818573,
-0.19815786182880402,
0.002191949635744095,
0.48090860247612,
0.07176733762025833,
0.09905670583248138,
0.23930411040782928,
-0.09057863056659698,
0.21786987781524658,
-0.1930624544620514,
0.15929745137691498,
0.06155060976743698,
0.13782478868961334,
0.09228190034627914,
0.20562446117401123,
0.058031123131513596,
-0.16874098777770996,
0.44588005542755127,
-0.20934797823429108,
-0.04299221560359001,
0.03874243423342705,
0.22013862431049347,
0.007328856736421585,
-0.21409468352794647,
-0.1121019721031189,
0.14359307289123535,
0.049338098615407944,
-0.02346053346991539,
-0.06795645505189896,
0.316185861825943,
-0.10024415701627731,
-0.14243638515472412,
0.37241804599761963,
0.03982089087367058,
0.0027561336755752563,
0.15339818596839905,
-0.01009957492351532,
0.6814361810684204,
-0.16845867037773132,
0.10011661052703857,
0.09301276504993439,
-0.0940331220626831,
0.1473727971315384,
0.00015856698155403137,
-0.16515609622001648,
0.055788591504096985,
0.11425888538360596,
0.08037441968917847,
0.13244937360286713,
-0.09233688563108444,
0.2239191234111786,
0.07065566629171371,
-0.11850535869598389,
0.14304353296756744,
0.275844931602478,
-0.04598851501941681,
0.32785841822624207,
-0.00797707587480545,
-0.13563838601112366,
-0.45590120553970337,
-0.2068631500005722,
0.00706697441637516,
0.3032446503639221,
-0.3892914056777954,
0.15563879907131195,
-0.298616498708725,
0.035303935408592224,
-0.18069860339164734,
-0.24787981808185577,
0.0673755407333374,
0.11777854710817337,
0.42053166031837463,
0.22113148868083954,
-0.12964797019958496,
0.08482528477907181,
-0.2570187449455261,
0.1801542043685913,
0.3226104974746704,
-0.39645588397979736,
0.22478583455085754,
0.08275455236434937,
0.1941956728696823,
0.1497114598751068,
0.5801194906234741,
0.4718058109283447,
0.3699621558189392,
-0.21174272894859314,
0.038597337901592255,
0.09322419762611389,
-0.1719110608100891,
0.15238718688488007,
0.3416368365287781,
0.1559269279241562,
0.40562036633491516,
0.2445879727602005,
0.054483115673065186,
-0.12545448541641235,
-0.06820015609264374,
0.008922290056943893,
0.3129778802394867,
0.07470506429672241,
0.32559332251548767,
-0.3188878893852234,
-0.02117396891117096,
-0.30755069851875305,
-0.21455764770507812,
-0.541293203830719,
0.25114691257476807,
0.1380738914012909,
-0.3379039764404297,
0.23706135153770447,
0.2107066959142685,
0.041355788707733154,
0.12892566621303558,
0.39152076840400696,
0.32086291909217834,
-0.11704496294260025,
-0.22311002016067505,
-0.2141532003879547,
-0.04882600158452988,
0.14476794004440308,
-0.12741005420684814,
0.2098490446805954,
0.09111282229423523,
0.17895708978176117,
0.06495467573404312,
0.011618837714195251,
-0.16242675483226776,
-0.17433688044548035,
-0.15806712210178375,
0.44149672985076904,
-0.25676682591438293,
-0.16884873807430267,
0.2641293406486511,
-0.09972607344388962,
-0.07464571297168732,
-0.39532437920570374,
0.37854427099227905,
0.0033988002687692642,
0.024081170558929443,
0.2235809713602066,
-0.010808076709508896,
-0.11503224074840546,
-0.2509831488132477,
-0.1852954924106598,
0.09121870994567871,
0.2607388496398926,
-0.141825333237648,
0.22902435064315796,
0.00770321860909462,
-0.3940144181251526,
-0.16227392852306366,
0.15064425766468048,
0.28829994797706604,
0.5727322101593018,
-0.10101907700300217,
-0.056833814829587936,
-0.11719965934753418,
0.03383030369877815,
0.03404407203197479,
0.44210284948349,
-0.2244769185781479,
0.3171278238296509,
-0.5137343406677246,
-0.011537509970366955,
-0.16595867276191711,
-0.06350765377283096,
0.020023547112941742,
0.11578787863254547,
-0.3006868362426758,
-0.5732619166374207,
0.5557034611701965,
-0.03774435073137283,
-0.4475892186164856,
0.0005660569295287132,
0.0033727064728736877,
0.08680182695388794,
0.08250974863767624,
-0.7949858903884888,
-0.24821710586547852,
0.17326243221759796,
-0.1102980300784111,
-0.22436583042144775,
-0.02592039480805397,
-0.1506868600845337,
-0.12512966990470886,
-0.16962379217147827,
0.08193519711494446,
0.2075193226337433,
-0.0521860308945179,
0.2629094421863556,
-0.1681855320930481
] |
https://github.com/huggingface/datasets/issues/5525 | TypeError: Couldn't cast array of type string to null | See, in this example, "nl" and "ro" transcripts are null:
```python
>>> europarl_ds["test"][:1]
{'original_speech': ['− Señor Presidente, en primer lugar, quisiera felicitar al señor Seeber por el trabajo realizado, porque en su informe se recogen muchas de las preocupaciones manifestadas en esta'],
'original_language': ['es'],
'audio_path': ['es/audios/en.20081008.24.3-238.m4a'],
'segment_start': [0.6200000047683716],
'segment_end': [11.319999694824219],
'transcriptions': [{'de': '− Herr Präsident! Zunächst möchte ich Richard Seeber zu der von ihm geleisteten Arbeit gratulieren, denn sein Bericht greift viele der in diesem Haus zum Ausdruck gebrachten Anliegen',
'en': '− Mr President, firstly I would like to congratulate Mr Seeber on the work he has done, because his report picks up many of the concerns expressed in this',
'es': '− Señor Presidente, en primer lugar, quisiera felicitar al señor Seeber por el trabajo realizado, porque en su informe se recogen muchas de las preocupaciones manifestadas en esta',
'fr': '− Monsieur le Président, je voudrais tout d ’ abord féliciter M. Seeber pour le travail qu ’ il a effectué, parce que son rapport reprend beaucoup des inquiétudes exprimées au sein de cette',
'it': "− Signor Presidente, mi congratulo innanzi tutto con l'onorevole Seeber per il lavoro svolto, perché la sua relazione accoglie molti dei timori espressi da quest'Aula",
'nl': None,
'pl': '− Panie przewodniczący! Po pierwsze chciałabym pogratulować panu posłowi Seeberowi wykonanej pracy, ponieważ jego sprawozdanie podejmuje szereg podnoszonych w tej Izbie',
'pt': '− Senhor Presidente, começo por felicitar o senhor deputado Seeber pelo trabalho que desenvolveu em torno deste relatório, que retoma muitas das preocupações expressas nesta',
'ro': None}]}
```
```python
>>> processed_europarl[0]
{'de': '− Herr Präsident! Zunächst möchte ich Richard Seeber zu der von ihm geleisteten Arbeit gratulieren, denn sein Bericht greift viele der in diesem Haus zum Ausdruck gebrachten Anliegen',
'en': '− Mr President, firstly I would like to congratulate Mr Seeber on the work he has done, because his report picks up many of the concerns expressed in this',
'es': '− Señor Presidente, en primer lugar, quisiera felicitar al señor Seeber por el trabajo realizado, porque en su informe se recogen muchas de las preocupaciones manifestadas en esta',
'fr': '− Monsieur le Président, je voudrais tout d ’ abord féliciter M. Seeber pour le travail qu ’ il a effectué, parce que son rapport reprend beaucoup des inquiétudes exprimées au sein de cette',
'it': "− Signor Presidente, mi congratulo innanzi tutto con l'onorevole Seeber per il lavoro svolto, perché la sua relazione accoglie molti dei timori espressi da quest'Aula",
'nl': None,
'pl': '− Panie przewodniczący! Po pierwsze chciałabym pogratulować panu posłowi Seeberowi wykonanej pracy, ponieważ jego sprawozdanie podejmuje szereg podnoszonych w tej Izbie',
'pt': '− Senhor Presidente, começo por felicitar o senhor deputado Seeber pelo trabalho que desenvolveu em torno deste relatório, que retoma muitas das preocupações expressas nesta',
'ro': None}
``` | ### Describe the bug
Processing a dataset I alredy uploaded to the Hub (https://huggingface.co/datasets/tj-solergibert/Europarl-ST) I found that for some splits and some languages (test split, source_lang = "nl") after applying a map function I get the mentioned error.
I alredy tried reseting the shorter strings (reset_cortas function). It only happends with NL, PL, RO and PT. It does not make sense since when processing the other languages I also use the corpus of those that fail and it does not cause any errors.
I suspect that the error may be in this direction:
We use cast_array_to_feature to support casting to custom types like Audio and Image # Also, when trying type "string", we don't want to convert integers or floats to "string". # We only do it if trying_type is False - since this is what the user asks for.
### Steps to reproduce the bug
Here I link a colab notebook to reproduce the error:
https://colab.research.google.com/drive/1JCrS7FlGfu_kFqChMrwKZ_bpabnIMqbP?authuser=1#scrollTo=FBAvlhMxIzpA
### Expected behavior
Data processing does not fail. A correct example can be seen here: https://huggingface.co/datasets/tj-solergibert/Europarl-ST-processed-mt-en
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.10.147+-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 9.0.0
- Pandas version: 1.3.5 | 458 | TypeError: Couldn't cast array of type string to null
### Describe the bug
Processing a dataset I alredy uploaded to the Hub (https://huggingface.co/datasets/tj-solergibert/Europarl-ST) I found that for some splits and some languages (test split, source_lang = "nl") after applying a map function I get the mentioned error.
I alredy tried reseting the shorter strings (reset_cortas function). It only happends with NL, PL, RO and PT. It does not make sense since when processing the other languages I also use the corpus of those that fail and it does not cause any errors.
I suspect that the error may be in this direction:
We use cast_array_to_feature to support casting to custom types like Audio and Image # Also, when trying type "string", we don't want to convert integers or floats to "string". # We only do it if trying_type is False - since this is what the user asks for.
### Steps to reproduce the bug
Here I link a colab notebook to reproduce the error:
https://colab.research.google.com/drive/1JCrS7FlGfu_kFqChMrwKZ_bpabnIMqbP?authuser=1#scrollTo=FBAvlhMxIzpA
### Expected behavior
Data processing does not fail. A correct example can be seen here: https://huggingface.co/datasets/tj-solergibert/Europarl-ST-processed-mt-en
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.10.147+-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 9.0.0
- Pandas version: 1.3.5
See, in this example, "nl" and "ro" transcripts are null:
```python
>>> europarl_ds["test"][:1]
{'original_speech': ['− Señor Presidente, en primer lugar, quisiera felicitar al señor Seeber por el trabajo realizado, porque en su informe se recogen muchas de las preocupaciones manifestadas en esta'],
'original_language': ['es'],
'audio_path': ['es/audios/en.20081008.24.3-238.m4a'],
'segment_start': [0.6200000047683716],
'segment_end': [11.319999694824219],
'transcriptions': [{'de': '− Herr Präsident! Zunächst möchte ich Richard Seeber zu der von ihm geleisteten Arbeit gratulieren, denn sein Bericht greift viele der in diesem Haus zum Ausdruck gebrachten Anliegen',
'en': '− Mr President, firstly I would like to congratulate Mr Seeber on the work he has done, because his report picks up many of the concerns expressed in this',
'es': '− Señor Presidente, en primer lugar, quisiera felicitar al señor Seeber por el trabajo realizado, porque en su informe se recogen muchas de las preocupaciones manifestadas en esta',
'fr': '− Monsieur le Président, je voudrais tout d ’ abord féliciter M. Seeber pour le travail qu ’ il a effectué, parce que son rapport reprend beaucoup des inquiétudes exprimées au sein de cette',
'it': "− Signor Presidente, mi congratulo innanzi tutto con l'onorevole Seeber per il lavoro svolto, perché la sua relazione accoglie molti dei timori espressi da quest'Aula",
'nl': None,
'pl': '− Panie przewodniczący! Po pierwsze chciałabym pogratulować panu posłowi Seeberowi wykonanej pracy, ponieważ jego sprawozdanie podejmuje szereg podnoszonych w tej Izbie',
'pt': '− Senhor Presidente, começo por felicitar o senhor deputado Seeber pelo trabalho que desenvolveu em torno deste relatório, que retoma muitas das preocupações expressas nesta',
'ro': None}]}
```
```python
>>> processed_europarl[0]
{'de': '− Herr Präsident! Zunächst möchte ich Richard Seeber zu der von ihm geleisteten Arbeit gratulieren, denn sein Bericht greift viele der in diesem Haus zum Ausdruck gebrachten Anliegen',
'en': '− Mr President, firstly I would like to congratulate Mr Seeber on the work he has done, because his report picks up many of the concerns expressed in this',
'es': '− Señor Presidente, en primer lugar, quisiera felicitar al señor Seeber por el trabajo realizado, porque en su informe se recogen muchas de las preocupaciones manifestadas en esta',
'fr': '− Monsieur le Président, je voudrais tout d ’ abord féliciter M. Seeber pour le travail qu ’ il a effectué, parce que son rapport reprend beaucoup des inquiétudes exprimées au sein de cette',
'it': "− Signor Presidente, mi congratulo innanzi tutto con l'onorevole Seeber per il lavoro svolto, perché la sua relazione accoglie molti dei timori espressi da quest'Aula",
'nl': None,
'pl': '− Panie przewodniczący! Po pierwsze chciałabym pogratulować panu posłowi Seeberowi wykonanej pracy, ponieważ jego sprawozdanie podejmuje szereg podnoszonych w tej Izbie',
'pt': '− Senhor Presidente, começo por felicitar o senhor deputado Seeber pelo trabalho que desenvolveu em torno deste relatório, que retoma muitas das preocupações expressas nesta',
'ro': None}
``` | [
-0.07954692840576172,
-0.5227319002151489,
0.042124319821596146,
0.40471529960632324,
0.42138445377349854,
-0.005711778998374939,
0.4713701903820038,
0.3309302031993866,
0.2484809160232544,
0.17114464938640594,
-0.05038853734731674,
0.33937522768974304,
-0.27421993017196655,
-0.015151917934417725,
-0.21663939952850342,
-0.18159659206867218,
0.1874718964099884,
0.16597041487693787,
0.0315338596701622,
-0.02982553094625473,
-0.1798316240310669,
0.223734512925148,
-0.5465201735496521,
0.04205404967069626,
-0.2935020327568054,
-0.09632319957017899,
0.17210128903388977,
-0.06349877268075943,
-0.04281187802553177,
-0.039550669491291046,
-0.04884999245405197,
-0.35591959953308105,
-0.15018978714942932,
0.37380367517471313,
-0.00012208623229525983,
-0.09020525962114334,
0.3547130823135376,
-0.006313590332865715,
-0.03420543670654297,
-0.11987395584583282,
-0.3593348264694214,
0.17438861727714539,
-0.16279864311218262,
-0.15778303146362305,
0.2889154851436615,
0.38582226634025574,
0.013045653700828552,
-0.5570056438446045,
0.05140099301934242,
0.4125716984272003,
0.08611683547496796,
0.32436779141426086,
-0.08067002892494202,
-0.04694489762187004,
0.11883319914340973,
0.2761830687522888,
-0.15879754722118378,
-0.22357507050037384,
0.10439411550760269,
0.46139368414878845,
0.09311357140541077,
0.13807229697704315,
-0.30216342210769653,
-0.17492665350437164,
-0.11824587732553482,
-0.055247530341148376,
-0.2825794816017151,
-0.5423715114593506,
0.1849600076675415,
0.12739212810993195,
0.32655420899391174,
-0.20818191766738892,
-0.08145194500684738,
-0.0347922220826149,
0.20756305754184723,
0.19439697265625,
0.08727402240037918,
0.1632252335548401,
0.07434408366680145,
0.03740557283163071,
-0.24866457283496857,
0.3003987669944763,
-0.07511787861585617,
0.09669962525367737,
-0.0626787394285202,
0.020068317651748657,
-0.03600328788161278,
0.1407138854265213,
0.0010303519666194916,
-0.40054070949554443,
0.22264596819877625,
-0.4331146776676178,
-0.012326542288064957,
0.38170748949050903,
-0.10962571203708649,
-0.23515914380550385,
-0.14201796054840088,
-0.1329212486743927,
-0.0764395073056221,
-0.359538733959198,
-0.029237113893032074,
0.3264751136302948,
-0.17769795656204224,
0.26955410838127136,
0.27940016984939575,
0.06712041795253754,
0.3666432499885559,
0.055670566856861115,
0.1642434000968933,
-0.17733559012413025,
-0.13325417041778564,
0.08571715652942657,
0.0197516568005085,
0.055698294192552567,
-0.13216246664524078,
0.3795466125011444,
0.34310460090637207,
-0.1325790137052536,
-0.1290053427219391,
0.16313104331493378,
-0.35957372188568115,
0.24894441664218903,
0.13688485324382782,
0.09745519608259201,
0.012735779397189617,
0.5578471422195435,
0.21666289865970612,
0.21506984531879425,
-0.251484751701355,
-0.25834184885025024,
-0.10246965289115906,
0.12711794674396515,
0.11804425716400146,
-0.2668401896953583,
0.07420800626277924,
0.046019017696380615,
0.03255784511566162,
-0.035491522401571274,
-0.05871300399303436,
-0.2939102053642273,
-0.2529604434967041,
-0.3924170732498169,
0.023228906095027924,
0.12113548815250397,
0.08414910733699799,
0.2710409462451935,
0.1981862634420395,
-0.09224799275398254,
-0.2261972725391388,
0.3462848663330078,
-0.6061574816703796,
-0.07543543726205826,
0.06096840649843216,
0.054250456392765045,
-0.1945875734090805,
0.14859169721603394,
-0.4950403869152069,
0.00011188909411430359,
0.2677413821220398,
-0.27330633997917175,
-0.0015286058187484741,
-0.4344131350517273,
-0.18608184158802032,
-0.1684042513370514,
-0.06763099879026413,
0.31397923827171326,
-0.3555424213409424,
0.03161954879760742,
-0.4022541642189026,
0.03429141268134117,
0.3467618227005005,
0.32499462366104126,
0.09089317172765732,
0.4322884678840637,
-0.1412626951932907,
0.8865323662757874,
0.36076921224594116,
0.18166981637477875,
-0.06816112995147705,
0.028094928711652756,
-0.028068922460079193,
-0.1397712081670761,
-0.23062297701835632,
0.10324990004301071,
0.4108133614063263,
-0.11620140075683594,
-0.06336019933223724,
0.23223306238651276,
-0.13880832493305206,
0.37745901942253113,
-0.32204294204711914,
0.010151343420147896,
0.15748102962970734,
0.10062339901924133,
0.13068099319934845,
0.10996527969837189,
0.029005616903305054,
0.6522895097732544,
-0.09287423640489578,
-0.2688116133213043,
0.44625118374824524,
0.10933990031480789,
0.16307517886161804,
-0.307988703250885,
-0.032926592975854874,
-0.37086594104766846,
-0.08871566504240036,
-0.03789892420172691,
-0.06999636441469193,
0.38051608204841614,
0.05968146771192551,
0.046608127653598785,
-0.24563956260681152,
0.006022229790687561,
0.036776475608348846,
0.3302531838417053,
-0.013631073758006096,
-0.014034576714038849,
-0.15534549951553345,
0.2713299095630646,
-0.2043076604604721,
-0.00483785942196846,
-0.22878889739513397,
-0.12032723426818848,
-0.37721168994903564,
0.4046092629432678,
-0.21617701649665833,
-0.33185338973999023,
-0.3520902097225189,
0.13137692213058472,
0.09438972920179367,
0.0948566347360611,
-0.18854168057441711,
0.19368937611579895,
0.3091488480567932,
-0.10343067348003387,
-0.33767828345298767,
-0.16500042378902435,
0.25821393728256226,
-0.6995612978935242,
0.2057063728570938,
0.46613767743110657,
0.47529396414756775,
-0.25587761402130127,
0.020306333899497986,
0.31869059801101685,
-0.06346462666988373,
0.27086836099624634,
-0.23088625073432922,
-0.08443707227706909,
0.035197533667087555,
0.040105920284986496,
0.06465893238782883,
-0.14469695091247559,
0.04162348434329033,
-0.1920606791973114,
-0.07970519363880157,
0.03975331783294678,
-0.2595846652984619,
-0.02848116308450699,
0.5777959227561951,
0.01004316657781601,
0.35294193029403687,
0.330567866563797,
-0.09788701683282852,
0.048382990062236786,
-0.09590157121419907,
-0.31214138865470886,
0.2937518358230591,
-0.09955648332834244,
0.006070263683795929,
0.04267448931932449,
0.13106437027454376,
-0.06544715911149979,
0.25193583965301514,
0.12859372794628143,
0.17334496974945068,
0.21813923120498657,
-0.000295411329716444,
-0.019476689398288727,
-0.06246894970536232,
-0.15428565442562103,
0.09212464839220047,
0.27905505895614624,
-0.484498530626297,
-0.12166543304920197,
-0.4048740565776825,
-0.19433003664016724,
-0.25062453746795654,
0.13826905190944672,
-0.22564217448234558,
-0.40294167399406433,
-0.090883269906044,
-0.0583343468606472,
-0.33703339099884033,
0.29641732573509216,
0.07041288912296295,
0.13120749592781067,
0.33434781432151794,
0.07124080508947372,
-0.15665249526500702,
0.08158427476882935,
-0.10354685038328171,
-0.048225902020931244,
0.40861788392066956,
0.20853213965892792,
-0.3411518931388855,
-0.08119814097881317,
-0.14350658655166626,
0.0000853613018989563,
-0.14175432920455933,
0.08104032278060913,
-0.2671152949333191,
0.0009691324084997177,
0.13438130915164948,
0.40818268060684204,
-0.09903117269277573,
-0.2805294096469879,
0.16142374277114868,
-0.31142935156822205,
-0.35882797837257385,
0.5158420205116272,
0.09704544395208359,
-0.02181607112288475,
-0.35000789165496826,
-0.16002225875854492,
-0.049286194145679474,
-0.37231284379959106,
0.08438344299793243,
-0.5030547380447388,
0.23034259676933289,
0.05669401213526726,
0.35901355743408203,
0.20507870614528656,
-0.003886569757014513,
-0.13442830741405487,
0.03136039152741432,
0.3647885024547577,
0.3509197533130646,
0.05710664764046669,
-0.19620946049690247,
0.002731531858444214,
0.12845589220523834,
-0.06329628825187683,
-0.05226527899503708,
-0.2691197991371155,
0.03179115802049637,
-0.10159440338611603,
-0.08298417925834656,
-0.0006158687174320221,
-0.13432013988494873,
0.3053940534591675,
0.04917267709970474,
0.12398234009742737,
-0.05474347248673439,
-0.0645042210817337,
-0.23010125756263733,
0.16384410858154297,
0.1541520059108734,
0.2381686270236969,
0.3139357268810272,
0.16296759247779846,
-0.11911006271839142,
0.3900611102581024,
0.10713686048984528,
0.28706175088882446,
0.08483821153640747,
-0.08594982326030731,
-0.4086824059486389,
-0.2355360984802246,
0.07983183115720749,
0.032961808145046234,
-0.2420656532049179,
0.2795970141887665,
-0.20566752552986145,
-0.5973308086395264,
0.047560177743434906,
-0.1584123820066452,
-0.29835987091064453,
-0.18870438635349274,
0.32352957129478455,
0.10160525143146515,
0.10025729238986969,
-0.3693099915981293,
-0.09518224745988846,
0.0840836763381958,
-0.22484812140464783,
-0.04594317078590393,
-0.015451312065124512,
0.020538516342639923,
-0.1954328566789627,
-0.4027555286884308,
-0.36952024698257446,
0.05620981752872467,
0.4276776909828186,
0.4009866416454315,
0.5664414167404175,
-0.16911427676677704,
-0.07714641094207764,
-0.003421001136302948,
0.20324736833572388,
0.46431809663772583,
-0.38898685574531555,
0.16625282168388367,
0.278988242149353,
0.23796087503433228,
-0.43437710404396057,
0.14630195498466492,
-0.21276141703128815,
-0.07785292714834213,
0.4240419864654541,
0.26089924573898315,
-0.2079521119594574,
0.13420672714710236,
0.20618875324726105,
0.2335958033800125,
0.19173453748226166,
0.15510720014572144,
0.06294900178909302,
-0.3177112638950348,
-0.22519975900650024,
0.020319461822509766,
0.35189396142959595,
0.39630526304244995,
0.0913051962852478,
0.1709728240966797,
-0.15830102562904358,
-0.2706151604652405,
0.11893472820520401,
-0.2596018314361572,
0.3811616897583008,
-0.10219884663820267,
0.1363249570131302,
-0.5271116495132446,
-0.3431354761123657,
-0.03368660807609558,
0.48881807923316956,
0.25719892978668213,
-0.034624144434928894,
0.2501632869243622,
-0.059243228286504745,
0.41718512773513794,
0.5458515882492065,
0.028629697859287262,
0.20461134612560272,
0.070643350481987,
0.1835194230079651,
-0.05834182724356651,
0.058053214102983475,
-0.02530011348426342,
-0.03727589175105095,
-0.35359883308410645,
0.0487876832485199,
0.07088848948478699,
-0.023575691506266594,
0.22944597899913788,
-0.00777687132358551,
0.11260510236024857,
-0.32453006505966187,
0.6222506761550903,
0.19011595845222473,
1.203222393989563,
0.056966979056596756,
0.08646004647016525,
-0.18046465516090393,
0.04612725228071213,
0.2384929209947586,
0.11411942541599274,
0.19308070838451385,
-0.387647807598114,
0.1262904405593872,
-0.1688249707221985,
0.09504042565822601,
0.25497275590896606,
0.10146567225456238,
-0.4401696026325226,
-0.015821026638150215,
0.1297791302204132,
0.5073531866073608,
-0.07957342267036438,
-0.26025331020355225,
-0.346437007188797,
-0.4554477334022522,
-0.13078907132148743,
0.05489843338727951,
-0.2545270323753357,
-0.05863840505480766,
0.245852530002594,
-0.0390259325504303,
-0.3144482970237732,
-0.27904874086380005,
-0.4770042300224304,
0.11827824264764786,
0.11430078744888306,
0.026169495657086372,
-0.07311353087425232,
-0.05909848213195801,
0.3434728682041168,
0.3539730906486511,
0.16709783673286438,
0.5295258164405823,
-0.09716050326824188,
-0.029933352023363113,
-0.013074539601802826,
-0.04428791627287865,
0.07497092336416245,
-0.1560131460428238,
0.1742437183856964,
0.019044972956180573,
-0.14980913698673248,
-0.15460556745529175,
-0.10172803699970245,
0.03715193271636963,
-0.03145236521959305,
0.10653400421142578,
-0.1714024692773819,
-0.25455424189567566,
-0.44663137197494507,
0.03396400809288025,
-0.0352131724357605,
-0.05836537480354309,
0.04104490578174591,
-0.16636517643928528,
-0.19244696199893951,
0.3938077986240387,
-0.04675300791859627,
-0.31241923570632935,
0.09954775869846344,
0.5719515681266785,
0.32666197419166565,
0.2844313383102417,
0.35688185691833496,
0.25747227668762207,
-0.22090937197208405,
-0.21700620651245117,
0.3319494128227234,
-0.0256063099950552,
-0.7872555255889893,
0.22190804779529572,
-0.4346863031387329,
-0.36393147706985474,
-0.07102839648723602,
0.38380807638168335,
-0.17377841472625732,
0.4210893213748932,
-0.3533264696598053,
-0.2697661221027374,
-0.23155398666858673,
0.28478655219078064,
0.3108101785182953,
0.19299820065498352,
-0.18780517578125,
0.3670356869697571,
0.07143601030111313,
-0.2784896790981293,
-0.1610756814479828,
0.14714646339416504,
-0.553133487701416,
0.4222153127193451,
-0.5080479383468628,
-0.010437969118356705,
-0.009788723662495613,
-0.1674470454454422,
-0.005363188683986664,
0.4508751630783081,
-0.18091511726379395,
-0.05492205172777176,
-0.020948583260178566,
0.19638487696647644,
0.31463509798049927,
-0.15353307127952576,
0.015565219335258007,
-0.08729757368564606,
-0.14505687355995178,
-0.2922685742378235,
-0.14729870855808258,
0.29005464911460876,
-0.19433118402957916,
0.14937925338745117,
0.4685640037059784,
0.07123063504695892,
0.06619231402873993,
0.28381937742233276,
-0.08821320533752441,
0.3305014967918396,
-0.16685600578784943,
0.2137356400489807,
0.15045426785945892,
0.15884119272232056,
-0.012704144231975079,
0.26512089371681213,
0.11609071493148804,
-0.11735641211271286,
0.37093478441238403,
-0.2540932297706604,
0.02445899322628975,
0.11934000253677368,
0.19546502828598022,
-0.004228681325912476,
-0.25092262029647827,
-0.09544528275728226,
0.061605289578437805,
0.006522988900542259,
0.0628468245267868,
0.006521861534565687,
0.4368510842323303,
-0.059682898223400116,
-0.15824612975120544,
0.3667250871658325,
0.07589034736156464,
0.010403946042060852,
0.15405866503715515,
0.06447923928499222,
0.686781108379364,
-0.23476512730121613,
0.12608228623867035,
0.051257792860269547,
-0.10136747360229492,
0.12780295312404633,
-0.09495889395475388,
-0.21316979825496674,
0.07143419981002808,
0.18000301718711853,
0.1411949247121811,
0.2459084540605545,
0.0028839968144893646,
0.22675873339176178,
0.11993047595024109,
-0.10735169053077698,
0.19743040204048157,
0.3089789152145386,
-0.03736324608325958,
0.31754210591316223,
0.04195937514305115,
-0.2386990785598755,
-0.43130403757095337,
-0.22467932105064392,
-0.0027799662202596664,
0.2502952218055725,
-0.40156054496765137,
0.120899498462677,
-0.29948097467422485,
-0.02831278368830681,
-0.21907822787761688,
-0.17969675362110138,
0.004782818257808685,
0.1489003747701645,
0.4039266109466553,
0.1991683542728424,
-0.2040432244539261,
0.019987229257822037,
-0.20640790462493896,
0.14098696410655975,
0.25689464807510376,
-0.36847758293151855,
0.2546979486942291,
0.023418240249156952,
0.22968454658985138,
0.2207576185464859,
0.574739396572113,
0.4482347369194031,
0.3832590878009796,
-0.2835492193698883,
0.027471020817756653,
0.05089624226093292,
-0.1632002741098404,
0.12889984250068665,
0.35558781027793884,
0.14493857324123383,
0.4599824845790863,
0.20139309763908386,
0.003048306331038475,
-0.06581006944179535,
-0.108817458152771,
0.017940573394298553,
0.29981034994125366,
0.07666689157485962,
0.38645634055137634,
-0.3434324562549591,
0.02579246461391449,
-0.28052350878715515,
-0.13944512605667114,
-0.5168470740318298,
0.09569547325372696,
0.23676136136054993,
-0.30299368500709534,
0.22498825192451477,
0.18630343675613403,
0.0025027506053447723,
0.0639512911438942,
0.3112178444862366,
0.2805556058883667,
-0.18148061633110046,
-0.23040495812892914,
-0.13604135811328888,
-0.05864792689681053,
0.22211846709251404,
-0.05170612409710884,
0.20541971921920776,
0.07460508495569229,
0.15146932005882263,
-0.026966191828250885,
0.06365130841732025,
-0.11687253415584564,
-0.195633664727211,
-0.07169095426797867,
0.39232954382896423,
-0.17606580257415771,
-0.17450274527072906,
0.28393280506134033,
-0.10441528260707855,
-0.06674341857433319,
-0.4635941684246063,
0.2873115837574005,
0.014215991832315922,
-0.024585871025919914,
0.15204910933971405,
-0.148042231798172,
-0.05890296399593353,
-0.26755061745643616,
-0.1541001796722412,
0.13549217581748962,
0.3708442151546478,
-0.10126370936632156,
0.13239754736423492,
-0.05324436351656914,
-0.40446826815605164,
-0.15876317024230957,
0.08323497325181961,
0.12401805818080902,
0.6182965040206909,
-0.15202417969703674,
0.04843839257955551,
-0.12559090554714203,
-0.05973619222640991,
-0.053773485124111176,
0.4391719102859497,
-0.3402548134326935,
0.3331473469734192,
-0.6300444602966309,
0.1326400339603424,
-0.14329975843429565,
-0.11203817278146744,
0.09166073054075241,
0.13374163210391998,
-0.34751254320144653,
-0.5436973571777344,
0.5328352451324463,
0.019666574895381927,
-0.44727280735969543,
-0.019470922648906708,
-0.047924116253852844,
-0.04293119162321091,
0.0966891348361969,
-0.8795728087425232,
-0.32859861850738525,
0.18902809917926788,
-0.09434168040752411,
-0.2044757455587387,
-0.08273421227931976,
-0.1372903436422348,
-0.13683755695819855,
-0.13815505802631378,
0.0762469694018364,
0.17867028713226318,
-0.02071036398410797,
0.28929686546325684,
-0.15562808513641357
] |
https://github.com/huggingface/datasets/issues/5525 | TypeError: Couldn't cast array of type string to null | You can fix this issue by forcing the cast of None to str by hand:
- If you replace this line:
```python
source_t += batch[src_lang]
```
- With this line (because the batch size is 1):
```python
source_t += [str(batch[src_lang][0])]
```
- Or with this line (if the batch size were larger than 1):
```python
source_t += [str(text) for text in batch[src_lang]]
``` | ### Describe the bug
Processing a dataset I alredy uploaded to the Hub (https://huggingface.co/datasets/tj-solergibert/Europarl-ST) I found that for some splits and some languages (test split, source_lang = "nl") after applying a map function I get the mentioned error.
I alredy tried reseting the shorter strings (reset_cortas function). It only happends with NL, PL, RO and PT. It does not make sense since when processing the other languages I also use the corpus of those that fail and it does not cause any errors.
I suspect that the error may be in this direction:
We use cast_array_to_feature to support casting to custom types like Audio and Image # Also, when trying type "string", we don't want to convert integers or floats to "string". # We only do it if trying_type is False - since this is what the user asks for.
### Steps to reproduce the bug
Here I link a colab notebook to reproduce the error:
https://colab.research.google.com/drive/1JCrS7FlGfu_kFqChMrwKZ_bpabnIMqbP?authuser=1#scrollTo=FBAvlhMxIzpA
### Expected behavior
Data processing does not fail. A correct example can be seen here: https://huggingface.co/datasets/tj-solergibert/Europarl-ST-processed-mt-en
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.10.147+-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 9.0.0
- Pandas version: 1.3.5 | 63 | TypeError: Couldn't cast array of type string to null
### Describe the bug
Processing a dataset I alredy uploaded to the Hub (https://huggingface.co/datasets/tj-solergibert/Europarl-ST) I found that for some splits and some languages (test split, source_lang = "nl") after applying a map function I get the mentioned error.
I alredy tried reseting the shorter strings (reset_cortas function). It only happends with NL, PL, RO and PT. It does not make sense since when processing the other languages I also use the corpus of those that fail and it does not cause any errors.
I suspect that the error may be in this direction:
We use cast_array_to_feature to support casting to custom types like Audio and Image # Also, when trying type "string", we don't want to convert integers or floats to "string". # We only do it if trying_type is False - since this is what the user asks for.
### Steps to reproduce the bug
Here I link a colab notebook to reproduce the error:
https://colab.research.google.com/drive/1JCrS7FlGfu_kFqChMrwKZ_bpabnIMqbP?authuser=1#scrollTo=FBAvlhMxIzpA
### Expected behavior
Data processing does not fail. A correct example can be seen here: https://huggingface.co/datasets/tj-solergibert/Europarl-ST-processed-mt-en
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.10.147+-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 9.0.0
- Pandas version: 1.3.5
You can fix this issue by forcing the cast of None to str by hand:
- If you replace this line:
```python
source_t += batch[src_lang]
```
- With this line (because the batch size is 1):
```python
source_t += [str(batch[src_lang][0])]
```
- Or with this line (if the batch size were larger than 1):
```python
source_t += [str(text) for text in batch[src_lang]]
``` | [
-0.11711007356643677,
-0.4815646708011627,
0.02524058148264885,
0.3356453776359558,
0.4890843629837036,
-0.008719071745872498,
0.5062230229377747,
0.34610745310783386,
0.18658514320850372,
0.21610313653945923,
-0.05457814037799835,
0.35119667649269104,
-0.24344445765018463,
0.09141892194747925,
-0.25321391224861145,
-0.1926027089357376,
0.1648256629705429,
0.17683055996894836,
-0.014908209443092346,
0.04520060122013092,
-0.2073328047990799,
0.18121106922626495,
-0.48493659496307373,
0.1378968507051468,
-0.31753143668174744,
-0.1928819864988327,
0.12338587641716003,
-0.05476134270429611,
-0.026608841493725777,
-0.055602364242076874,
0.019756505265831947,
-0.33317360281944275,
-0.0994560569524765,
0.38638949394226074,
-0.00012101761967642233,
-0.05427519977092743,
0.3550172448158264,
0.023649999871850014,
-0.07543212175369263,
-0.12607191503047943,
-0.3880733847618103,
0.13018293678760529,
-0.04965619742870331,
-0.17778369784355164,
0.30771392583847046,
0.35826799273490906,
0.029748806729912758,
-0.6107894778251648,
0.00028883665800094604,
0.3869380056858063,
0.11751438677310944,
0.34926608204841614,
-0.08384734392166138,
-0.03658125549554825,
0.05364815145730972,
0.28536278009414673,
-0.17266136407852173,
-0.2053455412387848,
0.1190294697880745,
0.4018283784389496,
0.019067518413066864,
0.10926063358783722,
-0.3135019838809967,
-0.11334538459777832,
-0.08741027861833572,
-0.016888190060853958,
-0.2267076075077057,
-0.6028677225112915,
0.1572626531124115,
0.10849790275096893,
0.24350252747535706,
-0.2590496242046356,
-0.1376984566450119,
-0.061770692467689514,
0.13785572350025177,
0.13432273268699646,
0.0715288519859314,
0.20168089866638184,
0.056743036955595016,
0.060135189443826675,
-0.2290169894695282,
0.2997317612171173,
-0.08256930112838745,
0.0900975689291954,
-0.060946255922317505,
0.007650583982467651,
-0.039241041988134384,
0.13093844056129456,
0.02261575683951378,
-0.4156032204627991,
0.2533872723579407,
-0.448599636554718,
-0.013967666774988174,
0.38268253207206726,
-0.11896282434463501,
-0.18952564895153046,
-0.17467623949050903,
-0.1522042453289032,
-0.09999646991491318,
-0.41273581981658936,
-0.026077624410390854,
0.31706488132476807,
-0.2095605581998825,
0.2429373562335968,
0.27797481417655945,
0.1134784072637558,
0.3135140836238861,
0.11711635440587997,
0.22175990045070648,
-0.1657436639070511,
-0.12089362740516663,
0.06384669244289398,
0.07326149940490723,
0.04011903703212738,
-0.10941477119922638,
0.3432231843471527,
0.35156500339508057,
-0.12330041825771332,
-0.15540926158428192,
0.11754696816205978,
-0.36990243196487427,
0.2544219195842743,
0.1216282844543457,
0.061689987778663635,
0.08105397969484329,
0.5910459756851196,
0.14691407978534698,
0.20977026224136353,
-0.24869243800640106,
-0.19798767566680908,
-0.11894158273935318,
0.15229569375514984,
0.07470309734344482,
-0.3210017681121826,
0.061639394611120224,
-0.06638956069946289,
-0.022762209177017212,
-0.02433493547141552,
-0.10299621522426605,
-0.2665509581565857,
-0.23136821389198303,
-0.3780565559864044,
-0.004409320652484894,
0.19137433171272278,
0.06383775174617767,
0.2657385468482971,
0.23705220222473145,
-0.12131199985742569,
-0.20267322659492493,
0.39377787709236145,
-0.6046364307403564,
-0.11590265482664108,
-0.04574105143547058,
0.07411710917949677,
-0.23706293106079102,
0.1785355657339096,
-0.47010430693626404,
-0.06141916289925575,
0.23701134324073792,
-0.1985355019569397,
-0.0002691224217414856,
-0.4577881097793579,
-0.13875606656074524,
-0.23313455283641815,
-0.08993600308895111,
0.32654905319213867,
-0.37656524777412415,
0.08108815550804138,
-0.4056413173675537,
0.007477998733520508,
0.36822810769081116,
0.31347113847732544,
0.09519929438829422,
0.36818787455558777,
-0.2026609182357788,
0.7822614908218384,
0.4014107584953308,
0.18875187635421753,
-0.06636714190244675,
0.08020156621932983,
-0.05807138979434967,
-0.15876531600952148,
-0.23353582620620728,
0.1685510128736496,
0.350247323513031,
-0.047925204038619995,
-0.16205894947052002,
0.26386749744415283,
-0.1444554477930069,
0.36630281805992126,
-0.34900692105293274,
-0.03233884647488594,
0.16913969814777374,
0.11891500651836395,
0.22888600826263428,
0.16074888408184052,
0.0918247401714325,
0.5931395292282104,
-0.08666606992483139,
-0.2593696117401123,
0.44859451055526733,
0.11434707790613174,
0.19982503354549408,
-0.32779616117477417,
-0.050975456833839417,
-0.40397220849990845,
-0.1501072645187378,
-0.0062056854367256165,
-0.028477743268013,
0.3752405047416687,
-0.039328232407569885,
0.06627430021762848,
-0.2141856849193573,
0.02944023720920086,
0.018278922885656357,
0.32086697220802307,
-0.013166498392820358,
-0.05751501023769379,
-0.15352793037891388,
0.2559444010257721,
-0.19653621315956116,
0.12635734677314758,
-0.23953944444656372,
-0.0473313182592392,
-0.33269521594047546,
0.407720685005188,
-0.24559740722179413,
-0.33947497606277466,
-0.340823233127594,
0.07474775612354279,
0.025455079972743988,
0.08961153775453568,
-0.24703454971313477,
0.20525723695755005,
0.27096235752105713,
-0.08245861530303955,
-0.23461195826530457,
-0.09224753081798553,
0.27059733867645264,
-0.5921710729598999,
0.16253343224525452,
0.44107726216316223,
0.42917460203170776,
-0.19119614362716675,
-0.03355264663696289,
0.3409392833709717,
-0.17863434553146362,
0.2853316068649292,
-0.20147475600242615,
0.005035990849137306,
0.11399579048156738,
0.04081021621823311,
0.07122811675071716,
-0.15914784371852875,
0.002469632774591446,
-0.21723313629627228,
-0.030407244339585304,
0.09364911168813705,
-0.27022117376327515,
-0.016719520092010498,
0.5299567580223083,
-0.013790801167488098,
0.34747314453125,
0.3813721239566803,
-0.005947567522525787,
0.08263078331947327,
-0.07896102964878082,
-0.208745077252388,
0.2774144113063812,
-0.07094931602478027,
-0.02811402454972267,
-0.0013397354632616043,
0.08399373292922974,
-0.052590880542993546,
0.2501140236854553,
0.1576503962278366,
0.2144620418548584,
0.1417485475540161,
0.04717132821679115,
-0.0004368377849459648,
-0.05075289309024811,
-0.19494590163230896,
0.0887254998087883,
0.3880711495876312,
-0.4476422369480133,
-0.0538816973567009,
-0.4153474271297455,
-0.24743980169296265,
-0.21231961250305176,
0.08610209822654724,
-0.2433064877986908,
-0.46353986859321594,
-0.17422188818454742,
0.007551383227109909,
-0.3417420983314514,
0.30994027853012085,
-0.08585476875305176,
0.06752090156078339,
0.34230250120162964,
0.030949775129556656,
-0.18563276529312134,
0.09457086026668549,
-0.06364226341247559,
-0.01654421165585518,
0.456608384847641,
0.22082403302192688,
-0.2850237786769867,
-0.08786487579345703,
-0.09744305908679962,
0.03832404315471649,
-0.13860803842544556,
0.01803133636713028,
-0.26721030473709106,
0.0012490898370742798,
0.1581823229789734,
0.4273494482040405,
-0.16909222304821014,
-0.29684215784072876,
0.21465907990932465,
-0.3670300543308258,
-0.3562154173851013,
0.45809751749038696,
0.13237224519252777,
-0.04269906505942345,
-0.4100661873817444,
-0.09385795146226883,
-0.03688386082649231,
-0.39310386776924133,
0.07077861577272415,
-0.46024808287620544,
0.24982722103595734,
0.027789577841758728,
0.383486807346344,
0.20152482390403748,
0.05573530122637749,
-0.2260027825832367,
0.06417429447174072,
0.2970198094844818,
0.3619881570339203,
0.13358186185359955,
-0.1738615781068802,
-0.011531829833984375,
0.06579097360372543,
-0.07179749011993408,
-0.03265757858753204,
-0.28696444630622864,
-0.036720022559165955,
-0.13889965415000916,
0.015771135687828064,
0.025102969259023666,
-0.11408676207065582,
0.28571373224258423,
0.11770544201135635,
0.09674982726573944,
-0.01131003350019455,
-0.014974771998822689,
-0.17179828882217407,
0.1618635356426239,
0.09273076057434082,
0.2625618875026703,
0.34372594952583313,
0.1361193209886551,
-0.12298974394798279,
0.310770720243454,
0.04579238221049309,
0.3532966673374176,
0.0675763338804245,
-0.0024886392056941986,
-0.33135291934013367,
-0.2769673764705658,
-0.02305000089108944,
-0.0013280659914016724,
-0.22244954109191895,
0.19535498321056366,
-0.21736416220664978,
-0.5047838091850281,
0.05829685926437378,
-0.17158743739128113,
-0.2596975862979889,
-0.1760108321905136,
0.30060911178588867,
0.035416509956121445,
0.09245317429304123,
-0.35084137320518494,
-0.12438042461872101,
0.027029134333133698,
-0.26953813433647156,
-0.051938414573669434,
-0.0010565295815467834,
0.023938313126564026,
-0.17576900124549866,
-0.3594273030757904,
-0.36246275901794434,
0.011653941124677658,
0.4401020407676697,
0.4392818808555603,
0.6096730828285217,
-0.13382428884506226,
-0.038284074515104294,
0.03565601631999016,
0.20136602222919464,
0.5786837339401245,
-0.32509416341781616,
0.09258951246738434,
0.25059831142425537,
0.18738603591918945,
-0.4366724491119385,
0.10265158116817474,
-0.21739299595355988,
0.001783756073564291,
0.4142482578754425,
0.2964476943016052,
-0.14638924598693848,
0.022766338661313057,
0.21550460159778595,
0.1938232034444809,
0.17043724656105042,
0.17145629227161407,
-0.02478039637207985,
-0.38255366683006287,
-0.2237924039363861,
0.05200060456991196,
0.34416186809539795,
0.4713108539581299,
0.062690369784832,
0.13054236769676208,
-0.2149713784456253,
-0.3121817409992218,
0.12767724692821503,
-0.19622664153575897,
0.39682552218437195,
-0.09183598309755325,
0.14242179691791534,
-0.5805537700653076,
-0.2720370292663574,
-0.02437504567205906,
0.47819972038269043,
0.19350068271160126,
-0.014019586145877838,
0.29289525747299194,
-0.10647734254598618,
0.4059089124202728,
0.4856853187084198,
-0.003136361250653863,
0.23173916339874268,
0.015702810138463974,
0.26003527641296387,
-0.08331382274627686,
0.11542411893606186,
-0.0011353977024555206,
-0.013146216049790382,
-0.39130693674087524,
0.03637230396270752,
0.057611510157585144,
-0.027753882110118866,
0.19518552720546722,
0.03715817630290985,
0.12487578392028809,
-0.3326314091682434,
0.5698051452636719,
0.28566914796829224,
1.1394308805465698,
-0.05421171337366104,
0.0952763706445694,
-0.16508719325065613,
0.024473845958709717,
0.28085973858833313,
0.20124608278274536,
0.21349768340587616,
-0.44618070125579834,
0.03655492141842842,
-0.17466317117214203,
0.04178472235798836,
0.2684549391269684,
0.0831463485956192,
-0.35871803760528564,
0.016527563333511353,
0.09523621201515198,
0.5665704011917114,
-0.01666915975511074,
-0.1613018810749054,
-0.3474229872226715,
-0.46892979741096497,
-0.18878690898418427,
0.047647856175899506,
-0.28229331970214844,
-0.07053467631340027,
0.25533050298690796,
-0.0559278205037117,
-0.2966826558113098,
-0.2497052103281021,
-0.41676509380340576,
0.10470021516084671,
0.1333339661359787,
0.0801253393292427,
-0.12725746631622314,
-0.03945431113243103,
0.3045031428337097,
0.39388367533683777,
0.22458046674728394,
0.4806061387062073,
-0.035947009921073914,
-0.07767128944396973,
-0.043621331453323364,
-0.009991506114602089,
0.10975635051727295,
-0.08837553858757019,
0.19816718995571136,
0.057275258004665375,
-0.1314375400543213,
-0.14704567193984985,
-0.0869339182972908,
0.05316740274429321,
-0.060237519443035126,
0.09717603772878647,
-0.20455636084079742,
-0.32847779989242554,
-0.4081973731517792,
-0.08290493488311768,
-0.015527572482824326,
-0.05257198587059975,
0.04907508194446564,
-0.12742795050144196,
-0.15125985443592072,
0.42318472266197205,
-0.061587657779455185,
-0.3177609443664551,
0.07083581387996674,
0.5308676958084106,
0.3596898317337036,
0.31744804978370667,
0.3743685483932495,
0.2276894897222519,
-0.2443944662809372,
-0.19301652908325195,
0.3913494646549225,
-0.041219256818294525,
-0.7472092509269714,
0.2695673406124115,
-0.4275532364845276,
-0.35776573419570923,
-0.09835682809352875,
0.365363210439682,
-0.16309402883052826,
0.47821104526519775,
-0.36564815044403076,
-0.26716214418411255,
-0.2793026864528656,
0.23918133974075317,
0.26485371589660645,
0.23691774904727936,
-0.18484097719192505,
0.38513436913490295,
0.060916922986507416,
-0.2664954662322998,
-0.17251943051815033,
0.15692353248596191,
-0.5730271935462952,
0.3657781183719635,
-0.531518816947937,
0.030113518238067627,
0.04762502387166023,
-0.22203148901462555,
0.003906704485416412,
0.43486982583999634,
-0.13489565253257751,
-0.057968758046627045,
-0.02891143411397934,
0.19625632464885712,
0.2441008985042572,
-0.20155209302902222,
0.02305290475487709,
-0.10753365606069565,
-0.13635261356830597,
-0.26350700855255127,
-0.15724952518939972,
0.3351859748363495,
-0.20141269266605377,
0.0822761207818985,
0.5117021203041077,
0.022710971534252167,
0.09446468949317932,
0.284218430519104,
-0.15098510682582855,
0.2744304835796356,
-0.14223700761795044,
0.25274035334587097,
0.18976877629756927,
0.18235212564468384,
0.08091305196285248,
0.19576093554496765,
0.06237766891717911,
-0.13279664516448975,
0.3549036979675293,
-0.3036673069000244,
-0.04701388254761696,
0.08495750278234482,
0.24148118495941162,
-0.015829555690288544,
-0.2565162181854248,
-0.06929191201925278,
0.08609166741371155,
0.016317809000611305,
0.006011132150888443,
-0.042510151863098145,
0.4324977695941925,
-0.12522049248218536,
-0.14913815259933472,
0.3958689868450165,
0.053877945989370346,
0.0451987087726593,
0.15099258720874786,
0.06733373552560806,
0.7413769364356995,
-0.18707667291164398,
0.0992642492055893,
0.12450306117534637,
-0.11782822757959366,
0.11261658370494843,
0.04750640690326691,
-0.22158914804458618,
0.034686967730522156,
0.23791931569576263,
0.09249487519264221,
0.2757282853126526,
-0.01821054518222809,
0.21091657876968384,
0.11014008522033691,
-0.09431766718626022,
0.21971185505390167,
0.29277294874191284,
-0.12173096835613251,
0.297389417886734,
0.05610676854848862,
-0.18623748421669006,
-0.5182202458381653,
-0.2513195872306824,
0.0008144974708557129,
0.21502524614334106,
-0.41629984974861145,
0.16089360415935516,
-0.29469624161720276,
-0.04305625334382057,
-0.1903097927570343,
-0.1465412974357605,
0.002233080565929413,
0.10212111473083496,
0.43622279167175293,
0.20996572077274323,
-0.1018400490283966,
0.07900194823741913,
-0.2436155378818512,
0.19770312309265137,
0.26540881395339966,
-0.3651261329650879,
0.19615456461906433,
0.03624320030212402,
0.16915825009346008,
0.14267107844352722,
0.5066187977790833,
0.4946092963218689,
0.35268574953079224,
-0.2592051923274994,
0.004844167269766331,
0.09644688665866852,
-0.14547225832939148,
0.17961405217647552,
0.3266102373600006,
0.1371082365512848,
0.4437917172908783,
0.2205687165260315,
0.015097655355930328,
-0.07890446484088898,
-0.11084116995334625,
0.025922313332557678,
0.2841476500034332,
0.08508625626564026,
0.46673452854156494,
-0.2669420540332794,
0.010847799479961395,
-0.21228750050067902,
-0.13269290328025818,
-0.4529981017112732,
0.10695332288742065,
0.22048519551753998,
-0.41136032342910767,
0.19772836565971375,
0.16626550257205963,
0.005556393414735794,
0.08052296936511993,
0.3403220474720001,
0.28963157534599304,
-0.1637037992477417,
-0.3002345561981201,
-0.14070488512516022,
-0.12303458154201508,
0.18407030403614044,
-0.07829099893569946,
0.15505391359329224,
0.11560185253620148,
0.1014690101146698,
-0.07900074869394302,
0.02548104152083397,
-0.05378367006778717,
-0.10356397181749344,
-0.060788292437791824,
0.41701555252075195,
-0.18291452527046204,
-0.17159897089004517,
0.1783405840396881,
-0.120052769780159,
-0.09796429425477982,
-0.47945937514305115,
0.36704927682876587,
-0.013198240660130978,
-0.0001491345465183258,
0.16627953946590424,
-0.0677240639925003,
-0.022467421367764473,
-0.30643683671951294,
-0.21348848938941956,
0.15063464641571045,
0.3000946044921875,
-0.045148324221372604,
0.09450050443410873,
-0.03303239867091179,
-0.44447168707847595,
-0.1736655831336975,
0.09787557274103165,
0.12711511552333832,
0.6509823799133301,
-0.11670932918787003,
-0.04877423122525215,
-0.20820024609565735,
-0.02875427156686783,
-0.03587508574128151,
0.5433587431907654,
-0.2884344458580017,
0.3241899013519287,
-0.6179208159446716,
0.11591372638940811,
-0.09180354326963425,
-0.08549270778894424,
0.13666987419128418,
0.18561439216136932,
-0.3207308053970337,
-0.5446871519088745,
0.5554074048995972,
-0.026460178196430206,
-0.4802452623844147,
-0.04727745056152344,
-0.09789659082889557,
-0.02846398949623108,
0.09836085140705109,
-0.8354721665382385,
-0.30030518770217896,
0.20129349827766418,
-0.09019239246845245,
-0.20519337058067322,
-0.0760120302438736,
-0.15255188941955566,
-0.10568567365407944,
-0.1376790702342987,
-0.015981905162334442,
0.14993129670619965,
-0.026767868548631668,
0.28047680854797363,
-0.13327041268348694
] |
https://github.com/huggingface/datasets/issues/5525 | TypeError: Couldn't cast array of type string to null | Problem solved! Thanks @albertvillanova, now I have even increased the batch size and it's crazy fast :rocket: ! | ### Describe the bug
Processing a dataset I alredy uploaded to the Hub (https://huggingface.co/datasets/tj-solergibert/Europarl-ST) I found that for some splits and some languages (test split, source_lang = "nl") after applying a map function I get the mentioned error.
I alredy tried reseting the shorter strings (reset_cortas function). It only happends with NL, PL, RO and PT. It does not make sense since when processing the other languages I also use the corpus of those that fail and it does not cause any errors.
I suspect that the error may be in this direction:
We use cast_array_to_feature to support casting to custom types like Audio and Image # Also, when trying type "string", we don't want to convert integers or floats to "string". # We only do it if trying_type is False - since this is what the user asks for.
### Steps to reproduce the bug
Here I link a colab notebook to reproduce the error:
https://colab.research.google.com/drive/1JCrS7FlGfu_kFqChMrwKZ_bpabnIMqbP?authuser=1#scrollTo=FBAvlhMxIzpA
### Expected behavior
Data processing does not fail. A correct example can be seen here: https://huggingface.co/datasets/tj-solergibert/Europarl-ST-processed-mt-en
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.10.147+-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 9.0.0
- Pandas version: 1.3.5 | 18 | TypeError: Couldn't cast array of type string to null
### Describe the bug
Processing a dataset I alredy uploaded to the Hub (https://huggingface.co/datasets/tj-solergibert/Europarl-ST) I found that for some splits and some languages (test split, source_lang = "nl") after applying a map function I get the mentioned error.
I alredy tried reseting the shorter strings (reset_cortas function). It only happends with NL, PL, RO and PT. It does not make sense since when processing the other languages I also use the corpus of those that fail and it does not cause any errors.
I suspect that the error may be in this direction:
We use cast_array_to_feature to support casting to custom types like Audio and Image # Also, when trying type "string", we don't want to convert integers or floats to "string". # We only do it if trying_type is False - since this is what the user asks for.
### Steps to reproduce the bug
Here I link a colab notebook to reproduce the error:
https://colab.research.google.com/drive/1JCrS7FlGfu_kFqChMrwKZ_bpabnIMqbP?authuser=1#scrollTo=FBAvlhMxIzpA
### Expected behavior
Data processing does not fail. A correct example can be seen here: https://huggingface.co/datasets/tj-solergibert/Europarl-ST-processed-mt-en
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.10.147+-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 9.0.0
- Pandas version: 1.3.5
Problem solved! Thanks @albertvillanova, now I have even increased the batch size and it's crazy fast :rocket: ! | [
-0.15800058841705322,
-0.4741203784942627,
0.001771615818142891,
0.3594154119491577,
0.4670639634132385,
-0.027541007846593857,
0.5098435282707214,
0.38467085361480713,
0.20798908174037933,
0.19020572304725647,
-0.0734347254037857,
0.33742567896842957,
-0.26622334122657776,
0.1427195966243744,
-0.20813603699207306,
-0.20515525341033936,
0.1967003047466278,
0.12439648061990738,
-0.002913042902946472,
0.006525538861751556,
-0.1674511879682541,
0.18062448501586914,
-0.4924919009208679,
0.07810506969690323,
-0.33695101737976074,
-0.1786402314901352,
0.12042893469333649,
-0.04924573749303818,
-0.04030708968639374,
-0.07082166522741318,
0.017023859545588493,
-0.3350363075733185,
-0.11416918784379959,
0.41437679529190063,
-0.0001203618521685712,
-0.05179266631603241,
0.36203908920288086,
0.023694878444075584,
-0.039230845868587494,
-0.051322683691978455,
-0.34544485807418823,
0.0926743820309639,
-0.09763709455728531,
-0.2078753113746643,
0.2854462265968323,
0.41343504190444946,
0.026210106909275055,
-0.550274133682251,
0.0634043961763382,
0.3767983913421631,
0.12314349412918091,
0.37451398372650146,
-0.08094540238380432,
-0.031355418264865875,
0.0943310558795929,
0.27434247732162476,
-0.1941085010766983,
-0.18481692671775818,
0.17334571480751038,
0.4117451608181,
0.044012460857629776,
0.13004456460475922,
-0.30125874280929565,
-0.14094458520412445,
-0.07778655737638474,
-0.035237718373537064,
-0.2615433633327484,
-0.5740599632263184,
0.1528298556804657,
0.11752425134181976,
0.23649683594703674,
-0.23666036128997803,
-0.17002232372760773,
-0.07996726036071777,
0.16059280931949615,
0.11233662068843842,
0.04882046580314636,
0.18699903786182404,
0.09196019172668457,
0.05182912200689316,
-0.23075078427791595,
0.2647711932659149,
-0.0891619548201561,
0.0347815603017807,
-0.033190831542015076,
0.027167782187461853,
-0.06454820185899734,
0.12144474685192108,
0.05362815037369728,
-0.40712273120880127,
0.2516650855541229,
-0.4193119406700134,
-0.02965112403035164,
0.3713957965373993,
-0.12947620451450348,
-0.20960190892219543,
-0.19795790314674377,
-0.11264491826295853,
-0.05879334360361099,
-0.4160923957824707,
-0.05802858620882034,
0.3452144265174866,
-0.19308553636074066,
0.22292491793632507,
0.2729729413986206,
0.13055379688739777,
0.3326936364173889,
0.07652135193347931,
0.2100396752357483,
-0.16406358778476715,
-0.18019665777683258,
0.09133580327033997,
0.032424669712781906,
-0.002988059539347887,
-0.07650686800479889,
0.33949142694473267,
0.3133375644683838,
-0.13411249220371246,
-0.1543467491865158,
0.08723799884319305,
-0.28185588121414185,
0.21554283797740936,
0.13676661252975464,
0.09182115644216537,
0.03844942897558212,
0.5248144268989563,
0.13399599492549896,
0.18666312098503113,
-0.2967947721481323,
-0.2520154118537903,
-0.11794161051511765,
0.1354610025882721,
0.045727502554655075,
-0.2927309274673462,
0.05837984010577202,
-0.02585890144109726,
-0.005721971392631531,
-0.05597409978508949,
-0.07841239869594574,
-0.2524866461753845,
-0.2278602570295334,
-0.3777455687522888,
-0.022227294743061066,
0.1637304723262787,
0.08760213851928711,
0.2668200731277466,
0.18688316643238068,
-0.07000872492790222,
-0.20941665768623352,
0.3207486867904663,
-0.5958406925201416,
-0.09821285307407379,
-0.031017260625958443,
0.06645011901855469,
-0.22755908966064453,
0.15726393461227417,
-0.48188385367393494,
-0.059297140687704086,
0.25136053562164307,
-0.18541017174720764,
-0.013014040887355804,
-0.42149096727371216,
-0.1322416067123413,
-0.24968305230140686,
-0.07185939699411392,
0.3011477589607239,
-0.3938986659049988,
0.11250580847263336,
-0.43610718846321106,
0.052789755165576935,
0.38259798288345337,
0.3899379372596741,
0.08446456491947174,
0.4244169592857361,
-0.21296465396881104,
0.7973490357398987,
0.3907328248023987,
0.20545752346515656,
-0.06940361857414246,
0.08177966624498367,
-0.05727490782737732,
-0.1968872845172882,
-0.20854038000106812,
0.18676351010799408,
0.3916923999786377,
-0.09222502261400223,
-0.10568909347057343,
0.2839229106903076,
-0.15187010169029236,
0.3660138249397278,
-0.35137495398521423,
-0.10326939076185226,
0.15464168787002563,
0.11535723507404327,
0.23713324964046478,
0.09362209588289261,
0.06981733441352844,
0.572836697101593,
-0.08348818868398666,
-0.26807713508605957,
0.4159822463989258,
0.12128617614507675,
0.17333652079105377,
-0.29240572452545166,
-0.03789244964718819,
-0.40753525495529175,
-0.16602501273155212,
0.024394623935222626,
-0.03631776571273804,
0.3078719973564148,
-0.021475642919540405,
0.021393083035945892,
-0.27190688252449036,
0.03986436128616333,
0.02355935424566269,
0.33969685435295105,
-0.007968183606863022,
-0.07588812708854675,
-0.13796517252922058,
0.22159074246883392,
-0.2114371359348297,
0.0621451810002327,
-0.20538672804832458,
-0.07760542631149292,
-0.3567439615726471,
0.40872207283973694,
-0.2678508758544922,
-0.3419668972492218,
-0.3179183006286621,
0.04374971240758896,
0.04038648307323456,
0.03043702431023121,
-0.211597740650177,
0.22059398889541626,
0.2464907020330429,
-0.05624082684516907,
-0.17516085505485535,
-0.1234201043844223,
0.2991194427013397,
-0.5813918113708496,
0.17830698192119598,
0.4251041114330292,
0.4312443733215332,
-0.23252633213996887,
-0.041249193251132965,
0.35933029651641846,
-0.22238732874393463,
0.26169201731681824,
-0.2271507978439331,
-0.04438360780477524,
0.08957447111606598,
0.06953676044940948,
0.10056576877832413,
-0.10678735375404358,
0.03977159038186073,
-0.23602397739887238,
-0.045051202178001404,
0.06386327743530273,
-0.24196448922157288,
-0.0028556808829307556,
0.6022087335586548,
-0.020090991631150246,
0.35554346442222595,
0.34100353717803955,
-0.015066169202327728,
0.0900946781039238,
-0.05067799240350723,
-0.25376787781715393,
0.27819937467575073,
-0.04796073958277702,
-0.006101634353399277,
-0.0028537865728139877,
0.10181606560945511,
-0.07291807234287262,
0.2605363726615906,
0.12358823418617249,
0.25706520676612854,
0.14648890495300293,
0.0023330883122980595,
0.009974262677133083,
-0.11006728559732437,
-0.19327831268310547,
0.10492905229330063,
0.32468536496162415,
-0.41274911165237427,
-0.07869160920381546,
-0.37648630142211914,
-0.22751137614250183,
-0.21421661972999573,
0.08772367984056473,
-0.2542423903942108,
-0.4459144175052643,
-0.15166781842708588,
-0.007081475108861923,
-0.3325095772743225,
0.3012591302394867,
-0.032580144703388214,
0.06629757583141327,
0.3521885871887207,
0.016225557774305344,
-0.1996336281299591,
0.08419531583786011,
-0.05323029309511185,
-0.03244098648428917,
0.47642388939857483,
0.2527167499065399,
-0.2586097717285156,
-0.09418371319770813,
-0.08081585168838501,
0.04263193905353546,
-0.14769971370697021,
0.011328864842653275,
-0.2951928377151489,
0.04477252438664436,
0.1498795747756958,
0.45962780714035034,
-0.11963062733411789,
-0.2785602807998657,
0.1944248527288437,
-0.39262622594833374,
-0.3285314440727234,
0.42639458179473877,
0.1542017012834549,
-0.08166071027517319,
-0.3821825087070465,
-0.10815522819757462,
-0.05525179207324982,
-0.40793296694755554,
0.10104641318321228,
-0.48730069398880005,
0.23653405904769897,
0.02013508602976799,
0.3671828806400299,
0.22761298716068268,
0.06816431879997253,
-0.23977065086364746,
0.04217967763543129,
0.28586331009864807,
0.3894185721874237,
0.12365229427814484,
-0.20775054395198822,
-0.023568227887153625,
0.08187863230705261,
-0.06629842519760132,
-0.06618994474411011,
-0.2631809115409851,
-0.02398579567670822,
-0.18216775357723236,
0.029699232429265976,
0.020677588880062103,
-0.0692562460899353,
0.28631168603897095,
0.06401465088129044,
0.10014423727989197,
-0.045059721916913986,
-0.03925897553563118,
-0.1809491217136383,
0.18460029363632202,
0.1393832564353943,
0.20592230558395386,
0.312027245759964,
0.13171197474002838,
-0.08071491122245789,
0.3270169496536255,
0.07489217817783356,
0.35240307450294495,
0.05492018163204193,
-0.051948871463537216,
-0.3697105646133423,
-0.2743290364742279,
0.030806684866547585,
-0.045552268624305725,
-0.26620399951934814,
0.22491984069347382,
-0.1933898627758026,
-0.5056044459342957,
0.06721808761358261,
-0.18598169088363647,
-0.2734529972076416,
-0.20424875617027283,
0.3156144917011261,
0.07291936874389648,
0.04004521295428276,
-0.3508126437664032,
-0.10194294154644012,
-0.007791244424879551,
-0.21212336421012878,
-0.006873860023915768,
-0.03500792384147644,
0.04508044570684433,
-0.18186065554618835,
-0.40312501788139343,
-0.3910389542579651,
-0.05224945396184921,
0.46083754301071167,
0.43230506777763367,
0.5605378746986389,
-0.12680059671401978,
0.005607374012470245,
0.057415518909692764,
0.1381453275680542,
0.6569397449493408,
-0.3897738456726074,
0.13994628190994263,
0.2340320646762848,
0.2204541563987732,
-0.4305364489555359,
0.1161460280418396,
-0.2407970428466797,
0.018299110233783722,
0.44127681851387024,
0.33110395073890686,
-0.17093732953071594,
0.05515684932470322,
0.2087770253419876,
0.21522723138332367,
0.1755669116973877,
0.1881529688835144,
-0.012923039495944977,
-0.39633506536483765,
-0.23246484994888306,
0.10303273797035217,
0.3634210228919983,
0.43066275119781494,
0.06940334290266037,
0.08144304156303406,
-0.20130494236946106,
-0.31982553005218506,
0.1070275530219078,
-0.1816146820783615,
0.36551788449287415,
-0.09892312437295914,
0.17261697351932526,
-0.532928466796875,
-0.29924389719963074,
-0.003138406202197075,
0.4590260088443756,
0.18842874467372894,
-0.006762586534023285,
0.22999298572540283,
-0.08705627918243408,
0.44121384620666504,
0.5414680242538452,
0.02179161086678505,
0.2102665901184082,
0.02417796105146408,
0.27925944328308105,
-0.08121049404144287,
0.08422134816646576,
0.017156805843114853,
0.0026481589302420616,
-0.4198577105998993,
0.03291288763284683,
0.09227246046066284,
-0.01984592340886593,
0.21582387387752533,
0.017114542424678802,
0.1281401365995407,
-0.33444833755493164,
0.5725734829902649,
0.25082242488861084,
1.1740094423294067,
-0.07134199142456055,
0.09427819401025772,
-0.191340833902359,
0.01604340225458145,
0.28789186477661133,
0.19560614228248596,
0.2166808694601059,
-0.42320436239242554,
0.026366285979747772,
-0.12453576177358627,
0.06910531222820282,
0.2714143991470337,
0.08105005323886871,
-0.3987693190574646,
0.028005516156554222,
0.0718098133802414,
0.5400843024253845,
-0.12161800265312195,
-0.14560547471046448,
-0.3652358949184418,
-0.4623931348323822,
-0.18794479966163635,
0.053881846368312836,
-0.27228260040283203,
-0.05553736910223961,
0.22057563066482544,
-0.1122618243098259,
-0.27943873405456543,
-0.2102646827697754,
-0.42804884910583496,
0.09299445152282715,
0.11225500702857971,
0.08842607587575912,
-0.10853073000907898,
-0.021632060408592224,
0.2926524877548218,
0.34325286746025085,
0.22814637422561646,
0.5174673795700073,
-0.06147705018520355,
-0.03089730069041252,
-0.07768788188695908,
0.00641664257273078,
0.09566284716129303,
-0.11925376206636429,
0.168407142162323,
0.06402487307786942,
-0.1600489318370819,
-0.2218444049358368,
-0.0965755432844162,
0.02651742845773697,
-0.04718957096338272,
0.10158103704452515,
-0.1309240758419037,
-0.3175865113735199,
-0.39339467883110046,
-0.029458753764629364,
-0.08691348880529404,
-0.07745184004306793,
0.05359887704253197,
-0.15104828774929047,
-0.18409472703933716,
0.4806852638721466,
-0.028671104460954666,
-0.31355875730514526,
0.0673346072435379,
0.5170395374298096,
0.36803093552589417,
0.29354754090309143,
0.3726293444633484,
0.23163117468357086,
-0.22043371200561523,
-0.2154495120048523,
0.4025348424911499,
-0.025437574833631516,
-0.7710127234458923,
0.2772615849971771,
-0.44026875495910645,
-0.37284600734710693,
-0.02378765679895878,
0.3516833484172821,
-0.09836004674434662,
0.3874225318431854,
-0.37726548314094543,
-0.27741265296936035,
-0.25995466113090515,
0.25611042976379395,
0.30273815989494324,
0.24006544053554535,
-0.17646726965904236,
0.36107712984085083,
0.06939299404621124,
-0.2369392216205597,
-0.18354538083076477,
0.1573333740234375,
-0.5780407786369324,
0.39615681767463684,
-0.5482667684555054,
-0.013420455157756805,
0.051607854664325714,
-0.21610724925994873,
-0.0007733311504125595,
0.43796098232269287,
-0.1799149066209793,
-0.06516040116548538,
-0.0024050958454608917,
0.18201789259910583,
0.21234896779060364,
-0.1652272343635559,
0.045265309512615204,
-0.12375446408987045,
-0.1706874519586563,
-0.3133380711078644,
-0.10763432085514069,
0.2735600173473358,
-0.18503089249134064,
0.025379758328199387,
0.554537296295166,
0.042928438633680344,
0.08440051227807999,
0.27700287103652954,
-0.09427595138549805,
0.3038589358329773,
-0.18876293301582336,
0.24932079017162323,
0.2014113813638687,
0.1564536839723587,
0.09679336845874786,
0.19263817369937897,
0.10981397330760956,
-0.07584383338689804,
0.35794588923454285,
-0.28517401218414307,
-0.06520359218120575,
0.1105344370007515,
0.2937532067298889,
0.03259489685297012,
-0.18464046716690063,
-0.07244303822517395,
0.11598464846611023,
0.026577947661280632,
0.0031691789627075195,
-0.06789921969175339,
0.45114514231681824,
-0.121613509953022,
-0.15698084235191345,
0.362821489572525,
0.08159324526786804,
0.11241964995861053,
0.15235474705696106,
0.08854661136865616,
0.7154678702354431,
-0.19959048926830292,
0.11694183945655823,
0.10754035413265228,
-0.10896369814872742,
0.08831747621297836,
0.04446554183959961,
-0.22657907009124756,
0.06054336950182915,
0.31606167554855347,
0.12942177057266235,
0.30282163619995117,
0.05254856497049332,
0.26452699303627014,
0.08925022184848785,
-0.0937081128358841,
0.15729141235351562,
0.284010112285614,
-0.11469931900501251,
0.32783856987953186,
0.0437735915184021,
-0.16232594847679138,
-0.5469100475311279,
-0.30041617155075073,
-0.023990448564291,
0.23300699889659882,
-0.4155295193195343,
0.17446894943714142,
-0.2433519959449768,
-0.006886482238769531,
-0.20747850835323334,
-0.13742299377918243,
-0.0006899125874042511,
0.12589359283447266,
0.434374064207077,
0.20961156487464905,
-0.0820467621088028,
0.04051833599805832,
-0.22745129466056824,
0.16024354100227356,
0.2954205572605133,
-0.3790602385997772,
0.22921498119831085,
0.013200514018535614,
0.18321505188941956,
0.11299435794353485,
0.5242860913276672,
0.4774898290634155,
0.3687583804130554,
-0.2931964695453644,
0.02119549736380577,
0.11023122072219849,
-0.13644467294216156,
0.1512608528137207,
0.2911451756954193,
0.12169389426708221,
0.4492630064487457,
0.21515215933322906,
0.01736217923462391,
-0.08366570621728897,
-0.11224354803562164,
0.005492012947797775,
0.2593158483505249,
0.09213396906852722,
0.4275813400745392,
-0.3115430474281311,
-0.023903738707304,
-0.28655803203582764,
-0.13808801770210266,
-0.49612221121788025,
0.10069505870342255,
0.21856290102005005,
-0.45920664072036743,
0.2217724323272705,
0.17860694229602814,
0.0138893723487854,
0.04992411658167839,
0.41034814715385437,
0.3099680542945862,
-0.15370064973831177,
-0.26973116397857666,
-0.09867800772190094,
-0.12301342189311981,
0.13752903044223785,
-0.06655178964138031,
0.2119680941104889,
0.11328776925802231,
0.13677449524402618,
-0.07560942322015762,
0.04046435281634331,
-0.025800392031669617,
-0.14181703329086304,
-0.018055509775877,
0.43193235993385315,
-0.22841720283031464,
-0.1187344491481781,
0.230294331908226,
-0.12002137303352356,
-0.05548279732465744,
-0.5261524319648743,
0.4141246974468231,
-0.046497151255607605,
-0.0067402757704257965,
0.18103672564029694,
-0.09682389348745346,
0.0002621375024318695,
-0.3214278817176819,
-0.12979714572429657,
0.12414705753326416,
0.32261404395103455,
-0.07351504266262054,
0.11347325891256332,
-0.04924866184592247,
-0.43931466341018677,
-0.14911799132823944,
0.07841064780950546,
0.1808430254459381,
0.6240262985229492,
-0.13684611022472382,
0.0019042156636714935,
-0.16775882244110107,
-0.010072858072817326,
-0.04485044628381729,
0.5003864169120789,
-0.250874787569046,
0.24760758876800537,
-0.6184237003326416,
0.11413753032684326,
-0.11480937898159027,
-0.05679798126220703,
0.08379107713699341,
0.1524597555398941,
-0.3233121633529663,
-0.5226786732673645,
0.5835346579551697,
0.013161220587790012,
-0.5405625104904175,
-0.05213245376944542,
-0.08243536949157715,
0.03160713240504265,
0.09263444691896439,
-0.806736946105957,
-0.32154691219329834,
0.16389316320419312,
-0.10762681812047958,
-0.19756466150283813,
-0.007222360000014305,
-0.09980487823486328,
-0.14343266189098358,
-0.11141477525234222,
-0.002741679549217224,
0.13765209913253784,
-0.06136750429868698,
0.3159327805042267,
-0.1560598909854889
] |
https://github.com/huggingface/datasets/issues/5517 | `with_format("numpy")` silently downcasts float64 to float32 features | Hi! This behavior stems from these lines:
https://github.com/huggingface/datasets/blob/b065547654efa0ec633cf373ac1512884c68b2e1/src/datasets/formatting/np_formatter.py#L45-L46
I agree we should preserve the original type whenever possible and downcast explicitly with a warning.
@lhoestq Do you remember why we need this "default dtype" logic in our formatters? | ### Describe the bug
When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`.
### Steps to reproduce the bug
```python
import datasets
dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy")
print("feature dtype:", dataset.features['a'].dtype)
print("array dtype:", dataset['a'].dtype)
```
output:
```
feature dtype: float64
array dtype: float32
```
### Expected behavior
```
feature dtype: float64
array dtype: float64
```
### Environment info
- `datasets` version: 2.8.0
- Platform: Linux-5.4.0-135-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.4.4
### Suggested Fix
Changing [the `_tensorize` function of the numpy formatter](https://github.com/huggingface/datasets/blob/b065547654efa0ec633cf373ac1512884c68b2e1/src/datasets/formatting/np_formatter.py#L32) to
```python
def _tensorize(self, value):
if isinstance(value, (str, bytes, type(None))):
return value
elif isinstance(value, (np.character, np.ndarray)) and np.issubdtype(value.dtype, np.character):
return value
elif isinstance(value, np.number):
return value
return np.asarray(value, **self.np_array_kwargs)
```
fixes this particular issue for me. Not sure if this would break other tests. This should also avoid unnecessary copying of the array.
| 38 | `with_format("numpy")` silently downcasts float64 to float32 features
### Describe the bug
When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`.
### Steps to reproduce the bug
```python
import datasets
dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy")
print("feature dtype:", dataset.features['a'].dtype)
print("array dtype:", dataset['a'].dtype)
```
output:
```
feature dtype: float64
array dtype: float32
```
### Expected behavior
```
feature dtype: float64
array dtype: float64
```
### Environment info
- `datasets` version: 2.8.0
- Platform: Linux-5.4.0-135-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.4.4
### Suggested Fix
Changing [the `_tensorize` function of the numpy formatter](https://github.com/huggingface/datasets/blob/b065547654efa0ec633cf373ac1512884c68b2e1/src/datasets/formatting/np_formatter.py#L32) to
```python
def _tensorize(self, value):
if isinstance(value, (str, bytes, type(None))):
return value
elif isinstance(value, (np.character, np.ndarray)) and np.issubdtype(value.dtype, np.character):
return value
elif isinstance(value, np.number):
return value
return np.asarray(value, **self.np_array_kwargs)
```
fixes this particular issue for me. Not sure if this would break other tests. This should also avoid unnecessary copying of the array.
Hi! This behavior stems from these lines:
https://github.com/huggingface/datasets/blob/b065547654efa0ec633cf373ac1512884c68b2e1/src/datasets/formatting/np_formatter.py#L45-L46
I agree we should preserve the original type whenever possible and downcast explicitly with a warning.
@lhoestq Do you remember why we need this "default dtype" logic in our formatters? | [
0.14177078008651733,
-0.24984367191791534,
0.000774633139371872,
0.0026635415852069855,
0.5696965456008911,
0.0561448410153389,
0.6134842038154602,
0.5261093378067017,
-0.16041861474514008,
-0.05886185169219971,
-0.13229535520076752,
0.6590015888214111,
-0.024173695594072342,
-0.055850546807050705,
-0.0898173376917839,
-0.09573148190975189,
0.19167107343673706,
0.36848190426826477,
-0.1873778998851776,
-0.08108260482549667,
-0.23802180588245392,
-0.2345665842294693,
-0.08685125410556793,
-0.115273118019104,
0.04147911071777344,
0.13877277076244354,
0.1588970422744751,
-0.2952386438846588,
-0.35430777072906494,
-0.21976175904273987,
0.17852190136909485,
-0.1553322821855545,
0.10645264387130737,
0.2438211739063263,
-0.0001166464644484222,
-0.02281355857849121,
0.08414025604724884,
-0.08400937914848328,
-0.23688678443431854,
0.33728793263435364,
0.15402573347091675,
-0.5218885540962219,
0.11003046482801437,
-0.31812769174575806,
-0.14374025166034698,
-0.4370628595352173,
-0.3288455307483673,
-0.3330014944076538,
0.12816524505615234,
-0.0955711379647255,
0.19108319282531738,
0.48318222165107727,
0.14118702709674835,
0.29137617349624634,
-0.4448983371257782,
0.29345792531967163,
-0.31258758902549744,
0.0738760232925415,
-0.301182359457016,
0.273569792509079,
0.1048036739230156,
0.3836762607097626,
-0.2931397259235382,
0.10119502246379852,
-0.00950537621974945,
0.12337784469127655,
0.28796064853668213,
-0.2609037458896637,
-0.09919553250074387,
0.13078156113624573,
0.3381490707397461,
-0.022355571389198303,
-0.3329734206199646,
-0.2674660384654999,
-0.12008658051490784,
-0.2960910499095917,
-0.08011550456285477,
0.17440173029899597,
0.028630852699279785,
0.05780795216560364,
-0.3742605745792389,
0.3191636800765991,
-0.08523911237716675,
0.21660591661930084,
0.019349433481693268,
0.22214846312999725,
-0.12840941548347473,
0.03873099386692047,
-0.46418362855911255,
-0.11483639478683472,
-0.057465579360723495,
-0.3399850130081177,
0.1099044531583786,
0.19607682526111603,
0.0805511474609375,
-0.31794920563697815,
0.33674243092536926,
-0.5577793121337891,
0.024656500667333603,
-0.22734667360782623,
-0.0029758578166365623,
0.3014673888683319,
-0.3438105583190918,
0.03839642554521561,
0.03598916903138161,
0.3496714234352112,
0.010740682482719421,
-0.03237667307257652,
0.22094452381134033,
0.21561606228351593,
0.448309063911438,
0.03775426372885704,
0.3862801790237427,
0.16529054939746857,
0.11328066885471344,
-0.02615904062986374,
0.482272207736969,
-0.22848306596279144,
-0.37862685322761536,
0.26312050223350525,
-0.3443557620048523,
0.07116350531578064,
0.020232656970620155,
0.025952007621526718,
-0.0595310777425766,
0.4846922755241394,
0.04862983524799347,
0.17409051954746246,
-0.2399595081806183,
-0.03258636221289635,
-0.19234873354434967,
-0.24789445102214813,
-0.1684461534023285,
-0.12529093027114868,
0.12297172844409943,
0.3188713788986206,
0.05905483663082123,
0.5129324793815613,
0.030423425137996674,
-0.22497598826885223,
0.05005607008934021,
-0.012772160582244396,
0.5335593223571777,
0.017126090824604034,
-0.43277454376220703,
0.3429165184497833,
0.29663321375846863,
-0.233347088098526,
-0.1042582243680954,
0.050958722829818726,
0.03980989754199982,
0.1377754807472229,
-0.3912065625190735,
0.19081571698188782,
-0.2958465814590454,
0.3621065020561218,
0.2892390787601471,
0.10355809330940247,
0.408719539642334,
-0.07775391638278961,
0.2351023554801941,
-0.4885823130607605,
-0.21119140088558197,
-0.35935577750205994,
0.442503422498703,
0.25058290362358093,
-0.37392354011535645,
0.10276424884796143,
0.4249876141548157,
0.09905529022216797,
0.47119471430778503,
0.15340320765972137,
0.10159412771463394,
-0.08906867355108261,
-0.19534000754356384,
-0.1690911054611206,
0.1824798882007599,
0.3884349465370178,
-0.22312237322330475,
0.014580398797988892,
-0.22743095457553864,
0.4001566767692566,
-0.1761632263660431,
0.19206295907497406,
-0.05699025094509125,
-0.09383387118577957,
-0.044567711651325226,
0.46422070264816284,
-0.0621139258146286,
0.16311419010162354,
-0.4260692298412323,
-0.15895642340183258,
0.326113224029541,
-0.04248140752315521,
-0.17545923590660095,
0.13407015800476074,
-0.0790473148226738,
0.05510125309228897,
0.3086705207824707,
-0.22969645261764526,
0.03570643067359924,
-0.2841407060623169,
0.44516056776046753,
0.030277080833911896,
0.09864893555641174,
0.09511732310056686,
-0.11758985370397568,
-0.03349681198596954,
0.33172401785850525,
0.010560065507888794,
-0.1749689131975174,
-0.19885586202144623,
-0.013105013407766819,
-0.0670318678021431,
-0.2619432806968689,
-0.17561075091362,
0.15882918238639832,
0.17338688671588898,
-0.08907944709062576,
0.30908268690109253,
-0.003730040043592453,
-0.10699750483036041,
0.016488289460539818,
0.0875212699174881,
-0.3464054763317108,
0.34655383229255676,
0.16837844252586365,
-0.28817468881607056,
-0.21669206023216248,
0.3719768524169922,
0.10448767244815826,
0.024191951379179955,
-0.19916880130767822,
0.15368404984474182,
-0.11736946552991867,
-0.12331914901733398,
-0.5844514966011047,
0.10993069410324097,
0.36117950081825256,
0.158380925655365,
0.2550024390220642,
0.5036296248435974,
0.11218855530023575,
-0.03440766781568527,
0.06214237958192825,
0.5594333410263062,
-0.18953436613082886,
0.022655494511127472,
-0.3018747568130493,
0.011687850579619408,
0.3107447028160095,
0.16395223140716553,
-0.16798870265483856,
-0.4434167444705963,
0.03712131455540657,
-0.022674202919006348,
-0.1656906008720398,
0.023112589493393898,
-0.4027048349380493,
0.34867551922798157,
0.28996482491493225,
-0.07821313291788101,
0.17961490154266357,
-0.0785859152674675,
-0.10272007435560226,
-0.1015440821647644,
0.22542288899421692,
-0.2952028512954712,
0.5789228677749634,
-0.03668339550495148,
-0.14496980607509613,
0.05437943711876869,
-0.026164434850215912,
-0.15568146109580994,
0.06167911738157272,
0.1211366355419159,
-0.06432566791772842,
0.11960962414741516,
0.24179601669311523,
0.03792747110128403,
-0.220016211271286,
0.29676324129104614,
-0.20568890869617462,
-0.11610236763954163,
-0.18921685218811035,
0.170144185423851,
-0.3475115895271301,
-0.011981168761849403,
-0.459431916475296,
-0.11035853624343872,
0.15138062834739685,
-0.09737793356180191,
-0.16793930530548096,
0.08473162353038788,
-0.2180066704750061,
0.10587573796510696,
-0.23040588200092316,
0.1284940391778946,
0.3007718324661255,
-0.038847386837005615,
-0.07833181321620941,
0.2827419340610504,
-0.1395007073879242,
-0.037971775978803635,
-0.11027470976114273,
-0.19640982151031494,
0.263609379529953,
0.2883650064468384,
-0.1961321234703064,
-0.1641438901424408,
-0.6332255601882935,
-0.11944152414798737,
-0.1341811865568161,
0.32877057790756226,
0.11765081435441971,
0.27563074231147766,
-0.15206806361675262,
-0.1166420429944992,
0.3145628869533539,
-0.015786170959472656,
0.17096300423145294,
0.18366959691047668,
0.13498282432556152,
-0.015545099042356014,
-0.5056920647621155,
-0.2204398214817047,
-0.09644326567649841,
-0.0626140907406807,
0.08665967732667923,
-0.21603132784366608,
0.02643602341413498,
0.04877009615302086,
-0.05383286252617836,
0.02739790827035904,
-0.24163490533828735,
0.04155478626489639,
-0.23594196140766144,
0.28192320466041565,
0.43028080463409424,
-0.06765486299991608,
-0.1318305879831314,
-0.16263237595558167,
-0.00796373002231121,
-0.35268425941467285,
-0.008451970294117928,
-0.059105485677719116,
-0.32497432827949524,
-0.20902518928050995,
0.2126208245754242,
-0.07352001219987869,
0.033843033015728,
-0.007720984518527985,
0.2844255268573761,
0.08240760117769241,
-0.10622656345367432,
-0.043578580021858215,
-0.028261028230190277,
0.08356566727161407,
0.1370989978313446,
-0.0031638499349355698,
0.3392145335674286,
0.06841930747032166,
-0.1338053196668625,
0.20237115025520325,
-0.3853635787963867,
0.18205255270004272,
0.14959716796875,
0.35083043575286865,
-0.17073947191238403,
-0.2915019690990448,
0.27154290676116943,
0.09857891499996185,
-0.1893194615840912,
0.12757858633995056,
-0.03816017508506775,
-0.2583358585834503,
0.12821795046329498,
0.25577250123023987,
0.1622960865497589,
-0.20246407389640808,
0.021912284195423126,
0.3147258162498474,
-0.0438629612326622,
0.07844042778015137,
0.5103879570960999,
-0.006447387859225273,
-0.3256703317165375,
-0.15435418486595154,
0.10719401389360428,
0.002452440559864044,
0.15893308818340302,
-0.24833530187606812,
-0.2655872404575348,
-0.2230769693851471,
0.12506654858589172,
0.08907152712345123,
0.7836353778839111,
0.162702739238739,
-0.27146637439727783,
0.10483947396278381,
0.38588374853134155,
0.2703321576118469,
0.08316407352685928,
-0.06095069646835327,
-0.015342682600021362,
0.056465938687324524,
-0.24661774933338165,
-0.471305251121521,
-0.24809110164642334,
0.16621437668800354,
0.03412298113107681,
0.45690804719924927,
-0.1455078423023224,
-0.02631291374564171,
0.2439652532339096,
0.3559235632419586,
0.005760703235864639,
-0.1592099368572235,
-0.3320910632610321,
-0.3904716372489929,
0.40063121914863586,
0.03301897272467613,
-0.23185162246227264,
0.23674964904785156,
-0.24372535943984985,
-0.1560375839471817,
-0.16547948122024536,
0.06785911321640015,
0.036890722811222076,
0.09785151481628418,
0.2811528444290161,
0.08527645468711853,
-0.008334344252943993,
0.03669160604476929,
0.20495948195457458,
-0.11603394150733948,
-0.1506892293691635,
0.09089115262031555,
-0.07816159725189209,
-0.1472303569316864,
-0.17592661082744598,
0.08062304556369781,
0.26898983120918274,
-0.009072834625840187,
0.11059244722127914,
-0.30576571822166443,
0.18404266238212585,
-0.20616307854652405,
0.028248464688658714,
0.22767724096775055,
0.21508431434631348,
-0.21185244619846344,
-0.40966877341270447,
0.3326396942138672,
-0.12602877616882324,
0.08509425818920135,
0.3867059350013733,
-0.24034728109836578,
-0.3442721366882324,
0.5024795532226562,
0.4321822226047516,
0.7307050228118896,
0.18443211913108826,
0.09520459175109863,
0.7169745564460754,
-0.02315870299935341,
0.6993008255958557,
-0.10370786488056183,
0.41096049547195435,
-0.4451063573360443,
-0.2860540449619293,
-0.046400465071201324,
-0.08398619294166565,
0.13445517420768738,
-0.338070273399353,
-0.28679633140563965,
0.12203896790742874,
-0.2664525508880615,
0.6795720458030701,
0.18808750808238983,
-0.2604108452796936,
0.18309825658798218,
-0.17585505545139313,
-0.5231517553329468,
0.05170615762472153,
-0.2250453680753708,
0.090544193983078,
-0.03223688155412674,
-0.2512684464454651,
-0.02041344717144966,
-0.08976083993911743,
0.09673063457012177,
0.13579818606376648,
-0.026400137692689896,
0.31396806240081787,
-0.0023805834352970123,
-0.4051858186721802,
0.11523212492465973,
0.11728981137275696,
0.29914236068725586,
0.40915241837501526,
0.05344369262456894,
-0.30661603808403015,
0.2917037010192871,
0.2551499903202057,
0.2743939757347107,
-0.04799065366387367,
0.21777084469795227,
0.22269582748413086,
-0.07819359749555588,
-0.03898932784795761,
0.21107301115989685,
0.2847232222557068,
-0.5404788255691528,
-0.07159267365932465,
-0.10032413899898529,
-0.5148371458053589,
-0.2767106592655182,
-0.2711356282234192,
0.1341780573129654,
-0.11004884541034698,
0.11929383873939514,
0.010615598410367966,
-0.2521549165248871,
0.4386938810348511,
0.004709966480731964,
-0.3241708278656006,
-0.1577308624982834,
0.25439125299453735,
0.10359043627977371,
-0.14188557863235474,
0.39548131823539734,
0.12317147850990295,
-0.3206825852394104,
-0.0323261059820652,
0.0648040845990181,
-0.07902119308710098,
-0.12969224154949188,
0.2723417580127716,
0.06640073657035828,
0.16467227041721344,
-0.24520307779312134,
-0.2958568036556244,
-0.1801092028617859,
0.0875241756439209,
-0.33371502161026,
-0.18719443678855896,
-0.01779516413807869,
-0.028193555772304535,
0.03364928439259529,
0.09985151886940002,
-0.02618296816945076,
-0.039158791303634644,
-0.2889397144317627,
-0.31229642033576965,
-0.2581632435321808,
-0.27343299984931946,
0.05263388901948929,
0.13591504096984863,
-0.09398671984672546,
-0.019878625869750977,
-0.21024063229560852,
-0.22653958201408386,
0.17268332839012146,
0.08614002168178558,
-0.14657087624073029,
-0.15443384647369385,
-0.033493489027023315,
0.11702485382556915,
-0.016894321888685226,
-0.37265193462371826,
0.03651238605380058,
0.1338893473148346,
-0.1707049012184143,
-0.21403785049915314,
0.1639729142189026,
0.14115315675735474,
0.035183385014534,
0.15294702351093292,
-0.08290630578994751,
0.2915264666080475,
0.1455330103635788,
0.007922405377030373,
-0.20121228694915771,
0.053967710584402084,
0.2531953752040863,
0.14744244515895844,
0.0888916552066803,
0.153603196144104,
-0.12798121571540833,
0.08545805513858795,
-0.14855581521987915,
0.13146159052848816,
0.4354933798313141,
-0.33341771364212036,
0.049891334027051926,
0.040589362382888794,
0.27430611848831177,
0.2675049901008606,
-0.38484570384025574,
-0.2557361423969269,
0.057178400456905365,
0.17968930304050446,
0.08079667389392853,
-0.057099342346191406,
0.49798327684402466,
0.3007374703884125,
-0.04355704411864281,
0.38421162962913513,
0.03313470259308815,
-0.05871395021677017,
-0.24107836186885834,
0.07994502037763596,
0.1146407201886177,
-0.18770718574523926,
0.3146584630012512,
0.7829314470291138,
0.030307356268167496,
0.018395930528640747,
0.022444631904363632,
-0.0692320466041565,
-0.0389486625790596,
0.18613949418067932,
0.18543294072151184,
0.24151688814163208,
0.29878783226013184,
-0.16087380051612854,
-0.14345663785934448,
-0.11297410726547241,
-0.2413642853498459,
0.1994004100561142,
-0.28661322593688965,
0.5658049583435059,
0.13620413839817047,
0.0380193293094635,
-0.4452711045742035,
-0.08038946986198425,
-0.2143814116716385,
0.03752100467681885,
-0.4529602527618408,
0.14074978232383728,
-0.006520433351397514,
0.03984876722097397,
-0.20045244693756104,
0.08343522250652313,
-0.2725495398044586,
0.07312937080860138,
0.042857445776462555,
0.15889659523963928,
-0.08723734319210052,
-0.0481923371553421,
0.2371426820755005,
0.10124494135379791,
0.2498708963394165,
-0.10691656172275543,
-0.0674716979265213,
0.3865653872489929,
0.09150315821170807,
-0.14542138576507568,
-0.05510881543159485,
0.27586960792541504,
0.6177332401275635,
-0.04567347839474678,
-0.06719356030225754,
-0.10213853418827057,
-0.08379292488098145,
0.08901912719011307,
0.262290358543396,
-0.05804002285003662,
-0.08907616138458252,
-0.0629318505525589,
0.15302352607250214,
-0.16242104768753052,
0.09774459898471832,
-0.08159786462783813,
0.25854581594467163,
-0.2866900861263275,
0.38327673077583313,
-0.12180745601654053,
-0.19208601117134094,
-0.08630562573671341,
-0.34347251057624817,
-0.062275566160678864,
-0.14492695033550262,
0.6067264080047607,
0.5737983584403992,
0.08965405821800232,
-0.015563995577394962,
0.04584934562444687,
-0.1593083143234253,
0.11178941279649734,
-0.13097769021987915,
-0.2677588164806366,
0.02734541893005371,
0.17095576226711273,
-0.2267080545425415,
0.15135693550109863,
0.33264297246932983,
-0.30999138951301575,
0.05313817039132118,
-0.01945139653980732,
0.07457497715950012,
0.052974432706832886,
-0.029099449515342712,
-0.0229388028383255,
0.4951131343841553,
0.15079326927661896,
-0.08291133493185043,
-0.19391243159770966,
-0.40169447660446167,
-0.06588386744260788,
-0.11119785904884338,
-0.33047375082969666,
0.2667972147464752,
-0.17961156368255615,
0.11254199594259262,
-0.16805478930473328,
0.17126990854740143,
-0.2835308611392975,
0.02523089200258255,
0.1856212019920349,
0.4099312722682953,
0.14531996846199036,
0.03864581137895584,
-0.22367319464683533,
-0.17643073201179504,
0.010659918189048767,
-0.23728755116462708,
0.28080037236213684,
-0.3789074420928955,
0.4946005642414093,
0.017529446631669998,
0.040532540529966354,
-0.3669935464859009,
0.39116090536117554,
0.001748785376548767,
-0.11669550836086273,
-0.0956469476222992,
0.15102341771125793,
-0.36021938920021057,
0.0048865885473787785,
0.21850959956645966,
0.099675253033638,
0.15540941059589386,
0.34668904542922974,
-0.09796872735023499,
-0.48147717118263245,
0.47677284479141235,
-0.3814901113510132,
-0.27774912118911743,
-0.13525331020355225,
0.148630291223526,
-0.07086648792028427,
-0.13644817471504211,
-0.5332998037338257,
-0.08449841290712357,
0.1973572075366974,
-0.18259301781654358,
-0.13010410964488983,
0.25621992349624634,
0.04519832134246826,
0.008136224001646042,
-0.12021878361701965,
0.30836981534957886,
-0.025906506925821304,
-0.02033541165292263,
0.16722485423088074,
-0.08359858393669128
] |
https://github.com/huggingface/datasets/issues/5517 | `with_format("numpy")` silently downcasts float64 to float32 features | I was also wondering why the default type logic is needed. Me just deleting it is probably too naive of a solution. | ### Describe the bug
When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`.
### Steps to reproduce the bug
```python
import datasets
dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy")
print("feature dtype:", dataset.features['a'].dtype)
print("array dtype:", dataset['a'].dtype)
```
output:
```
feature dtype: float64
array dtype: float32
```
### Expected behavior
```
feature dtype: float64
array dtype: float64
```
### Environment info
- `datasets` version: 2.8.0
- Platform: Linux-5.4.0-135-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.4.4
### Suggested Fix
Changing [the `_tensorize` function of the numpy formatter](https://github.com/huggingface/datasets/blob/b065547654efa0ec633cf373ac1512884c68b2e1/src/datasets/formatting/np_formatter.py#L32) to
```python
def _tensorize(self, value):
if isinstance(value, (str, bytes, type(None))):
return value
elif isinstance(value, (np.character, np.ndarray)) and np.issubdtype(value.dtype, np.character):
return value
elif isinstance(value, np.number):
return value
return np.asarray(value, **self.np_array_kwargs)
```
fixes this particular issue for me. Not sure if this would break other tests. This should also avoid unnecessary copying of the array.
| 22 | `with_format("numpy")` silently downcasts float64 to float32 features
### Describe the bug
When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`.
### Steps to reproduce the bug
```python
import datasets
dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy")
print("feature dtype:", dataset.features['a'].dtype)
print("array dtype:", dataset['a'].dtype)
```
output:
```
feature dtype: float64
array dtype: float32
```
### Expected behavior
```
feature dtype: float64
array dtype: float64
```
### Environment info
- `datasets` version: 2.8.0
- Platform: Linux-5.4.0-135-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.4.4
### Suggested Fix
Changing [the `_tensorize` function of the numpy formatter](https://github.com/huggingface/datasets/blob/b065547654efa0ec633cf373ac1512884c68b2e1/src/datasets/formatting/np_formatter.py#L32) to
```python
def _tensorize(self, value):
if isinstance(value, (str, bytes, type(None))):
return value
elif isinstance(value, (np.character, np.ndarray)) and np.issubdtype(value.dtype, np.character):
return value
elif isinstance(value, np.number):
return value
return np.asarray(value, **self.np_array_kwargs)
```
fixes this particular issue for me. Not sure if this would break other tests. This should also avoid unnecessary copying of the array.
I was also wondering why the default type logic is needed. Me just deleting it is probably too naive of a solution. | [
0.14177078008651733,
-0.24984367191791534,
0.000774633139371872,
0.0026635415852069855,
0.5696965456008911,
0.0561448410153389,
0.6134842038154602,
0.5261093378067017,
-0.16041861474514008,
-0.05886185169219971,
-0.13229535520076752,
0.6590015888214111,
-0.024173695594072342,
-0.055850546807050705,
-0.0898173376917839,
-0.09573148190975189,
0.19167107343673706,
0.36848190426826477,
-0.1873778998851776,
-0.08108260482549667,
-0.23802180588245392,
-0.2345665842294693,
-0.08685125410556793,
-0.115273118019104,
0.04147911071777344,
0.13877277076244354,
0.1588970422744751,
-0.2952386438846588,
-0.35430777072906494,
-0.21976175904273987,
0.17852190136909485,
-0.1553322821855545,
0.10645264387130737,
0.2438211739063263,
-0.0001166464644484222,
-0.02281355857849121,
0.08414025604724884,
-0.08400937914848328,
-0.23688678443431854,
0.33728793263435364,
0.15402573347091675,
-0.5218885540962219,
0.11003046482801437,
-0.31812769174575806,
-0.14374025166034698,
-0.4370628595352173,
-0.3288455307483673,
-0.3330014944076538,
0.12816524505615234,
-0.0955711379647255,
0.19108319282531738,
0.48318222165107727,
0.14118702709674835,
0.29137617349624634,
-0.4448983371257782,
0.29345792531967163,
-0.31258758902549744,
0.0738760232925415,
-0.301182359457016,
0.273569792509079,
0.1048036739230156,
0.3836762607097626,
-0.2931397259235382,
0.10119502246379852,
-0.00950537621974945,
0.12337784469127655,
0.28796064853668213,
-0.2609037458896637,
-0.09919553250074387,
0.13078156113624573,
0.3381490707397461,
-0.022355571389198303,
-0.3329734206199646,
-0.2674660384654999,
-0.12008658051490784,
-0.2960910499095917,
-0.08011550456285477,
0.17440173029899597,
0.028630852699279785,
0.05780795216560364,
-0.3742605745792389,
0.3191636800765991,
-0.08523911237716675,
0.21660591661930084,
0.019349433481693268,
0.22214846312999725,
-0.12840941548347473,
0.03873099386692047,
-0.46418362855911255,
-0.11483639478683472,
-0.057465579360723495,
-0.3399850130081177,
0.1099044531583786,
0.19607682526111603,
0.0805511474609375,
-0.31794920563697815,
0.33674243092536926,
-0.5577793121337891,
0.024656500667333603,
-0.22734667360782623,
-0.0029758578166365623,
0.3014673888683319,
-0.3438105583190918,
0.03839642554521561,
0.03598916903138161,
0.3496714234352112,
0.010740682482719421,
-0.03237667307257652,
0.22094452381134033,
0.21561606228351593,
0.448309063911438,
0.03775426372885704,
0.3862801790237427,
0.16529054939746857,
0.11328066885471344,
-0.02615904062986374,
0.482272207736969,
-0.22848306596279144,
-0.37862685322761536,
0.26312050223350525,
-0.3443557620048523,
0.07116350531578064,
0.020232656970620155,
0.025952007621526718,
-0.0595310777425766,
0.4846922755241394,
0.04862983524799347,
0.17409051954746246,
-0.2399595081806183,
-0.03258636221289635,
-0.19234873354434967,
-0.24789445102214813,
-0.1684461534023285,
-0.12529093027114868,
0.12297172844409943,
0.3188713788986206,
0.05905483663082123,
0.5129324793815613,
0.030423425137996674,
-0.22497598826885223,
0.05005607008934021,
-0.012772160582244396,
0.5335593223571777,
0.017126090824604034,
-0.43277454376220703,
0.3429165184497833,
0.29663321375846863,
-0.233347088098526,
-0.1042582243680954,
0.050958722829818726,
0.03980989754199982,
0.1377754807472229,
-0.3912065625190735,
0.19081571698188782,
-0.2958465814590454,
0.3621065020561218,
0.2892390787601471,
0.10355809330940247,
0.408719539642334,
-0.07775391638278961,
0.2351023554801941,
-0.4885823130607605,
-0.21119140088558197,
-0.35935577750205994,
0.442503422498703,
0.25058290362358093,
-0.37392354011535645,
0.10276424884796143,
0.4249876141548157,
0.09905529022216797,
0.47119471430778503,
0.15340320765972137,
0.10159412771463394,
-0.08906867355108261,
-0.19534000754356384,
-0.1690911054611206,
0.1824798882007599,
0.3884349465370178,
-0.22312237322330475,
0.014580398797988892,
-0.22743095457553864,
0.4001566767692566,
-0.1761632263660431,
0.19206295907497406,
-0.05699025094509125,
-0.09383387118577957,
-0.044567711651325226,
0.46422070264816284,
-0.0621139258146286,
0.16311419010162354,
-0.4260692298412323,
-0.15895642340183258,
0.326113224029541,
-0.04248140752315521,
-0.17545923590660095,
0.13407015800476074,
-0.0790473148226738,
0.05510125309228897,
0.3086705207824707,
-0.22969645261764526,
0.03570643067359924,
-0.2841407060623169,
0.44516056776046753,
0.030277080833911896,
0.09864893555641174,
0.09511732310056686,
-0.11758985370397568,
-0.03349681198596954,
0.33172401785850525,
0.010560065507888794,
-0.1749689131975174,
-0.19885586202144623,
-0.013105013407766819,
-0.0670318678021431,
-0.2619432806968689,
-0.17561075091362,
0.15882918238639832,
0.17338688671588898,
-0.08907944709062576,
0.30908268690109253,
-0.003730040043592453,
-0.10699750483036041,
0.016488289460539818,
0.0875212699174881,
-0.3464054763317108,
0.34655383229255676,
0.16837844252586365,
-0.28817468881607056,
-0.21669206023216248,
0.3719768524169922,
0.10448767244815826,
0.024191951379179955,
-0.19916880130767822,
0.15368404984474182,
-0.11736946552991867,
-0.12331914901733398,
-0.5844514966011047,
0.10993069410324097,
0.36117950081825256,
0.158380925655365,
0.2550024390220642,
0.5036296248435974,
0.11218855530023575,
-0.03440766781568527,
0.06214237958192825,
0.5594333410263062,
-0.18953436613082886,
0.022655494511127472,
-0.3018747568130493,
0.011687850579619408,
0.3107447028160095,
0.16395223140716553,
-0.16798870265483856,
-0.4434167444705963,
0.03712131455540657,
-0.022674202919006348,
-0.1656906008720398,
0.023112589493393898,
-0.4027048349380493,
0.34867551922798157,
0.28996482491493225,
-0.07821313291788101,
0.17961490154266357,
-0.0785859152674675,
-0.10272007435560226,
-0.1015440821647644,
0.22542288899421692,
-0.2952028512954712,
0.5789228677749634,
-0.03668339550495148,
-0.14496980607509613,
0.05437943711876869,
-0.026164434850215912,
-0.15568146109580994,
0.06167911738157272,
0.1211366355419159,
-0.06432566791772842,
0.11960962414741516,
0.24179601669311523,
0.03792747110128403,
-0.220016211271286,
0.29676324129104614,
-0.20568890869617462,
-0.11610236763954163,
-0.18921685218811035,
0.170144185423851,
-0.3475115895271301,
-0.011981168761849403,
-0.459431916475296,
-0.11035853624343872,
0.15138062834739685,
-0.09737793356180191,
-0.16793930530548096,
0.08473162353038788,
-0.2180066704750061,
0.10587573796510696,
-0.23040588200092316,
0.1284940391778946,
0.3007718324661255,
-0.038847386837005615,
-0.07833181321620941,
0.2827419340610504,
-0.1395007073879242,
-0.037971775978803635,
-0.11027470976114273,
-0.19640982151031494,
0.263609379529953,
0.2883650064468384,
-0.1961321234703064,
-0.1641438901424408,
-0.6332255601882935,
-0.11944152414798737,
-0.1341811865568161,
0.32877057790756226,
0.11765081435441971,
0.27563074231147766,
-0.15206806361675262,
-0.1166420429944992,
0.3145628869533539,
-0.015786170959472656,
0.17096300423145294,
0.18366959691047668,
0.13498282432556152,
-0.015545099042356014,
-0.5056920647621155,
-0.2204398214817047,
-0.09644326567649841,
-0.0626140907406807,
0.08665967732667923,
-0.21603132784366608,
0.02643602341413498,
0.04877009615302086,
-0.05383286252617836,
0.02739790827035904,
-0.24163490533828735,
0.04155478626489639,
-0.23594196140766144,
0.28192320466041565,
0.43028080463409424,
-0.06765486299991608,
-0.1318305879831314,
-0.16263237595558167,
-0.00796373002231121,
-0.35268425941467285,
-0.008451970294117928,
-0.059105485677719116,
-0.32497432827949524,
-0.20902518928050995,
0.2126208245754242,
-0.07352001219987869,
0.033843033015728,
-0.007720984518527985,
0.2844255268573761,
0.08240760117769241,
-0.10622656345367432,
-0.043578580021858215,
-0.028261028230190277,
0.08356566727161407,
0.1370989978313446,
-0.0031638499349355698,
0.3392145335674286,
0.06841930747032166,
-0.1338053196668625,
0.20237115025520325,
-0.3853635787963867,
0.18205255270004272,
0.14959716796875,
0.35083043575286865,
-0.17073947191238403,
-0.2915019690990448,
0.27154290676116943,
0.09857891499996185,
-0.1893194615840912,
0.12757858633995056,
-0.03816017508506775,
-0.2583358585834503,
0.12821795046329498,
0.25577250123023987,
0.1622960865497589,
-0.20246407389640808,
0.021912284195423126,
0.3147258162498474,
-0.0438629612326622,
0.07844042778015137,
0.5103879570960999,
-0.006447387859225273,
-0.3256703317165375,
-0.15435418486595154,
0.10719401389360428,
0.002452440559864044,
0.15893308818340302,
-0.24833530187606812,
-0.2655872404575348,
-0.2230769693851471,
0.12506654858589172,
0.08907152712345123,
0.7836353778839111,
0.162702739238739,
-0.27146637439727783,
0.10483947396278381,
0.38588374853134155,
0.2703321576118469,
0.08316407352685928,
-0.06095069646835327,
-0.015342682600021362,
0.056465938687324524,
-0.24661774933338165,
-0.471305251121521,
-0.24809110164642334,
0.16621437668800354,
0.03412298113107681,
0.45690804719924927,
-0.1455078423023224,
-0.02631291374564171,
0.2439652532339096,
0.3559235632419586,
0.005760703235864639,
-0.1592099368572235,
-0.3320910632610321,
-0.3904716372489929,
0.40063121914863586,
0.03301897272467613,
-0.23185162246227264,
0.23674964904785156,
-0.24372535943984985,
-0.1560375839471817,
-0.16547948122024536,
0.06785911321640015,
0.036890722811222076,
0.09785151481628418,
0.2811528444290161,
0.08527645468711853,
-0.008334344252943993,
0.03669160604476929,
0.20495948195457458,
-0.11603394150733948,
-0.1506892293691635,
0.09089115262031555,
-0.07816159725189209,
-0.1472303569316864,
-0.17592661082744598,
0.08062304556369781,
0.26898983120918274,
-0.009072834625840187,
0.11059244722127914,
-0.30576571822166443,
0.18404266238212585,
-0.20616307854652405,
0.028248464688658714,
0.22767724096775055,
0.21508431434631348,
-0.21185244619846344,
-0.40966877341270447,
0.3326396942138672,
-0.12602877616882324,
0.08509425818920135,
0.3867059350013733,
-0.24034728109836578,
-0.3442721366882324,
0.5024795532226562,
0.4321822226047516,
0.7307050228118896,
0.18443211913108826,
0.09520459175109863,
0.7169745564460754,
-0.02315870299935341,
0.6993008255958557,
-0.10370786488056183,
0.41096049547195435,
-0.4451063573360443,
-0.2860540449619293,
-0.046400465071201324,
-0.08398619294166565,
0.13445517420768738,
-0.338070273399353,
-0.28679633140563965,
0.12203896790742874,
-0.2664525508880615,
0.6795720458030701,
0.18808750808238983,
-0.2604108452796936,
0.18309825658798218,
-0.17585505545139313,
-0.5231517553329468,
0.05170615762472153,
-0.2250453680753708,
0.090544193983078,
-0.03223688155412674,
-0.2512684464454651,
-0.02041344717144966,
-0.08976083993911743,
0.09673063457012177,
0.13579818606376648,
-0.026400137692689896,
0.31396806240081787,
-0.0023805834352970123,
-0.4051858186721802,
0.11523212492465973,
0.11728981137275696,
0.29914236068725586,
0.40915241837501526,
0.05344369262456894,
-0.30661603808403015,
0.2917037010192871,
0.2551499903202057,
0.2743939757347107,
-0.04799065366387367,
0.21777084469795227,
0.22269582748413086,
-0.07819359749555588,
-0.03898932784795761,
0.21107301115989685,
0.2847232222557068,
-0.5404788255691528,
-0.07159267365932465,
-0.10032413899898529,
-0.5148371458053589,
-0.2767106592655182,
-0.2711356282234192,
0.1341780573129654,
-0.11004884541034698,
0.11929383873939514,
0.010615598410367966,
-0.2521549165248871,
0.4386938810348511,
0.004709966480731964,
-0.3241708278656006,
-0.1577308624982834,
0.25439125299453735,
0.10359043627977371,
-0.14188557863235474,
0.39548131823539734,
0.12317147850990295,
-0.3206825852394104,
-0.0323261059820652,
0.0648040845990181,
-0.07902119308710098,
-0.12969224154949188,
0.2723417580127716,
0.06640073657035828,
0.16467227041721344,
-0.24520307779312134,
-0.2958568036556244,
-0.1801092028617859,
0.0875241756439209,
-0.33371502161026,
-0.18719443678855896,
-0.01779516413807869,
-0.028193555772304535,
0.03364928439259529,
0.09985151886940002,
-0.02618296816945076,
-0.039158791303634644,
-0.2889397144317627,
-0.31229642033576965,
-0.2581632435321808,
-0.27343299984931946,
0.05263388901948929,
0.13591504096984863,
-0.09398671984672546,
-0.019878625869750977,
-0.21024063229560852,
-0.22653958201408386,
0.17268332839012146,
0.08614002168178558,
-0.14657087624073029,
-0.15443384647369385,
-0.033493489027023315,
0.11702485382556915,
-0.016894321888685226,
-0.37265193462371826,
0.03651238605380058,
0.1338893473148346,
-0.1707049012184143,
-0.21403785049915314,
0.1639729142189026,
0.14115315675735474,
0.035183385014534,
0.15294702351093292,
-0.08290630578994751,
0.2915264666080475,
0.1455330103635788,
0.007922405377030373,
-0.20121228694915771,
0.053967710584402084,
0.2531953752040863,
0.14744244515895844,
0.0888916552066803,
0.153603196144104,
-0.12798121571540833,
0.08545805513858795,
-0.14855581521987915,
0.13146159052848816,
0.4354933798313141,
-0.33341771364212036,
0.049891334027051926,
0.040589362382888794,
0.27430611848831177,
0.2675049901008606,
-0.38484570384025574,
-0.2557361423969269,
0.057178400456905365,
0.17968930304050446,
0.08079667389392853,
-0.057099342346191406,
0.49798327684402466,
0.3007374703884125,
-0.04355704411864281,
0.38421162962913513,
0.03313470259308815,
-0.05871395021677017,
-0.24107836186885834,
0.07994502037763596,
0.1146407201886177,
-0.18770718574523926,
0.3146584630012512,
0.7829314470291138,
0.030307356268167496,
0.018395930528640747,
0.022444631904363632,
-0.0692320466041565,
-0.0389486625790596,
0.18613949418067932,
0.18543294072151184,
0.24151688814163208,
0.29878783226013184,
-0.16087380051612854,
-0.14345663785934448,
-0.11297410726547241,
-0.2413642853498459,
0.1994004100561142,
-0.28661322593688965,
0.5658049583435059,
0.13620413839817047,
0.0380193293094635,
-0.4452711045742035,
-0.08038946986198425,
-0.2143814116716385,
0.03752100467681885,
-0.4529602527618408,
0.14074978232383728,
-0.006520433351397514,
0.03984876722097397,
-0.20045244693756104,
0.08343522250652313,
-0.2725495398044586,
0.07312937080860138,
0.042857445776462555,
0.15889659523963928,
-0.08723734319210052,
-0.0481923371553421,
0.2371426820755005,
0.10124494135379791,
0.2498708963394165,
-0.10691656172275543,
-0.0674716979265213,
0.3865653872489929,
0.09150315821170807,
-0.14542138576507568,
-0.05510881543159485,
0.27586960792541504,
0.6177332401275635,
-0.04567347839474678,
-0.06719356030225754,
-0.10213853418827057,
-0.08379292488098145,
0.08901912719011307,
0.262290358543396,
-0.05804002285003662,
-0.08907616138458252,
-0.0629318505525589,
0.15302352607250214,
-0.16242104768753052,
0.09774459898471832,
-0.08159786462783813,
0.25854581594467163,
-0.2866900861263275,
0.38327673077583313,
-0.12180745601654053,
-0.19208601117134094,
-0.08630562573671341,
-0.34347251057624817,
-0.062275566160678864,
-0.14492695033550262,
0.6067264080047607,
0.5737983584403992,
0.08965405821800232,
-0.015563995577394962,
0.04584934562444687,
-0.1593083143234253,
0.11178941279649734,
-0.13097769021987915,
-0.2677588164806366,
0.02734541893005371,
0.17095576226711273,
-0.2267080545425415,
0.15135693550109863,
0.33264297246932983,
-0.30999138951301575,
0.05313817039132118,
-0.01945139653980732,
0.07457497715950012,
0.052974432706832886,
-0.029099449515342712,
-0.0229388028383255,
0.4951131343841553,
0.15079326927661896,
-0.08291133493185043,
-0.19391243159770966,
-0.40169447660446167,
-0.06588386744260788,
-0.11119785904884338,
-0.33047375082969666,
0.2667972147464752,
-0.17961156368255615,
0.11254199594259262,
-0.16805478930473328,
0.17126990854740143,
-0.2835308611392975,
0.02523089200258255,
0.1856212019920349,
0.4099312722682953,
0.14531996846199036,
0.03864581137895584,
-0.22367319464683533,
-0.17643073201179504,
0.010659918189048767,
-0.23728755116462708,
0.28080037236213684,
-0.3789074420928955,
0.4946005642414093,
0.017529446631669998,
0.040532540529966354,
-0.3669935464859009,
0.39116090536117554,
0.001748785376548767,
-0.11669550836086273,
-0.0956469476222992,
0.15102341771125793,
-0.36021938920021057,
0.0048865885473787785,
0.21850959956645966,
0.099675253033638,
0.15540941059589386,
0.34668904542922974,
-0.09796872735023499,
-0.48147717118263245,
0.47677284479141235,
-0.3814901113510132,
-0.27774912118911743,
-0.13525331020355225,
0.148630291223526,
-0.07086648792028427,
-0.13644817471504211,
-0.5332998037338257,
-0.08449841290712357,
0.1973572075366974,
-0.18259301781654358,
-0.13010410964488983,
0.25621992349624634,
0.04519832134246826,
0.008136224001646042,
-0.12021878361701965,
0.30836981534957886,
-0.025906506925821304,
-0.02033541165292263,
0.16722485423088074,
-0.08359858393669128
] |
https://github.com/huggingface/datasets/issues/5517 | `with_format("numpy")` silently downcasts float64 to float32 features | Hmm I think the idea was to end up with the usual default precision for deep learning models - no matter how the data was stored or where it comes from.
For example in NLP we store tokens using an optimized low precision to save disk space, but when we set the format to `torch` we actually need to get `int64`. Although the need for a default for integers also comes from numpy not returning the same integer precision depending on your machine. Finally I guess we added a default for floats as well for consistency.
I'm a bit embarrassed by this though, as a user I'd have expected to get the same precision indeed as well and get a zero copy view. | ### Describe the bug
When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`.
### Steps to reproduce the bug
```python
import datasets
dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy")
print("feature dtype:", dataset.features['a'].dtype)
print("array dtype:", dataset['a'].dtype)
```
output:
```
feature dtype: float64
array dtype: float32
```
### Expected behavior
```
feature dtype: float64
array dtype: float64
```
### Environment info
- `datasets` version: 2.8.0
- Platform: Linux-5.4.0-135-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.4.4
### Suggested Fix
Changing [the `_tensorize` function of the numpy formatter](https://github.com/huggingface/datasets/blob/b065547654efa0ec633cf373ac1512884c68b2e1/src/datasets/formatting/np_formatter.py#L32) to
```python
def _tensorize(self, value):
if isinstance(value, (str, bytes, type(None))):
return value
elif isinstance(value, (np.character, np.ndarray)) and np.issubdtype(value.dtype, np.character):
return value
elif isinstance(value, np.number):
return value
return np.asarray(value, **self.np_array_kwargs)
```
fixes this particular issue for me. Not sure if this would break other tests. This should also avoid unnecessary copying of the array.
| 123 | `with_format("numpy")` silently downcasts float64 to float32 features
### Describe the bug
When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`.
### Steps to reproduce the bug
```python
import datasets
dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy")
print("feature dtype:", dataset.features['a'].dtype)
print("array dtype:", dataset['a'].dtype)
```
output:
```
feature dtype: float64
array dtype: float32
```
### Expected behavior
```
feature dtype: float64
array dtype: float64
```
### Environment info
- `datasets` version: 2.8.0
- Platform: Linux-5.4.0-135-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.4.4
### Suggested Fix
Changing [the `_tensorize` function of the numpy formatter](https://github.com/huggingface/datasets/blob/b065547654efa0ec633cf373ac1512884c68b2e1/src/datasets/formatting/np_formatter.py#L32) to
```python
def _tensorize(self, value):
if isinstance(value, (str, bytes, type(None))):
return value
elif isinstance(value, (np.character, np.ndarray)) and np.issubdtype(value.dtype, np.character):
return value
elif isinstance(value, np.number):
return value
return np.asarray(value, **self.np_array_kwargs)
```
fixes this particular issue for me. Not sure if this would break other tests. This should also avoid unnecessary copying of the array.
Hmm I think the idea was to end up with the usual default precision for deep learning models - no matter how the data was stored or where it comes from.
For example in NLP we store tokens using an optimized low precision to save disk space, but when we set the format to `torch` we actually need to get `int64`. Although the need for a default for integers also comes from numpy not returning the same integer precision depending on your machine. Finally I guess we added a default for floats as well for consistency.
I'm a bit embarrassed by this though, as a user I'd have expected to get the same precision indeed as well and get a zero copy view. | [
0.14177078008651733,
-0.24984367191791534,
0.000774633139371872,
0.0026635415852069855,
0.5696965456008911,
0.0561448410153389,
0.6134842038154602,
0.5261093378067017,
-0.16041861474514008,
-0.05886185169219971,
-0.13229535520076752,
0.6590015888214111,
-0.024173695594072342,
-0.055850546807050705,
-0.0898173376917839,
-0.09573148190975189,
0.19167107343673706,
0.36848190426826477,
-0.1873778998851776,
-0.08108260482549667,
-0.23802180588245392,
-0.2345665842294693,
-0.08685125410556793,
-0.115273118019104,
0.04147911071777344,
0.13877277076244354,
0.1588970422744751,
-0.2952386438846588,
-0.35430777072906494,
-0.21976175904273987,
0.17852190136909485,
-0.1553322821855545,
0.10645264387130737,
0.2438211739063263,
-0.0001166464644484222,
-0.02281355857849121,
0.08414025604724884,
-0.08400937914848328,
-0.23688678443431854,
0.33728793263435364,
0.15402573347091675,
-0.5218885540962219,
0.11003046482801437,
-0.31812769174575806,
-0.14374025166034698,
-0.4370628595352173,
-0.3288455307483673,
-0.3330014944076538,
0.12816524505615234,
-0.0955711379647255,
0.19108319282531738,
0.48318222165107727,
0.14118702709674835,
0.29137617349624634,
-0.4448983371257782,
0.29345792531967163,
-0.31258758902549744,
0.0738760232925415,
-0.301182359457016,
0.273569792509079,
0.1048036739230156,
0.3836762607097626,
-0.2931397259235382,
0.10119502246379852,
-0.00950537621974945,
0.12337784469127655,
0.28796064853668213,
-0.2609037458896637,
-0.09919553250074387,
0.13078156113624573,
0.3381490707397461,
-0.022355571389198303,
-0.3329734206199646,
-0.2674660384654999,
-0.12008658051490784,
-0.2960910499095917,
-0.08011550456285477,
0.17440173029899597,
0.028630852699279785,
0.05780795216560364,
-0.3742605745792389,
0.3191636800765991,
-0.08523911237716675,
0.21660591661930084,
0.019349433481693268,
0.22214846312999725,
-0.12840941548347473,
0.03873099386692047,
-0.46418362855911255,
-0.11483639478683472,
-0.057465579360723495,
-0.3399850130081177,
0.1099044531583786,
0.19607682526111603,
0.0805511474609375,
-0.31794920563697815,
0.33674243092536926,
-0.5577793121337891,
0.024656500667333603,
-0.22734667360782623,
-0.0029758578166365623,
0.3014673888683319,
-0.3438105583190918,
0.03839642554521561,
0.03598916903138161,
0.3496714234352112,
0.010740682482719421,
-0.03237667307257652,
0.22094452381134033,
0.21561606228351593,
0.448309063911438,
0.03775426372885704,
0.3862801790237427,
0.16529054939746857,
0.11328066885471344,
-0.02615904062986374,
0.482272207736969,
-0.22848306596279144,
-0.37862685322761536,
0.26312050223350525,
-0.3443557620048523,
0.07116350531578064,
0.020232656970620155,
0.025952007621526718,
-0.0595310777425766,
0.4846922755241394,
0.04862983524799347,
0.17409051954746246,
-0.2399595081806183,
-0.03258636221289635,
-0.19234873354434967,
-0.24789445102214813,
-0.1684461534023285,
-0.12529093027114868,
0.12297172844409943,
0.3188713788986206,
0.05905483663082123,
0.5129324793815613,
0.030423425137996674,
-0.22497598826885223,
0.05005607008934021,
-0.012772160582244396,
0.5335593223571777,
0.017126090824604034,
-0.43277454376220703,
0.3429165184497833,
0.29663321375846863,
-0.233347088098526,
-0.1042582243680954,
0.050958722829818726,
0.03980989754199982,
0.1377754807472229,
-0.3912065625190735,
0.19081571698188782,
-0.2958465814590454,
0.3621065020561218,
0.2892390787601471,
0.10355809330940247,
0.408719539642334,
-0.07775391638278961,
0.2351023554801941,
-0.4885823130607605,
-0.21119140088558197,
-0.35935577750205994,
0.442503422498703,
0.25058290362358093,
-0.37392354011535645,
0.10276424884796143,
0.4249876141548157,
0.09905529022216797,
0.47119471430778503,
0.15340320765972137,
0.10159412771463394,
-0.08906867355108261,
-0.19534000754356384,
-0.1690911054611206,
0.1824798882007599,
0.3884349465370178,
-0.22312237322330475,
0.014580398797988892,
-0.22743095457553864,
0.4001566767692566,
-0.1761632263660431,
0.19206295907497406,
-0.05699025094509125,
-0.09383387118577957,
-0.044567711651325226,
0.46422070264816284,
-0.0621139258146286,
0.16311419010162354,
-0.4260692298412323,
-0.15895642340183258,
0.326113224029541,
-0.04248140752315521,
-0.17545923590660095,
0.13407015800476074,
-0.0790473148226738,
0.05510125309228897,
0.3086705207824707,
-0.22969645261764526,
0.03570643067359924,
-0.2841407060623169,
0.44516056776046753,
0.030277080833911896,
0.09864893555641174,
0.09511732310056686,
-0.11758985370397568,
-0.03349681198596954,
0.33172401785850525,
0.010560065507888794,
-0.1749689131975174,
-0.19885586202144623,
-0.013105013407766819,
-0.0670318678021431,
-0.2619432806968689,
-0.17561075091362,
0.15882918238639832,
0.17338688671588898,
-0.08907944709062576,
0.30908268690109253,
-0.003730040043592453,
-0.10699750483036041,
0.016488289460539818,
0.0875212699174881,
-0.3464054763317108,
0.34655383229255676,
0.16837844252586365,
-0.28817468881607056,
-0.21669206023216248,
0.3719768524169922,
0.10448767244815826,
0.024191951379179955,
-0.19916880130767822,
0.15368404984474182,
-0.11736946552991867,
-0.12331914901733398,
-0.5844514966011047,
0.10993069410324097,
0.36117950081825256,
0.158380925655365,
0.2550024390220642,
0.5036296248435974,
0.11218855530023575,
-0.03440766781568527,
0.06214237958192825,
0.5594333410263062,
-0.18953436613082886,
0.022655494511127472,
-0.3018747568130493,
0.011687850579619408,
0.3107447028160095,
0.16395223140716553,
-0.16798870265483856,
-0.4434167444705963,
0.03712131455540657,
-0.022674202919006348,
-0.1656906008720398,
0.023112589493393898,
-0.4027048349380493,
0.34867551922798157,
0.28996482491493225,
-0.07821313291788101,
0.17961490154266357,
-0.0785859152674675,
-0.10272007435560226,
-0.1015440821647644,
0.22542288899421692,
-0.2952028512954712,
0.5789228677749634,
-0.03668339550495148,
-0.14496980607509613,
0.05437943711876869,
-0.026164434850215912,
-0.15568146109580994,
0.06167911738157272,
0.1211366355419159,
-0.06432566791772842,
0.11960962414741516,
0.24179601669311523,
0.03792747110128403,
-0.220016211271286,
0.29676324129104614,
-0.20568890869617462,
-0.11610236763954163,
-0.18921685218811035,
0.170144185423851,
-0.3475115895271301,
-0.011981168761849403,
-0.459431916475296,
-0.11035853624343872,
0.15138062834739685,
-0.09737793356180191,
-0.16793930530548096,
0.08473162353038788,
-0.2180066704750061,
0.10587573796510696,
-0.23040588200092316,
0.1284940391778946,
0.3007718324661255,
-0.038847386837005615,
-0.07833181321620941,
0.2827419340610504,
-0.1395007073879242,
-0.037971775978803635,
-0.11027470976114273,
-0.19640982151031494,
0.263609379529953,
0.2883650064468384,
-0.1961321234703064,
-0.1641438901424408,
-0.6332255601882935,
-0.11944152414798737,
-0.1341811865568161,
0.32877057790756226,
0.11765081435441971,
0.27563074231147766,
-0.15206806361675262,
-0.1166420429944992,
0.3145628869533539,
-0.015786170959472656,
0.17096300423145294,
0.18366959691047668,
0.13498282432556152,
-0.015545099042356014,
-0.5056920647621155,
-0.2204398214817047,
-0.09644326567649841,
-0.0626140907406807,
0.08665967732667923,
-0.21603132784366608,
0.02643602341413498,
0.04877009615302086,
-0.05383286252617836,
0.02739790827035904,
-0.24163490533828735,
0.04155478626489639,
-0.23594196140766144,
0.28192320466041565,
0.43028080463409424,
-0.06765486299991608,
-0.1318305879831314,
-0.16263237595558167,
-0.00796373002231121,
-0.35268425941467285,
-0.008451970294117928,
-0.059105485677719116,
-0.32497432827949524,
-0.20902518928050995,
0.2126208245754242,
-0.07352001219987869,
0.033843033015728,
-0.007720984518527985,
0.2844255268573761,
0.08240760117769241,
-0.10622656345367432,
-0.043578580021858215,
-0.028261028230190277,
0.08356566727161407,
0.1370989978313446,
-0.0031638499349355698,
0.3392145335674286,
0.06841930747032166,
-0.1338053196668625,
0.20237115025520325,
-0.3853635787963867,
0.18205255270004272,
0.14959716796875,
0.35083043575286865,
-0.17073947191238403,
-0.2915019690990448,
0.27154290676116943,
0.09857891499996185,
-0.1893194615840912,
0.12757858633995056,
-0.03816017508506775,
-0.2583358585834503,
0.12821795046329498,
0.25577250123023987,
0.1622960865497589,
-0.20246407389640808,
0.021912284195423126,
0.3147258162498474,
-0.0438629612326622,
0.07844042778015137,
0.5103879570960999,
-0.006447387859225273,
-0.3256703317165375,
-0.15435418486595154,
0.10719401389360428,
0.002452440559864044,
0.15893308818340302,
-0.24833530187606812,
-0.2655872404575348,
-0.2230769693851471,
0.12506654858589172,
0.08907152712345123,
0.7836353778839111,
0.162702739238739,
-0.27146637439727783,
0.10483947396278381,
0.38588374853134155,
0.2703321576118469,
0.08316407352685928,
-0.06095069646835327,
-0.015342682600021362,
0.056465938687324524,
-0.24661774933338165,
-0.471305251121521,
-0.24809110164642334,
0.16621437668800354,
0.03412298113107681,
0.45690804719924927,
-0.1455078423023224,
-0.02631291374564171,
0.2439652532339096,
0.3559235632419586,
0.005760703235864639,
-0.1592099368572235,
-0.3320910632610321,
-0.3904716372489929,
0.40063121914863586,
0.03301897272467613,
-0.23185162246227264,
0.23674964904785156,
-0.24372535943984985,
-0.1560375839471817,
-0.16547948122024536,
0.06785911321640015,
0.036890722811222076,
0.09785151481628418,
0.2811528444290161,
0.08527645468711853,
-0.008334344252943993,
0.03669160604476929,
0.20495948195457458,
-0.11603394150733948,
-0.1506892293691635,
0.09089115262031555,
-0.07816159725189209,
-0.1472303569316864,
-0.17592661082744598,
0.08062304556369781,
0.26898983120918274,
-0.009072834625840187,
0.11059244722127914,
-0.30576571822166443,
0.18404266238212585,
-0.20616307854652405,
0.028248464688658714,
0.22767724096775055,
0.21508431434631348,
-0.21185244619846344,
-0.40966877341270447,
0.3326396942138672,
-0.12602877616882324,
0.08509425818920135,
0.3867059350013733,
-0.24034728109836578,
-0.3442721366882324,
0.5024795532226562,
0.4321822226047516,
0.7307050228118896,
0.18443211913108826,
0.09520459175109863,
0.7169745564460754,
-0.02315870299935341,
0.6993008255958557,
-0.10370786488056183,
0.41096049547195435,
-0.4451063573360443,
-0.2860540449619293,
-0.046400465071201324,
-0.08398619294166565,
0.13445517420768738,
-0.338070273399353,
-0.28679633140563965,
0.12203896790742874,
-0.2664525508880615,
0.6795720458030701,
0.18808750808238983,
-0.2604108452796936,
0.18309825658798218,
-0.17585505545139313,
-0.5231517553329468,
0.05170615762472153,
-0.2250453680753708,
0.090544193983078,
-0.03223688155412674,
-0.2512684464454651,
-0.02041344717144966,
-0.08976083993911743,
0.09673063457012177,
0.13579818606376648,
-0.026400137692689896,
0.31396806240081787,
-0.0023805834352970123,
-0.4051858186721802,
0.11523212492465973,
0.11728981137275696,
0.29914236068725586,
0.40915241837501526,
0.05344369262456894,
-0.30661603808403015,
0.2917037010192871,
0.2551499903202057,
0.2743939757347107,
-0.04799065366387367,
0.21777084469795227,
0.22269582748413086,
-0.07819359749555588,
-0.03898932784795761,
0.21107301115989685,
0.2847232222557068,
-0.5404788255691528,
-0.07159267365932465,
-0.10032413899898529,
-0.5148371458053589,
-0.2767106592655182,
-0.2711356282234192,
0.1341780573129654,
-0.11004884541034698,
0.11929383873939514,
0.010615598410367966,
-0.2521549165248871,
0.4386938810348511,
0.004709966480731964,
-0.3241708278656006,
-0.1577308624982834,
0.25439125299453735,
0.10359043627977371,
-0.14188557863235474,
0.39548131823539734,
0.12317147850990295,
-0.3206825852394104,
-0.0323261059820652,
0.0648040845990181,
-0.07902119308710098,
-0.12969224154949188,
0.2723417580127716,
0.06640073657035828,
0.16467227041721344,
-0.24520307779312134,
-0.2958568036556244,
-0.1801092028617859,
0.0875241756439209,
-0.33371502161026,
-0.18719443678855896,
-0.01779516413807869,
-0.028193555772304535,
0.03364928439259529,
0.09985151886940002,
-0.02618296816945076,
-0.039158791303634644,
-0.2889397144317627,
-0.31229642033576965,
-0.2581632435321808,
-0.27343299984931946,
0.05263388901948929,
0.13591504096984863,
-0.09398671984672546,
-0.019878625869750977,
-0.21024063229560852,
-0.22653958201408386,
0.17268332839012146,
0.08614002168178558,
-0.14657087624073029,
-0.15443384647369385,
-0.033493489027023315,
0.11702485382556915,
-0.016894321888685226,
-0.37265193462371826,
0.03651238605380058,
0.1338893473148346,
-0.1707049012184143,
-0.21403785049915314,
0.1639729142189026,
0.14115315675735474,
0.035183385014534,
0.15294702351093292,
-0.08290630578994751,
0.2915264666080475,
0.1455330103635788,
0.007922405377030373,
-0.20121228694915771,
0.053967710584402084,
0.2531953752040863,
0.14744244515895844,
0.0888916552066803,
0.153603196144104,
-0.12798121571540833,
0.08545805513858795,
-0.14855581521987915,
0.13146159052848816,
0.4354933798313141,
-0.33341771364212036,
0.049891334027051926,
0.040589362382888794,
0.27430611848831177,
0.2675049901008606,
-0.38484570384025574,
-0.2557361423969269,
0.057178400456905365,
0.17968930304050446,
0.08079667389392853,
-0.057099342346191406,
0.49798327684402466,
0.3007374703884125,
-0.04355704411864281,
0.38421162962913513,
0.03313470259308815,
-0.05871395021677017,
-0.24107836186885834,
0.07994502037763596,
0.1146407201886177,
-0.18770718574523926,
0.3146584630012512,
0.7829314470291138,
0.030307356268167496,
0.018395930528640747,
0.022444631904363632,
-0.0692320466041565,
-0.0389486625790596,
0.18613949418067932,
0.18543294072151184,
0.24151688814163208,
0.29878783226013184,
-0.16087380051612854,
-0.14345663785934448,
-0.11297410726547241,
-0.2413642853498459,
0.1994004100561142,
-0.28661322593688965,
0.5658049583435059,
0.13620413839817047,
0.0380193293094635,
-0.4452711045742035,
-0.08038946986198425,
-0.2143814116716385,
0.03752100467681885,
-0.4529602527618408,
0.14074978232383728,
-0.006520433351397514,
0.03984876722097397,
-0.20045244693756104,
0.08343522250652313,
-0.2725495398044586,
0.07312937080860138,
0.042857445776462555,
0.15889659523963928,
-0.08723734319210052,
-0.0481923371553421,
0.2371426820755005,
0.10124494135379791,
0.2498708963394165,
-0.10691656172275543,
-0.0674716979265213,
0.3865653872489929,
0.09150315821170807,
-0.14542138576507568,
-0.05510881543159485,
0.27586960792541504,
0.6177332401275635,
-0.04567347839474678,
-0.06719356030225754,
-0.10213853418827057,
-0.08379292488098145,
0.08901912719011307,
0.262290358543396,
-0.05804002285003662,
-0.08907616138458252,
-0.0629318505525589,
0.15302352607250214,
-0.16242104768753052,
0.09774459898471832,
-0.08159786462783813,
0.25854581594467163,
-0.2866900861263275,
0.38327673077583313,
-0.12180745601654053,
-0.19208601117134094,
-0.08630562573671341,
-0.34347251057624817,
-0.062275566160678864,
-0.14492695033550262,
0.6067264080047607,
0.5737983584403992,
0.08965405821800232,
-0.015563995577394962,
0.04584934562444687,
-0.1593083143234253,
0.11178941279649734,
-0.13097769021987915,
-0.2677588164806366,
0.02734541893005371,
0.17095576226711273,
-0.2267080545425415,
0.15135693550109863,
0.33264297246932983,
-0.30999138951301575,
0.05313817039132118,
-0.01945139653980732,
0.07457497715950012,
0.052974432706832886,
-0.029099449515342712,
-0.0229388028383255,
0.4951131343841553,
0.15079326927661896,
-0.08291133493185043,
-0.19391243159770966,
-0.40169447660446167,
-0.06588386744260788,
-0.11119785904884338,
-0.33047375082969666,
0.2667972147464752,
-0.17961156368255615,
0.11254199594259262,
-0.16805478930473328,
0.17126990854740143,
-0.2835308611392975,
0.02523089200258255,
0.1856212019920349,
0.4099312722682953,
0.14531996846199036,
0.03864581137895584,
-0.22367319464683533,
-0.17643073201179504,
0.010659918189048767,
-0.23728755116462708,
0.28080037236213684,
-0.3789074420928955,
0.4946005642414093,
0.017529446631669998,
0.040532540529966354,
-0.3669935464859009,
0.39116090536117554,
0.001748785376548767,
-0.11669550836086273,
-0.0956469476222992,
0.15102341771125793,
-0.36021938920021057,
0.0048865885473787785,
0.21850959956645966,
0.099675253033638,
0.15540941059589386,
0.34668904542922974,
-0.09796872735023499,
-0.48147717118263245,
0.47677284479141235,
-0.3814901113510132,
-0.27774912118911743,
-0.13525331020355225,
0.148630291223526,
-0.07086648792028427,
-0.13644817471504211,
-0.5332998037338257,
-0.08449841290712357,
0.1973572075366974,
-0.18259301781654358,
-0.13010410964488983,
0.25621992349624634,
0.04519832134246826,
0.008136224001646042,
-0.12021878361701965,
0.30836981534957886,
-0.025906506925821304,
-0.02033541165292263,
0.16722485423088074,
-0.08359858393669128
] |
https://github.com/huggingface/datasets/issues/5517 | `with_format("numpy")` silently downcasts float64 to float32 features | Unfortunately removing it for integers is a breaking change for most `transformers` + `datasets` users for NLP (which is a common case). Removing it for floats is a breaking change for `transformers` + `datasets` for ASR as well. And it also is a breaking change for the other users relying on this behavior.
Therefore I think that the only short term solution is for the user to provide `dtype=` manually and document better this behavior. We could also extend `dtype` to accept a value that means "return the same dtype as the underlying storage" and make it easier to do zero copy. | ### Describe the bug
When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`.
### Steps to reproduce the bug
```python
import datasets
dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy")
print("feature dtype:", dataset.features['a'].dtype)
print("array dtype:", dataset['a'].dtype)
```
output:
```
feature dtype: float64
array dtype: float32
```
### Expected behavior
```
feature dtype: float64
array dtype: float64
```
### Environment info
- `datasets` version: 2.8.0
- Platform: Linux-5.4.0-135-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.4.4
### Suggested Fix
Changing [the `_tensorize` function of the numpy formatter](https://github.com/huggingface/datasets/blob/b065547654efa0ec633cf373ac1512884c68b2e1/src/datasets/formatting/np_formatter.py#L32) to
```python
def _tensorize(self, value):
if isinstance(value, (str, bytes, type(None))):
return value
elif isinstance(value, (np.character, np.ndarray)) and np.issubdtype(value.dtype, np.character):
return value
elif isinstance(value, np.number):
return value
return np.asarray(value, **self.np_array_kwargs)
```
fixes this particular issue for me. Not sure if this would break other tests. This should also avoid unnecessary copying of the array.
| 102 | `with_format("numpy")` silently downcasts float64 to float32 features
### Describe the bug
When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`.
### Steps to reproduce the bug
```python
import datasets
dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy")
print("feature dtype:", dataset.features['a'].dtype)
print("array dtype:", dataset['a'].dtype)
```
output:
```
feature dtype: float64
array dtype: float32
```
### Expected behavior
```
feature dtype: float64
array dtype: float64
```
### Environment info
- `datasets` version: 2.8.0
- Platform: Linux-5.4.0-135-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.4.4
### Suggested Fix
Changing [the `_tensorize` function of the numpy formatter](https://github.com/huggingface/datasets/blob/b065547654efa0ec633cf373ac1512884c68b2e1/src/datasets/formatting/np_formatter.py#L32) to
```python
def _tensorize(self, value):
if isinstance(value, (str, bytes, type(None))):
return value
elif isinstance(value, (np.character, np.ndarray)) and np.issubdtype(value.dtype, np.character):
return value
elif isinstance(value, np.number):
return value
return np.asarray(value, **self.np_array_kwargs)
```
fixes this particular issue for me. Not sure if this would break other tests. This should also avoid unnecessary copying of the array.
Unfortunately removing it for integers is a breaking change for most `transformers` + `datasets` users for NLP (which is a common case). Removing it for floats is a breaking change for `transformers` + `datasets` for ASR as well. And it also is a breaking change for the other users relying on this behavior.
Therefore I think that the only short term solution is for the user to provide `dtype=` manually and document better this behavior. We could also extend `dtype` to accept a value that means "return the same dtype as the underlying storage" and make it easier to do zero copy. | [
0.14177078008651733,
-0.24984367191791534,
0.000774633139371872,
0.0026635415852069855,
0.5696965456008911,
0.0561448410153389,
0.6134842038154602,
0.5261093378067017,
-0.16041861474514008,
-0.05886185169219971,
-0.13229535520076752,
0.6590015888214111,
-0.024173695594072342,
-0.055850546807050705,
-0.0898173376917839,
-0.09573148190975189,
0.19167107343673706,
0.36848190426826477,
-0.1873778998851776,
-0.08108260482549667,
-0.23802180588245392,
-0.2345665842294693,
-0.08685125410556793,
-0.115273118019104,
0.04147911071777344,
0.13877277076244354,
0.1588970422744751,
-0.2952386438846588,
-0.35430777072906494,
-0.21976175904273987,
0.17852190136909485,
-0.1553322821855545,
0.10645264387130737,
0.2438211739063263,
-0.0001166464644484222,
-0.02281355857849121,
0.08414025604724884,
-0.08400937914848328,
-0.23688678443431854,
0.33728793263435364,
0.15402573347091675,
-0.5218885540962219,
0.11003046482801437,
-0.31812769174575806,
-0.14374025166034698,
-0.4370628595352173,
-0.3288455307483673,
-0.3330014944076538,
0.12816524505615234,
-0.0955711379647255,
0.19108319282531738,
0.48318222165107727,
0.14118702709674835,
0.29137617349624634,
-0.4448983371257782,
0.29345792531967163,
-0.31258758902549744,
0.0738760232925415,
-0.301182359457016,
0.273569792509079,
0.1048036739230156,
0.3836762607097626,
-0.2931397259235382,
0.10119502246379852,
-0.00950537621974945,
0.12337784469127655,
0.28796064853668213,
-0.2609037458896637,
-0.09919553250074387,
0.13078156113624573,
0.3381490707397461,
-0.022355571389198303,
-0.3329734206199646,
-0.2674660384654999,
-0.12008658051490784,
-0.2960910499095917,
-0.08011550456285477,
0.17440173029899597,
0.028630852699279785,
0.05780795216560364,
-0.3742605745792389,
0.3191636800765991,
-0.08523911237716675,
0.21660591661930084,
0.019349433481693268,
0.22214846312999725,
-0.12840941548347473,
0.03873099386692047,
-0.46418362855911255,
-0.11483639478683472,
-0.057465579360723495,
-0.3399850130081177,
0.1099044531583786,
0.19607682526111603,
0.0805511474609375,
-0.31794920563697815,
0.33674243092536926,
-0.5577793121337891,
0.024656500667333603,
-0.22734667360782623,
-0.0029758578166365623,
0.3014673888683319,
-0.3438105583190918,
0.03839642554521561,
0.03598916903138161,
0.3496714234352112,
0.010740682482719421,
-0.03237667307257652,
0.22094452381134033,
0.21561606228351593,
0.448309063911438,
0.03775426372885704,
0.3862801790237427,
0.16529054939746857,
0.11328066885471344,
-0.02615904062986374,
0.482272207736969,
-0.22848306596279144,
-0.37862685322761536,
0.26312050223350525,
-0.3443557620048523,
0.07116350531578064,
0.020232656970620155,
0.025952007621526718,
-0.0595310777425766,
0.4846922755241394,
0.04862983524799347,
0.17409051954746246,
-0.2399595081806183,
-0.03258636221289635,
-0.19234873354434967,
-0.24789445102214813,
-0.1684461534023285,
-0.12529093027114868,
0.12297172844409943,
0.3188713788986206,
0.05905483663082123,
0.5129324793815613,
0.030423425137996674,
-0.22497598826885223,
0.05005607008934021,
-0.012772160582244396,
0.5335593223571777,
0.017126090824604034,
-0.43277454376220703,
0.3429165184497833,
0.29663321375846863,
-0.233347088098526,
-0.1042582243680954,
0.050958722829818726,
0.03980989754199982,
0.1377754807472229,
-0.3912065625190735,
0.19081571698188782,
-0.2958465814590454,
0.3621065020561218,
0.2892390787601471,
0.10355809330940247,
0.408719539642334,
-0.07775391638278961,
0.2351023554801941,
-0.4885823130607605,
-0.21119140088558197,
-0.35935577750205994,
0.442503422498703,
0.25058290362358093,
-0.37392354011535645,
0.10276424884796143,
0.4249876141548157,
0.09905529022216797,
0.47119471430778503,
0.15340320765972137,
0.10159412771463394,
-0.08906867355108261,
-0.19534000754356384,
-0.1690911054611206,
0.1824798882007599,
0.3884349465370178,
-0.22312237322330475,
0.014580398797988892,
-0.22743095457553864,
0.4001566767692566,
-0.1761632263660431,
0.19206295907497406,
-0.05699025094509125,
-0.09383387118577957,
-0.044567711651325226,
0.46422070264816284,
-0.0621139258146286,
0.16311419010162354,
-0.4260692298412323,
-0.15895642340183258,
0.326113224029541,
-0.04248140752315521,
-0.17545923590660095,
0.13407015800476074,
-0.0790473148226738,
0.05510125309228897,
0.3086705207824707,
-0.22969645261764526,
0.03570643067359924,
-0.2841407060623169,
0.44516056776046753,
0.030277080833911896,
0.09864893555641174,
0.09511732310056686,
-0.11758985370397568,
-0.03349681198596954,
0.33172401785850525,
0.010560065507888794,
-0.1749689131975174,
-0.19885586202144623,
-0.013105013407766819,
-0.0670318678021431,
-0.2619432806968689,
-0.17561075091362,
0.15882918238639832,
0.17338688671588898,
-0.08907944709062576,
0.30908268690109253,
-0.003730040043592453,
-0.10699750483036041,
0.016488289460539818,
0.0875212699174881,
-0.3464054763317108,
0.34655383229255676,
0.16837844252586365,
-0.28817468881607056,
-0.21669206023216248,
0.3719768524169922,
0.10448767244815826,
0.024191951379179955,
-0.19916880130767822,
0.15368404984474182,
-0.11736946552991867,
-0.12331914901733398,
-0.5844514966011047,
0.10993069410324097,
0.36117950081825256,
0.158380925655365,
0.2550024390220642,
0.5036296248435974,
0.11218855530023575,
-0.03440766781568527,
0.06214237958192825,
0.5594333410263062,
-0.18953436613082886,
0.022655494511127472,
-0.3018747568130493,
0.011687850579619408,
0.3107447028160095,
0.16395223140716553,
-0.16798870265483856,
-0.4434167444705963,
0.03712131455540657,
-0.022674202919006348,
-0.1656906008720398,
0.023112589493393898,
-0.4027048349380493,
0.34867551922798157,
0.28996482491493225,
-0.07821313291788101,
0.17961490154266357,
-0.0785859152674675,
-0.10272007435560226,
-0.1015440821647644,
0.22542288899421692,
-0.2952028512954712,
0.5789228677749634,
-0.03668339550495148,
-0.14496980607509613,
0.05437943711876869,
-0.026164434850215912,
-0.15568146109580994,
0.06167911738157272,
0.1211366355419159,
-0.06432566791772842,
0.11960962414741516,
0.24179601669311523,
0.03792747110128403,
-0.220016211271286,
0.29676324129104614,
-0.20568890869617462,
-0.11610236763954163,
-0.18921685218811035,
0.170144185423851,
-0.3475115895271301,
-0.011981168761849403,
-0.459431916475296,
-0.11035853624343872,
0.15138062834739685,
-0.09737793356180191,
-0.16793930530548096,
0.08473162353038788,
-0.2180066704750061,
0.10587573796510696,
-0.23040588200092316,
0.1284940391778946,
0.3007718324661255,
-0.038847386837005615,
-0.07833181321620941,
0.2827419340610504,
-0.1395007073879242,
-0.037971775978803635,
-0.11027470976114273,
-0.19640982151031494,
0.263609379529953,
0.2883650064468384,
-0.1961321234703064,
-0.1641438901424408,
-0.6332255601882935,
-0.11944152414798737,
-0.1341811865568161,
0.32877057790756226,
0.11765081435441971,
0.27563074231147766,
-0.15206806361675262,
-0.1166420429944992,
0.3145628869533539,
-0.015786170959472656,
0.17096300423145294,
0.18366959691047668,
0.13498282432556152,
-0.015545099042356014,
-0.5056920647621155,
-0.2204398214817047,
-0.09644326567649841,
-0.0626140907406807,
0.08665967732667923,
-0.21603132784366608,
0.02643602341413498,
0.04877009615302086,
-0.05383286252617836,
0.02739790827035904,
-0.24163490533828735,
0.04155478626489639,
-0.23594196140766144,
0.28192320466041565,
0.43028080463409424,
-0.06765486299991608,
-0.1318305879831314,
-0.16263237595558167,
-0.00796373002231121,
-0.35268425941467285,
-0.008451970294117928,
-0.059105485677719116,
-0.32497432827949524,
-0.20902518928050995,
0.2126208245754242,
-0.07352001219987869,
0.033843033015728,
-0.007720984518527985,
0.2844255268573761,
0.08240760117769241,
-0.10622656345367432,
-0.043578580021858215,
-0.028261028230190277,
0.08356566727161407,
0.1370989978313446,
-0.0031638499349355698,
0.3392145335674286,
0.06841930747032166,
-0.1338053196668625,
0.20237115025520325,
-0.3853635787963867,
0.18205255270004272,
0.14959716796875,
0.35083043575286865,
-0.17073947191238403,
-0.2915019690990448,
0.27154290676116943,
0.09857891499996185,
-0.1893194615840912,
0.12757858633995056,
-0.03816017508506775,
-0.2583358585834503,
0.12821795046329498,
0.25577250123023987,
0.1622960865497589,
-0.20246407389640808,
0.021912284195423126,
0.3147258162498474,
-0.0438629612326622,
0.07844042778015137,
0.5103879570960999,
-0.006447387859225273,
-0.3256703317165375,
-0.15435418486595154,
0.10719401389360428,
0.002452440559864044,
0.15893308818340302,
-0.24833530187606812,
-0.2655872404575348,
-0.2230769693851471,
0.12506654858589172,
0.08907152712345123,
0.7836353778839111,
0.162702739238739,
-0.27146637439727783,
0.10483947396278381,
0.38588374853134155,
0.2703321576118469,
0.08316407352685928,
-0.06095069646835327,
-0.015342682600021362,
0.056465938687324524,
-0.24661774933338165,
-0.471305251121521,
-0.24809110164642334,
0.16621437668800354,
0.03412298113107681,
0.45690804719924927,
-0.1455078423023224,
-0.02631291374564171,
0.2439652532339096,
0.3559235632419586,
0.005760703235864639,
-0.1592099368572235,
-0.3320910632610321,
-0.3904716372489929,
0.40063121914863586,
0.03301897272467613,
-0.23185162246227264,
0.23674964904785156,
-0.24372535943984985,
-0.1560375839471817,
-0.16547948122024536,
0.06785911321640015,
0.036890722811222076,
0.09785151481628418,
0.2811528444290161,
0.08527645468711853,
-0.008334344252943993,
0.03669160604476929,
0.20495948195457458,
-0.11603394150733948,
-0.1506892293691635,
0.09089115262031555,
-0.07816159725189209,
-0.1472303569316864,
-0.17592661082744598,
0.08062304556369781,
0.26898983120918274,
-0.009072834625840187,
0.11059244722127914,
-0.30576571822166443,
0.18404266238212585,
-0.20616307854652405,
0.028248464688658714,
0.22767724096775055,
0.21508431434631348,
-0.21185244619846344,
-0.40966877341270447,
0.3326396942138672,
-0.12602877616882324,
0.08509425818920135,
0.3867059350013733,
-0.24034728109836578,
-0.3442721366882324,
0.5024795532226562,
0.4321822226047516,
0.7307050228118896,
0.18443211913108826,
0.09520459175109863,
0.7169745564460754,
-0.02315870299935341,
0.6993008255958557,
-0.10370786488056183,
0.41096049547195435,
-0.4451063573360443,
-0.2860540449619293,
-0.046400465071201324,
-0.08398619294166565,
0.13445517420768738,
-0.338070273399353,
-0.28679633140563965,
0.12203896790742874,
-0.2664525508880615,
0.6795720458030701,
0.18808750808238983,
-0.2604108452796936,
0.18309825658798218,
-0.17585505545139313,
-0.5231517553329468,
0.05170615762472153,
-0.2250453680753708,
0.090544193983078,
-0.03223688155412674,
-0.2512684464454651,
-0.02041344717144966,
-0.08976083993911743,
0.09673063457012177,
0.13579818606376648,
-0.026400137692689896,
0.31396806240081787,
-0.0023805834352970123,
-0.4051858186721802,
0.11523212492465973,
0.11728981137275696,
0.29914236068725586,
0.40915241837501526,
0.05344369262456894,
-0.30661603808403015,
0.2917037010192871,
0.2551499903202057,
0.2743939757347107,
-0.04799065366387367,
0.21777084469795227,
0.22269582748413086,
-0.07819359749555588,
-0.03898932784795761,
0.21107301115989685,
0.2847232222557068,
-0.5404788255691528,
-0.07159267365932465,
-0.10032413899898529,
-0.5148371458053589,
-0.2767106592655182,
-0.2711356282234192,
0.1341780573129654,
-0.11004884541034698,
0.11929383873939514,
0.010615598410367966,
-0.2521549165248871,
0.4386938810348511,
0.004709966480731964,
-0.3241708278656006,
-0.1577308624982834,
0.25439125299453735,
0.10359043627977371,
-0.14188557863235474,
0.39548131823539734,
0.12317147850990295,
-0.3206825852394104,
-0.0323261059820652,
0.0648040845990181,
-0.07902119308710098,
-0.12969224154949188,
0.2723417580127716,
0.06640073657035828,
0.16467227041721344,
-0.24520307779312134,
-0.2958568036556244,
-0.1801092028617859,
0.0875241756439209,
-0.33371502161026,
-0.18719443678855896,
-0.01779516413807869,
-0.028193555772304535,
0.03364928439259529,
0.09985151886940002,
-0.02618296816945076,
-0.039158791303634644,
-0.2889397144317627,
-0.31229642033576965,
-0.2581632435321808,
-0.27343299984931946,
0.05263388901948929,
0.13591504096984863,
-0.09398671984672546,
-0.019878625869750977,
-0.21024063229560852,
-0.22653958201408386,
0.17268332839012146,
0.08614002168178558,
-0.14657087624073029,
-0.15443384647369385,
-0.033493489027023315,
0.11702485382556915,
-0.016894321888685226,
-0.37265193462371826,
0.03651238605380058,
0.1338893473148346,
-0.1707049012184143,
-0.21403785049915314,
0.1639729142189026,
0.14115315675735474,
0.035183385014534,
0.15294702351093292,
-0.08290630578994751,
0.2915264666080475,
0.1455330103635788,
0.007922405377030373,
-0.20121228694915771,
0.053967710584402084,
0.2531953752040863,
0.14744244515895844,
0.0888916552066803,
0.153603196144104,
-0.12798121571540833,
0.08545805513858795,
-0.14855581521987915,
0.13146159052848816,
0.4354933798313141,
-0.33341771364212036,
0.049891334027051926,
0.040589362382888794,
0.27430611848831177,
0.2675049901008606,
-0.38484570384025574,
-0.2557361423969269,
0.057178400456905365,
0.17968930304050446,
0.08079667389392853,
-0.057099342346191406,
0.49798327684402466,
0.3007374703884125,
-0.04355704411864281,
0.38421162962913513,
0.03313470259308815,
-0.05871395021677017,
-0.24107836186885834,
0.07994502037763596,
0.1146407201886177,
-0.18770718574523926,
0.3146584630012512,
0.7829314470291138,
0.030307356268167496,
0.018395930528640747,
0.022444631904363632,
-0.0692320466041565,
-0.0389486625790596,
0.18613949418067932,
0.18543294072151184,
0.24151688814163208,
0.29878783226013184,
-0.16087380051612854,
-0.14345663785934448,
-0.11297410726547241,
-0.2413642853498459,
0.1994004100561142,
-0.28661322593688965,
0.5658049583435059,
0.13620413839817047,
0.0380193293094635,
-0.4452711045742035,
-0.08038946986198425,
-0.2143814116716385,
0.03752100467681885,
-0.4529602527618408,
0.14074978232383728,
-0.006520433351397514,
0.03984876722097397,
-0.20045244693756104,
0.08343522250652313,
-0.2725495398044586,
0.07312937080860138,
0.042857445776462555,
0.15889659523963928,
-0.08723734319210052,
-0.0481923371553421,
0.2371426820755005,
0.10124494135379791,
0.2498708963394165,
-0.10691656172275543,
-0.0674716979265213,
0.3865653872489929,
0.09150315821170807,
-0.14542138576507568,
-0.05510881543159485,
0.27586960792541504,
0.6177332401275635,
-0.04567347839474678,
-0.06719356030225754,
-0.10213853418827057,
-0.08379292488098145,
0.08901912719011307,
0.262290358543396,
-0.05804002285003662,
-0.08907616138458252,
-0.0629318505525589,
0.15302352607250214,
-0.16242104768753052,
0.09774459898471832,
-0.08159786462783813,
0.25854581594467163,
-0.2866900861263275,
0.38327673077583313,
-0.12180745601654053,
-0.19208601117134094,
-0.08630562573671341,
-0.34347251057624817,
-0.062275566160678864,
-0.14492695033550262,
0.6067264080047607,
0.5737983584403992,
0.08965405821800232,
-0.015563995577394962,
0.04584934562444687,
-0.1593083143234253,
0.11178941279649734,
-0.13097769021987915,
-0.2677588164806366,
0.02734541893005371,
0.17095576226711273,
-0.2267080545425415,
0.15135693550109863,
0.33264297246932983,
-0.30999138951301575,
0.05313817039132118,
-0.01945139653980732,
0.07457497715950012,
0.052974432706832886,
-0.029099449515342712,
-0.0229388028383255,
0.4951131343841553,
0.15079326927661896,
-0.08291133493185043,
-0.19391243159770966,
-0.40169447660446167,
-0.06588386744260788,
-0.11119785904884338,
-0.33047375082969666,
0.2667972147464752,
-0.17961156368255615,
0.11254199594259262,
-0.16805478930473328,
0.17126990854740143,
-0.2835308611392975,
0.02523089200258255,
0.1856212019920349,
0.4099312722682953,
0.14531996846199036,
0.03864581137895584,
-0.22367319464683533,
-0.17643073201179504,
0.010659918189048767,
-0.23728755116462708,
0.28080037236213684,
-0.3789074420928955,
0.4946005642414093,
0.017529446631669998,
0.040532540529966354,
-0.3669935464859009,
0.39116090536117554,
0.001748785376548767,
-0.11669550836086273,
-0.0956469476222992,
0.15102341771125793,
-0.36021938920021057,
0.0048865885473787785,
0.21850959956645966,
0.099675253033638,
0.15540941059589386,
0.34668904542922974,
-0.09796872735023499,
-0.48147717118263245,
0.47677284479141235,
-0.3814901113510132,
-0.27774912118911743,
-0.13525331020355225,
0.148630291223526,
-0.07086648792028427,
-0.13644817471504211,
-0.5332998037338257,
-0.08449841290712357,
0.1973572075366974,
-0.18259301781654358,
-0.13010410964488983,
0.25621992349624634,
0.04519832134246826,
0.008136224001646042,
-0.12021878361701965,
0.30836981534957886,
-0.025906506925821304,
-0.02033541165292263,
0.16722485423088074,
-0.08359858393669128
] |
https://github.com/huggingface/datasets/issues/5517 | `with_format("numpy")` silently downcasts float64 to float32 features | @lhoestq It should be fine to remove this conversion in Datasets 3.0, no? For now, we can warn the user (with a log message) about the future change when the default type is changed. | ### Describe the bug
When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`.
### Steps to reproduce the bug
```python
import datasets
dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy")
print("feature dtype:", dataset.features['a'].dtype)
print("array dtype:", dataset['a'].dtype)
```
output:
```
feature dtype: float64
array dtype: float32
```
### Expected behavior
```
feature dtype: float64
array dtype: float64
```
### Environment info
- `datasets` version: 2.8.0
- Platform: Linux-5.4.0-135-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.4.4
### Suggested Fix
Changing [the `_tensorize` function of the numpy formatter](https://github.com/huggingface/datasets/blob/b065547654efa0ec633cf373ac1512884c68b2e1/src/datasets/formatting/np_formatter.py#L32) to
```python
def _tensorize(self, value):
if isinstance(value, (str, bytes, type(None))):
return value
elif isinstance(value, (np.character, np.ndarray)) and np.issubdtype(value.dtype, np.character):
return value
elif isinstance(value, np.number):
return value
return np.asarray(value, **self.np_array_kwargs)
```
fixes this particular issue for me. Not sure if this would break other tests. This should also avoid unnecessary copying of the array.
| 34 | `with_format("numpy")` silently downcasts float64 to float32 features
### Describe the bug
When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`.
### Steps to reproduce the bug
```python
import datasets
dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy")
print("feature dtype:", dataset.features['a'].dtype)
print("array dtype:", dataset['a'].dtype)
```
output:
```
feature dtype: float64
array dtype: float32
```
### Expected behavior
```
feature dtype: float64
array dtype: float64
```
### Environment info
- `datasets` version: 2.8.0
- Platform: Linux-5.4.0-135-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.4.4
### Suggested Fix
Changing [the `_tensorize` function of the numpy formatter](https://github.com/huggingface/datasets/blob/b065547654efa0ec633cf373ac1512884c68b2e1/src/datasets/formatting/np_formatter.py#L32) to
```python
def _tensorize(self, value):
if isinstance(value, (str, bytes, type(None))):
return value
elif isinstance(value, (np.character, np.ndarray)) and np.issubdtype(value.dtype, np.character):
return value
elif isinstance(value, np.number):
return value
return np.asarray(value, **self.np_array_kwargs)
```
fixes this particular issue for me. Not sure if this would break other tests. This should also avoid unnecessary copying of the array.
@lhoestq It should be fine to remove this conversion in Datasets 3.0, no? For now, we can warn the user (with a log message) about the future change when the default type is changed. | [
0.14177078008651733,
-0.24984367191791534,
0.000774633139371872,
0.0026635415852069855,
0.5696965456008911,
0.0561448410153389,
0.6134842038154602,
0.5261093378067017,
-0.16041861474514008,
-0.05886185169219971,
-0.13229535520076752,
0.6590015888214111,
-0.024173695594072342,
-0.055850546807050705,
-0.0898173376917839,
-0.09573148190975189,
0.19167107343673706,
0.36848190426826477,
-0.1873778998851776,
-0.08108260482549667,
-0.23802180588245392,
-0.2345665842294693,
-0.08685125410556793,
-0.115273118019104,
0.04147911071777344,
0.13877277076244354,
0.1588970422744751,
-0.2952386438846588,
-0.35430777072906494,
-0.21976175904273987,
0.17852190136909485,
-0.1553322821855545,
0.10645264387130737,
0.2438211739063263,
-0.0001166464644484222,
-0.02281355857849121,
0.08414025604724884,
-0.08400937914848328,
-0.23688678443431854,
0.33728793263435364,
0.15402573347091675,
-0.5218885540962219,
0.11003046482801437,
-0.31812769174575806,
-0.14374025166034698,
-0.4370628595352173,
-0.3288455307483673,
-0.3330014944076538,
0.12816524505615234,
-0.0955711379647255,
0.19108319282531738,
0.48318222165107727,
0.14118702709674835,
0.29137617349624634,
-0.4448983371257782,
0.29345792531967163,
-0.31258758902549744,
0.0738760232925415,
-0.301182359457016,
0.273569792509079,
0.1048036739230156,
0.3836762607097626,
-0.2931397259235382,
0.10119502246379852,
-0.00950537621974945,
0.12337784469127655,
0.28796064853668213,
-0.2609037458896637,
-0.09919553250074387,
0.13078156113624573,
0.3381490707397461,
-0.022355571389198303,
-0.3329734206199646,
-0.2674660384654999,
-0.12008658051490784,
-0.2960910499095917,
-0.08011550456285477,
0.17440173029899597,
0.028630852699279785,
0.05780795216560364,
-0.3742605745792389,
0.3191636800765991,
-0.08523911237716675,
0.21660591661930084,
0.019349433481693268,
0.22214846312999725,
-0.12840941548347473,
0.03873099386692047,
-0.46418362855911255,
-0.11483639478683472,
-0.057465579360723495,
-0.3399850130081177,
0.1099044531583786,
0.19607682526111603,
0.0805511474609375,
-0.31794920563697815,
0.33674243092536926,
-0.5577793121337891,
0.024656500667333603,
-0.22734667360782623,
-0.0029758578166365623,
0.3014673888683319,
-0.3438105583190918,
0.03839642554521561,
0.03598916903138161,
0.3496714234352112,
0.010740682482719421,
-0.03237667307257652,
0.22094452381134033,
0.21561606228351593,
0.448309063911438,
0.03775426372885704,
0.3862801790237427,
0.16529054939746857,
0.11328066885471344,
-0.02615904062986374,
0.482272207736969,
-0.22848306596279144,
-0.37862685322761536,
0.26312050223350525,
-0.3443557620048523,
0.07116350531578064,
0.020232656970620155,
0.025952007621526718,
-0.0595310777425766,
0.4846922755241394,
0.04862983524799347,
0.17409051954746246,
-0.2399595081806183,
-0.03258636221289635,
-0.19234873354434967,
-0.24789445102214813,
-0.1684461534023285,
-0.12529093027114868,
0.12297172844409943,
0.3188713788986206,
0.05905483663082123,
0.5129324793815613,
0.030423425137996674,
-0.22497598826885223,
0.05005607008934021,
-0.012772160582244396,
0.5335593223571777,
0.017126090824604034,
-0.43277454376220703,
0.3429165184497833,
0.29663321375846863,
-0.233347088098526,
-0.1042582243680954,
0.050958722829818726,
0.03980989754199982,
0.1377754807472229,
-0.3912065625190735,
0.19081571698188782,
-0.2958465814590454,
0.3621065020561218,
0.2892390787601471,
0.10355809330940247,
0.408719539642334,
-0.07775391638278961,
0.2351023554801941,
-0.4885823130607605,
-0.21119140088558197,
-0.35935577750205994,
0.442503422498703,
0.25058290362358093,
-0.37392354011535645,
0.10276424884796143,
0.4249876141548157,
0.09905529022216797,
0.47119471430778503,
0.15340320765972137,
0.10159412771463394,
-0.08906867355108261,
-0.19534000754356384,
-0.1690911054611206,
0.1824798882007599,
0.3884349465370178,
-0.22312237322330475,
0.014580398797988892,
-0.22743095457553864,
0.4001566767692566,
-0.1761632263660431,
0.19206295907497406,
-0.05699025094509125,
-0.09383387118577957,
-0.044567711651325226,
0.46422070264816284,
-0.0621139258146286,
0.16311419010162354,
-0.4260692298412323,
-0.15895642340183258,
0.326113224029541,
-0.04248140752315521,
-0.17545923590660095,
0.13407015800476074,
-0.0790473148226738,
0.05510125309228897,
0.3086705207824707,
-0.22969645261764526,
0.03570643067359924,
-0.2841407060623169,
0.44516056776046753,
0.030277080833911896,
0.09864893555641174,
0.09511732310056686,
-0.11758985370397568,
-0.03349681198596954,
0.33172401785850525,
0.010560065507888794,
-0.1749689131975174,
-0.19885586202144623,
-0.013105013407766819,
-0.0670318678021431,
-0.2619432806968689,
-0.17561075091362,
0.15882918238639832,
0.17338688671588898,
-0.08907944709062576,
0.30908268690109253,
-0.003730040043592453,
-0.10699750483036041,
0.016488289460539818,
0.0875212699174881,
-0.3464054763317108,
0.34655383229255676,
0.16837844252586365,
-0.28817468881607056,
-0.21669206023216248,
0.3719768524169922,
0.10448767244815826,
0.024191951379179955,
-0.19916880130767822,
0.15368404984474182,
-0.11736946552991867,
-0.12331914901733398,
-0.5844514966011047,
0.10993069410324097,
0.36117950081825256,
0.158380925655365,
0.2550024390220642,
0.5036296248435974,
0.11218855530023575,
-0.03440766781568527,
0.06214237958192825,
0.5594333410263062,
-0.18953436613082886,
0.022655494511127472,
-0.3018747568130493,
0.011687850579619408,
0.3107447028160095,
0.16395223140716553,
-0.16798870265483856,
-0.4434167444705963,
0.03712131455540657,
-0.022674202919006348,
-0.1656906008720398,
0.023112589493393898,
-0.4027048349380493,
0.34867551922798157,
0.28996482491493225,
-0.07821313291788101,
0.17961490154266357,
-0.0785859152674675,
-0.10272007435560226,
-0.1015440821647644,
0.22542288899421692,
-0.2952028512954712,
0.5789228677749634,
-0.03668339550495148,
-0.14496980607509613,
0.05437943711876869,
-0.026164434850215912,
-0.15568146109580994,
0.06167911738157272,
0.1211366355419159,
-0.06432566791772842,
0.11960962414741516,
0.24179601669311523,
0.03792747110128403,
-0.220016211271286,
0.29676324129104614,
-0.20568890869617462,
-0.11610236763954163,
-0.18921685218811035,
0.170144185423851,
-0.3475115895271301,
-0.011981168761849403,
-0.459431916475296,
-0.11035853624343872,
0.15138062834739685,
-0.09737793356180191,
-0.16793930530548096,
0.08473162353038788,
-0.2180066704750061,
0.10587573796510696,
-0.23040588200092316,
0.1284940391778946,
0.3007718324661255,
-0.038847386837005615,
-0.07833181321620941,
0.2827419340610504,
-0.1395007073879242,
-0.037971775978803635,
-0.11027470976114273,
-0.19640982151031494,
0.263609379529953,
0.2883650064468384,
-0.1961321234703064,
-0.1641438901424408,
-0.6332255601882935,
-0.11944152414798737,
-0.1341811865568161,
0.32877057790756226,
0.11765081435441971,
0.27563074231147766,
-0.15206806361675262,
-0.1166420429944992,
0.3145628869533539,
-0.015786170959472656,
0.17096300423145294,
0.18366959691047668,
0.13498282432556152,
-0.015545099042356014,
-0.5056920647621155,
-0.2204398214817047,
-0.09644326567649841,
-0.0626140907406807,
0.08665967732667923,
-0.21603132784366608,
0.02643602341413498,
0.04877009615302086,
-0.05383286252617836,
0.02739790827035904,
-0.24163490533828735,
0.04155478626489639,
-0.23594196140766144,
0.28192320466041565,
0.43028080463409424,
-0.06765486299991608,
-0.1318305879831314,
-0.16263237595558167,
-0.00796373002231121,
-0.35268425941467285,
-0.008451970294117928,
-0.059105485677719116,
-0.32497432827949524,
-0.20902518928050995,
0.2126208245754242,
-0.07352001219987869,
0.033843033015728,
-0.007720984518527985,
0.2844255268573761,
0.08240760117769241,
-0.10622656345367432,
-0.043578580021858215,
-0.028261028230190277,
0.08356566727161407,
0.1370989978313446,
-0.0031638499349355698,
0.3392145335674286,
0.06841930747032166,
-0.1338053196668625,
0.20237115025520325,
-0.3853635787963867,
0.18205255270004272,
0.14959716796875,
0.35083043575286865,
-0.17073947191238403,
-0.2915019690990448,
0.27154290676116943,
0.09857891499996185,
-0.1893194615840912,
0.12757858633995056,
-0.03816017508506775,
-0.2583358585834503,
0.12821795046329498,
0.25577250123023987,
0.1622960865497589,
-0.20246407389640808,
0.021912284195423126,
0.3147258162498474,
-0.0438629612326622,
0.07844042778015137,
0.5103879570960999,
-0.006447387859225273,
-0.3256703317165375,
-0.15435418486595154,
0.10719401389360428,
0.002452440559864044,
0.15893308818340302,
-0.24833530187606812,
-0.2655872404575348,
-0.2230769693851471,
0.12506654858589172,
0.08907152712345123,
0.7836353778839111,
0.162702739238739,
-0.27146637439727783,
0.10483947396278381,
0.38588374853134155,
0.2703321576118469,
0.08316407352685928,
-0.06095069646835327,
-0.015342682600021362,
0.056465938687324524,
-0.24661774933338165,
-0.471305251121521,
-0.24809110164642334,
0.16621437668800354,
0.03412298113107681,
0.45690804719924927,
-0.1455078423023224,
-0.02631291374564171,
0.2439652532339096,
0.3559235632419586,
0.005760703235864639,
-0.1592099368572235,
-0.3320910632610321,
-0.3904716372489929,
0.40063121914863586,
0.03301897272467613,
-0.23185162246227264,
0.23674964904785156,
-0.24372535943984985,
-0.1560375839471817,
-0.16547948122024536,
0.06785911321640015,
0.036890722811222076,
0.09785151481628418,
0.2811528444290161,
0.08527645468711853,
-0.008334344252943993,
0.03669160604476929,
0.20495948195457458,
-0.11603394150733948,
-0.1506892293691635,
0.09089115262031555,
-0.07816159725189209,
-0.1472303569316864,
-0.17592661082744598,
0.08062304556369781,
0.26898983120918274,
-0.009072834625840187,
0.11059244722127914,
-0.30576571822166443,
0.18404266238212585,
-0.20616307854652405,
0.028248464688658714,
0.22767724096775055,
0.21508431434631348,
-0.21185244619846344,
-0.40966877341270447,
0.3326396942138672,
-0.12602877616882324,
0.08509425818920135,
0.3867059350013733,
-0.24034728109836578,
-0.3442721366882324,
0.5024795532226562,
0.4321822226047516,
0.7307050228118896,
0.18443211913108826,
0.09520459175109863,
0.7169745564460754,
-0.02315870299935341,
0.6993008255958557,
-0.10370786488056183,
0.41096049547195435,
-0.4451063573360443,
-0.2860540449619293,
-0.046400465071201324,
-0.08398619294166565,
0.13445517420768738,
-0.338070273399353,
-0.28679633140563965,
0.12203896790742874,
-0.2664525508880615,
0.6795720458030701,
0.18808750808238983,
-0.2604108452796936,
0.18309825658798218,
-0.17585505545139313,
-0.5231517553329468,
0.05170615762472153,
-0.2250453680753708,
0.090544193983078,
-0.03223688155412674,
-0.2512684464454651,
-0.02041344717144966,
-0.08976083993911743,
0.09673063457012177,
0.13579818606376648,
-0.026400137692689896,
0.31396806240081787,
-0.0023805834352970123,
-0.4051858186721802,
0.11523212492465973,
0.11728981137275696,
0.29914236068725586,
0.40915241837501526,
0.05344369262456894,
-0.30661603808403015,
0.2917037010192871,
0.2551499903202057,
0.2743939757347107,
-0.04799065366387367,
0.21777084469795227,
0.22269582748413086,
-0.07819359749555588,
-0.03898932784795761,
0.21107301115989685,
0.2847232222557068,
-0.5404788255691528,
-0.07159267365932465,
-0.10032413899898529,
-0.5148371458053589,
-0.2767106592655182,
-0.2711356282234192,
0.1341780573129654,
-0.11004884541034698,
0.11929383873939514,
0.010615598410367966,
-0.2521549165248871,
0.4386938810348511,
0.004709966480731964,
-0.3241708278656006,
-0.1577308624982834,
0.25439125299453735,
0.10359043627977371,
-0.14188557863235474,
0.39548131823539734,
0.12317147850990295,
-0.3206825852394104,
-0.0323261059820652,
0.0648040845990181,
-0.07902119308710098,
-0.12969224154949188,
0.2723417580127716,
0.06640073657035828,
0.16467227041721344,
-0.24520307779312134,
-0.2958568036556244,
-0.1801092028617859,
0.0875241756439209,
-0.33371502161026,
-0.18719443678855896,
-0.01779516413807869,
-0.028193555772304535,
0.03364928439259529,
0.09985151886940002,
-0.02618296816945076,
-0.039158791303634644,
-0.2889397144317627,
-0.31229642033576965,
-0.2581632435321808,
-0.27343299984931946,
0.05263388901948929,
0.13591504096984863,
-0.09398671984672546,
-0.019878625869750977,
-0.21024063229560852,
-0.22653958201408386,
0.17268332839012146,
0.08614002168178558,
-0.14657087624073029,
-0.15443384647369385,
-0.033493489027023315,
0.11702485382556915,
-0.016894321888685226,
-0.37265193462371826,
0.03651238605380058,
0.1338893473148346,
-0.1707049012184143,
-0.21403785049915314,
0.1639729142189026,
0.14115315675735474,
0.035183385014534,
0.15294702351093292,
-0.08290630578994751,
0.2915264666080475,
0.1455330103635788,
0.007922405377030373,
-0.20121228694915771,
0.053967710584402084,
0.2531953752040863,
0.14744244515895844,
0.0888916552066803,
0.153603196144104,
-0.12798121571540833,
0.08545805513858795,
-0.14855581521987915,
0.13146159052848816,
0.4354933798313141,
-0.33341771364212036,
0.049891334027051926,
0.040589362382888794,
0.27430611848831177,
0.2675049901008606,
-0.38484570384025574,
-0.2557361423969269,
0.057178400456905365,
0.17968930304050446,
0.08079667389392853,
-0.057099342346191406,
0.49798327684402466,
0.3007374703884125,
-0.04355704411864281,
0.38421162962913513,
0.03313470259308815,
-0.05871395021677017,
-0.24107836186885834,
0.07994502037763596,
0.1146407201886177,
-0.18770718574523926,
0.3146584630012512,
0.7829314470291138,
0.030307356268167496,
0.018395930528640747,
0.022444631904363632,
-0.0692320466041565,
-0.0389486625790596,
0.18613949418067932,
0.18543294072151184,
0.24151688814163208,
0.29878783226013184,
-0.16087380051612854,
-0.14345663785934448,
-0.11297410726547241,
-0.2413642853498459,
0.1994004100561142,
-0.28661322593688965,
0.5658049583435059,
0.13620413839817047,
0.0380193293094635,
-0.4452711045742035,
-0.08038946986198425,
-0.2143814116716385,
0.03752100467681885,
-0.4529602527618408,
0.14074978232383728,
-0.006520433351397514,
0.03984876722097397,
-0.20045244693756104,
0.08343522250652313,
-0.2725495398044586,
0.07312937080860138,
0.042857445776462555,
0.15889659523963928,
-0.08723734319210052,
-0.0481923371553421,
0.2371426820755005,
0.10124494135379791,
0.2498708963394165,
-0.10691656172275543,
-0.0674716979265213,
0.3865653872489929,
0.09150315821170807,
-0.14542138576507568,
-0.05510881543159485,
0.27586960792541504,
0.6177332401275635,
-0.04567347839474678,
-0.06719356030225754,
-0.10213853418827057,
-0.08379292488098145,
0.08901912719011307,
0.262290358543396,
-0.05804002285003662,
-0.08907616138458252,
-0.0629318505525589,
0.15302352607250214,
-0.16242104768753052,
0.09774459898471832,
-0.08159786462783813,
0.25854581594467163,
-0.2866900861263275,
0.38327673077583313,
-0.12180745601654053,
-0.19208601117134094,
-0.08630562573671341,
-0.34347251057624817,
-0.062275566160678864,
-0.14492695033550262,
0.6067264080047607,
0.5737983584403992,
0.08965405821800232,
-0.015563995577394962,
0.04584934562444687,
-0.1593083143234253,
0.11178941279649734,
-0.13097769021987915,
-0.2677588164806366,
0.02734541893005371,
0.17095576226711273,
-0.2267080545425415,
0.15135693550109863,
0.33264297246932983,
-0.30999138951301575,
0.05313817039132118,
-0.01945139653980732,
0.07457497715950012,
0.052974432706832886,
-0.029099449515342712,
-0.0229388028383255,
0.4951131343841553,
0.15079326927661896,
-0.08291133493185043,
-0.19391243159770966,
-0.40169447660446167,
-0.06588386744260788,
-0.11119785904884338,
-0.33047375082969666,
0.2667972147464752,
-0.17961156368255615,
0.11254199594259262,
-0.16805478930473328,
0.17126990854740143,
-0.2835308611392975,
0.02523089200258255,
0.1856212019920349,
0.4099312722682953,
0.14531996846199036,
0.03864581137895584,
-0.22367319464683533,
-0.17643073201179504,
0.010659918189048767,
-0.23728755116462708,
0.28080037236213684,
-0.3789074420928955,
0.4946005642414093,
0.017529446631669998,
0.040532540529966354,
-0.3669935464859009,
0.39116090536117554,
0.001748785376548767,
-0.11669550836086273,
-0.0956469476222992,
0.15102341771125793,
-0.36021938920021057,
0.0048865885473787785,
0.21850959956645966,
0.099675253033638,
0.15540941059589386,
0.34668904542922974,
-0.09796872735023499,
-0.48147717118263245,
0.47677284479141235,
-0.3814901113510132,
-0.27774912118911743,
-0.13525331020355225,
0.148630291223526,
-0.07086648792028427,
-0.13644817471504211,
-0.5332998037338257,
-0.08449841290712357,
0.1973572075366974,
-0.18259301781654358,
-0.13010410964488983,
0.25621992349624634,
0.04519832134246826,
0.008136224001646042,
-0.12021878361701965,
0.30836981534957886,
-0.025906506925821304,
-0.02033541165292263,
0.16722485423088074,
-0.08359858393669128
] |
https://github.com/huggingface/datasets/issues/5517 | `with_format("numpy")` silently downcasts float64 to float32 features | Let's see with the transformers team if it sounds reasonable ? We'd have to fix multiple example scripts though.
If it's not ok we can also explore keeping this behavior only for tokens and audio data. | ### Describe the bug
When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`.
### Steps to reproduce the bug
```python
import datasets
dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy")
print("feature dtype:", dataset.features['a'].dtype)
print("array dtype:", dataset['a'].dtype)
```
output:
```
feature dtype: float64
array dtype: float32
```
### Expected behavior
```
feature dtype: float64
array dtype: float64
```
### Environment info
- `datasets` version: 2.8.0
- Platform: Linux-5.4.0-135-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.4.4
### Suggested Fix
Changing [the `_tensorize` function of the numpy formatter](https://github.com/huggingface/datasets/blob/b065547654efa0ec633cf373ac1512884c68b2e1/src/datasets/formatting/np_formatter.py#L32) to
```python
def _tensorize(self, value):
if isinstance(value, (str, bytes, type(None))):
return value
elif isinstance(value, (np.character, np.ndarray)) and np.issubdtype(value.dtype, np.character):
return value
elif isinstance(value, np.number):
return value
return np.asarray(value, **self.np_array_kwargs)
```
fixes this particular issue for me. Not sure if this would break other tests. This should also avoid unnecessary copying of the array.
| 36 | `with_format("numpy")` silently downcasts float64 to float32 features
### Describe the bug
When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`.
### Steps to reproduce the bug
```python
import datasets
dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy")
print("feature dtype:", dataset.features['a'].dtype)
print("array dtype:", dataset['a'].dtype)
```
output:
```
feature dtype: float64
array dtype: float32
```
### Expected behavior
```
feature dtype: float64
array dtype: float64
```
### Environment info
- `datasets` version: 2.8.0
- Platform: Linux-5.4.0-135-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.4.4
### Suggested Fix
Changing [the `_tensorize` function of the numpy formatter](https://github.com/huggingface/datasets/blob/b065547654efa0ec633cf373ac1512884c68b2e1/src/datasets/formatting/np_formatter.py#L32) to
```python
def _tensorize(self, value):
if isinstance(value, (str, bytes, type(None))):
return value
elif isinstance(value, (np.character, np.ndarray)) and np.issubdtype(value.dtype, np.character):
return value
elif isinstance(value, np.number):
return value
return np.asarray(value, **self.np_array_kwargs)
```
fixes this particular issue for me. Not sure if this would break other tests. This should also avoid unnecessary copying of the array.
Let's see with the transformers team if it sounds reasonable ? We'd have to fix multiple example scripts though.
If it's not ok we can also explore keeping this behavior only for tokens and audio data. | [
0.14177078008651733,
-0.24984367191791534,
0.000774633139371872,
0.0026635415852069855,
0.5696965456008911,
0.0561448410153389,
0.6134842038154602,
0.5261093378067017,
-0.16041861474514008,
-0.05886185169219971,
-0.13229535520076752,
0.6590015888214111,
-0.024173695594072342,
-0.055850546807050705,
-0.0898173376917839,
-0.09573148190975189,
0.19167107343673706,
0.36848190426826477,
-0.1873778998851776,
-0.08108260482549667,
-0.23802180588245392,
-0.2345665842294693,
-0.08685125410556793,
-0.115273118019104,
0.04147911071777344,
0.13877277076244354,
0.1588970422744751,
-0.2952386438846588,
-0.35430777072906494,
-0.21976175904273987,
0.17852190136909485,
-0.1553322821855545,
0.10645264387130737,
0.2438211739063263,
-0.0001166464644484222,
-0.02281355857849121,
0.08414025604724884,
-0.08400937914848328,
-0.23688678443431854,
0.33728793263435364,
0.15402573347091675,
-0.5218885540962219,
0.11003046482801437,
-0.31812769174575806,
-0.14374025166034698,
-0.4370628595352173,
-0.3288455307483673,
-0.3330014944076538,
0.12816524505615234,
-0.0955711379647255,
0.19108319282531738,
0.48318222165107727,
0.14118702709674835,
0.29137617349624634,
-0.4448983371257782,
0.29345792531967163,
-0.31258758902549744,
0.0738760232925415,
-0.301182359457016,
0.273569792509079,
0.1048036739230156,
0.3836762607097626,
-0.2931397259235382,
0.10119502246379852,
-0.00950537621974945,
0.12337784469127655,
0.28796064853668213,
-0.2609037458896637,
-0.09919553250074387,
0.13078156113624573,
0.3381490707397461,
-0.022355571389198303,
-0.3329734206199646,
-0.2674660384654999,
-0.12008658051490784,
-0.2960910499095917,
-0.08011550456285477,
0.17440173029899597,
0.028630852699279785,
0.05780795216560364,
-0.3742605745792389,
0.3191636800765991,
-0.08523911237716675,
0.21660591661930084,
0.019349433481693268,
0.22214846312999725,
-0.12840941548347473,
0.03873099386692047,
-0.46418362855911255,
-0.11483639478683472,
-0.057465579360723495,
-0.3399850130081177,
0.1099044531583786,
0.19607682526111603,
0.0805511474609375,
-0.31794920563697815,
0.33674243092536926,
-0.5577793121337891,
0.024656500667333603,
-0.22734667360782623,
-0.0029758578166365623,
0.3014673888683319,
-0.3438105583190918,
0.03839642554521561,
0.03598916903138161,
0.3496714234352112,
0.010740682482719421,
-0.03237667307257652,
0.22094452381134033,
0.21561606228351593,
0.448309063911438,
0.03775426372885704,
0.3862801790237427,
0.16529054939746857,
0.11328066885471344,
-0.02615904062986374,
0.482272207736969,
-0.22848306596279144,
-0.37862685322761536,
0.26312050223350525,
-0.3443557620048523,
0.07116350531578064,
0.020232656970620155,
0.025952007621526718,
-0.0595310777425766,
0.4846922755241394,
0.04862983524799347,
0.17409051954746246,
-0.2399595081806183,
-0.03258636221289635,
-0.19234873354434967,
-0.24789445102214813,
-0.1684461534023285,
-0.12529093027114868,
0.12297172844409943,
0.3188713788986206,
0.05905483663082123,
0.5129324793815613,
0.030423425137996674,
-0.22497598826885223,
0.05005607008934021,
-0.012772160582244396,
0.5335593223571777,
0.017126090824604034,
-0.43277454376220703,
0.3429165184497833,
0.29663321375846863,
-0.233347088098526,
-0.1042582243680954,
0.050958722829818726,
0.03980989754199982,
0.1377754807472229,
-0.3912065625190735,
0.19081571698188782,
-0.2958465814590454,
0.3621065020561218,
0.2892390787601471,
0.10355809330940247,
0.408719539642334,
-0.07775391638278961,
0.2351023554801941,
-0.4885823130607605,
-0.21119140088558197,
-0.35935577750205994,
0.442503422498703,
0.25058290362358093,
-0.37392354011535645,
0.10276424884796143,
0.4249876141548157,
0.09905529022216797,
0.47119471430778503,
0.15340320765972137,
0.10159412771463394,
-0.08906867355108261,
-0.19534000754356384,
-0.1690911054611206,
0.1824798882007599,
0.3884349465370178,
-0.22312237322330475,
0.014580398797988892,
-0.22743095457553864,
0.4001566767692566,
-0.1761632263660431,
0.19206295907497406,
-0.05699025094509125,
-0.09383387118577957,
-0.044567711651325226,
0.46422070264816284,
-0.0621139258146286,
0.16311419010162354,
-0.4260692298412323,
-0.15895642340183258,
0.326113224029541,
-0.04248140752315521,
-0.17545923590660095,
0.13407015800476074,
-0.0790473148226738,
0.05510125309228897,
0.3086705207824707,
-0.22969645261764526,
0.03570643067359924,
-0.2841407060623169,
0.44516056776046753,
0.030277080833911896,
0.09864893555641174,
0.09511732310056686,
-0.11758985370397568,
-0.03349681198596954,
0.33172401785850525,
0.010560065507888794,
-0.1749689131975174,
-0.19885586202144623,
-0.013105013407766819,
-0.0670318678021431,
-0.2619432806968689,
-0.17561075091362,
0.15882918238639832,
0.17338688671588898,
-0.08907944709062576,
0.30908268690109253,
-0.003730040043592453,
-0.10699750483036041,
0.016488289460539818,
0.0875212699174881,
-0.3464054763317108,
0.34655383229255676,
0.16837844252586365,
-0.28817468881607056,
-0.21669206023216248,
0.3719768524169922,
0.10448767244815826,
0.024191951379179955,
-0.19916880130767822,
0.15368404984474182,
-0.11736946552991867,
-0.12331914901733398,
-0.5844514966011047,
0.10993069410324097,
0.36117950081825256,
0.158380925655365,
0.2550024390220642,
0.5036296248435974,
0.11218855530023575,
-0.03440766781568527,
0.06214237958192825,
0.5594333410263062,
-0.18953436613082886,
0.022655494511127472,
-0.3018747568130493,
0.011687850579619408,
0.3107447028160095,
0.16395223140716553,
-0.16798870265483856,
-0.4434167444705963,
0.03712131455540657,
-0.022674202919006348,
-0.1656906008720398,
0.023112589493393898,
-0.4027048349380493,
0.34867551922798157,
0.28996482491493225,
-0.07821313291788101,
0.17961490154266357,
-0.0785859152674675,
-0.10272007435560226,
-0.1015440821647644,
0.22542288899421692,
-0.2952028512954712,
0.5789228677749634,
-0.03668339550495148,
-0.14496980607509613,
0.05437943711876869,
-0.026164434850215912,
-0.15568146109580994,
0.06167911738157272,
0.1211366355419159,
-0.06432566791772842,
0.11960962414741516,
0.24179601669311523,
0.03792747110128403,
-0.220016211271286,
0.29676324129104614,
-0.20568890869617462,
-0.11610236763954163,
-0.18921685218811035,
0.170144185423851,
-0.3475115895271301,
-0.011981168761849403,
-0.459431916475296,
-0.11035853624343872,
0.15138062834739685,
-0.09737793356180191,
-0.16793930530548096,
0.08473162353038788,
-0.2180066704750061,
0.10587573796510696,
-0.23040588200092316,
0.1284940391778946,
0.3007718324661255,
-0.038847386837005615,
-0.07833181321620941,
0.2827419340610504,
-0.1395007073879242,
-0.037971775978803635,
-0.11027470976114273,
-0.19640982151031494,
0.263609379529953,
0.2883650064468384,
-0.1961321234703064,
-0.1641438901424408,
-0.6332255601882935,
-0.11944152414798737,
-0.1341811865568161,
0.32877057790756226,
0.11765081435441971,
0.27563074231147766,
-0.15206806361675262,
-0.1166420429944992,
0.3145628869533539,
-0.015786170959472656,
0.17096300423145294,
0.18366959691047668,
0.13498282432556152,
-0.015545099042356014,
-0.5056920647621155,
-0.2204398214817047,
-0.09644326567649841,
-0.0626140907406807,
0.08665967732667923,
-0.21603132784366608,
0.02643602341413498,
0.04877009615302086,
-0.05383286252617836,
0.02739790827035904,
-0.24163490533828735,
0.04155478626489639,
-0.23594196140766144,
0.28192320466041565,
0.43028080463409424,
-0.06765486299991608,
-0.1318305879831314,
-0.16263237595558167,
-0.00796373002231121,
-0.35268425941467285,
-0.008451970294117928,
-0.059105485677719116,
-0.32497432827949524,
-0.20902518928050995,
0.2126208245754242,
-0.07352001219987869,
0.033843033015728,
-0.007720984518527985,
0.2844255268573761,
0.08240760117769241,
-0.10622656345367432,
-0.043578580021858215,
-0.028261028230190277,
0.08356566727161407,
0.1370989978313446,
-0.0031638499349355698,
0.3392145335674286,
0.06841930747032166,
-0.1338053196668625,
0.20237115025520325,
-0.3853635787963867,
0.18205255270004272,
0.14959716796875,
0.35083043575286865,
-0.17073947191238403,
-0.2915019690990448,
0.27154290676116943,
0.09857891499996185,
-0.1893194615840912,
0.12757858633995056,
-0.03816017508506775,
-0.2583358585834503,
0.12821795046329498,
0.25577250123023987,
0.1622960865497589,
-0.20246407389640808,
0.021912284195423126,
0.3147258162498474,
-0.0438629612326622,
0.07844042778015137,
0.5103879570960999,
-0.006447387859225273,
-0.3256703317165375,
-0.15435418486595154,
0.10719401389360428,
0.002452440559864044,
0.15893308818340302,
-0.24833530187606812,
-0.2655872404575348,
-0.2230769693851471,
0.12506654858589172,
0.08907152712345123,
0.7836353778839111,
0.162702739238739,
-0.27146637439727783,
0.10483947396278381,
0.38588374853134155,
0.2703321576118469,
0.08316407352685928,
-0.06095069646835327,
-0.015342682600021362,
0.056465938687324524,
-0.24661774933338165,
-0.471305251121521,
-0.24809110164642334,
0.16621437668800354,
0.03412298113107681,
0.45690804719924927,
-0.1455078423023224,
-0.02631291374564171,
0.2439652532339096,
0.3559235632419586,
0.005760703235864639,
-0.1592099368572235,
-0.3320910632610321,
-0.3904716372489929,
0.40063121914863586,
0.03301897272467613,
-0.23185162246227264,
0.23674964904785156,
-0.24372535943984985,
-0.1560375839471817,
-0.16547948122024536,
0.06785911321640015,
0.036890722811222076,
0.09785151481628418,
0.2811528444290161,
0.08527645468711853,
-0.008334344252943993,
0.03669160604476929,
0.20495948195457458,
-0.11603394150733948,
-0.1506892293691635,
0.09089115262031555,
-0.07816159725189209,
-0.1472303569316864,
-0.17592661082744598,
0.08062304556369781,
0.26898983120918274,
-0.009072834625840187,
0.11059244722127914,
-0.30576571822166443,
0.18404266238212585,
-0.20616307854652405,
0.028248464688658714,
0.22767724096775055,
0.21508431434631348,
-0.21185244619846344,
-0.40966877341270447,
0.3326396942138672,
-0.12602877616882324,
0.08509425818920135,
0.3867059350013733,
-0.24034728109836578,
-0.3442721366882324,
0.5024795532226562,
0.4321822226047516,
0.7307050228118896,
0.18443211913108826,
0.09520459175109863,
0.7169745564460754,
-0.02315870299935341,
0.6993008255958557,
-0.10370786488056183,
0.41096049547195435,
-0.4451063573360443,
-0.2860540449619293,
-0.046400465071201324,
-0.08398619294166565,
0.13445517420768738,
-0.338070273399353,
-0.28679633140563965,
0.12203896790742874,
-0.2664525508880615,
0.6795720458030701,
0.18808750808238983,
-0.2604108452796936,
0.18309825658798218,
-0.17585505545139313,
-0.5231517553329468,
0.05170615762472153,
-0.2250453680753708,
0.090544193983078,
-0.03223688155412674,
-0.2512684464454651,
-0.02041344717144966,
-0.08976083993911743,
0.09673063457012177,
0.13579818606376648,
-0.026400137692689896,
0.31396806240081787,
-0.0023805834352970123,
-0.4051858186721802,
0.11523212492465973,
0.11728981137275696,
0.29914236068725586,
0.40915241837501526,
0.05344369262456894,
-0.30661603808403015,
0.2917037010192871,
0.2551499903202057,
0.2743939757347107,
-0.04799065366387367,
0.21777084469795227,
0.22269582748413086,
-0.07819359749555588,
-0.03898932784795761,
0.21107301115989685,
0.2847232222557068,
-0.5404788255691528,
-0.07159267365932465,
-0.10032413899898529,
-0.5148371458053589,
-0.2767106592655182,
-0.2711356282234192,
0.1341780573129654,
-0.11004884541034698,
0.11929383873939514,
0.010615598410367966,
-0.2521549165248871,
0.4386938810348511,
0.004709966480731964,
-0.3241708278656006,
-0.1577308624982834,
0.25439125299453735,
0.10359043627977371,
-0.14188557863235474,
0.39548131823539734,
0.12317147850990295,
-0.3206825852394104,
-0.0323261059820652,
0.0648040845990181,
-0.07902119308710098,
-0.12969224154949188,
0.2723417580127716,
0.06640073657035828,
0.16467227041721344,
-0.24520307779312134,
-0.2958568036556244,
-0.1801092028617859,
0.0875241756439209,
-0.33371502161026,
-0.18719443678855896,
-0.01779516413807869,
-0.028193555772304535,
0.03364928439259529,
0.09985151886940002,
-0.02618296816945076,
-0.039158791303634644,
-0.2889397144317627,
-0.31229642033576965,
-0.2581632435321808,
-0.27343299984931946,
0.05263388901948929,
0.13591504096984863,
-0.09398671984672546,
-0.019878625869750977,
-0.21024063229560852,
-0.22653958201408386,
0.17268332839012146,
0.08614002168178558,
-0.14657087624073029,
-0.15443384647369385,
-0.033493489027023315,
0.11702485382556915,
-0.016894321888685226,
-0.37265193462371826,
0.03651238605380058,
0.1338893473148346,
-0.1707049012184143,
-0.21403785049915314,
0.1639729142189026,
0.14115315675735474,
0.035183385014534,
0.15294702351093292,
-0.08290630578994751,
0.2915264666080475,
0.1455330103635788,
0.007922405377030373,
-0.20121228694915771,
0.053967710584402084,
0.2531953752040863,
0.14744244515895844,
0.0888916552066803,
0.153603196144104,
-0.12798121571540833,
0.08545805513858795,
-0.14855581521987915,
0.13146159052848816,
0.4354933798313141,
-0.33341771364212036,
0.049891334027051926,
0.040589362382888794,
0.27430611848831177,
0.2675049901008606,
-0.38484570384025574,
-0.2557361423969269,
0.057178400456905365,
0.17968930304050446,
0.08079667389392853,
-0.057099342346191406,
0.49798327684402466,
0.3007374703884125,
-0.04355704411864281,
0.38421162962913513,
0.03313470259308815,
-0.05871395021677017,
-0.24107836186885834,
0.07994502037763596,
0.1146407201886177,
-0.18770718574523926,
0.3146584630012512,
0.7829314470291138,
0.030307356268167496,
0.018395930528640747,
0.022444631904363632,
-0.0692320466041565,
-0.0389486625790596,
0.18613949418067932,
0.18543294072151184,
0.24151688814163208,
0.29878783226013184,
-0.16087380051612854,
-0.14345663785934448,
-0.11297410726547241,
-0.2413642853498459,
0.1994004100561142,
-0.28661322593688965,
0.5658049583435059,
0.13620413839817047,
0.0380193293094635,
-0.4452711045742035,
-0.08038946986198425,
-0.2143814116716385,
0.03752100467681885,
-0.4529602527618408,
0.14074978232383728,
-0.006520433351397514,
0.03984876722097397,
-0.20045244693756104,
0.08343522250652313,
-0.2725495398044586,
0.07312937080860138,
0.042857445776462555,
0.15889659523963928,
-0.08723734319210052,
-0.0481923371553421,
0.2371426820755005,
0.10124494135379791,
0.2498708963394165,
-0.10691656172275543,
-0.0674716979265213,
0.3865653872489929,
0.09150315821170807,
-0.14542138576507568,
-0.05510881543159485,
0.27586960792541504,
0.6177332401275635,
-0.04567347839474678,
-0.06719356030225754,
-0.10213853418827057,
-0.08379292488098145,
0.08901912719011307,
0.262290358543396,
-0.05804002285003662,
-0.08907616138458252,
-0.0629318505525589,
0.15302352607250214,
-0.16242104768753052,
0.09774459898471832,
-0.08159786462783813,
0.25854581594467163,
-0.2866900861263275,
0.38327673077583313,
-0.12180745601654053,
-0.19208601117134094,
-0.08630562573671341,
-0.34347251057624817,
-0.062275566160678864,
-0.14492695033550262,
0.6067264080047607,
0.5737983584403992,
0.08965405821800232,
-0.015563995577394962,
0.04584934562444687,
-0.1593083143234253,
0.11178941279649734,
-0.13097769021987915,
-0.2677588164806366,
0.02734541893005371,
0.17095576226711273,
-0.2267080545425415,
0.15135693550109863,
0.33264297246932983,
-0.30999138951301575,
0.05313817039132118,
-0.01945139653980732,
0.07457497715950012,
0.052974432706832886,
-0.029099449515342712,
-0.0229388028383255,
0.4951131343841553,
0.15079326927661896,
-0.08291133493185043,
-0.19391243159770966,
-0.40169447660446167,
-0.06588386744260788,
-0.11119785904884338,
-0.33047375082969666,
0.2667972147464752,
-0.17961156368255615,
0.11254199594259262,
-0.16805478930473328,
0.17126990854740143,
-0.2835308611392975,
0.02523089200258255,
0.1856212019920349,
0.4099312722682953,
0.14531996846199036,
0.03864581137895584,
-0.22367319464683533,
-0.17643073201179504,
0.010659918189048767,
-0.23728755116462708,
0.28080037236213684,
-0.3789074420928955,
0.4946005642414093,
0.017529446631669998,
0.040532540529966354,
-0.3669935464859009,
0.39116090536117554,
0.001748785376548767,
-0.11669550836086273,
-0.0956469476222992,
0.15102341771125793,
-0.36021938920021057,
0.0048865885473787785,
0.21850959956645966,
0.099675253033638,
0.15540941059589386,
0.34668904542922974,
-0.09796872735023499,
-0.48147717118263245,
0.47677284479141235,
-0.3814901113510132,
-0.27774912118911743,
-0.13525331020355225,
0.148630291223526,
-0.07086648792028427,
-0.13644817471504211,
-0.5332998037338257,
-0.08449841290712357,
0.1973572075366974,
-0.18259301781654358,
-0.13010410964488983,
0.25621992349624634,
0.04519832134246826,
0.008136224001646042,
-0.12021878361701965,
0.30836981534957886,
-0.025906506925821304,
-0.02033541165292263,
0.16722485423088074,
-0.08359858393669128
] |
https://github.com/huggingface/datasets/issues/5517 | `with_format("numpy")` silently downcasts float64 to float32 features | IMO being coupled with Transformers can lead to unexpected behavior when one tries to use our lib without pairing it with Transformers, so I think it's still important to "fix" this, even if it means we will need to update Transformers' example scripts afterward.
| ### Describe the bug
When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`.
### Steps to reproduce the bug
```python
import datasets
dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy")
print("feature dtype:", dataset.features['a'].dtype)
print("array dtype:", dataset['a'].dtype)
```
output:
```
feature dtype: float64
array dtype: float32
```
### Expected behavior
```
feature dtype: float64
array dtype: float64
```
### Environment info
- `datasets` version: 2.8.0
- Platform: Linux-5.4.0-135-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.4.4
### Suggested Fix
Changing [the `_tensorize` function of the numpy formatter](https://github.com/huggingface/datasets/blob/b065547654efa0ec633cf373ac1512884c68b2e1/src/datasets/formatting/np_formatter.py#L32) to
```python
def _tensorize(self, value):
if isinstance(value, (str, bytes, type(None))):
return value
elif isinstance(value, (np.character, np.ndarray)) and np.issubdtype(value.dtype, np.character):
return value
elif isinstance(value, np.number):
return value
return np.asarray(value, **self.np_array_kwargs)
```
fixes this particular issue for me. Not sure if this would break other tests. This should also avoid unnecessary copying of the array.
| 44 | `with_format("numpy")` silently downcasts float64 to float32 features
### Describe the bug
When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`.
### Steps to reproduce the bug
```python
import datasets
dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy")
print("feature dtype:", dataset.features['a'].dtype)
print("array dtype:", dataset['a'].dtype)
```
output:
```
feature dtype: float64
array dtype: float32
```
### Expected behavior
```
feature dtype: float64
array dtype: float64
```
### Environment info
- `datasets` version: 2.8.0
- Platform: Linux-5.4.0-135-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.4.4
### Suggested Fix
Changing [the `_tensorize` function of the numpy formatter](https://github.com/huggingface/datasets/blob/b065547654efa0ec633cf373ac1512884c68b2e1/src/datasets/formatting/np_formatter.py#L32) to
```python
def _tensorize(self, value):
if isinstance(value, (str, bytes, type(None))):
return value
elif isinstance(value, (np.character, np.ndarray)) and np.issubdtype(value.dtype, np.character):
return value
elif isinstance(value, np.number):
return value
return np.asarray(value, **self.np_array_kwargs)
```
fixes this particular issue for me. Not sure if this would break other tests. This should also avoid unnecessary copying of the array.
IMO being coupled with Transformers can lead to unexpected behavior when one tries to use our lib without pairing it with Transformers, so I think it's still important to "fix" this, even if it means we will need to update Transformers' example scripts afterward.
| [
0.14177078008651733,
-0.24984367191791534,
0.000774633139371872,
0.0026635415852069855,
0.5696965456008911,
0.0561448410153389,
0.6134842038154602,
0.5261093378067017,
-0.16041861474514008,
-0.05886185169219971,
-0.13229535520076752,
0.6590015888214111,
-0.024173695594072342,
-0.055850546807050705,
-0.0898173376917839,
-0.09573148190975189,
0.19167107343673706,
0.36848190426826477,
-0.1873778998851776,
-0.08108260482549667,
-0.23802180588245392,
-0.2345665842294693,
-0.08685125410556793,
-0.115273118019104,
0.04147911071777344,
0.13877277076244354,
0.1588970422744751,
-0.2952386438846588,
-0.35430777072906494,
-0.21976175904273987,
0.17852190136909485,
-0.1553322821855545,
0.10645264387130737,
0.2438211739063263,
-0.0001166464644484222,
-0.02281355857849121,
0.08414025604724884,
-0.08400937914848328,
-0.23688678443431854,
0.33728793263435364,
0.15402573347091675,
-0.5218885540962219,
0.11003046482801437,
-0.31812769174575806,
-0.14374025166034698,
-0.4370628595352173,
-0.3288455307483673,
-0.3330014944076538,
0.12816524505615234,
-0.0955711379647255,
0.19108319282531738,
0.48318222165107727,
0.14118702709674835,
0.29137617349624634,
-0.4448983371257782,
0.29345792531967163,
-0.31258758902549744,
0.0738760232925415,
-0.301182359457016,
0.273569792509079,
0.1048036739230156,
0.3836762607097626,
-0.2931397259235382,
0.10119502246379852,
-0.00950537621974945,
0.12337784469127655,
0.28796064853668213,
-0.2609037458896637,
-0.09919553250074387,
0.13078156113624573,
0.3381490707397461,
-0.022355571389198303,
-0.3329734206199646,
-0.2674660384654999,
-0.12008658051490784,
-0.2960910499095917,
-0.08011550456285477,
0.17440173029899597,
0.028630852699279785,
0.05780795216560364,
-0.3742605745792389,
0.3191636800765991,
-0.08523911237716675,
0.21660591661930084,
0.019349433481693268,
0.22214846312999725,
-0.12840941548347473,
0.03873099386692047,
-0.46418362855911255,
-0.11483639478683472,
-0.057465579360723495,
-0.3399850130081177,
0.1099044531583786,
0.19607682526111603,
0.0805511474609375,
-0.31794920563697815,
0.33674243092536926,
-0.5577793121337891,
0.024656500667333603,
-0.22734667360782623,
-0.0029758578166365623,
0.3014673888683319,
-0.3438105583190918,
0.03839642554521561,
0.03598916903138161,
0.3496714234352112,
0.010740682482719421,
-0.03237667307257652,
0.22094452381134033,
0.21561606228351593,
0.448309063911438,
0.03775426372885704,
0.3862801790237427,
0.16529054939746857,
0.11328066885471344,
-0.02615904062986374,
0.482272207736969,
-0.22848306596279144,
-0.37862685322761536,
0.26312050223350525,
-0.3443557620048523,
0.07116350531578064,
0.020232656970620155,
0.025952007621526718,
-0.0595310777425766,
0.4846922755241394,
0.04862983524799347,
0.17409051954746246,
-0.2399595081806183,
-0.03258636221289635,
-0.19234873354434967,
-0.24789445102214813,
-0.1684461534023285,
-0.12529093027114868,
0.12297172844409943,
0.3188713788986206,
0.05905483663082123,
0.5129324793815613,
0.030423425137996674,
-0.22497598826885223,
0.05005607008934021,
-0.012772160582244396,
0.5335593223571777,
0.017126090824604034,
-0.43277454376220703,
0.3429165184497833,
0.29663321375846863,
-0.233347088098526,
-0.1042582243680954,
0.050958722829818726,
0.03980989754199982,
0.1377754807472229,
-0.3912065625190735,
0.19081571698188782,
-0.2958465814590454,
0.3621065020561218,
0.2892390787601471,
0.10355809330940247,
0.408719539642334,
-0.07775391638278961,
0.2351023554801941,
-0.4885823130607605,
-0.21119140088558197,
-0.35935577750205994,
0.442503422498703,
0.25058290362358093,
-0.37392354011535645,
0.10276424884796143,
0.4249876141548157,
0.09905529022216797,
0.47119471430778503,
0.15340320765972137,
0.10159412771463394,
-0.08906867355108261,
-0.19534000754356384,
-0.1690911054611206,
0.1824798882007599,
0.3884349465370178,
-0.22312237322330475,
0.014580398797988892,
-0.22743095457553864,
0.4001566767692566,
-0.1761632263660431,
0.19206295907497406,
-0.05699025094509125,
-0.09383387118577957,
-0.044567711651325226,
0.46422070264816284,
-0.0621139258146286,
0.16311419010162354,
-0.4260692298412323,
-0.15895642340183258,
0.326113224029541,
-0.04248140752315521,
-0.17545923590660095,
0.13407015800476074,
-0.0790473148226738,
0.05510125309228897,
0.3086705207824707,
-0.22969645261764526,
0.03570643067359924,
-0.2841407060623169,
0.44516056776046753,
0.030277080833911896,
0.09864893555641174,
0.09511732310056686,
-0.11758985370397568,
-0.03349681198596954,
0.33172401785850525,
0.010560065507888794,
-0.1749689131975174,
-0.19885586202144623,
-0.013105013407766819,
-0.0670318678021431,
-0.2619432806968689,
-0.17561075091362,
0.15882918238639832,
0.17338688671588898,
-0.08907944709062576,
0.30908268690109253,
-0.003730040043592453,
-0.10699750483036041,
0.016488289460539818,
0.0875212699174881,
-0.3464054763317108,
0.34655383229255676,
0.16837844252586365,
-0.28817468881607056,
-0.21669206023216248,
0.3719768524169922,
0.10448767244815826,
0.024191951379179955,
-0.19916880130767822,
0.15368404984474182,
-0.11736946552991867,
-0.12331914901733398,
-0.5844514966011047,
0.10993069410324097,
0.36117950081825256,
0.158380925655365,
0.2550024390220642,
0.5036296248435974,
0.11218855530023575,
-0.03440766781568527,
0.06214237958192825,
0.5594333410263062,
-0.18953436613082886,
0.022655494511127472,
-0.3018747568130493,
0.011687850579619408,
0.3107447028160095,
0.16395223140716553,
-0.16798870265483856,
-0.4434167444705963,
0.03712131455540657,
-0.022674202919006348,
-0.1656906008720398,
0.023112589493393898,
-0.4027048349380493,
0.34867551922798157,
0.28996482491493225,
-0.07821313291788101,
0.17961490154266357,
-0.0785859152674675,
-0.10272007435560226,
-0.1015440821647644,
0.22542288899421692,
-0.2952028512954712,
0.5789228677749634,
-0.03668339550495148,
-0.14496980607509613,
0.05437943711876869,
-0.026164434850215912,
-0.15568146109580994,
0.06167911738157272,
0.1211366355419159,
-0.06432566791772842,
0.11960962414741516,
0.24179601669311523,
0.03792747110128403,
-0.220016211271286,
0.29676324129104614,
-0.20568890869617462,
-0.11610236763954163,
-0.18921685218811035,
0.170144185423851,
-0.3475115895271301,
-0.011981168761849403,
-0.459431916475296,
-0.11035853624343872,
0.15138062834739685,
-0.09737793356180191,
-0.16793930530548096,
0.08473162353038788,
-0.2180066704750061,
0.10587573796510696,
-0.23040588200092316,
0.1284940391778946,
0.3007718324661255,
-0.038847386837005615,
-0.07833181321620941,
0.2827419340610504,
-0.1395007073879242,
-0.037971775978803635,
-0.11027470976114273,
-0.19640982151031494,
0.263609379529953,
0.2883650064468384,
-0.1961321234703064,
-0.1641438901424408,
-0.6332255601882935,
-0.11944152414798737,
-0.1341811865568161,
0.32877057790756226,
0.11765081435441971,
0.27563074231147766,
-0.15206806361675262,
-0.1166420429944992,
0.3145628869533539,
-0.015786170959472656,
0.17096300423145294,
0.18366959691047668,
0.13498282432556152,
-0.015545099042356014,
-0.5056920647621155,
-0.2204398214817047,
-0.09644326567649841,
-0.0626140907406807,
0.08665967732667923,
-0.21603132784366608,
0.02643602341413498,
0.04877009615302086,
-0.05383286252617836,
0.02739790827035904,
-0.24163490533828735,
0.04155478626489639,
-0.23594196140766144,
0.28192320466041565,
0.43028080463409424,
-0.06765486299991608,
-0.1318305879831314,
-0.16263237595558167,
-0.00796373002231121,
-0.35268425941467285,
-0.008451970294117928,
-0.059105485677719116,
-0.32497432827949524,
-0.20902518928050995,
0.2126208245754242,
-0.07352001219987869,
0.033843033015728,
-0.007720984518527985,
0.2844255268573761,
0.08240760117769241,
-0.10622656345367432,
-0.043578580021858215,
-0.028261028230190277,
0.08356566727161407,
0.1370989978313446,
-0.0031638499349355698,
0.3392145335674286,
0.06841930747032166,
-0.1338053196668625,
0.20237115025520325,
-0.3853635787963867,
0.18205255270004272,
0.14959716796875,
0.35083043575286865,
-0.17073947191238403,
-0.2915019690990448,
0.27154290676116943,
0.09857891499996185,
-0.1893194615840912,
0.12757858633995056,
-0.03816017508506775,
-0.2583358585834503,
0.12821795046329498,
0.25577250123023987,
0.1622960865497589,
-0.20246407389640808,
0.021912284195423126,
0.3147258162498474,
-0.0438629612326622,
0.07844042778015137,
0.5103879570960999,
-0.006447387859225273,
-0.3256703317165375,
-0.15435418486595154,
0.10719401389360428,
0.002452440559864044,
0.15893308818340302,
-0.24833530187606812,
-0.2655872404575348,
-0.2230769693851471,
0.12506654858589172,
0.08907152712345123,
0.7836353778839111,
0.162702739238739,
-0.27146637439727783,
0.10483947396278381,
0.38588374853134155,
0.2703321576118469,
0.08316407352685928,
-0.06095069646835327,
-0.015342682600021362,
0.056465938687324524,
-0.24661774933338165,
-0.471305251121521,
-0.24809110164642334,
0.16621437668800354,
0.03412298113107681,
0.45690804719924927,
-0.1455078423023224,
-0.02631291374564171,
0.2439652532339096,
0.3559235632419586,
0.005760703235864639,
-0.1592099368572235,
-0.3320910632610321,
-0.3904716372489929,
0.40063121914863586,
0.03301897272467613,
-0.23185162246227264,
0.23674964904785156,
-0.24372535943984985,
-0.1560375839471817,
-0.16547948122024536,
0.06785911321640015,
0.036890722811222076,
0.09785151481628418,
0.2811528444290161,
0.08527645468711853,
-0.008334344252943993,
0.03669160604476929,
0.20495948195457458,
-0.11603394150733948,
-0.1506892293691635,
0.09089115262031555,
-0.07816159725189209,
-0.1472303569316864,
-0.17592661082744598,
0.08062304556369781,
0.26898983120918274,
-0.009072834625840187,
0.11059244722127914,
-0.30576571822166443,
0.18404266238212585,
-0.20616307854652405,
0.028248464688658714,
0.22767724096775055,
0.21508431434631348,
-0.21185244619846344,
-0.40966877341270447,
0.3326396942138672,
-0.12602877616882324,
0.08509425818920135,
0.3867059350013733,
-0.24034728109836578,
-0.3442721366882324,
0.5024795532226562,
0.4321822226047516,
0.7307050228118896,
0.18443211913108826,
0.09520459175109863,
0.7169745564460754,
-0.02315870299935341,
0.6993008255958557,
-0.10370786488056183,
0.41096049547195435,
-0.4451063573360443,
-0.2860540449619293,
-0.046400465071201324,
-0.08398619294166565,
0.13445517420768738,
-0.338070273399353,
-0.28679633140563965,
0.12203896790742874,
-0.2664525508880615,
0.6795720458030701,
0.18808750808238983,
-0.2604108452796936,
0.18309825658798218,
-0.17585505545139313,
-0.5231517553329468,
0.05170615762472153,
-0.2250453680753708,
0.090544193983078,
-0.03223688155412674,
-0.2512684464454651,
-0.02041344717144966,
-0.08976083993911743,
0.09673063457012177,
0.13579818606376648,
-0.026400137692689896,
0.31396806240081787,
-0.0023805834352970123,
-0.4051858186721802,
0.11523212492465973,
0.11728981137275696,
0.29914236068725586,
0.40915241837501526,
0.05344369262456894,
-0.30661603808403015,
0.2917037010192871,
0.2551499903202057,
0.2743939757347107,
-0.04799065366387367,
0.21777084469795227,
0.22269582748413086,
-0.07819359749555588,
-0.03898932784795761,
0.21107301115989685,
0.2847232222557068,
-0.5404788255691528,
-0.07159267365932465,
-0.10032413899898529,
-0.5148371458053589,
-0.2767106592655182,
-0.2711356282234192,
0.1341780573129654,
-0.11004884541034698,
0.11929383873939514,
0.010615598410367966,
-0.2521549165248871,
0.4386938810348511,
0.004709966480731964,
-0.3241708278656006,
-0.1577308624982834,
0.25439125299453735,
0.10359043627977371,
-0.14188557863235474,
0.39548131823539734,
0.12317147850990295,
-0.3206825852394104,
-0.0323261059820652,
0.0648040845990181,
-0.07902119308710098,
-0.12969224154949188,
0.2723417580127716,
0.06640073657035828,
0.16467227041721344,
-0.24520307779312134,
-0.2958568036556244,
-0.1801092028617859,
0.0875241756439209,
-0.33371502161026,
-0.18719443678855896,
-0.01779516413807869,
-0.028193555772304535,
0.03364928439259529,
0.09985151886940002,
-0.02618296816945076,
-0.039158791303634644,
-0.2889397144317627,
-0.31229642033576965,
-0.2581632435321808,
-0.27343299984931946,
0.05263388901948929,
0.13591504096984863,
-0.09398671984672546,
-0.019878625869750977,
-0.21024063229560852,
-0.22653958201408386,
0.17268332839012146,
0.08614002168178558,
-0.14657087624073029,
-0.15443384647369385,
-0.033493489027023315,
0.11702485382556915,
-0.016894321888685226,
-0.37265193462371826,
0.03651238605380058,
0.1338893473148346,
-0.1707049012184143,
-0.21403785049915314,
0.1639729142189026,
0.14115315675735474,
0.035183385014534,
0.15294702351093292,
-0.08290630578994751,
0.2915264666080475,
0.1455330103635788,
0.007922405377030373,
-0.20121228694915771,
0.053967710584402084,
0.2531953752040863,
0.14744244515895844,
0.0888916552066803,
0.153603196144104,
-0.12798121571540833,
0.08545805513858795,
-0.14855581521987915,
0.13146159052848816,
0.4354933798313141,
-0.33341771364212036,
0.049891334027051926,
0.040589362382888794,
0.27430611848831177,
0.2675049901008606,
-0.38484570384025574,
-0.2557361423969269,
0.057178400456905365,
0.17968930304050446,
0.08079667389392853,
-0.057099342346191406,
0.49798327684402466,
0.3007374703884125,
-0.04355704411864281,
0.38421162962913513,
0.03313470259308815,
-0.05871395021677017,
-0.24107836186885834,
0.07994502037763596,
0.1146407201886177,
-0.18770718574523926,
0.3146584630012512,
0.7829314470291138,
0.030307356268167496,
0.018395930528640747,
0.022444631904363632,
-0.0692320466041565,
-0.0389486625790596,
0.18613949418067932,
0.18543294072151184,
0.24151688814163208,
0.29878783226013184,
-0.16087380051612854,
-0.14345663785934448,
-0.11297410726547241,
-0.2413642853498459,
0.1994004100561142,
-0.28661322593688965,
0.5658049583435059,
0.13620413839817047,
0.0380193293094635,
-0.4452711045742035,
-0.08038946986198425,
-0.2143814116716385,
0.03752100467681885,
-0.4529602527618408,
0.14074978232383728,
-0.006520433351397514,
0.03984876722097397,
-0.20045244693756104,
0.08343522250652313,
-0.2725495398044586,
0.07312937080860138,
0.042857445776462555,
0.15889659523963928,
-0.08723734319210052,
-0.0481923371553421,
0.2371426820755005,
0.10124494135379791,
0.2498708963394165,
-0.10691656172275543,
-0.0674716979265213,
0.3865653872489929,
0.09150315821170807,
-0.14542138576507568,
-0.05510881543159485,
0.27586960792541504,
0.6177332401275635,
-0.04567347839474678,
-0.06719356030225754,
-0.10213853418827057,
-0.08379292488098145,
0.08901912719011307,
0.262290358543396,
-0.05804002285003662,
-0.08907616138458252,
-0.0629318505525589,
0.15302352607250214,
-0.16242104768753052,
0.09774459898471832,
-0.08159786462783813,
0.25854581594467163,
-0.2866900861263275,
0.38327673077583313,
-0.12180745601654053,
-0.19208601117134094,
-0.08630562573671341,
-0.34347251057624817,
-0.062275566160678864,
-0.14492695033550262,
0.6067264080047607,
0.5737983584403992,
0.08965405821800232,
-0.015563995577394962,
0.04584934562444687,
-0.1593083143234253,
0.11178941279649734,
-0.13097769021987915,
-0.2677588164806366,
0.02734541893005371,
0.17095576226711273,
-0.2267080545425415,
0.15135693550109863,
0.33264297246932983,
-0.30999138951301575,
0.05313817039132118,
-0.01945139653980732,
0.07457497715950012,
0.052974432706832886,
-0.029099449515342712,
-0.0229388028383255,
0.4951131343841553,
0.15079326927661896,
-0.08291133493185043,
-0.19391243159770966,
-0.40169447660446167,
-0.06588386744260788,
-0.11119785904884338,
-0.33047375082969666,
0.2667972147464752,
-0.17961156368255615,
0.11254199594259262,
-0.16805478930473328,
0.17126990854740143,
-0.2835308611392975,
0.02523089200258255,
0.1856212019920349,
0.4099312722682953,
0.14531996846199036,
0.03864581137895584,
-0.22367319464683533,
-0.17643073201179504,
0.010659918189048767,
-0.23728755116462708,
0.28080037236213684,
-0.3789074420928955,
0.4946005642414093,
0.017529446631669998,
0.040532540529966354,
-0.3669935464859009,
0.39116090536117554,
0.001748785376548767,
-0.11669550836086273,
-0.0956469476222992,
0.15102341771125793,
-0.36021938920021057,
0.0048865885473787785,
0.21850959956645966,
0.099675253033638,
0.15540941059589386,
0.34668904542922974,
-0.09796872735023499,
-0.48147717118263245,
0.47677284479141235,
-0.3814901113510132,
-0.27774912118911743,
-0.13525331020355225,
0.148630291223526,
-0.07086648792028427,
-0.13644817471504211,
-0.5332998037338257,
-0.08449841290712357,
0.1973572075366974,
-0.18259301781654358,
-0.13010410964488983,
0.25621992349624634,
0.04519832134246826,
0.008136224001646042,
-0.12021878361701965,
0.30836981534957886,
-0.025906506925821304,
-0.02033541165292263,
0.16722485423088074,
-0.08359858393669128
] |
https://github.com/huggingface/datasets/issues/5517 | `with_format("numpy")` silently downcasts float64 to float32 features | For others that run into the same issue: A temporary workaround for me is this:
```python
def numpy_transform(batch):
return {key: np.asarray(val) for key, val in batch.items()}
dataset = dataset.with_transform(numpy_transform)
``` | ### Describe the bug
When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`.
### Steps to reproduce the bug
```python
import datasets
dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy")
print("feature dtype:", dataset.features['a'].dtype)
print("array dtype:", dataset['a'].dtype)
```
output:
```
feature dtype: float64
array dtype: float32
```
### Expected behavior
```
feature dtype: float64
array dtype: float64
```
### Environment info
- `datasets` version: 2.8.0
- Platform: Linux-5.4.0-135-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.4.4
### Suggested Fix
Changing [the `_tensorize` function of the numpy formatter](https://github.com/huggingface/datasets/blob/b065547654efa0ec633cf373ac1512884c68b2e1/src/datasets/formatting/np_formatter.py#L32) to
```python
def _tensorize(self, value):
if isinstance(value, (str, bytes, type(None))):
return value
elif isinstance(value, (np.character, np.ndarray)) and np.issubdtype(value.dtype, np.character):
return value
elif isinstance(value, np.number):
return value
return np.asarray(value, **self.np_array_kwargs)
```
fixes this particular issue for me. Not sure if this would break other tests. This should also avoid unnecessary copying of the array.
| 30 | `with_format("numpy")` silently downcasts float64 to float32 features
### Describe the bug
When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`.
### Steps to reproduce the bug
```python
import datasets
dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy")
print("feature dtype:", dataset.features['a'].dtype)
print("array dtype:", dataset['a'].dtype)
```
output:
```
feature dtype: float64
array dtype: float32
```
### Expected behavior
```
feature dtype: float64
array dtype: float64
```
### Environment info
- `datasets` version: 2.8.0
- Platform: Linux-5.4.0-135-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.4.4
### Suggested Fix
Changing [the `_tensorize` function of the numpy formatter](https://github.com/huggingface/datasets/blob/b065547654efa0ec633cf373ac1512884c68b2e1/src/datasets/formatting/np_formatter.py#L32) to
```python
def _tensorize(self, value):
if isinstance(value, (str, bytes, type(None))):
return value
elif isinstance(value, (np.character, np.ndarray)) and np.issubdtype(value.dtype, np.character):
return value
elif isinstance(value, np.number):
return value
return np.asarray(value, **self.np_array_kwargs)
```
fixes this particular issue for me. Not sure if this would break other tests. This should also avoid unnecessary copying of the array.
For others that run into the same issue: A temporary workaround for me is this:
```python
def numpy_transform(batch):
return {key: np.asarray(val) for key, val in batch.items()}
dataset = dataset.with_transform(numpy_transform)
``` | [
0.14177078008651733,
-0.24984367191791534,
0.000774633139371872,
0.0026635415852069855,
0.5696965456008911,
0.0561448410153389,
0.6134842038154602,
0.5261093378067017,
-0.16041861474514008,
-0.05886185169219971,
-0.13229535520076752,
0.6590015888214111,
-0.024173695594072342,
-0.055850546807050705,
-0.0898173376917839,
-0.09573148190975189,
0.19167107343673706,
0.36848190426826477,
-0.1873778998851776,
-0.08108260482549667,
-0.23802180588245392,
-0.2345665842294693,
-0.08685125410556793,
-0.115273118019104,
0.04147911071777344,
0.13877277076244354,
0.1588970422744751,
-0.2952386438846588,
-0.35430777072906494,
-0.21976175904273987,
0.17852190136909485,
-0.1553322821855545,
0.10645264387130737,
0.2438211739063263,
-0.0001166464644484222,
-0.02281355857849121,
0.08414025604724884,
-0.08400937914848328,
-0.23688678443431854,
0.33728793263435364,
0.15402573347091675,
-0.5218885540962219,
0.11003046482801437,
-0.31812769174575806,
-0.14374025166034698,
-0.4370628595352173,
-0.3288455307483673,
-0.3330014944076538,
0.12816524505615234,
-0.0955711379647255,
0.19108319282531738,
0.48318222165107727,
0.14118702709674835,
0.29137617349624634,
-0.4448983371257782,
0.29345792531967163,
-0.31258758902549744,
0.0738760232925415,
-0.301182359457016,
0.273569792509079,
0.1048036739230156,
0.3836762607097626,
-0.2931397259235382,
0.10119502246379852,
-0.00950537621974945,
0.12337784469127655,
0.28796064853668213,
-0.2609037458896637,
-0.09919553250074387,
0.13078156113624573,
0.3381490707397461,
-0.022355571389198303,
-0.3329734206199646,
-0.2674660384654999,
-0.12008658051490784,
-0.2960910499095917,
-0.08011550456285477,
0.17440173029899597,
0.028630852699279785,
0.05780795216560364,
-0.3742605745792389,
0.3191636800765991,
-0.08523911237716675,
0.21660591661930084,
0.019349433481693268,
0.22214846312999725,
-0.12840941548347473,
0.03873099386692047,
-0.46418362855911255,
-0.11483639478683472,
-0.057465579360723495,
-0.3399850130081177,
0.1099044531583786,
0.19607682526111603,
0.0805511474609375,
-0.31794920563697815,
0.33674243092536926,
-0.5577793121337891,
0.024656500667333603,
-0.22734667360782623,
-0.0029758578166365623,
0.3014673888683319,
-0.3438105583190918,
0.03839642554521561,
0.03598916903138161,
0.3496714234352112,
0.010740682482719421,
-0.03237667307257652,
0.22094452381134033,
0.21561606228351593,
0.448309063911438,
0.03775426372885704,
0.3862801790237427,
0.16529054939746857,
0.11328066885471344,
-0.02615904062986374,
0.482272207736969,
-0.22848306596279144,
-0.37862685322761536,
0.26312050223350525,
-0.3443557620048523,
0.07116350531578064,
0.020232656970620155,
0.025952007621526718,
-0.0595310777425766,
0.4846922755241394,
0.04862983524799347,
0.17409051954746246,
-0.2399595081806183,
-0.03258636221289635,
-0.19234873354434967,
-0.24789445102214813,
-0.1684461534023285,
-0.12529093027114868,
0.12297172844409943,
0.3188713788986206,
0.05905483663082123,
0.5129324793815613,
0.030423425137996674,
-0.22497598826885223,
0.05005607008934021,
-0.012772160582244396,
0.5335593223571777,
0.017126090824604034,
-0.43277454376220703,
0.3429165184497833,
0.29663321375846863,
-0.233347088098526,
-0.1042582243680954,
0.050958722829818726,
0.03980989754199982,
0.1377754807472229,
-0.3912065625190735,
0.19081571698188782,
-0.2958465814590454,
0.3621065020561218,
0.2892390787601471,
0.10355809330940247,
0.408719539642334,
-0.07775391638278961,
0.2351023554801941,
-0.4885823130607605,
-0.21119140088558197,
-0.35935577750205994,
0.442503422498703,
0.25058290362358093,
-0.37392354011535645,
0.10276424884796143,
0.4249876141548157,
0.09905529022216797,
0.47119471430778503,
0.15340320765972137,
0.10159412771463394,
-0.08906867355108261,
-0.19534000754356384,
-0.1690911054611206,
0.1824798882007599,
0.3884349465370178,
-0.22312237322330475,
0.014580398797988892,
-0.22743095457553864,
0.4001566767692566,
-0.1761632263660431,
0.19206295907497406,
-0.05699025094509125,
-0.09383387118577957,
-0.044567711651325226,
0.46422070264816284,
-0.0621139258146286,
0.16311419010162354,
-0.4260692298412323,
-0.15895642340183258,
0.326113224029541,
-0.04248140752315521,
-0.17545923590660095,
0.13407015800476074,
-0.0790473148226738,
0.05510125309228897,
0.3086705207824707,
-0.22969645261764526,
0.03570643067359924,
-0.2841407060623169,
0.44516056776046753,
0.030277080833911896,
0.09864893555641174,
0.09511732310056686,
-0.11758985370397568,
-0.03349681198596954,
0.33172401785850525,
0.010560065507888794,
-0.1749689131975174,
-0.19885586202144623,
-0.013105013407766819,
-0.0670318678021431,
-0.2619432806968689,
-0.17561075091362,
0.15882918238639832,
0.17338688671588898,
-0.08907944709062576,
0.30908268690109253,
-0.003730040043592453,
-0.10699750483036041,
0.016488289460539818,
0.0875212699174881,
-0.3464054763317108,
0.34655383229255676,
0.16837844252586365,
-0.28817468881607056,
-0.21669206023216248,
0.3719768524169922,
0.10448767244815826,
0.024191951379179955,
-0.19916880130767822,
0.15368404984474182,
-0.11736946552991867,
-0.12331914901733398,
-0.5844514966011047,
0.10993069410324097,
0.36117950081825256,
0.158380925655365,
0.2550024390220642,
0.5036296248435974,
0.11218855530023575,
-0.03440766781568527,
0.06214237958192825,
0.5594333410263062,
-0.18953436613082886,
0.022655494511127472,
-0.3018747568130493,
0.011687850579619408,
0.3107447028160095,
0.16395223140716553,
-0.16798870265483856,
-0.4434167444705963,
0.03712131455540657,
-0.022674202919006348,
-0.1656906008720398,
0.023112589493393898,
-0.4027048349380493,
0.34867551922798157,
0.28996482491493225,
-0.07821313291788101,
0.17961490154266357,
-0.0785859152674675,
-0.10272007435560226,
-0.1015440821647644,
0.22542288899421692,
-0.2952028512954712,
0.5789228677749634,
-0.03668339550495148,
-0.14496980607509613,
0.05437943711876869,
-0.026164434850215912,
-0.15568146109580994,
0.06167911738157272,
0.1211366355419159,
-0.06432566791772842,
0.11960962414741516,
0.24179601669311523,
0.03792747110128403,
-0.220016211271286,
0.29676324129104614,
-0.20568890869617462,
-0.11610236763954163,
-0.18921685218811035,
0.170144185423851,
-0.3475115895271301,
-0.011981168761849403,
-0.459431916475296,
-0.11035853624343872,
0.15138062834739685,
-0.09737793356180191,
-0.16793930530548096,
0.08473162353038788,
-0.2180066704750061,
0.10587573796510696,
-0.23040588200092316,
0.1284940391778946,
0.3007718324661255,
-0.038847386837005615,
-0.07833181321620941,
0.2827419340610504,
-0.1395007073879242,
-0.037971775978803635,
-0.11027470976114273,
-0.19640982151031494,
0.263609379529953,
0.2883650064468384,
-0.1961321234703064,
-0.1641438901424408,
-0.6332255601882935,
-0.11944152414798737,
-0.1341811865568161,
0.32877057790756226,
0.11765081435441971,
0.27563074231147766,
-0.15206806361675262,
-0.1166420429944992,
0.3145628869533539,
-0.015786170959472656,
0.17096300423145294,
0.18366959691047668,
0.13498282432556152,
-0.015545099042356014,
-0.5056920647621155,
-0.2204398214817047,
-0.09644326567649841,
-0.0626140907406807,
0.08665967732667923,
-0.21603132784366608,
0.02643602341413498,
0.04877009615302086,
-0.05383286252617836,
0.02739790827035904,
-0.24163490533828735,
0.04155478626489639,
-0.23594196140766144,
0.28192320466041565,
0.43028080463409424,
-0.06765486299991608,
-0.1318305879831314,
-0.16263237595558167,
-0.00796373002231121,
-0.35268425941467285,
-0.008451970294117928,
-0.059105485677719116,
-0.32497432827949524,
-0.20902518928050995,
0.2126208245754242,
-0.07352001219987869,
0.033843033015728,
-0.007720984518527985,
0.2844255268573761,
0.08240760117769241,
-0.10622656345367432,
-0.043578580021858215,
-0.028261028230190277,
0.08356566727161407,
0.1370989978313446,
-0.0031638499349355698,
0.3392145335674286,
0.06841930747032166,
-0.1338053196668625,
0.20237115025520325,
-0.3853635787963867,
0.18205255270004272,
0.14959716796875,
0.35083043575286865,
-0.17073947191238403,
-0.2915019690990448,
0.27154290676116943,
0.09857891499996185,
-0.1893194615840912,
0.12757858633995056,
-0.03816017508506775,
-0.2583358585834503,
0.12821795046329498,
0.25577250123023987,
0.1622960865497589,
-0.20246407389640808,
0.021912284195423126,
0.3147258162498474,
-0.0438629612326622,
0.07844042778015137,
0.5103879570960999,
-0.006447387859225273,
-0.3256703317165375,
-0.15435418486595154,
0.10719401389360428,
0.002452440559864044,
0.15893308818340302,
-0.24833530187606812,
-0.2655872404575348,
-0.2230769693851471,
0.12506654858589172,
0.08907152712345123,
0.7836353778839111,
0.162702739238739,
-0.27146637439727783,
0.10483947396278381,
0.38588374853134155,
0.2703321576118469,
0.08316407352685928,
-0.06095069646835327,
-0.015342682600021362,
0.056465938687324524,
-0.24661774933338165,
-0.471305251121521,
-0.24809110164642334,
0.16621437668800354,
0.03412298113107681,
0.45690804719924927,
-0.1455078423023224,
-0.02631291374564171,
0.2439652532339096,
0.3559235632419586,
0.005760703235864639,
-0.1592099368572235,
-0.3320910632610321,
-0.3904716372489929,
0.40063121914863586,
0.03301897272467613,
-0.23185162246227264,
0.23674964904785156,
-0.24372535943984985,
-0.1560375839471817,
-0.16547948122024536,
0.06785911321640015,
0.036890722811222076,
0.09785151481628418,
0.2811528444290161,
0.08527645468711853,
-0.008334344252943993,
0.03669160604476929,
0.20495948195457458,
-0.11603394150733948,
-0.1506892293691635,
0.09089115262031555,
-0.07816159725189209,
-0.1472303569316864,
-0.17592661082744598,
0.08062304556369781,
0.26898983120918274,
-0.009072834625840187,
0.11059244722127914,
-0.30576571822166443,
0.18404266238212585,
-0.20616307854652405,
0.028248464688658714,
0.22767724096775055,
0.21508431434631348,
-0.21185244619846344,
-0.40966877341270447,
0.3326396942138672,
-0.12602877616882324,
0.08509425818920135,
0.3867059350013733,
-0.24034728109836578,
-0.3442721366882324,
0.5024795532226562,
0.4321822226047516,
0.7307050228118896,
0.18443211913108826,
0.09520459175109863,
0.7169745564460754,
-0.02315870299935341,
0.6993008255958557,
-0.10370786488056183,
0.41096049547195435,
-0.4451063573360443,
-0.2860540449619293,
-0.046400465071201324,
-0.08398619294166565,
0.13445517420768738,
-0.338070273399353,
-0.28679633140563965,
0.12203896790742874,
-0.2664525508880615,
0.6795720458030701,
0.18808750808238983,
-0.2604108452796936,
0.18309825658798218,
-0.17585505545139313,
-0.5231517553329468,
0.05170615762472153,
-0.2250453680753708,
0.090544193983078,
-0.03223688155412674,
-0.2512684464454651,
-0.02041344717144966,
-0.08976083993911743,
0.09673063457012177,
0.13579818606376648,
-0.026400137692689896,
0.31396806240081787,
-0.0023805834352970123,
-0.4051858186721802,
0.11523212492465973,
0.11728981137275696,
0.29914236068725586,
0.40915241837501526,
0.05344369262456894,
-0.30661603808403015,
0.2917037010192871,
0.2551499903202057,
0.2743939757347107,
-0.04799065366387367,
0.21777084469795227,
0.22269582748413086,
-0.07819359749555588,
-0.03898932784795761,
0.21107301115989685,
0.2847232222557068,
-0.5404788255691528,
-0.07159267365932465,
-0.10032413899898529,
-0.5148371458053589,
-0.2767106592655182,
-0.2711356282234192,
0.1341780573129654,
-0.11004884541034698,
0.11929383873939514,
0.010615598410367966,
-0.2521549165248871,
0.4386938810348511,
0.004709966480731964,
-0.3241708278656006,
-0.1577308624982834,
0.25439125299453735,
0.10359043627977371,
-0.14188557863235474,
0.39548131823539734,
0.12317147850990295,
-0.3206825852394104,
-0.0323261059820652,
0.0648040845990181,
-0.07902119308710098,
-0.12969224154949188,
0.2723417580127716,
0.06640073657035828,
0.16467227041721344,
-0.24520307779312134,
-0.2958568036556244,
-0.1801092028617859,
0.0875241756439209,
-0.33371502161026,
-0.18719443678855896,
-0.01779516413807869,
-0.028193555772304535,
0.03364928439259529,
0.09985151886940002,
-0.02618296816945076,
-0.039158791303634644,
-0.2889397144317627,
-0.31229642033576965,
-0.2581632435321808,
-0.27343299984931946,
0.05263388901948929,
0.13591504096984863,
-0.09398671984672546,
-0.019878625869750977,
-0.21024063229560852,
-0.22653958201408386,
0.17268332839012146,
0.08614002168178558,
-0.14657087624073029,
-0.15443384647369385,
-0.033493489027023315,
0.11702485382556915,
-0.016894321888685226,
-0.37265193462371826,
0.03651238605380058,
0.1338893473148346,
-0.1707049012184143,
-0.21403785049915314,
0.1639729142189026,
0.14115315675735474,
0.035183385014534,
0.15294702351093292,
-0.08290630578994751,
0.2915264666080475,
0.1455330103635788,
0.007922405377030373,
-0.20121228694915771,
0.053967710584402084,
0.2531953752040863,
0.14744244515895844,
0.0888916552066803,
0.153603196144104,
-0.12798121571540833,
0.08545805513858795,
-0.14855581521987915,
0.13146159052848816,
0.4354933798313141,
-0.33341771364212036,
0.049891334027051926,
0.040589362382888794,
0.27430611848831177,
0.2675049901008606,
-0.38484570384025574,
-0.2557361423969269,
0.057178400456905365,
0.17968930304050446,
0.08079667389392853,
-0.057099342346191406,
0.49798327684402466,
0.3007374703884125,
-0.04355704411864281,
0.38421162962913513,
0.03313470259308815,
-0.05871395021677017,
-0.24107836186885834,
0.07994502037763596,
0.1146407201886177,
-0.18770718574523926,
0.3146584630012512,
0.7829314470291138,
0.030307356268167496,
0.018395930528640747,
0.022444631904363632,
-0.0692320466041565,
-0.0389486625790596,
0.18613949418067932,
0.18543294072151184,
0.24151688814163208,
0.29878783226013184,
-0.16087380051612854,
-0.14345663785934448,
-0.11297410726547241,
-0.2413642853498459,
0.1994004100561142,
-0.28661322593688965,
0.5658049583435059,
0.13620413839817047,
0.0380193293094635,
-0.4452711045742035,
-0.08038946986198425,
-0.2143814116716385,
0.03752100467681885,
-0.4529602527618408,
0.14074978232383728,
-0.006520433351397514,
0.03984876722097397,
-0.20045244693756104,
0.08343522250652313,
-0.2725495398044586,
0.07312937080860138,
0.042857445776462555,
0.15889659523963928,
-0.08723734319210052,
-0.0481923371553421,
0.2371426820755005,
0.10124494135379791,
0.2498708963394165,
-0.10691656172275543,
-0.0674716979265213,
0.3865653872489929,
0.09150315821170807,
-0.14542138576507568,
-0.05510881543159485,
0.27586960792541504,
0.6177332401275635,
-0.04567347839474678,
-0.06719356030225754,
-0.10213853418827057,
-0.08379292488098145,
0.08901912719011307,
0.262290358543396,
-0.05804002285003662,
-0.08907616138458252,
-0.0629318505525589,
0.15302352607250214,
-0.16242104768753052,
0.09774459898471832,
-0.08159786462783813,
0.25854581594467163,
-0.2866900861263275,
0.38327673077583313,
-0.12180745601654053,
-0.19208601117134094,
-0.08630562573671341,
-0.34347251057624817,
-0.062275566160678864,
-0.14492695033550262,
0.6067264080047607,
0.5737983584403992,
0.08965405821800232,
-0.015563995577394962,
0.04584934562444687,
-0.1593083143234253,
0.11178941279649734,
-0.13097769021987915,
-0.2677588164806366,
0.02734541893005371,
0.17095576226711273,
-0.2267080545425415,
0.15135693550109863,
0.33264297246932983,
-0.30999138951301575,
0.05313817039132118,
-0.01945139653980732,
0.07457497715950012,
0.052974432706832886,
-0.029099449515342712,
-0.0229388028383255,
0.4951131343841553,
0.15079326927661896,
-0.08291133493185043,
-0.19391243159770966,
-0.40169447660446167,
-0.06588386744260788,
-0.11119785904884338,
-0.33047375082969666,
0.2667972147464752,
-0.17961156368255615,
0.11254199594259262,
-0.16805478930473328,
0.17126990854740143,
-0.2835308611392975,
0.02523089200258255,
0.1856212019920349,
0.4099312722682953,
0.14531996846199036,
0.03864581137895584,
-0.22367319464683533,
-0.17643073201179504,
0.010659918189048767,
-0.23728755116462708,
0.28080037236213684,
-0.3789074420928955,
0.4946005642414093,
0.017529446631669998,
0.040532540529966354,
-0.3669935464859009,
0.39116090536117554,
0.001748785376548767,
-0.11669550836086273,
-0.0956469476222992,
0.15102341771125793,
-0.36021938920021057,
0.0048865885473787785,
0.21850959956645966,
0.099675253033638,
0.15540941059589386,
0.34668904542922974,
-0.09796872735023499,
-0.48147717118263245,
0.47677284479141235,
-0.3814901113510132,
-0.27774912118911743,
-0.13525331020355225,
0.148630291223526,
-0.07086648792028427,
-0.13644817471504211,
-0.5332998037338257,
-0.08449841290712357,
0.1973572075366974,
-0.18259301781654358,
-0.13010410964488983,
0.25621992349624634,
0.04519832134246826,
0.008136224001646042,
-0.12021878361701965,
0.30836981534957886,
-0.025906506925821304,
-0.02033541165292263,
0.16722485423088074,
-0.08359858393669128
] |
https://github.com/huggingface/datasets/issues/5517 | `with_format("numpy")` silently downcasts float64 to float32 features | This behavior (silent upcast from `int32` to `int64`) is also unexpected for the user in https://discuss.huggingface.co/t/standard-getitem-returns-wrong-data-type-for-arrays/62470/2 | ### Describe the bug
When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`.
### Steps to reproduce the bug
```python
import datasets
dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy")
print("feature dtype:", dataset.features['a'].dtype)
print("array dtype:", dataset['a'].dtype)
```
output:
```
feature dtype: float64
array dtype: float32
```
### Expected behavior
```
feature dtype: float64
array dtype: float64
```
### Environment info
- `datasets` version: 2.8.0
- Platform: Linux-5.4.0-135-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.4.4
### Suggested Fix
Changing [the `_tensorize` function of the numpy formatter](https://github.com/huggingface/datasets/blob/b065547654efa0ec633cf373ac1512884c68b2e1/src/datasets/formatting/np_formatter.py#L32) to
```python
def _tensorize(self, value):
if isinstance(value, (str, bytes, type(None))):
return value
elif isinstance(value, (np.character, np.ndarray)) and np.issubdtype(value.dtype, np.character):
return value
elif isinstance(value, np.number):
return value
return np.asarray(value, **self.np_array_kwargs)
```
fixes this particular issue for me. Not sure if this would break other tests. This should also avoid unnecessary copying of the array.
| 16 | `with_format("numpy")` silently downcasts float64 to float32 features
### Describe the bug
When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`.
### Steps to reproduce the bug
```python
import datasets
dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy")
print("feature dtype:", dataset.features['a'].dtype)
print("array dtype:", dataset['a'].dtype)
```
output:
```
feature dtype: float64
array dtype: float32
```
### Expected behavior
```
feature dtype: float64
array dtype: float64
```
### Environment info
- `datasets` version: 2.8.0
- Platform: Linux-5.4.0-135-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.4.4
### Suggested Fix
Changing [the `_tensorize` function of the numpy formatter](https://github.com/huggingface/datasets/blob/b065547654efa0ec633cf373ac1512884c68b2e1/src/datasets/formatting/np_formatter.py#L32) to
```python
def _tensorize(self, value):
if isinstance(value, (str, bytes, type(None))):
return value
elif isinstance(value, (np.character, np.ndarray)) and np.issubdtype(value.dtype, np.character):
return value
elif isinstance(value, np.number):
return value
return np.asarray(value, **self.np_array_kwargs)
```
fixes this particular issue for me. Not sure if this would break other tests. This should also avoid unnecessary copying of the array.
This behavior (silent upcast from `int32` to `int64`) is also unexpected for the user in https://discuss.huggingface.co/t/standard-getitem-returns-wrong-data-type-for-arrays/62470/2 | [
0.14177078008651733,
-0.24984367191791534,
0.000774633139371872,
0.0026635415852069855,
0.5696965456008911,
0.0561448410153389,
0.6134842038154602,
0.5261093378067017,
-0.16041861474514008,
-0.05886185169219971,
-0.13229535520076752,
0.6590015888214111,
-0.024173695594072342,
-0.055850546807050705,
-0.0898173376917839,
-0.09573148190975189,
0.19167107343673706,
0.36848190426826477,
-0.1873778998851776,
-0.08108260482549667,
-0.23802180588245392,
-0.2345665842294693,
-0.08685125410556793,
-0.115273118019104,
0.04147911071777344,
0.13877277076244354,
0.1588970422744751,
-0.2952386438846588,
-0.35430777072906494,
-0.21976175904273987,
0.17852190136909485,
-0.1553322821855545,
0.10645264387130737,
0.2438211739063263,
-0.0001166464644484222,
-0.02281355857849121,
0.08414025604724884,
-0.08400937914848328,
-0.23688678443431854,
0.33728793263435364,
0.15402573347091675,
-0.5218885540962219,
0.11003046482801437,
-0.31812769174575806,
-0.14374025166034698,
-0.4370628595352173,
-0.3288455307483673,
-0.3330014944076538,
0.12816524505615234,
-0.0955711379647255,
0.19108319282531738,
0.48318222165107727,
0.14118702709674835,
0.29137617349624634,
-0.4448983371257782,
0.29345792531967163,
-0.31258758902549744,
0.0738760232925415,
-0.301182359457016,
0.273569792509079,
0.1048036739230156,
0.3836762607097626,
-0.2931397259235382,
0.10119502246379852,
-0.00950537621974945,
0.12337784469127655,
0.28796064853668213,
-0.2609037458896637,
-0.09919553250074387,
0.13078156113624573,
0.3381490707397461,
-0.022355571389198303,
-0.3329734206199646,
-0.2674660384654999,
-0.12008658051490784,
-0.2960910499095917,
-0.08011550456285477,
0.17440173029899597,
0.028630852699279785,
0.05780795216560364,
-0.3742605745792389,
0.3191636800765991,
-0.08523911237716675,
0.21660591661930084,
0.019349433481693268,
0.22214846312999725,
-0.12840941548347473,
0.03873099386692047,
-0.46418362855911255,
-0.11483639478683472,
-0.057465579360723495,
-0.3399850130081177,
0.1099044531583786,
0.19607682526111603,
0.0805511474609375,
-0.31794920563697815,
0.33674243092536926,
-0.5577793121337891,
0.024656500667333603,
-0.22734667360782623,
-0.0029758578166365623,
0.3014673888683319,
-0.3438105583190918,
0.03839642554521561,
0.03598916903138161,
0.3496714234352112,
0.010740682482719421,
-0.03237667307257652,
0.22094452381134033,
0.21561606228351593,
0.448309063911438,
0.03775426372885704,
0.3862801790237427,
0.16529054939746857,
0.11328066885471344,
-0.02615904062986374,
0.482272207736969,
-0.22848306596279144,
-0.37862685322761536,
0.26312050223350525,
-0.3443557620048523,
0.07116350531578064,
0.020232656970620155,
0.025952007621526718,
-0.0595310777425766,
0.4846922755241394,
0.04862983524799347,
0.17409051954746246,
-0.2399595081806183,
-0.03258636221289635,
-0.19234873354434967,
-0.24789445102214813,
-0.1684461534023285,
-0.12529093027114868,
0.12297172844409943,
0.3188713788986206,
0.05905483663082123,
0.5129324793815613,
0.030423425137996674,
-0.22497598826885223,
0.05005607008934021,
-0.012772160582244396,
0.5335593223571777,
0.017126090824604034,
-0.43277454376220703,
0.3429165184497833,
0.29663321375846863,
-0.233347088098526,
-0.1042582243680954,
0.050958722829818726,
0.03980989754199982,
0.1377754807472229,
-0.3912065625190735,
0.19081571698188782,
-0.2958465814590454,
0.3621065020561218,
0.2892390787601471,
0.10355809330940247,
0.408719539642334,
-0.07775391638278961,
0.2351023554801941,
-0.4885823130607605,
-0.21119140088558197,
-0.35935577750205994,
0.442503422498703,
0.25058290362358093,
-0.37392354011535645,
0.10276424884796143,
0.4249876141548157,
0.09905529022216797,
0.47119471430778503,
0.15340320765972137,
0.10159412771463394,
-0.08906867355108261,
-0.19534000754356384,
-0.1690911054611206,
0.1824798882007599,
0.3884349465370178,
-0.22312237322330475,
0.014580398797988892,
-0.22743095457553864,
0.4001566767692566,
-0.1761632263660431,
0.19206295907497406,
-0.05699025094509125,
-0.09383387118577957,
-0.044567711651325226,
0.46422070264816284,
-0.0621139258146286,
0.16311419010162354,
-0.4260692298412323,
-0.15895642340183258,
0.326113224029541,
-0.04248140752315521,
-0.17545923590660095,
0.13407015800476074,
-0.0790473148226738,
0.05510125309228897,
0.3086705207824707,
-0.22969645261764526,
0.03570643067359924,
-0.2841407060623169,
0.44516056776046753,
0.030277080833911896,
0.09864893555641174,
0.09511732310056686,
-0.11758985370397568,
-0.03349681198596954,
0.33172401785850525,
0.010560065507888794,
-0.1749689131975174,
-0.19885586202144623,
-0.013105013407766819,
-0.0670318678021431,
-0.2619432806968689,
-0.17561075091362,
0.15882918238639832,
0.17338688671588898,
-0.08907944709062576,
0.30908268690109253,
-0.003730040043592453,
-0.10699750483036041,
0.016488289460539818,
0.0875212699174881,
-0.3464054763317108,
0.34655383229255676,
0.16837844252586365,
-0.28817468881607056,
-0.21669206023216248,
0.3719768524169922,
0.10448767244815826,
0.024191951379179955,
-0.19916880130767822,
0.15368404984474182,
-0.11736946552991867,
-0.12331914901733398,
-0.5844514966011047,
0.10993069410324097,
0.36117950081825256,
0.158380925655365,
0.2550024390220642,
0.5036296248435974,
0.11218855530023575,
-0.03440766781568527,
0.06214237958192825,
0.5594333410263062,
-0.18953436613082886,
0.022655494511127472,
-0.3018747568130493,
0.011687850579619408,
0.3107447028160095,
0.16395223140716553,
-0.16798870265483856,
-0.4434167444705963,
0.03712131455540657,
-0.022674202919006348,
-0.1656906008720398,
0.023112589493393898,
-0.4027048349380493,
0.34867551922798157,
0.28996482491493225,
-0.07821313291788101,
0.17961490154266357,
-0.0785859152674675,
-0.10272007435560226,
-0.1015440821647644,
0.22542288899421692,
-0.2952028512954712,
0.5789228677749634,
-0.03668339550495148,
-0.14496980607509613,
0.05437943711876869,
-0.026164434850215912,
-0.15568146109580994,
0.06167911738157272,
0.1211366355419159,
-0.06432566791772842,
0.11960962414741516,
0.24179601669311523,
0.03792747110128403,
-0.220016211271286,
0.29676324129104614,
-0.20568890869617462,
-0.11610236763954163,
-0.18921685218811035,
0.170144185423851,
-0.3475115895271301,
-0.011981168761849403,
-0.459431916475296,
-0.11035853624343872,
0.15138062834739685,
-0.09737793356180191,
-0.16793930530548096,
0.08473162353038788,
-0.2180066704750061,
0.10587573796510696,
-0.23040588200092316,
0.1284940391778946,
0.3007718324661255,
-0.038847386837005615,
-0.07833181321620941,
0.2827419340610504,
-0.1395007073879242,
-0.037971775978803635,
-0.11027470976114273,
-0.19640982151031494,
0.263609379529953,
0.2883650064468384,
-0.1961321234703064,
-0.1641438901424408,
-0.6332255601882935,
-0.11944152414798737,
-0.1341811865568161,
0.32877057790756226,
0.11765081435441971,
0.27563074231147766,
-0.15206806361675262,
-0.1166420429944992,
0.3145628869533539,
-0.015786170959472656,
0.17096300423145294,
0.18366959691047668,
0.13498282432556152,
-0.015545099042356014,
-0.5056920647621155,
-0.2204398214817047,
-0.09644326567649841,
-0.0626140907406807,
0.08665967732667923,
-0.21603132784366608,
0.02643602341413498,
0.04877009615302086,
-0.05383286252617836,
0.02739790827035904,
-0.24163490533828735,
0.04155478626489639,
-0.23594196140766144,
0.28192320466041565,
0.43028080463409424,
-0.06765486299991608,
-0.1318305879831314,
-0.16263237595558167,
-0.00796373002231121,
-0.35268425941467285,
-0.008451970294117928,
-0.059105485677719116,
-0.32497432827949524,
-0.20902518928050995,
0.2126208245754242,
-0.07352001219987869,
0.033843033015728,
-0.007720984518527985,
0.2844255268573761,
0.08240760117769241,
-0.10622656345367432,
-0.043578580021858215,
-0.028261028230190277,
0.08356566727161407,
0.1370989978313446,
-0.0031638499349355698,
0.3392145335674286,
0.06841930747032166,
-0.1338053196668625,
0.20237115025520325,
-0.3853635787963867,
0.18205255270004272,
0.14959716796875,
0.35083043575286865,
-0.17073947191238403,
-0.2915019690990448,
0.27154290676116943,
0.09857891499996185,
-0.1893194615840912,
0.12757858633995056,
-0.03816017508506775,
-0.2583358585834503,
0.12821795046329498,
0.25577250123023987,
0.1622960865497589,
-0.20246407389640808,
0.021912284195423126,
0.3147258162498474,
-0.0438629612326622,
0.07844042778015137,
0.5103879570960999,
-0.006447387859225273,
-0.3256703317165375,
-0.15435418486595154,
0.10719401389360428,
0.002452440559864044,
0.15893308818340302,
-0.24833530187606812,
-0.2655872404575348,
-0.2230769693851471,
0.12506654858589172,
0.08907152712345123,
0.7836353778839111,
0.162702739238739,
-0.27146637439727783,
0.10483947396278381,
0.38588374853134155,
0.2703321576118469,
0.08316407352685928,
-0.06095069646835327,
-0.015342682600021362,
0.056465938687324524,
-0.24661774933338165,
-0.471305251121521,
-0.24809110164642334,
0.16621437668800354,
0.03412298113107681,
0.45690804719924927,
-0.1455078423023224,
-0.02631291374564171,
0.2439652532339096,
0.3559235632419586,
0.005760703235864639,
-0.1592099368572235,
-0.3320910632610321,
-0.3904716372489929,
0.40063121914863586,
0.03301897272467613,
-0.23185162246227264,
0.23674964904785156,
-0.24372535943984985,
-0.1560375839471817,
-0.16547948122024536,
0.06785911321640015,
0.036890722811222076,
0.09785151481628418,
0.2811528444290161,
0.08527645468711853,
-0.008334344252943993,
0.03669160604476929,
0.20495948195457458,
-0.11603394150733948,
-0.1506892293691635,
0.09089115262031555,
-0.07816159725189209,
-0.1472303569316864,
-0.17592661082744598,
0.08062304556369781,
0.26898983120918274,
-0.009072834625840187,
0.11059244722127914,
-0.30576571822166443,
0.18404266238212585,
-0.20616307854652405,
0.028248464688658714,
0.22767724096775055,
0.21508431434631348,
-0.21185244619846344,
-0.40966877341270447,
0.3326396942138672,
-0.12602877616882324,
0.08509425818920135,
0.3867059350013733,
-0.24034728109836578,
-0.3442721366882324,
0.5024795532226562,
0.4321822226047516,
0.7307050228118896,
0.18443211913108826,
0.09520459175109863,
0.7169745564460754,
-0.02315870299935341,
0.6993008255958557,
-0.10370786488056183,
0.41096049547195435,
-0.4451063573360443,
-0.2860540449619293,
-0.046400465071201324,
-0.08398619294166565,
0.13445517420768738,
-0.338070273399353,
-0.28679633140563965,
0.12203896790742874,
-0.2664525508880615,
0.6795720458030701,
0.18808750808238983,
-0.2604108452796936,
0.18309825658798218,
-0.17585505545139313,
-0.5231517553329468,
0.05170615762472153,
-0.2250453680753708,
0.090544193983078,
-0.03223688155412674,
-0.2512684464454651,
-0.02041344717144966,
-0.08976083993911743,
0.09673063457012177,
0.13579818606376648,
-0.026400137692689896,
0.31396806240081787,
-0.0023805834352970123,
-0.4051858186721802,
0.11523212492465973,
0.11728981137275696,
0.29914236068725586,
0.40915241837501526,
0.05344369262456894,
-0.30661603808403015,
0.2917037010192871,
0.2551499903202057,
0.2743939757347107,
-0.04799065366387367,
0.21777084469795227,
0.22269582748413086,
-0.07819359749555588,
-0.03898932784795761,
0.21107301115989685,
0.2847232222557068,
-0.5404788255691528,
-0.07159267365932465,
-0.10032413899898529,
-0.5148371458053589,
-0.2767106592655182,
-0.2711356282234192,
0.1341780573129654,
-0.11004884541034698,
0.11929383873939514,
0.010615598410367966,
-0.2521549165248871,
0.4386938810348511,
0.004709966480731964,
-0.3241708278656006,
-0.1577308624982834,
0.25439125299453735,
0.10359043627977371,
-0.14188557863235474,
0.39548131823539734,
0.12317147850990295,
-0.3206825852394104,
-0.0323261059820652,
0.0648040845990181,
-0.07902119308710098,
-0.12969224154949188,
0.2723417580127716,
0.06640073657035828,
0.16467227041721344,
-0.24520307779312134,
-0.2958568036556244,
-0.1801092028617859,
0.0875241756439209,
-0.33371502161026,
-0.18719443678855896,
-0.01779516413807869,
-0.028193555772304535,
0.03364928439259529,
0.09985151886940002,
-0.02618296816945076,
-0.039158791303634644,
-0.2889397144317627,
-0.31229642033576965,
-0.2581632435321808,
-0.27343299984931946,
0.05263388901948929,
0.13591504096984863,
-0.09398671984672546,
-0.019878625869750977,
-0.21024063229560852,
-0.22653958201408386,
0.17268332839012146,
0.08614002168178558,
-0.14657087624073029,
-0.15443384647369385,
-0.033493489027023315,
0.11702485382556915,
-0.016894321888685226,
-0.37265193462371826,
0.03651238605380058,
0.1338893473148346,
-0.1707049012184143,
-0.21403785049915314,
0.1639729142189026,
0.14115315675735474,
0.035183385014534,
0.15294702351093292,
-0.08290630578994751,
0.2915264666080475,
0.1455330103635788,
0.007922405377030373,
-0.20121228694915771,
0.053967710584402084,
0.2531953752040863,
0.14744244515895844,
0.0888916552066803,
0.153603196144104,
-0.12798121571540833,
0.08545805513858795,
-0.14855581521987915,
0.13146159052848816,
0.4354933798313141,
-0.33341771364212036,
0.049891334027051926,
0.040589362382888794,
0.27430611848831177,
0.2675049901008606,
-0.38484570384025574,
-0.2557361423969269,
0.057178400456905365,
0.17968930304050446,
0.08079667389392853,
-0.057099342346191406,
0.49798327684402466,
0.3007374703884125,
-0.04355704411864281,
0.38421162962913513,
0.03313470259308815,
-0.05871395021677017,
-0.24107836186885834,
0.07994502037763596,
0.1146407201886177,
-0.18770718574523926,
0.3146584630012512,
0.7829314470291138,
0.030307356268167496,
0.018395930528640747,
0.022444631904363632,
-0.0692320466041565,
-0.0389486625790596,
0.18613949418067932,
0.18543294072151184,
0.24151688814163208,
0.29878783226013184,
-0.16087380051612854,
-0.14345663785934448,
-0.11297410726547241,
-0.2413642853498459,
0.1994004100561142,
-0.28661322593688965,
0.5658049583435059,
0.13620413839817047,
0.0380193293094635,
-0.4452711045742035,
-0.08038946986198425,
-0.2143814116716385,
0.03752100467681885,
-0.4529602527618408,
0.14074978232383728,
-0.006520433351397514,
0.03984876722097397,
-0.20045244693756104,
0.08343522250652313,
-0.2725495398044586,
0.07312937080860138,
0.042857445776462555,
0.15889659523963928,
-0.08723734319210052,
-0.0481923371553421,
0.2371426820755005,
0.10124494135379791,
0.2498708963394165,
-0.10691656172275543,
-0.0674716979265213,
0.3865653872489929,
0.09150315821170807,
-0.14542138576507568,
-0.05510881543159485,
0.27586960792541504,
0.6177332401275635,
-0.04567347839474678,
-0.06719356030225754,
-0.10213853418827057,
-0.08379292488098145,
0.08901912719011307,
0.262290358543396,
-0.05804002285003662,
-0.08907616138458252,
-0.0629318505525589,
0.15302352607250214,
-0.16242104768753052,
0.09774459898471832,
-0.08159786462783813,
0.25854581594467163,
-0.2866900861263275,
0.38327673077583313,
-0.12180745601654053,
-0.19208601117134094,
-0.08630562573671341,
-0.34347251057624817,
-0.062275566160678864,
-0.14492695033550262,
0.6067264080047607,
0.5737983584403992,
0.08965405821800232,
-0.015563995577394962,
0.04584934562444687,
-0.1593083143234253,
0.11178941279649734,
-0.13097769021987915,
-0.2677588164806366,
0.02734541893005371,
0.17095576226711273,
-0.2267080545425415,
0.15135693550109863,
0.33264297246932983,
-0.30999138951301575,
0.05313817039132118,
-0.01945139653980732,
0.07457497715950012,
0.052974432706832886,
-0.029099449515342712,
-0.0229388028383255,
0.4951131343841553,
0.15079326927661896,
-0.08291133493185043,
-0.19391243159770966,
-0.40169447660446167,
-0.06588386744260788,
-0.11119785904884338,
-0.33047375082969666,
0.2667972147464752,
-0.17961156368255615,
0.11254199594259262,
-0.16805478930473328,
0.17126990854740143,
-0.2835308611392975,
0.02523089200258255,
0.1856212019920349,
0.4099312722682953,
0.14531996846199036,
0.03864581137895584,
-0.22367319464683533,
-0.17643073201179504,
0.010659918189048767,
-0.23728755116462708,
0.28080037236213684,
-0.3789074420928955,
0.4946005642414093,
0.017529446631669998,
0.040532540529966354,
-0.3669935464859009,
0.39116090536117554,
0.001748785376548767,
-0.11669550836086273,
-0.0956469476222992,
0.15102341771125793,
-0.36021938920021057,
0.0048865885473787785,
0.21850959956645966,
0.099675253033638,
0.15540941059589386,
0.34668904542922974,
-0.09796872735023499,
-0.48147717118263245,
0.47677284479141235,
-0.3814901113510132,
-0.27774912118911743,
-0.13525331020355225,
0.148630291223526,
-0.07086648792028427,
-0.13644817471504211,
-0.5332998037338257,
-0.08449841290712357,
0.1973572075366974,
-0.18259301781654358,
-0.13010410964488983,
0.25621992349624634,
0.04519832134246826,
0.008136224001646042,
-0.12021878361701965,
0.30836981534957886,
-0.025906506925821304,
-0.02033541165292263,
0.16722485423088074,
-0.08359858393669128
] |
https://github.com/huggingface/datasets/issues/5517 | `with_format("numpy")` silently downcasts float64 to float32 features | Hi, I stumbled on a variation that upcasts uint8 to int64. I would expect the dtype to be the same as it was when I generated the dataset.
```
import numpy as np
import datasets as ds
foo = np.random.randint(0, 256, size=(5, 10, 10), dtype=np.uint8)
features = ds.Features({"foo": ds.Array2D((10, 10), "uint8")})
dataset = ds.Dataset.from_dict({"foo": foo}, features=features)
dataset.set_format("torch")
print("feature dtype:", dataset.features["foo"].dtype)
print("array dtype:", dataset["foo"].dtype)
# feature dtype: uint8
# array dtype: torch.int64
```
| ### Describe the bug
When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`.
### Steps to reproduce the bug
```python
import datasets
dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy")
print("feature dtype:", dataset.features['a'].dtype)
print("array dtype:", dataset['a'].dtype)
```
output:
```
feature dtype: float64
array dtype: float32
```
### Expected behavior
```
feature dtype: float64
array dtype: float64
```
### Environment info
- `datasets` version: 2.8.0
- Platform: Linux-5.4.0-135-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.4.4
### Suggested Fix
Changing [the `_tensorize` function of the numpy formatter](https://github.com/huggingface/datasets/blob/b065547654efa0ec633cf373ac1512884c68b2e1/src/datasets/formatting/np_formatter.py#L32) to
```python
def _tensorize(self, value):
if isinstance(value, (str, bytes, type(None))):
return value
elif isinstance(value, (np.character, np.ndarray)) and np.issubdtype(value.dtype, np.character):
return value
elif isinstance(value, np.number):
return value
return np.asarray(value, **self.np_array_kwargs)
```
fixes this particular issue for me. Not sure if this would break other tests. This should also avoid unnecessary copying of the array.
| 72 | `with_format("numpy")` silently downcasts float64 to float32 features
### Describe the bug
When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`.
### Steps to reproduce the bug
```python
import datasets
dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy")
print("feature dtype:", dataset.features['a'].dtype)
print("array dtype:", dataset['a'].dtype)
```
output:
```
feature dtype: float64
array dtype: float32
```
### Expected behavior
```
feature dtype: float64
array dtype: float64
```
### Environment info
- `datasets` version: 2.8.0
- Platform: Linux-5.4.0-135-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.4.4
### Suggested Fix
Changing [the `_tensorize` function of the numpy formatter](https://github.com/huggingface/datasets/blob/b065547654efa0ec633cf373ac1512884c68b2e1/src/datasets/formatting/np_formatter.py#L32) to
```python
def _tensorize(self, value):
if isinstance(value, (str, bytes, type(None))):
return value
elif isinstance(value, (np.character, np.ndarray)) and np.issubdtype(value.dtype, np.character):
return value
elif isinstance(value, np.number):
return value
return np.asarray(value, **self.np_array_kwargs)
```
fixes this particular issue for me. Not sure if this would break other tests. This should also avoid unnecessary copying of the array.
Hi, I stumbled on a variation that upcasts uint8 to int64. I would expect the dtype to be the same as it was when I generated the dataset.
```
import numpy as np
import datasets as ds
foo = np.random.randint(0, 256, size=(5, 10, 10), dtype=np.uint8)
features = ds.Features({"foo": ds.Array2D((10, 10), "uint8")})
dataset = ds.Dataset.from_dict({"foo": foo}, features=features)
dataset.set_format("torch")
print("feature dtype:", dataset.features["foo"].dtype)
print("array dtype:", dataset["foo"].dtype)
# feature dtype: uint8
# array dtype: torch.int64
```
| [
0.14177078008651733,
-0.24984367191791534,
0.000774633139371872,
0.0026635415852069855,
0.5696965456008911,
0.0561448410153389,
0.6134842038154602,
0.5261093378067017,
-0.16041861474514008,
-0.05886185169219971,
-0.13229535520076752,
0.6590015888214111,
-0.024173695594072342,
-0.055850546807050705,
-0.0898173376917839,
-0.09573148190975189,
0.19167107343673706,
0.36848190426826477,
-0.1873778998851776,
-0.08108260482549667,
-0.23802180588245392,
-0.2345665842294693,
-0.08685125410556793,
-0.115273118019104,
0.04147911071777344,
0.13877277076244354,
0.1588970422744751,
-0.2952386438846588,
-0.35430777072906494,
-0.21976175904273987,
0.17852190136909485,
-0.1553322821855545,
0.10645264387130737,
0.2438211739063263,
-0.0001166464644484222,
-0.02281355857849121,
0.08414025604724884,
-0.08400937914848328,
-0.23688678443431854,
0.33728793263435364,
0.15402573347091675,
-0.5218885540962219,
0.11003046482801437,
-0.31812769174575806,
-0.14374025166034698,
-0.4370628595352173,
-0.3288455307483673,
-0.3330014944076538,
0.12816524505615234,
-0.0955711379647255,
0.19108319282531738,
0.48318222165107727,
0.14118702709674835,
0.29137617349624634,
-0.4448983371257782,
0.29345792531967163,
-0.31258758902549744,
0.0738760232925415,
-0.301182359457016,
0.273569792509079,
0.1048036739230156,
0.3836762607097626,
-0.2931397259235382,
0.10119502246379852,
-0.00950537621974945,
0.12337784469127655,
0.28796064853668213,
-0.2609037458896637,
-0.09919553250074387,
0.13078156113624573,
0.3381490707397461,
-0.022355571389198303,
-0.3329734206199646,
-0.2674660384654999,
-0.12008658051490784,
-0.2960910499095917,
-0.08011550456285477,
0.17440173029899597,
0.028630852699279785,
0.05780795216560364,
-0.3742605745792389,
0.3191636800765991,
-0.08523911237716675,
0.21660591661930084,
0.019349433481693268,
0.22214846312999725,
-0.12840941548347473,
0.03873099386692047,
-0.46418362855911255,
-0.11483639478683472,
-0.057465579360723495,
-0.3399850130081177,
0.1099044531583786,
0.19607682526111603,
0.0805511474609375,
-0.31794920563697815,
0.33674243092536926,
-0.5577793121337891,
0.024656500667333603,
-0.22734667360782623,
-0.0029758578166365623,
0.3014673888683319,
-0.3438105583190918,
0.03839642554521561,
0.03598916903138161,
0.3496714234352112,
0.010740682482719421,
-0.03237667307257652,
0.22094452381134033,
0.21561606228351593,
0.448309063911438,
0.03775426372885704,
0.3862801790237427,
0.16529054939746857,
0.11328066885471344,
-0.02615904062986374,
0.482272207736969,
-0.22848306596279144,
-0.37862685322761536,
0.26312050223350525,
-0.3443557620048523,
0.07116350531578064,
0.020232656970620155,
0.025952007621526718,
-0.0595310777425766,
0.4846922755241394,
0.04862983524799347,
0.17409051954746246,
-0.2399595081806183,
-0.03258636221289635,
-0.19234873354434967,
-0.24789445102214813,
-0.1684461534023285,
-0.12529093027114868,
0.12297172844409943,
0.3188713788986206,
0.05905483663082123,
0.5129324793815613,
0.030423425137996674,
-0.22497598826885223,
0.05005607008934021,
-0.012772160582244396,
0.5335593223571777,
0.017126090824604034,
-0.43277454376220703,
0.3429165184497833,
0.29663321375846863,
-0.233347088098526,
-0.1042582243680954,
0.050958722829818726,
0.03980989754199982,
0.1377754807472229,
-0.3912065625190735,
0.19081571698188782,
-0.2958465814590454,
0.3621065020561218,
0.2892390787601471,
0.10355809330940247,
0.408719539642334,
-0.07775391638278961,
0.2351023554801941,
-0.4885823130607605,
-0.21119140088558197,
-0.35935577750205994,
0.442503422498703,
0.25058290362358093,
-0.37392354011535645,
0.10276424884796143,
0.4249876141548157,
0.09905529022216797,
0.47119471430778503,
0.15340320765972137,
0.10159412771463394,
-0.08906867355108261,
-0.19534000754356384,
-0.1690911054611206,
0.1824798882007599,
0.3884349465370178,
-0.22312237322330475,
0.014580398797988892,
-0.22743095457553864,
0.4001566767692566,
-0.1761632263660431,
0.19206295907497406,
-0.05699025094509125,
-0.09383387118577957,
-0.044567711651325226,
0.46422070264816284,
-0.0621139258146286,
0.16311419010162354,
-0.4260692298412323,
-0.15895642340183258,
0.326113224029541,
-0.04248140752315521,
-0.17545923590660095,
0.13407015800476074,
-0.0790473148226738,
0.05510125309228897,
0.3086705207824707,
-0.22969645261764526,
0.03570643067359924,
-0.2841407060623169,
0.44516056776046753,
0.030277080833911896,
0.09864893555641174,
0.09511732310056686,
-0.11758985370397568,
-0.03349681198596954,
0.33172401785850525,
0.010560065507888794,
-0.1749689131975174,
-0.19885586202144623,
-0.013105013407766819,
-0.0670318678021431,
-0.2619432806968689,
-0.17561075091362,
0.15882918238639832,
0.17338688671588898,
-0.08907944709062576,
0.30908268690109253,
-0.003730040043592453,
-0.10699750483036041,
0.016488289460539818,
0.0875212699174881,
-0.3464054763317108,
0.34655383229255676,
0.16837844252586365,
-0.28817468881607056,
-0.21669206023216248,
0.3719768524169922,
0.10448767244815826,
0.024191951379179955,
-0.19916880130767822,
0.15368404984474182,
-0.11736946552991867,
-0.12331914901733398,
-0.5844514966011047,
0.10993069410324097,
0.36117950081825256,
0.158380925655365,
0.2550024390220642,
0.5036296248435974,
0.11218855530023575,
-0.03440766781568527,
0.06214237958192825,
0.5594333410263062,
-0.18953436613082886,
0.022655494511127472,
-0.3018747568130493,
0.011687850579619408,
0.3107447028160095,
0.16395223140716553,
-0.16798870265483856,
-0.4434167444705963,
0.03712131455540657,
-0.022674202919006348,
-0.1656906008720398,
0.023112589493393898,
-0.4027048349380493,
0.34867551922798157,
0.28996482491493225,
-0.07821313291788101,
0.17961490154266357,
-0.0785859152674675,
-0.10272007435560226,
-0.1015440821647644,
0.22542288899421692,
-0.2952028512954712,
0.5789228677749634,
-0.03668339550495148,
-0.14496980607509613,
0.05437943711876869,
-0.026164434850215912,
-0.15568146109580994,
0.06167911738157272,
0.1211366355419159,
-0.06432566791772842,
0.11960962414741516,
0.24179601669311523,
0.03792747110128403,
-0.220016211271286,
0.29676324129104614,
-0.20568890869617462,
-0.11610236763954163,
-0.18921685218811035,
0.170144185423851,
-0.3475115895271301,
-0.011981168761849403,
-0.459431916475296,
-0.11035853624343872,
0.15138062834739685,
-0.09737793356180191,
-0.16793930530548096,
0.08473162353038788,
-0.2180066704750061,
0.10587573796510696,
-0.23040588200092316,
0.1284940391778946,
0.3007718324661255,
-0.038847386837005615,
-0.07833181321620941,
0.2827419340610504,
-0.1395007073879242,
-0.037971775978803635,
-0.11027470976114273,
-0.19640982151031494,
0.263609379529953,
0.2883650064468384,
-0.1961321234703064,
-0.1641438901424408,
-0.6332255601882935,
-0.11944152414798737,
-0.1341811865568161,
0.32877057790756226,
0.11765081435441971,
0.27563074231147766,
-0.15206806361675262,
-0.1166420429944992,
0.3145628869533539,
-0.015786170959472656,
0.17096300423145294,
0.18366959691047668,
0.13498282432556152,
-0.015545099042356014,
-0.5056920647621155,
-0.2204398214817047,
-0.09644326567649841,
-0.0626140907406807,
0.08665967732667923,
-0.21603132784366608,
0.02643602341413498,
0.04877009615302086,
-0.05383286252617836,
0.02739790827035904,
-0.24163490533828735,
0.04155478626489639,
-0.23594196140766144,
0.28192320466041565,
0.43028080463409424,
-0.06765486299991608,
-0.1318305879831314,
-0.16263237595558167,
-0.00796373002231121,
-0.35268425941467285,
-0.008451970294117928,
-0.059105485677719116,
-0.32497432827949524,
-0.20902518928050995,
0.2126208245754242,
-0.07352001219987869,
0.033843033015728,
-0.007720984518527985,
0.2844255268573761,
0.08240760117769241,
-0.10622656345367432,
-0.043578580021858215,
-0.028261028230190277,
0.08356566727161407,
0.1370989978313446,
-0.0031638499349355698,
0.3392145335674286,
0.06841930747032166,
-0.1338053196668625,
0.20237115025520325,
-0.3853635787963867,
0.18205255270004272,
0.14959716796875,
0.35083043575286865,
-0.17073947191238403,
-0.2915019690990448,
0.27154290676116943,
0.09857891499996185,
-0.1893194615840912,
0.12757858633995056,
-0.03816017508506775,
-0.2583358585834503,
0.12821795046329498,
0.25577250123023987,
0.1622960865497589,
-0.20246407389640808,
0.021912284195423126,
0.3147258162498474,
-0.0438629612326622,
0.07844042778015137,
0.5103879570960999,
-0.006447387859225273,
-0.3256703317165375,
-0.15435418486595154,
0.10719401389360428,
0.002452440559864044,
0.15893308818340302,
-0.24833530187606812,
-0.2655872404575348,
-0.2230769693851471,
0.12506654858589172,
0.08907152712345123,
0.7836353778839111,
0.162702739238739,
-0.27146637439727783,
0.10483947396278381,
0.38588374853134155,
0.2703321576118469,
0.08316407352685928,
-0.06095069646835327,
-0.015342682600021362,
0.056465938687324524,
-0.24661774933338165,
-0.471305251121521,
-0.24809110164642334,
0.16621437668800354,
0.03412298113107681,
0.45690804719924927,
-0.1455078423023224,
-0.02631291374564171,
0.2439652532339096,
0.3559235632419586,
0.005760703235864639,
-0.1592099368572235,
-0.3320910632610321,
-0.3904716372489929,
0.40063121914863586,
0.03301897272467613,
-0.23185162246227264,
0.23674964904785156,
-0.24372535943984985,
-0.1560375839471817,
-0.16547948122024536,
0.06785911321640015,
0.036890722811222076,
0.09785151481628418,
0.2811528444290161,
0.08527645468711853,
-0.008334344252943993,
0.03669160604476929,
0.20495948195457458,
-0.11603394150733948,
-0.1506892293691635,
0.09089115262031555,
-0.07816159725189209,
-0.1472303569316864,
-0.17592661082744598,
0.08062304556369781,
0.26898983120918274,
-0.009072834625840187,
0.11059244722127914,
-0.30576571822166443,
0.18404266238212585,
-0.20616307854652405,
0.028248464688658714,
0.22767724096775055,
0.21508431434631348,
-0.21185244619846344,
-0.40966877341270447,
0.3326396942138672,
-0.12602877616882324,
0.08509425818920135,
0.3867059350013733,
-0.24034728109836578,
-0.3442721366882324,
0.5024795532226562,
0.4321822226047516,
0.7307050228118896,
0.18443211913108826,
0.09520459175109863,
0.7169745564460754,
-0.02315870299935341,
0.6993008255958557,
-0.10370786488056183,
0.41096049547195435,
-0.4451063573360443,
-0.2860540449619293,
-0.046400465071201324,
-0.08398619294166565,
0.13445517420768738,
-0.338070273399353,
-0.28679633140563965,
0.12203896790742874,
-0.2664525508880615,
0.6795720458030701,
0.18808750808238983,
-0.2604108452796936,
0.18309825658798218,
-0.17585505545139313,
-0.5231517553329468,
0.05170615762472153,
-0.2250453680753708,
0.090544193983078,
-0.03223688155412674,
-0.2512684464454651,
-0.02041344717144966,
-0.08976083993911743,
0.09673063457012177,
0.13579818606376648,
-0.026400137692689896,
0.31396806240081787,
-0.0023805834352970123,
-0.4051858186721802,
0.11523212492465973,
0.11728981137275696,
0.29914236068725586,
0.40915241837501526,
0.05344369262456894,
-0.30661603808403015,
0.2917037010192871,
0.2551499903202057,
0.2743939757347107,
-0.04799065366387367,
0.21777084469795227,
0.22269582748413086,
-0.07819359749555588,
-0.03898932784795761,
0.21107301115989685,
0.2847232222557068,
-0.5404788255691528,
-0.07159267365932465,
-0.10032413899898529,
-0.5148371458053589,
-0.2767106592655182,
-0.2711356282234192,
0.1341780573129654,
-0.11004884541034698,
0.11929383873939514,
0.010615598410367966,
-0.2521549165248871,
0.4386938810348511,
0.004709966480731964,
-0.3241708278656006,
-0.1577308624982834,
0.25439125299453735,
0.10359043627977371,
-0.14188557863235474,
0.39548131823539734,
0.12317147850990295,
-0.3206825852394104,
-0.0323261059820652,
0.0648040845990181,
-0.07902119308710098,
-0.12969224154949188,
0.2723417580127716,
0.06640073657035828,
0.16467227041721344,
-0.24520307779312134,
-0.2958568036556244,
-0.1801092028617859,
0.0875241756439209,
-0.33371502161026,
-0.18719443678855896,
-0.01779516413807869,
-0.028193555772304535,
0.03364928439259529,
0.09985151886940002,
-0.02618296816945076,
-0.039158791303634644,
-0.2889397144317627,
-0.31229642033576965,
-0.2581632435321808,
-0.27343299984931946,
0.05263388901948929,
0.13591504096984863,
-0.09398671984672546,
-0.019878625869750977,
-0.21024063229560852,
-0.22653958201408386,
0.17268332839012146,
0.08614002168178558,
-0.14657087624073029,
-0.15443384647369385,
-0.033493489027023315,
0.11702485382556915,
-0.016894321888685226,
-0.37265193462371826,
0.03651238605380058,
0.1338893473148346,
-0.1707049012184143,
-0.21403785049915314,
0.1639729142189026,
0.14115315675735474,
0.035183385014534,
0.15294702351093292,
-0.08290630578994751,
0.2915264666080475,
0.1455330103635788,
0.007922405377030373,
-0.20121228694915771,
0.053967710584402084,
0.2531953752040863,
0.14744244515895844,
0.0888916552066803,
0.153603196144104,
-0.12798121571540833,
0.08545805513858795,
-0.14855581521987915,
0.13146159052848816,
0.4354933798313141,
-0.33341771364212036,
0.049891334027051926,
0.040589362382888794,
0.27430611848831177,
0.2675049901008606,
-0.38484570384025574,
-0.2557361423969269,
0.057178400456905365,
0.17968930304050446,
0.08079667389392853,
-0.057099342346191406,
0.49798327684402466,
0.3007374703884125,
-0.04355704411864281,
0.38421162962913513,
0.03313470259308815,
-0.05871395021677017,
-0.24107836186885834,
0.07994502037763596,
0.1146407201886177,
-0.18770718574523926,
0.3146584630012512,
0.7829314470291138,
0.030307356268167496,
0.018395930528640747,
0.022444631904363632,
-0.0692320466041565,
-0.0389486625790596,
0.18613949418067932,
0.18543294072151184,
0.24151688814163208,
0.29878783226013184,
-0.16087380051612854,
-0.14345663785934448,
-0.11297410726547241,
-0.2413642853498459,
0.1994004100561142,
-0.28661322593688965,
0.5658049583435059,
0.13620413839817047,
0.0380193293094635,
-0.4452711045742035,
-0.08038946986198425,
-0.2143814116716385,
0.03752100467681885,
-0.4529602527618408,
0.14074978232383728,
-0.006520433351397514,
0.03984876722097397,
-0.20045244693756104,
0.08343522250652313,
-0.2725495398044586,
0.07312937080860138,
0.042857445776462555,
0.15889659523963928,
-0.08723734319210052,
-0.0481923371553421,
0.2371426820755005,
0.10124494135379791,
0.2498708963394165,
-0.10691656172275543,
-0.0674716979265213,
0.3865653872489929,
0.09150315821170807,
-0.14542138576507568,
-0.05510881543159485,
0.27586960792541504,
0.6177332401275635,
-0.04567347839474678,
-0.06719356030225754,
-0.10213853418827057,
-0.08379292488098145,
0.08901912719011307,
0.262290358543396,
-0.05804002285003662,
-0.08907616138458252,
-0.0629318505525589,
0.15302352607250214,
-0.16242104768753052,
0.09774459898471832,
-0.08159786462783813,
0.25854581594467163,
-0.2866900861263275,
0.38327673077583313,
-0.12180745601654053,
-0.19208601117134094,
-0.08630562573671341,
-0.34347251057624817,
-0.062275566160678864,
-0.14492695033550262,
0.6067264080047607,
0.5737983584403992,
0.08965405821800232,
-0.015563995577394962,
0.04584934562444687,
-0.1593083143234253,
0.11178941279649734,
-0.13097769021987915,
-0.2677588164806366,
0.02734541893005371,
0.17095576226711273,
-0.2267080545425415,
0.15135693550109863,
0.33264297246932983,
-0.30999138951301575,
0.05313817039132118,
-0.01945139653980732,
0.07457497715950012,
0.052974432706832886,
-0.029099449515342712,
-0.0229388028383255,
0.4951131343841553,
0.15079326927661896,
-0.08291133493185043,
-0.19391243159770966,
-0.40169447660446167,
-0.06588386744260788,
-0.11119785904884338,
-0.33047375082969666,
0.2667972147464752,
-0.17961156368255615,
0.11254199594259262,
-0.16805478930473328,
0.17126990854740143,
-0.2835308611392975,
0.02523089200258255,
0.1856212019920349,
0.4099312722682953,
0.14531996846199036,
0.03864581137895584,
-0.22367319464683533,
-0.17643073201179504,
0.010659918189048767,
-0.23728755116462708,
0.28080037236213684,
-0.3789074420928955,
0.4946005642414093,
0.017529446631669998,
0.040532540529966354,
-0.3669935464859009,
0.39116090536117554,
0.001748785376548767,
-0.11669550836086273,
-0.0956469476222992,
0.15102341771125793,
-0.36021938920021057,
0.0048865885473787785,
0.21850959956645966,
0.099675253033638,
0.15540941059589386,
0.34668904542922974,
-0.09796872735023499,
-0.48147717118263245,
0.47677284479141235,
-0.3814901113510132,
-0.27774912118911743,
-0.13525331020355225,
0.148630291223526,
-0.07086648792028427,
-0.13644817471504211,
-0.5332998037338257,
-0.08449841290712357,
0.1973572075366974,
-0.18259301781654358,
-0.13010410964488983,
0.25621992349624634,
0.04519832134246826,
0.008136224001646042,
-0.12021878361701965,
0.30836981534957886,
-0.025906506925821304,
-0.02033541165292263,
0.16722485423088074,
-0.08359858393669128
] |
https://github.com/huggingface/datasets/issues/5517 | `with_format("numpy")` silently downcasts float64 to float32 features | workaround to remove torch upcasting
```
import datasets as ds
import torch
class FixedTorchFormatter(ds.formatting.TorchFormatter):
def _tensorize(self, value):
return torch.from_numpy(value)
ds.formatting._register_formatter(FixedTorchFormatter, "torch")
``` | ### Describe the bug
When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`.
### Steps to reproduce the bug
```python
import datasets
dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy")
print("feature dtype:", dataset.features['a'].dtype)
print("array dtype:", dataset['a'].dtype)
```
output:
```
feature dtype: float64
array dtype: float32
```
### Expected behavior
```
feature dtype: float64
array dtype: float64
```
### Environment info
- `datasets` version: 2.8.0
- Platform: Linux-5.4.0-135-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.4.4
### Suggested Fix
Changing [the `_tensorize` function of the numpy formatter](https://github.com/huggingface/datasets/blob/b065547654efa0ec633cf373ac1512884c68b2e1/src/datasets/formatting/np_formatter.py#L32) to
```python
def _tensorize(self, value):
if isinstance(value, (str, bytes, type(None))):
return value
elif isinstance(value, (np.character, np.ndarray)) and np.issubdtype(value.dtype, np.character):
return value
elif isinstance(value, np.number):
return value
return np.asarray(value, **self.np_array_kwargs)
```
fixes this particular issue for me. Not sure if this would break other tests. This should also avoid unnecessary copying of the array.
| 22 | `with_format("numpy")` silently downcasts float64 to float32 features
### Describe the bug
When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`.
### Steps to reproduce the bug
```python
import datasets
dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy")
print("feature dtype:", dataset.features['a'].dtype)
print("array dtype:", dataset['a'].dtype)
```
output:
```
feature dtype: float64
array dtype: float32
```
### Expected behavior
```
feature dtype: float64
array dtype: float64
```
### Environment info
- `datasets` version: 2.8.0
- Platform: Linux-5.4.0-135-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.4.4
### Suggested Fix
Changing [the `_tensorize` function of the numpy formatter](https://github.com/huggingface/datasets/blob/b065547654efa0ec633cf373ac1512884c68b2e1/src/datasets/formatting/np_formatter.py#L32) to
```python
def _tensorize(self, value):
if isinstance(value, (str, bytes, type(None))):
return value
elif isinstance(value, (np.character, np.ndarray)) and np.issubdtype(value.dtype, np.character):
return value
elif isinstance(value, np.number):
return value
return np.asarray(value, **self.np_array_kwargs)
```
fixes this particular issue for me. Not sure if this would break other tests. This should also avoid unnecessary copying of the array.
workaround to remove torch upcasting
```
import datasets as ds
import torch
class FixedTorchFormatter(ds.formatting.TorchFormatter):
def _tensorize(self, value):
return torch.from_numpy(value)
ds.formatting._register_formatter(FixedTorchFormatter, "torch")
``` | [
0.14177078008651733,
-0.24984367191791534,
0.000774633139371872,
0.0026635415852069855,
0.5696965456008911,
0.0561448410153389,
0.6134842038154602,
0.5261093378067017,
-0.16041861474514008,
-0.05886185169219971,
-0.13229535520076752,
0.6590015888214111,
-0.024173695594072342,
-0.055850546807050705,
-0.0898173376917839,
-0.09573148190975189,
0.19167107343673706,
0.36848190426826477,
-0.1873778998851776,
-0.08108260482549667,
-0.23802180588245392,
-0.2345665842294693,
-0.08685125410556793,
-0.115273118019104,
0.04147911071777344,
0.13877277076244354,
0.1588970422744751,
-0.2952386438846588,
-0.35430777072906494,
-0.21976175904273987,
0.17852190136909485,
-0.1553322821855545,
0.10645264387130737,
0.2438211739063263,
-0.0001166464644484222,
-0.02281355857849121,
0.08414025604724884,
-0.08400937914848328,
-0.23688678443431854,
0.33728793263435364,
0.15402573347091675,
-0.5218885540962219,
0.11003046482801437,
-0.31812769174575806,
-0.14374025166034698,
-0.4370628595352173,
-0.3288455307483673,
-0.3330014944076538,
0.12816524505615234,
-0.0955711379647255,
0.19108319282531738,
0.48318222165107727,
0.14118702709674835,
0.29137617349624634,
-0.4448983371257782,
0.29345792531967163,
-0.31258758902549744,
0.0738760232925415,
-0.301182359457016,
0.273569792509079,
0.1048036739230156,
0.3836762607097626,
-0.2931397259235382,
0.10119502246379852,
-0.00950537621974945,
0.12337784469127655,
0.28796064853668213,
-0.2609037458896637,
-0.09919553250074387,
0.13078156113624573,
0.3381490707397461,
-0.022355571389198303,
-0.3329734206199646,
-0.2674660384654999,
-0.12008658051490784,
-0.2960910499095917,
-0.08011550456285477,
0.17440173029899597,
0.028630852699279785,
0.05780795216560364,
-0.3742605745792389,
0.3191636800765991,
-0.08523911237716675,
0.21660591661930084,
0.019349433481693268,
0.22214846312999725,
-0.12840941548347473,
0.03873099386692047,
-0.46418362855911255,
-0.11483639478683472,
-0.057465579360723495,
-0.3399850130081177,
0.1099044531583786,
0.19607682526111603,
0.0805511474609375,
-0.31794920563697815,
0.33674243092536926,
-0.5577793121337891,
0.024656500667333603,
-0.22734667360782623,
-0.0029758578166365623,
0.3014673888683319,
-0.3438105583190918,
0.03839642554521561,
0.03598916903138161,
0.3496714234352112,
0.010740682482719421,
-0.03237667307257652,
0.22094452381134033,
0.21561606228351593,
0.448309063911438,
0.03775426372885704,
0.3862801790237427,
0.16529054939746857,
0.11328066885471344,
-0.02615904062986374,
0.482272207736969,
-0.22848306596279144,
-0.37862685322761536,
0.26312050223350525,
-0.3443557620048523,
0.07116350531578064,
0.020232656970620155,
0.025952007621526718,
-0.0595310777425766,
0.4846922755241394,
0.04862983524799347,
0.17409051954746246,
-0.2399595081806183,
-0.03258636221289635,
-0.19234873354434967,
-0.24789445102214813,
-0.1684461534023285,
-0.12529093027114868,
0.12297172844409943,
0.3188713788986206,
0.05905483663082123,
0.5129324793815613,
0.030423425137996674,
-0.22497598826885223,
0.05005607008934021,
-0.012772160582244396,
0.5335593223571777,
0.017126090824604034,
-0.43277454376220703,
0.3429165184497833,
0.29663321375846863,
-0.233347088098526,
-0.1042582243680954,
0.050958722829818726,
0.03980989754199982,
0.1377754807472229,
-0.3912065625190735,
0.19081571698188782,
-0.2958465814590454,
0.3621065020561218,
0.2892390787601471,
0.10355809330940247,
0.408719539642334,
-0.07775391638278961,
0.2351023554801941,
-0.4885823130607605,
-0.21119140088558197,
-0.35935577750205994,
0.442503422498703,
0.25058290362358093,
-0.37392354011535645,
0.10276424884796143,
0.4249876141548157,
0.09905529022216797,
0.47119471430778503,
0.15340320765972137,
0.10159412771463394,
-0.08906867355108261,
-0.19534000754356384,
-0.1690911054611206,
0.1824798882007599,
0.3884349465370178,
-0.22312237322330475,
0.014580398797988892,
-0.22743095457553864,
0.4001566767692566,
-0.1761632263660431,
0.19206295907497406,
-0.05699025094509125,
-0.09383387118577957,
-0.044567711651325226,
0.46422070264816284,
-0.0621139258146286,
0.16311419010162354,
-0.4260692298412323,
-0.15895642340183258,
0.326113224029541,
-0.04248140752315521,
-0.17545923590660095,
0.13407015800476074,
-0.0790473148226738,
0.05510125309228897,
0.3086705207824707,
-0.22969645261764526,
0.03570643067359924,
-0.2841407060623169,
0.44516056776046753,
0.030277080833911896,
0.09864893555641174,
0.09511732310056686,
-0.11758985370397568,
-0.03349681198596954,
0.33172401785850525,
0.010560065507888794,
-0.1749689131975174,
-0.19885586202144623,
-0.013105013407766819,
-0.0670318678021431,
-0.2619432806968689,
-0.17561075091362,
0.15882918238639832,
0.17338688671588898,
-0.08907944709062576,
0.30908268690109253,
-0.003730040043592453,
-0.10699750483036041,
0.016488289460539818,
0.0875212699174881,
-0.3464054763317108,
0.34655383229255676,
0.16837844252586365,
-0.28817468881607056,
-0.21669206023216248,
0.3719768524169922,
0.10448767244815826,
0.024191951379179955,
-0.19916880130767822,
0.15368404984474182,
-0.11736946552991867,
-0.12331914901733398,
-0.5844514966011047,
0.10993069410324097,
0.36117950081825256,
0.158380925655365,
0.2550024390220642,
0.5036296248435974,
0.11218855530023575,
-0.03440766781568527,
0.06214237958192825,
0.5594333410263062,
-0.18953436613082886,
0.022655494511127472,
-0.3018747568130493,
0.011687850579619408,
0.3107447028160095,
0.16395223140716553,
-0.16798870265483856,
-0.4434167444705963,
0.03712131455540657,
-0.022674202919006348,
-0.1656906008720398,
0.023112589493393898,
-0.4027048349380493,
0.34867551922798157,
0.28996482491493225,
-0.07821313291788101,
0.17961490154266357,
-0.0785859152674675,
-0.10272007435560226,
-0.1015440821647644,
0.22542288899421692,
-0.2952028512954712,
0.5789228677749634,
-0.03668339550495148,
-0.14496980607509613,
0.05437943711876869,
-0.026164434850215912,
-0.15568146109580994,
0.06167911738157272,
0.1211366355419159,
-0.06432566791772842,
0.11960962414741516,
0.24179601669311523,
0.03792747110128403,
-0.220016211271286,
0.29676324129104614,
-0.20568890869617462,
-0.11610236763954163,
-0.18921685218811035,
0.170144185423851,
-0.3475115895271301,
-0.011981168761849403,
-0.459431916475296,
-0.11035853624343872,
0.15138062834739685,
-0.09737793356180191,
-0.16793930530548096,
0.08473162353038788,
-0.2180066704750061,
0.10587573796510696,
-0.23040588200092316,
0.1284940391778946,
0.3007718324661255,
-0.038847386837005615,
-0.07833181321620941,
0.2827419340610504,
-0.1395007073879242,
-0.037971775978803635,
-0.11027470976114273,
-0.19640982151031494,
0.263609379529953,
0.2883650064468384,
-0.1961321234703064,
-0.1641438901424408,
-0.6332255601882935,
-0.11944152414798737,
-0.1341811865568161,
0.32877057790756226,
0.11765081435441971,
0.27563074231147766,
-0.15206806361675262,
-0.1166420429944992,
0.3145628869533539,
-0.015786170959472656,
0.17096300423145294,
0.18366959691047668,
0.13498282432556152,
-0.015545099042356014,
-0.5056920647621155,
-0.2204398214817047,
-0.09644326567649841,
-0.0626140907406807,
0.08665967732667923,
-0.21603132784366608,
0.02643602341413498,
0.04877009615302086,
-0.05383286252617836,
0.02739790827035904,
-0.24163490533828735,
0.04155478626489639,
-0.23594196140766144,
0.28192320466041565,
0.43028080463409424,
-0.06765486299991608,
-0.1318305879831314,
-0.16263237595558167,
-0.00796373002231121,
-0.35268425941467285,
-0.008451970294117928,
-0.059105485677719116,
-0.32497432827949524,
-0.20902518928050995,
0.2126208245754242,
-0.07352001219987869,
0.033843033015728,
-0.007720984518527985,
0.2844255268573761,
0.08240760117769241,
-0.10622656345367432,
-0.043578580021858215,
-0.028261028230190277,
0.08356566727161407,
0.1370989978313446,
-0.0031638499349355698,
0.3392145335674286,
0.06841930747032166,
-0.1338053196668625,
0.20237115025520325,
-0.3853635787963867,
0.18205255270004272,
0.14959716796875,
0.35083043575286865,
-0.17073947191238403,
-0.2915019690990448,
0.27154290676116943,
0.09857891499996185,
-0.1893194615840912,
0.12757858633995056,
-0.03816017508506775,
-0.2583358585834503,
0.12821795046329498,
0.25577250123023987,
0.1622960865497589,
-0.20246407389640808,
0.021912284195423126,
0.3147258162498474,
-0.0438629612326622,
0.07844042778015137,
0.5103879570960999,
-0.006447387859225273,
-0.3256703317165375,
-0.15435418486595154,
0.10719401389360428,
0.002452440559864044,
0.15893308818340302,
-0.24833530187606812,
-0.2655872404575348,
-0.2230769693851471,
0.12506654858589172,
0.08907152712345123,
0.7836353778839111,
0.162702739238739,
-0.27146637439727783,
0.10483947396278381,
0.38588374853134155,
0.2703321576118469,
0.08316407352685928,
-0.06095069646835327,
-0.015342682600021362,
0.056465938687324524,
-0.24661774933338165,
-0.471305251121521,
-0.24809110164642334,
0.16621437668800354,
0.03412298113107681,
0.45690804719924927,
-0.1455078423023224,
-0.02631291374564171,
0.2439652532339096,
0.3559235632419586,
0.005760703235864639,
-0.1592099368572235,
-0.3320910632610321,
-0.3904716372489929,
0.40063121914863586,
0.03301897272467613,
-0.23185162246227264,
0.23674964904785156,
-0.24372535943984985,
-0.1560375839471817,
-0.16547948122024536,
0.06785911321640015,
0.036890722811222076,
0.09785151481628418,
0.2811528444290161,
0.08527645468711853,
-0.008334344252943993,
0.03669160604476929,
0.20495948195457458,
-0.11603394150733948,
-0.1506892293691635,
0.09089115262031555,
-0.07816159725189209,
-0.1472303569316864,
-0.17592661082744598,
0.08062304556369781,
0.26898983120918274,
-0.009072834625840187,
0.11059244722127914,
-0.30576571822166443,
0.18404266238212585,
-0.20616307854652405,
0.028248464688658714,
0.22767724096775055,
0.21508431434631348,
-0.21185244619846344,
-0.40966877341270447,
0.3326396942138672,
-0.12602877616882324,
0.08509425818920135,
0.3867059350013733,
-0.24034728109836578,
-0.3442721366882324,
0.5024795532226562,
0.4321822226047516,
0.7307050228118896,
0.18443211913108826,
0.09520459175109863,
0.7169745564460754,
-0.02315870299935341,
0.6993008255958557,
-0.10370786488056183,
0.41096049547195435,
-0.4451063573360443,
-0.2860540449619293,
-0.046400465071201324,
-0.08398619294166565,
0.13445517420768738,
-0.338070273399353,
-0.28679633140563965,
0.12203896790742874,
-0.2664525508880615,
0.6795720458030701,
0.18808750808238983,
-0.2604108452796936,
0.18309825658798218,
-0.17585505545139313,
-0.5231517553329468,
0.05170615762472153,
-0.2250453680753708,
0.090544193983078,
-0.03223688155412674,
-0.2512684464454651,
-0.02041344717144966,
-0.08976083993911743,
0.09673063457012177,
0.13579818606376648,
-0.026400137692689896,
0.31396806240081787,
-0.0023805834352970123,
-0.4051858186721802,
0.11523212492465973,
0.11728981137275696,
0.29914236068725586,
0.40915241837501526,
0.05344369262456894,
-0.30661603808403015,
0.2917037010192871,
0.2551499903202057,
0.2743939757347107,
-0.04799065366387367,
0.21777084469795227,
0.22269582748413086,
-0.07819359749555588,
-0.03898932784795761,
0.21107301115989685,
0.2847232222557068,
-0.5404788255691528,
-0.07159267365932465,
-0.10032413899898529,
-0.5148371458053589,
-0.2767106592655182,
-0.2711356282234192,
0.1341780573129654,
-0.11004884541034698,
0.11929383873939514,
0.010615598410367966,
-0.2521549165248871,
0.4386938810348511,
0.004709966480731964,
-0.3241708278656006,
-0.1577308624982834,
0.25439125299453735,
0.10359043627977371,
-0.14188557863235474,
0.39548131823539734,
0.12317147850990295,
-0.3206825852394104,
-0.0323261059820652,
0.0648040845990181,
-0.07902119308710098,
-0.12969224154949188,
0.2723417580127716,
0.06640073657035828,
0.16467227041721344,
-0.24520307779312134,
-0.2958568036556244,
-0.1801092028617859,
0.0875241756439209,
-0.33371502161026,
-0.18719443678855896,
-0.01779516413807869,
-0.028193555772304535,
0.03364928439259529,
0.09985151886940002,
-0.02618296816945076,
-0.039158791303634644,
-0.2889397144317627,
-0.31229642033576965,
-0.2581632435321808,
-0.27343299984931946,
0.05263388901948929,
0.13591504096984863,
-0.09398671984672546,
-0.019878625869750977,
-0.21024063229560852,
-0.22653958201408386,
0.17268332839012146,
0.08614002168178558,
-0.14657087624073029,
-0.15443384647369385,
-0.033493489027023315,
0.11702485382556915,
-0.016894321888685226,
-0.37265193462371826,
0.03651238605380058,
0.1338893473148346,
-0.1707049012184143,
-0.21403785049915314,
0.1639729142189026,
0.14115315675735474,
0.035183385014534,
0.15294702351093292,
-0.08290630578994751,
0.2915264666080475,
0.1455330103635788,
0.007922405377030373,
-0.20121228694915771,
0.053967710584402084,
0.2531953752040863,
0.14744244515895844,
0.0888916552066803,
0.153603196144104,
-0.12798121571540833,
0.08545805513858795,
-0.14855581521987915,
0.13146159052848816,
0.4354933798313141,
-0.33341771364212036,
0.049891334027051926,
0.040589362382888794,
0.27430611848831177,
0.2675049901008606,
-0.38484570384025574,
-0.2557361423969269,
0.057178400456905365,
0.17968930304050446,
0.08079667389392853,
-0.057099342346191406,
0.49798327684402466,
0.3007374703884125,
-0.04355704411864281,
0.38421162962913513,
0.03313470259308815,
-0.05871395021677017,
-0.24107836186885834,
0.07994502037763596,
0.1146407201886177,
-0.18770718574523926,
0.3146584630012512,
0.7829314470291138,
0.030307356268167496,
0.018395930528640747,
0.022444631904363632,
-0.0692320466041565,
-0.0389486625790596,
0.18613949418067932,
0.18543294072151184,
0.24151688814163208,
0.29878783226013184,
-0.16087380051612854,
-0.14345663785934448,
-0.11297410726547241,
-0.2413642853498459,
0.1994004100561142,
-0.28661322593688965,
0.5658049583435059,
0.13620413839817047,
0.0380193293094635,
-0.4452711045742035,
-0.08038946986198425,
-0.2143814116716385,
0.03752100467681885,
-0.4529602527618408,
0.14074978232383728,
-0.006520433351397514,
0.03984876722097397,
-0.20045244693756104,
0.08343522250652313,
-0.2725495398044586,
0.07312937080860138,
0.042857445776462555,
0.15889659523963928,
-0.08723734319210052,
-0.0481923371553421,
0.2371426820755005,
0.10124494135379791,
0.2498708963394165,
-0.10691656172275543,
-0.0674716979265213,
0.3865653872489929,
0.09150315821170807,
-0.14542138576507568,
-0.05510881543159485,
0.27586960792541504,
0.6177332401275635,
-0.04567347839474678,
-0.06719356030225754,
-0.10213853418827057,
-0.08379292488098145,
0.08901912719011307,
0.262290358543396,
-0.05804002285003662,
-0.08907616138458252,
-0.0629318505525589,
0.15302352607250214,
-0.16242104768753052,
0.09774459898471832,
-0.08159786462783813,
0.25854581594467163,
-0.2866900861263275,
0.38327673077583313,
-0.12180745601654053,
-0.19208601117134094,
-0.08630562573671341,
-0.34347251057624817,
-0.062275566160678864,
-0.14492695033550262,
0.6067264080047607,
0.5737983584403992,
0.08965405821800232,
-0.015563995577394962,
0.04584934562444687,
-0.1593083143234253,
0.11178941279649734,
-0.13097769021987915,
-0.2677588164806366,
0.02734541893005371,
0.17095576226711273,
-0.2267080545425415,
0.15135693550109863,
0.33264297246932983,
-0.30999138951301575,
0.05313817039132118,
-0.01945139653980732,
0.07457497715950012,
0.052974432706832886,
-0.029099449515342712,
-0.0229388028383255,
0.4951131343841553,
0.15079326927661896,
-0.08291133493185043,
-0.19391243159770966,
-0.40169447660446167,
-0.06588386744260788,
-0.11119785904884338,
-0.33047375082969666,
0.2667972147464752,
-0.17961156368255615,
0.11254199594259262,
-0.16805478930473328,
0.17126990854740143,
-0.2835308611392975,
0.02523089200258255,
0.1856212019920349,
0.4099312722682953,
0.14531996846199036,
0.03864581137895584,
-0.22367319464683533,
-0.17643073201179504,
0.010659918189048767,
-0.23728755116462708,
0.28080037236213684,
-0.3789074420928955,
0.4946005642414093,
0.017529446631669998,
0.040532540529966354,
-0.3669935464859009,
0.39116090536117554,
0.001748785376548767,
-0.11669550836086273,
-0.0956469476222992,
0.15102341771125793,
-0.36021938920021057,
0.0048865885473787785,
0.21850959956645966,
0.099675253033638,
0.15540941059589386,
0.34668904542922974,
-0.09796872735023499,
-0.48147717118263245,
0.47677284479141235,
-0.3814901113510132,
-0.27774912118911743,
-0.13525331020355225,
0.148630291223526,
-0.07086648792028427,
-0.13644817471504211,
-0.5332998037338257,
-0.08449841290712357,
0.1973572075366974,
-0.18259301781654358,
-0.13010410964488983,
0.25621992349624634,
0.04519832134246826,
0.008136224001646042,
-0.12021878361701965,
0.30836981534957886,
-0.025906506925821304,
-0.02033541165292263,
0.16722485423088074,
-0.08359858393669128
] |
https://github.com/huggingface/datasets/issues/5514 | Improve inconsistency of `Dataset.map` interface for `load_from_cache_file` | Hi, thanks for noticing this! We can't just remove the cache control as this allows us to control where the arrow files generated by the ops are written (cached on disk if enabled or a temporary directory if disabled). The right way to address this inconsistency would be by having `load_from_cache_file=None` by default everywhere. | ### Feature request
1. Replace the `load_from_cache_file` default value to `True`.
2. Remove or alter checks from `is_caching_enabled` logic.
### Motivation
I stumbled over an inconsistency in the `Dataset.map` interface. The documentation (and source) states for the parameter `load_from_cache_file`:
```
load_from_cache_file (`bool`, defaults to `True` if caching is enabled):
If a cache file storing the current computation from `function`
can be identified, use it instead of recomputing.
```
1. `load_from_cache_file` default value is `None`, while being annotated as `bool`
2. It is inconsistent with other method signatures like `filter`, that have the default value `True`
3. The logic is inconsistent, as the `map` method checks if caching is enabled through `is_caching_enabled`. This logic is not used for other similar methods.
### Your contribution
I am not fully aware of the logic behind caching checks. If this is just a inconsistency that historically grew, I would suggest to remove the `is_caching_enabled` logic as the "default" logic. Maybe someone can give insights, if environment variables have a higher priority than local variables or vice versa.
If this is clarified, I could adjust the source according to the "Feature request" section of this issue. | 54 | Improve inconsistency of `Dataset.map` interface for `load_from_cache_file`
### Feature request
1. Replace the `load_from_cache_file` default value to `True`.
2. Remove or alter checks from `is_caching_enabled` logic.
### Motivation
I stumbled over an inconsistency in the `Dataset.map` interface. The documentation (and source) states for the parameter `load_from_cache_file`:
```
load_from_cache_file (`bool`, defaults to `True` if caching is enabled):
If a cache file storing the current computation from `function`
can be identified, use it instead of recomputing.
```
1. `load_from_cache_file` default value is `None`, while being annotated as `bool`
2. It is inconsistent with other method signatures like `filter`, that have the default value `True`
3. The logic is inconsistent, as the `map` method checks if caching is enabled through `is_caching_enabled`. This logic is not used for other similar methods.
### Your contribution
I am not fully aware of the logic behind caching checks. If this is just a inconsistency that historically grew, I would suggest to remove the `is_caching_enabled` logic as the "default" logic. Maybe someone can give insights, if environment variables have a higher priority than local variables or vice versa.
If this is clarified, I could adjust the source according to the "Feature request" section of this issue.
Hi, thanks for noticing this! We can't just remove the cache control as this allows us to control where the arrow files generated by the ops are written (cached on disk if enabled or a temporary directory if disabled). The right way to address this inconsistency would be by having `load_from_cache_file=None` by default everywhere. | [
-0.22572489082813263,
0.11557582020759583,
-0.018234264105558395,
0.08944402635097504,
-0.2545173168182373,
-0.19448745250701904,
0.2094080001115799,
0.24666523933410645,
0.4795498251914978,
-0.027434200048446655,
0.27308300137519836,
0.651593804359436,
0.21231448650360107,
0.03541683405637741,
-0.14654339849948883,
0.3056740164756775,
0.10693187266588211,
0.1348617672920227,
-0.039305679500103,
-0.037410490214824677,
-0.23548956215381622,
0.030568525195121765,
-0.19573137164115906,
-0.3114215135574341,
0.21745723485946655,
-0.2121468037366867,
0.24990731477737427,
0.04668610915541649,
-0.13025414943695068,
-0.463458389043808,
0.25891798734664917,
0.5089842677116394,
-0.29162922501564026,
0.09697782248258591,
-0.00011218079453101382,
-0.05321092531085014,
0.442146360874176,
0.013283902779221535,
-0.051509298384189606,
0.024417094886302948,
-0.3487044870853424,
0.001878795213997364,
0.11994469165802002,
-0.2628677487373352,
0.17156541347503662,
0.275249183177948,
-0.11634992063045502,
-0.58514404296875,
0.29081404209136963,
0.03132757917046547,
0.1446155607700348,
0.09801775962114334,
-0.3669120669364929,
0.046607691794633865,
0.2100640833377838,
0.2906869053840637,
0.1003391221165657,
0.1679268181324005,
0.26387712359428406,
-0.24545443058013916,
-0.36032649874687195,
0.3152158558368683,
-0.26268911361694336,
-0.0666854977607727,
0.5204312205314636,
-0.19665969908237457,
0.065925732254982,
-0.01577361300587654,
0.1382400244474411,
0.13227547705173492,
0.5484031438827515,
-0.13387921452522278,
-0.16817958652973175,
0.05082756280899048,
-0.19697092473506927,
-0.18365821242332458,
0.46423813700675964,
-0.3382726013660431,
0.07154527306556702,
0.27400052547454834,
-0.2020523101091385,
-0.3027017116546631,
0.04034927487373352,
0.29389941692352295,
-0.1253184676170349,
-0.11301884055137634,
-0.04519996792078018,
0.1109999418258667,
0.14108482003211975,
0.02348751574754715,
0.11301261186599731,
-0.2320145070552826,
-0.23816776275634766,
0.29914048314094543,
-0.1898399442434311,
0.0023422539234161377,
0.2804250121116638,
0.35593608021736145,
0.1594904065132141,
0.146877259016037,
0.2538978159427643,
0.2078348696231842,
-0.21105584502220154,
0.17377588152885437,
0.1613583266735077,
0.45583224296569824,
0.17288896441459656,
0.10308491438627243,
0.09784936904907227,
-0.029541699215769768,
-0.19050079584121704,
0.12700612843036652,
0.43359896540641785,
-0.22120124101638794,
0.5012794733047485,
0.05072636157274246,
-0.08236049115657806,
-0.3535546362400055,
-0.10486936569213867,
0.05237841606140137,
-0.3265801966190338,
-0.26470786333084106,
0.34745529294013977,
-0.012311108410358429,
0.028190601617097855,
0.46143582463264465,
0.14550814032554626,
0.12298547476530075,
-0.14243322610855103,
-0.285435289144516,
-0.17486397922039032,
-0.27218833565711975,
-0.21687650680541992,
0.16000746190547943,
0.19532589614391327,
-0.05825081095099449,
0.036929674446582794,
0.2921940088272095,
-0.029692381620407104,
0.08321082592010498,
0.2094441056251526,
-0.15491023659706116,
0.5858340263366699,
0.06546192616224289,
-0.5941917300224304,
0.1418018788099289,
0.1553572416305542,
0.058172307908535004,
-0.21757152676582336,
0.31109094619750977,
-0.3947126865386963,
-0.2958358824253082,
0.10422858595848083,
0.12189779430627823,
-0.34686440229415894,
0.14953550696372986,
-0.1708153784275055,
0.037172991782426834,
0.17598550021648407,
-0.5315040946006775,
0.1657736748456955,
0.0020561236888170242,
-0.2972571551799774,
-0.42347022891044617,
-0.013746101409196854,
0.7031285762786865,
-0.40134158730506897,
-0.025378525257110596,
-0.27130743861198425,
-0.05665313079953194,
-0.060434795916080475,
0.1681993305683136,
-0.6229380369186401,
0.1487293243408203,
-0.1782347857952118,
0.06136547029018402,
0.2749496102333069,
-0.41066431999206543,
-0.6757497191429138,
0.5498150587081909,
0.12207269668579102,
0.1622772216796875,
0.09007670730352402,
0.15601855516433716,
0.18304215371608734,
-0.186274453997612,
0.17403051257133484,
0.10995864868164062,
0.1908879578113556,
-0.027618277817964554,
-0.40515878796577454,
-0.33637315034866333,
0.24500954151153564,
-0.07142628729343414,
-0.1665777564048767,
0.30562299489974976,
0.029786162078380585,
-0.3429131805896759,
0.3273381292819977,
0.13267849385738373,
-0.08479112386703491,
0.15184998512268066,
0.3819049000740051,
-0.20429612696170807,
0.05296021327376366,
0.039301611483097076,
-0.662079930305481,
0.2792183756828308,
0.033949851989746094,
-0.3439241945743561,
-0.0696968287229538,
-0.13199512660503387,
0.1041349396109581,
-0.06769568473100662,
-0.06107247993350029,
0.19738095998764038,
0.0663653314113617,
-0.0580483078956604,
-0.19288299977779388,
-0.23505686223506927,
-0.22247707843780518,
0.32627344131469727,
-0.28964725136756897,
-0.1754106730222702,
-0.013670708984136581,
-0.025884030386805534,
0.13251051306724548,
0.15712890028953552,
-0.22723737359046936,
-0.1263749599456787,
-0.030610263347625732,
-0.038382723927497864,
-0.4718613624572754,
0.47686728835105896,
0.3751623034477234,
0.2514728903770447,
-0.03682989627122879,
0.45211082696914673,
0.07949972152709961,
-0.1921638548374176,
0.09400410950183868,
0.13660474121570587,
-0.09936413168907166,
-0.06705989688634872,
-0.3366797864437103,
0.222330704331398,
-0.10088740289211273,
0.05508793145418167,
-0.21804282069206238,
-0.031920112669467926,
0.1580880880355835,
-0.054316092282533646,
-0.3530052602291107,
-0.44649621844291687,
0.04283593222498894,
0.2303917407989502,
0.4884416460990906,
0.38904356956481934,
0.10809941589832306,
0.1926134079694748,
0.31064173579216003,
0.060799431055784225,
-0.10490623861551285,
-0.10873522609472275,
0.15740430355072021,
-0.31567123532295227,
0.04558420926332474,
0.2839033901691437,
0.5062447786331177,
0.10546185076236725,
0.08269548416137695,
-0.1946832537651062,
-0.06838716566562653,
0.0754840299487114,
0.17118531465530396,
-0.1533341258764267,
0.1443740874528885,
0.11850593984127045,
0.2350168377161026,
0.14461703598499298,
-0.18752774596214294,
0.11026902496814728,
0.048018574714660645,
-0.06255414336919785,
-0.2309705764055252,
0.12147096544504166,
-0.30129384994506836,
-0.1422414481639862,
0.02817852608859539,
0.10347451269626617,
-0.4615165889263153,
-0.23240181803703308,
-0.05095882713794708,
0.1032811626791954,
-0.1960572451353073,
0.19485998153686523,
-0.3766736388206482,
0.45485809445381165,
-0.17982785403728485,
-0.5702720880508423,
0.05196969211101532,
-0.42917704582214355,
-0.1901334524154663,
-0.1356016844511032,
0.2816295623779297,
0.0034565520472824574,
0.1590154767036438,
-0.07659558951854706,
-0.11371585726737976,
-0.27148598432540894,
-0.2941003739833832,
0.2001962959766388,
0.37937813997268677,
0.10881663858890533,
0.05426550284028053,
0.04035058990120888,
-0.061668187379837036,
0.14750359952449799,
-0.0597502700984478,
-0.3754344880580902,
-0.24146157503128052,
-0.029535889625549316,
-0.08419842272996902,
-0.014191883616149426,
-0.2809673249721527,
-0.29738157987594604,
0.008238459005951881,
-0.4303553104400635,
-0.10531169176101685,
-0.2935905158519745,
0.20765554904937744,
0.4380960762500763,
-0.11122661828994751,
-0.2198849767446518,
0.04443544149398804,
0.10297701507806778,
-0.40540996193885803,
-0.43731918931007385,
0.22220832109451294,
0.02743944339454174,
-0.10727119445800781,
-0.11060560494661331,
0.007502172142267227,
0.09735221415758133,
0.6548483967781067,
-0.280758261680603,
-0.1039021834731102,
-0.07743921875953674,
0.3482406437397003,
-0.23106101155281067,
-0.061282359063625336,
0.38859254121780396,
0.19741618633270264,
-0.04059543088078499,
-0.35083070397377014,
-0.45375725626945496,
0.5130708813667297,
0.43074193596839905,
0.17241063714027405,
0.43769511580467224,
-0.03438117355108261,
-0.11354640126228333,
0.5887894034385681,
-0.033740751445293427,
-0.23861666023731232,
0.28458070755004883,
0.32821518182754517,
0.4904649555683136,
-0.06784189492464066,
-0.03327145799994469,
-0.16523246467113495,
-0.006887257099151611,
-0.23688511550426483,
0.08469174802303314,
-0.09824808686971664,
-0.5497812032699585,
-0.05558193102478981,
0.07724815607070923,
-0.2622368335723877,
-0.34880220890045166,
0.2528094947338104,
-0.47471415996551514,
0.3577442467212677,
0.021311812102794647,
0.04755415767431259,
-0.6752095818519592,
-0.013147002086043358,
0.3266424238681793,
0.12907037138938904,
0.4146766662597656,
-0.03275737911462784,
-0.3040545582771301,
0.047013431787490845,
0.011837631464004517,
0.2203242927789688,
0.06892086565494537,
0.238735169172287,
-0.14590537548065186,
-0.381879597902298,
-0.10598111152648926,
0.013491261750459671,
0.6438438892364502,
-0.3809775710105896,
0.10428997874259949,
0.2024790495634079,
0.2345934808254242,
0.1586432009935379,
-0.18353582918643951,
0.0812917947769165,
0.6242875456809998,
0.1920137107372284,
0.38263559341430664,
-0.1772771179676056,
-0.317117303609848,
-0.33977335691452026,
0.1607116460800171,
-0.015429779887199402,
-0.3137741982936859,
-0.07829532772302628,
0.35725587606430054,
0.0798213854432106,
-0.2169080376625061,
0.1952325701713562,
0.010667089372873306,
0.06415873020887375,
0.11678911745548248,
-0.005752053111791611,
0.2080521583557129,
-0.1255904585123062,
0.13268254697322845,
0.46899086236953735,
-0.13978727161884308,
-0.04288249835371971,
0.16788873076438904,
0.22296223044395447,
0.10892702639102936,
0.39576977491378784,
-0.43148767948150635,
0.010074310004711151,
-0.08371828496456146,
-0.08833847939968109,
-0.05420859903097153,
0.44159573316574097,
0.010926640592515469,
0.11006264388561249,
0.32391420006752014,
-0.1644688844680786,
-0.17711210250854492,
-0.07816672325134277,
0.051585353910923004,
-0.1703694760799408,
-0.011142185889184475,
-0.43159642815589905,
0.31381720304489136,
0.26010990142822266,
-0.44192516803741455,
0.7154243588447571,
0.030778367072343826,
-0.15706829726696014,
0.47316551208496094,
0.307304710149765,
0.9442843198776245,
0.06284098327159882,
-0.12098951637744904,
0.03233411908149719,
-0.07619354128837585,
0.21126961708068848,
-0.05327711999416351,
0.26195836067199707,
-0.20179025828838348,
-0.09682386368513107,
-0.08083147555589676,
-0.2727438509464264,
-0.01437351107597351,
0.2729763984680176,
-0.21769322454929352,
0.0623234398663044,
-0.15669500827789307,
0.5739823579788208,
0.07338355481624603,
0.1099102646112442,
0.07318902760744095,
-0.08625823259353638,
0.07071641087532043,
0.08296610414981842,
-0.018663309514522552,
0.08406168222427368,
-0.03733138367533684,
-0.25493085384368896,
0.2195218801498413,
-0.11631501466035843,
-0.165385901927948,
-0.12924551963806152,
-0.3907179534435272,
0.30337923765182495,
0.030078355222940445,
0.15134187042713165,
0.13265421986579895,
0.2638338506221771,
-0.05366259813308716,
-0.09244011342525482,
-0.1401752382516861,
0.1812746226787567,
0.5060617327690125,
0.3696310818195343,
-0.053305938839912415,
0.029967904090881348,
0.3460582494735718,
0.08201678842306137,
-0.1113993301987648,
-0.1358606517314911,
-0.33666983246803284,
-0.5605126619338989,
0.05155450105667114,
0.09275247156620026,
0.19333958625793457,
0.05301639810204506,
-0.016248200088739395,
0.12150253355503082,
0.08987830579280853,
0.10037557780742645,
0.08153775334358215,
0.21365918219089508,
0.19640737771987915,
0.3452560603618622,
-0.21618635952472687,
-0.2657132148742676,
0.04204782843589783,
0.36160901188850403,
-0.18192827701568604,
-0.22009241580963135,
0.10122423619031906,
-0.42482081055641174,
-0.1295068860054016,
-0.2653496265411377,
-0.24587607383728027,
-0.10554058849811554,
-0.02464444190263748,
-0.06807825714349747,
-0.0975741520524025,
-0.17443907260894775,
0.1241362988948822,
0.12430578470230103,
0.2760723829269409,
0.43236812949180603,
-0.25824791193008423,
-0.30643361806869507,
-0.21308952569961548,
0.23313608765602112,
-0.2378416508436203,
0.15359637141227722,
-0.12620922923088074,
-0.6492385268211365,
-0.05299340933561325,
0.07108098268508911,
-0.3215576410293579,
0.07580038905143738,
0.189311221241951,
-0.0014705024659633636,
-0.037541650235652924,
0.22092434763908386,
0.07971621304750443,
-0.3667256534099579,
-0.03203901648521423,
-0.3079621195793152,
-0.4499777853488922,
-0.13236728310585022,
0.024864789098501205,
0.15293177962303162,
-0.12409240752458572,
-0.0503031462430954,
0.051248569041490555,
-0.36286354064941406,
0.10577331483364105,
-0.26452651619911194,
0.03993615135550499,
0.07692769169807434,
-0.10460267961025238,
0.08050927519798279,
-0.28282544016838074,
0.26695704460144043,
-0.17469817399978638,
0.1820175051689148,
0.22809536755084991,
-0.10065677762031555,
-0.14202849566936493,
0.22974731028079987,
-0.17776790261268616,
-0.1905462145805359,
0.21647663414478302,
0.18964508175849915,
-0.20610736310482025,
0.17783483862876892,
0.10724467039108276,
0.004840996116399765,
0.05091847851872444,
0.28254225850105286,
0.05861279368400574,
0.2085341513156891,
-0.12421900779008865,
-0.15470978617668152,
0.004441481549292803,
0.20130832493305206,
-0.07698207348585129,
-0.15022553503513336,
0.4358115494251251,
-0.1034667044878006,
0.15593989193439484,
0.18017449975013733,
0.5787592530250549,
-0.17073573172092438,
0.3927420377731323,
0.03874494507908821,
0.2733388841152191,
-0.30483579635620117,
0.1845814734697342,
0.38727501034736633,
0.09342539310455322,
0.04252583906054497,
0.3685756325721741,
0.3249899446964264,
0.22040672600269318,
0.2949603497982025,
0.40281131863594055,
0.15280121564865112,
0.20560762286186218,
0.28817370533943176,
-0.16136622428894043,
-0.5640228390693665,
0.2921253442764282,
0.29662173986434937,
-0.1968834102153778,
0.14311322569847107,
0.28042131662368774,
0.15426069498062134,
-0.1423075944185257,
-0.40599730610847473,
-0.13612200319766998,
-0.18450169265270233,
-0.08659130334854126,
0.021130360662937164,
-0.1821441948413849,
-0.22401836514472961,
-0.05536022037267685,
-0.050432682037353516,
-0.10728035867214203,
0.26248693466186523,
0.5592745542526245,
0.119115449488163,
-0.05268049240112305,
-0.10316453129053116,
-0.12224171310663223,
-0.14939996600151062,
0.4133889079093933,
-0.15341703593730927,
0.1106892004609108,
-0.4153760075569153,
-0.10299268364906311,
0.20561832189559937,
0.16121672093868256,
0.07259368896484375,
0.5025254487991333,
-0.07644882798194885,
-0.014554888941347599,
0.28883400559425354,
-0.02187553234398365,
-0.158524751663208,
-0.024439919739961624,
-0.06826817989349365,
-0.339373916387558,
0.1265522688627243,
0.08741533011198044,
-0.004420846700668335,
0.12974627315998077,
-0.39144816994667053,
0.4947367012500763,
0.005739064887166023,
0.07240231335163116,
0.2570047080516815,
-0.0655369982123375,
0.0712556466460228,
0.03496009111404419,
-0.10916882753372192,
-0.059321328997612,
0.20103062689304352,
0.15647785365581512,
0.0835394635796547,
-0.05270007252693176,
0.10923939943313599,
0.025093870237469673,
0.22516785562038422,
0.3211655616760254,
-0.02538832277059555,
-0.3732830584049225,
-0.14241927862167358,
-0.7930980324745178,
-0.047314949333667755,
0.12712188065052032,
0.24027782678604126,
0.15700016915798187,
0.23634092509746552,
0.14809633791446686,
0.06876323372125626,
0.32785558700561523,
-0.4919533133506775,
0.30905914306640625,
-0.09575943648815155,
-0.28393039107322693,
0.06053115800023079,
0.27257299423217773,
-0.15632688999176025,
-0.0149211585521698,
-0.30394047498703003,
0.09581999480724335,
0.11739182472229004,
0.14144247770309448,
-0.10980644822120667,
-0.21446125209331512,
0.16999183595180511,
0.3306845426559448,
0.4625256359577179,
0.1928958147764206,
0.0250917449593544,
0.18962007761001587,
-0.17636916041374207,
-0.14376261830329895,
0.10011903196573257,
-0.11299266666173935,
0.10070761293172836,
-0.18834196031093597,
0.1528678983449936,
-0.39201435446739197,
0.007276028394699097,
-0.3311876952648163,
0.08174032717943192,
-0.0707264319062233,
-0.20521380007266998,
-0.4004010856151581,
-0.11365488916635513,
-0.16958674788475037,
0.09578076750040054,
0.07233712822198868,
0.2619526982307434,
0.000795561820268631,
0.2801583409309387,
-0.32642513513565063,
0.08033857494592667,
0.34791314601898193,
-0.4966030418872833,
0.05885850265622139,
-0.067292720079422,
0.4372345507144928,
0.17242911458015442,
-0.10238700360059738,
-0.28863778710365295,
-0.18775412440299988,
0.20087933540344238,
-0.4242379665374756,
-0.1868448555469513,
0.1320529282093048,
-0.16699111461639404,
0.2922217845916748,
-0.11060537397861481,
0.427190363407135,
0.14683614671230316,
-0.144683375954628,
-0.15270201861858368,
-0.13186106085777283
] |
https://github.com/huggingface/datasets/issues/5514 | Improve inconsistency of `Dataset.map` interface for `load_from_cache_file` | Hi! Yes, this seems more plausible. I can implement that. One last thing is the type annotation `load_from_cache_file: bool = None`. Which I then would change to `load_from_cache_file: Optional[bool] = None`. | ### Feature request
1. Replace the `load_from_cache_file` default value to `True`.
2. Remove or alter checks from `is_caching_enabled` logic.
### Motivation
I stumbled over an inconsistency in the `Dataset.map` interface. The documentation (and source) states for the parameter `load_from_cache_file`:
```
load_from_cache_file (`bool`, defaults to `True` if caching is enabled):
If a cache file storing the current computation from `function`
can be identified, use it instead of recomputing.
```
1. `load_from_cache_file` default value is `None`, while being annotated as `bool`
2. It is inconsistent with other method signatures like `filter`, that have the default value `True`
3. The logic is inconsistent, as the `map` method checks if caching is enabled through `is_caching_enabled`. This logic is not used for other similar methods.
### Your contribution
I am not fully aware of the logic behind caching checks. If this is just a inconsistency that historically grew, I would suggest to remove the `is_caching_enabled` logic as the "default" logic. Maybe someone can give insights, if environment variables have a higher priority than local variables or vice versa.
If this is clarified, I could adjust the source according to the "Feature request" section of this issue. | 31 | Improve inconsistency of `Dataset.map` interface for `load_from_cache_file`
### Feature request
1. Replace the `load_from_cache_file` default value to `True`.
2. Remove or alter checks from `is_caching_enabled` logic.
### Motivation
I stumbled over an inconsistency in the `Dataset.map` interface. The documentation (and source) states for the parameter `load_from_cache_file`:
```
load_from_cache_file (`bool`, defaults to `True` if caching is enabled):
If a cache file storing the current computation from `function`
can be identified, use it instead of recomputing.
```
1. `load_from_cache_file` default value is `None`, while being annotated as `bool`
2. It is inconsistent with other method signatures like `filter`, that have the default value `True`
3. The logic is inconsistent, as the `map` method checks if caching is enabled through `is_caching_enabled`. This logic is not used for other similar methods.
### Your contribution
I am not fully aware of the logic behind caching checks. If this is just a inconsistency that historically grew, I would suggest to remove the `is_caching_enabled` logic as the "default" logic. Maybe someone can give insights, if environment variables have a higher priority than local variables or vice versa.
If this is clarified, I could adjust the source according to the "Feature request" section of this issue.
Hi! Yes, this seems more plausible. I can implement that. One last thing is the type annotation `load_from_cache_file: bool = None`. Which I then would change to `load_from_cache_file: Optional[bool] = None`. | [
-0.22042793035507202,
0.1094694435596466,
-0.014823367819190025,
0.11704322695732117,
-0.2883232831954956,
-0.1477023959159851,
0.2506014108657837,
0.2232019156217575,
0.4472062587738037,
-0.0559086948633194,
0.2891519069671631,
0.6225760579109192,
0.21416610479354858,
0.05612708628177643,
-0.10780882090330124,
0.2672240436077118,
0.1069006696343422,
0.06794953346252441,
0.11340907216072083,
-0.02477259188890457,
-0.1798907220363617,
0.03579038381576538,
-0.2351173311471939,
-0.38672834634780884,
0.11202900856733322,
-0.12397607415914536,
0.22155895829200745,
0.04041845351457596,
-0.0780755802989006,
-0.4456245005130768,
0.2434760481119156,
0.512181282043457,
-0.3097575008869171,
0.1428307741880417,
-0.00011182494199601933,
-0.08501264452934265,
0.46995753049850464,
0.02315252088010311,
-0.037355028092861176,
-0.005445197224617004,
-0.4187574088573456,
-0.024443725124001503,
0.04542537033557892,
-0.2476043701171875,
0.06772665679454803,
0.21911455690860748,
-0.1263391375541687,
-0.499920129776001,
0.27952417731285095,
0.0055730221793055534,
0.13800685107707977,
0.02225584164261818,
-0.32124966382980347,
0.05057389661669731,
0.18583598732948303,
0.22336649894714355,
0.18918246030807495,
0.21410629153251648,
0.30874741077423096,
-0.1841019093990326,
-0.3011109530925751,
0.2687332034111023,
-0.29037266969680786,
-0.09195508062839508,
0.5470024943351746,
-0.2188088446855545,
-0.09869316965341568,
-0.025322727859020233,
0.13650766015052795,
0.16410551965236664,
0.5865497589111328,
-0.11281854659318924,
-0.2774042785167694,
0.007188171148300171,
-0.15475136041641235,
-0.08118141442537308,
0.46986550092697144,
-0.41994455456733704,
0.04221345856785774,
0.26507657766342163,
-0.16490422189235687,
-0.294719934463501,
0.06097792088985443,
0.2832528352737427,
-0.11284993588924408,
-0.09909851849079132,
-0.04050011932849884,
0.12002009898424149,
0.12347497045993805,
-0.018628299236297607,
0.0635194405913353,
-0.305372953414917,
-0.08891116082668304,
0.27632686495780945,
-0.14690187573432922,
-0.037442851811647415,
0.31348684430122375,
0.38609200716018677,
0.152207612991333,
0.0622633621096611,
0.131841778755188,
0.2790532112121582,
-0.2540758550167084,
0.17878508567810059,
0.19242943823337555,
0.41152331233024597,
0.1655564308166504,
0.030227195471525192,
0.10856360197067261,
-0.07823637872934341,
-0.20204298198223114,
0.1167084276676178,
0.3526396155357361,
-0.21695150434970856,
0.5662088990211487,
0.2150900661945343,
-0.05829496309161186,
-0.34813401103019714,
-0.07362712919712067,
0.030346937477588654,
-0.2622094452381134,
-0.2916578948497772,
0.3423350751399994,
-0.022784188389778137,
-0.07280220836400986,
0.4308679699897766,
0.0789351612329483,
-0.010177996009588242,
-0.1469864398241043,
-0.3668161630630493,
-0.2111218124628067,
-0.22901348769664764,
-0.20188429951667786,
0.09620307385921478,
0.1969357281923294,
-0.12523353099822998,
0.03301995247602463,
0.22775767743587494,
-0.053512342274188995,
0.16066746413707733,
0.17648234963417053,
-0.17919215559959412,
0.5359259247779846,
0.0056590065360069275,
-0.6433233618736267,
0.1205415353178978,
0.14172594249248505,
0.029279328882694244,
-0.23563256859779358,
0.2556535005569458,
-0.3844979405403137,
-0.2597186267375946,
0.09454345703125,
0.12308383733034134,
-0.36963075399398804,
0.14731469750404358,
-0.13032975792884827,
0.08319641649723053,
0.22337274253368378,
-0.5093197226524353,
0.01927221566438675,
-0.017754770815372467,
-0.3554671108722687,
-0.44765499234199524,
0.04260142147541046,
0.7209381461143494,
-0.3934973180294037,
-0.031296271830797195,
-0.2602839767932892,
-0.07714316248893738,
-0.11554611474275589,
0.1842147260904312,
-0.5661898255348206,
0.21095648407936096,
-0.14397770166397095,
0.11855615675449371,
0.22442638874053955,
-0.3994579017162323,
-0.7072790265083313,
0.5747563242912292,
0.1558457463979721,
0.2572785019874573,
0.025915704667568207,
0.24030213057994843,
0.19533149898052216,
-0.2270033061504364,
0.38772156834602356,
0.1663924753665924,
0.1708030104637146,
-0.0707821175456047,
-0.4203982353210449,
-0.3213549852371216,
0.3094062805175781,
-0.08698877692222595,
-0.1503332257270813,
0.3687171936035156,
-0.016741685569286346,
-0.3189055025577545,
0.324325829744339,
0.16684547066688538,
-0.10335328429937363,
0.1368393898010254,
0.492390900850296,
-0.129675030708313,
0.008225983008742332,
-0.045233193784952164,
-0.6681663990020752,
0.32278165221214294,
0.06596627086400986,
-0.310441792011261,
-0.05965183675289154,
-0.15542107820510864,
0.0945625975728035,
-0.07726550102233887,
0.004889465868473053,
0.2375875562429428,
0.08700941503047943,
-0.0019041597843170166,
-0.19165049493312836,
-0.18569906055927277,
-0.22348198294639587,
0.29156285524368286,
-0.2802478075027466,
-0.21872350573539734,
-0.04865496978163719,
-0.038290318101644516,
0.1040572002530098,
0.16311636567115784,
-0.19894148409366608,
-0.1422896385192871,
-0.0010667257010936737,
-0.0696958526968956,
-0.41707590222358704,
0.41998371481895447,
0.3777978718280792,
0.29873937368392944,
-0.12464993447065353,
0.4602079391479492,
0.0898703932762146,
-0.20220030844211578,
0.07418128103017807,
0.12942373752593994,
-0.1116240918636322,
-0.0879666656255722,
-0.32598939538002014,
0.24134561419487,
-0.10519428551197052,
-0.019855260848999023,
-0.2380772978067398,
-0.07828406244516373,
0.11667002737522125,
-0.0564284510910511,
-0.3336849510669708,
-0.4415220022201538,
-0.012210946530103683,
0.18586334586143494,
0.4420887231826782,
0.3549540638923645,
0.10118144750595093,
0.13777047395706177,
0.22350142896175385,
0.08620111644268036,
-0.07896646112203598,
-0.10269657522439957,
0.20711955428123474,
-0.3315269947052002,
0.06454453617334366,
0.28581470251083374,
0.4595873951911926,
0.10044538974761963,
0.08749055117368698,
-0.14976422488689423,
-0.032142866402864456,
0.09493564069271088,
0.11382102221250534,
-0.17623530328273773,
0.018622511997818947,
0.17629963159561157,
0.182061105966568,
0.19995243847370148,
-0.14225240051746368,
0.08950409293174744,
0.09044384956359863,
0.02333572879433632,
-0.25498974323272705,
0.0760175883769989,
-0.30229195952415466,
-0.24155926704406738,
-0.027723774313926697,
0.01892693340778351,
-0.3988005220890045,
-0.2936496138572693,
-0.11326786875724792,
0.18612350523471832,
-0.1720094233751297,
0.2073499709367752,
-0.3399113118648529,
0.3944127559661865,
-0.12034816294908524,
-0.5926055312156677,
0.05597289651632309,
-0.40283772349357605,
-0.18560791015625,
-0.10322462022304535,
0.3399898409843445,
0.04664461314678192,
0.1612246185541153,
-0.14197203516960144,
-0.117709681391716,
-0.273419588804245,
-0.39716577529907227,
0.1404871642589569,
0.31565022468566895,
0.3128719925880432,
0.1382536143064499,
0.1385764479637146,
0.026231296360492706,
0.1440432071685791,
0.016642490401864052,
-0.3262574076652527,
-0.18695779144763947,
-0.07434691488742828,
-0.06885582953691483,
-0.10547211021184921,
-0.21184222400188446,
-0.35114794969558716,
0.03080548346042633,
-0.3956165313720703,
-0.1321105659008026,
-0.33891046047210693,
0.18217092752456665,
0.49301987886428833,
-0.0713978111743927,
-0.16665023565292358,
0.1251206248998642,
0.14694657921791077,
-0.3912813663482666,
-0.4287773668766022,
0.2046712338924408,
0.0645313709974289,
-0.08719515800476074,
-0.10654990375041962,
-0.023587733507156372,
0.03642823174595833,
0.5837440490722656,
-0.25877928733825684,
-0.10526928305625916,
-0.028345057740807533,
0.32258203625679016,
-0.16117289662361145,
-0.13642562925815582,
0.26458442211151123,
0.18065862357616425,
-0.029941145330667496,
-0.33178961277008057,
-0.5311869978904724,
0.43374577164649963,
0.39659664034843445,
0.1483907699584961,
0.5205000638961792,
-0.04983706772327423,
-0.05338221415877342,
0.4683740735054016,
0.0325041264295578,
-0.28847184777259827,
0.26041364669799805,
0.34972429275512695,
0.40996095538139343,
-0.05174603313207626,
-0.1497328281402588,
-0.16809530556201935,
0.0018067359924316406,
-0.24296824634075165,
0.09718263149261475,
-0.11251654475927353,
-0.48568201065063477,
-0.07609325647354126,
-0.05614342913031578,
-0.23624125123023987,
-0.3348758816719055,
0.2557964324951172,
-0.45803725719451904,
0.33370327949523926,
0.048211533576250076,
-0.00906340405344963,
-0.6544485092163086,
-0.0008944249711930752,
0.2726060450077057,
0.20161578059196472,
0.4066774845123291,
-0.021662725135684013,
-0.33299627900123596,
0.04607148468494415,
0.0032143667340278625,
0.23394078016281128,
0.1550249457359314,
0.29098597168922424,
-0.19090858101844788,
-0.3308112919330597,
-0.1595747023820877,
0.06953545659780502,
0.640904426574707,
-0.46982449293136597,
0.10508209466934204,
0.20974980294704437,
0.18179504573345184,
0.2248757928609848,
-0.15078629553318024,
0.12426674365997314,
0.617164134979248,
0.16196106374263763,
0.40266484022140503,
-0.19622144103050232,
-0.2904714345932007,
-0.2941570580005646,
0.2063586264848709,
0.0033504031598567963,
-0.3331582546234131,
-0.07029058784246445,
0.3671552538871765,
0.08284346759319305,
-0.20443901419639587,
0.15116029977798462,
-0.01282310951501131,
0.12411773204803467,
0.1309516727924347,
0.024814559146761894,
0.24942946434020996,
-0.07061390578746796,
0.11610041558742523,
0.4554998278617859,
-0.13049766421318054,
-0.005949798971414566,
0.091870978474617,
0.2138673961162567,
0.09854993224143982,
0.32389524579048157,
-0.5165627002716064,
-0.01813437044620514,
-0.1304762363433838,
-0.07489471137523651,
-0.07769929617643356,
0.3717016875743866,
-0.02493935078382492,
0.11596941947937012,
0.44447413086891174,
-0.15838775038719177,
-0.21043601632118225,
-0.06187823414802551,
0.06742945313453674,
-0.14785149693489075,
-0.08416645973920822,
-0.567040205001831,
0.3488819897174835,
0.20598579943180084,
-0.46269917488098145,
0.7132798433303833,
-0.001779116690158844,
-0.19480036199092865,
0.395768404006958,
0.30493155121803284,
0.9452329874038696,
0.13247577846050262,
-0.18342305719852448,
0.006936745718121529,
-0.00044567883014678955,
0.18140798807144165,
0.04908332973718643,
0.22358527779579163,
-0.2226669043302536,
-0.12666383385658264,
-0.09822236746549606,
-0.20513051748275757,
0.03491949662566185,
0.24942447245121002,
-0.25824427604675293,
0.10847512632608414,
-0.1737898290157318,
0.5769100785255432,
0.041508059948682785,
0.1906832605600357,
0.07632213085889816,
0.03776463493704796,
0.11911296844482422,
0.10264649987220764,
0.019481167197227478,
0.11595454812049866,
-0.07352732121944427,
-0.2804969549179077,
0.2090761959552765,
-0.07295834273099899,
-0.21690309047698975,
-0.20186921954154968,
-0.32680022716522217,
0.3126397132873535,
0.08488288521766663,
0.1876489669084549,
0.16561338305473328,
0.30066218972206116,
0.005236193537712097,
-0.05061305686831474,
-0.20852702856063843,
0.11807924509048462,
0.38954102993011475,
0.3659333288669586,
-0.030821019783616066,
-0.0030987574718892574,
0.41348177194595337,
0.0854160338640213,
-0.1453055441379547,
-0.12635189294815063,
-0.2996881306171417,
-0.5182005167007446,
0.012097284197807312,
0.0474618598818779,
0.2696823477745056,
-0.018633173778653145,
-0.12348954379558563,
0.10321389138698578,
0.09509779512882233,
0.0822947770357132,
0.08225800096988678,
0.25604116916656494,
0.22109505534172058,
0.34045615792274475,
-0.18802140653133392,
-0.19751116633415222,
0.042584992945194244,
0.41871100664138794,
-0.13248422741889954,
-0.2269124984741211,
0.09242404997348785,
-0.37622711062431335,
-0.12346694618463516,
-0.24268078804016113,
-0.3105509579181671,
-0.24860930442810059,
0.07995031028985977,
-0.10392121225595474,
-0.15029612183570862,
-0.12135180085897446,
0.11162117123603821,
0.19349883496761322,
0.2918502688407898,
0.4544651210308075,
-0.1955530047416687,
-0.3053228557109833,
-0.16536952555179596,
0.23987776041030884,
-0.25953537225723267,
0.1970130205154419,
-0.1727929711341858,
-0.6115164756774902,
0.00025276467204093933,
0.04451080039143562,
-0.3381201922893524,
0.07330786436796188,
0.17447976768016815,
-0.01399311050772667,
-0.04341791570186615,
0.27823710441589355,
0.047860197722911835,
-0.3613187372684479,
-0.023675262928009033,
-0.255615770816803,
-0.4044002592563629,
-0.12333521246910095,
0.05382298305630684,
0.14053519070148468,
-0.10717981308698654,
0.0067145321518182755,
0.04373377189040184,
-0.29778778553009033,
0.0890880674123764,
-0.27652469277381897,
0.07266946136951447,
0.09888320416212082,
-0.09861579537391663,
0.2069326490163803,
-0.23358561098575592,
0.2553022801876068,
-0.20025703310966492,
0.19674217700958252,
0.22192277014255524,
-0.1863919347524643,
-0.12846383452415466,
0.17061203718185425,
-0.17828591167926788,
-0.16591282188892365,
0.1472710222005844,
0.2385212779045105,
-0.1658802181482315,
0.16043031215667725,
0.1317782998085022,
0.05043249577283859,
0.16780425608158112,
0.39051464200019836,
0.06652023643255234,
0.20329055190086365,
-0.13982535898685455,
-0.10971038043498993,
0.08153717964887619,
0.2100040763616562,
-0.08092962950468063,
-0.14017097651958466,
0.4574347734451294,
-0.10875936597585678,
0.109815314412117,
0.16519103944301605,
0.5375946164131165,
-0.1343335211277008,
0.3310546278953552,
-0.0037263203412294388,
0.32081329822540283,
-0.3142671585083008,
0.18272508680820465,
0.320337176322937,
0.06723861396312714,
0.04363727942109108,
0.26938527822494507,
0.3144596517086029,
0.20232704281806946,
0.34223127365112305,
0.4231184124946594,
0.06470607221126556,
0.05738893896341324,
0.2703520655632019,
-0.17663118243217468,
-0.623622477054596,
0.4317072927951813,
0.433424711227417,
-0.21244829893112183,
0.17937153577804565,
0.22118088603019714,
0.15312016010284424,
-0.16804128885269165,
-0.3764462172985077,
-0.13018031418323517,
-0.09107452630996704,
-0.1266060173511505,
-0.00413028709590435,
-0.058363743126392365,
-0.21019181609153748,
-0.055986471474170685,
-0.06735940277576447,
-0.11223408579826355,
0.24903272092342377,
0.4886961579322815,
0.07278753072023392,
-0.0716019868850708,
-0.13448388874530792,
-0.06810995191335678,
-0.14685946702957153,
0.4128125011920929,
-0.17637215554714203,
0.08783236145973206,
-0.3977367877960205,
-0.09048786759376526,
0.20991972088813782,
0.17864872515201569,
0.05087282508611679,
0.540524959564209,
-0.003772912546992302,
-0.03441295400261879,
0.23303985595703125,
-0.018005814403295517,
-0.16632501780986786,
0.010796683840453625,
-0.14476622641086578,
-0.2702094316482544,
0.1604364961385727,
0.11581307649612427,
-0.0018510306254029274,
0.18193554878234863,
-0.3689357340335846,
0.5224785804748535,
-0.058551937341690063,
0.1521153748035431,
0.23823441565036774,
-0.03004305064678192,
0.08198627829551697,
0.00707302987575531,
-0.12354829907417297,
-0.1291210800409317,
0.17916546761989594,
0.13664758205413818,
0.10618774592876434,
-0.019325286149978638,
0.11518938839435577,
0.04422720521688461,
0.20830199122428894,
0.3081849217414856,
-0.04889273643493652,
-0.36045801639556885,
-0.12942543625831604,
-0.8346726298332214,
-0.0748286172747612,
0.22631335258483887,
0.2614845335483551,
0.13964809477329254,
0.1916264295578003,
0.08069713413715363,
0.10843615233898163,
0.19670048356056213,
-0.5034545660018921,
0.23753994703292847,
-0.0944754034280777,
-0.2618272304534912,
0.03187700733542442,
0.1893734186887741,
-0.13752463459968567,
-0.007136154919862747,
-0.24106457829475403,
0.10334707796573639,
0.08714243024587631,
0.1720510721206665,
-0.1413625180721283,
-0.24829471111297607,
0.21124814450740814,
0.27921542525291443,
0.4416206181049347,
0.20828379690647125,
0.12819735705852509,
0.1956716775894165,
-0.21304704248905182,
-0.10522942245006561,
0.09648529440164566,
-0.08819790184497833,
0.14288580417633057,
-0.2368519902229309,
0.20668312907218933,
-0.349298894405365,
0.06003457307815552,
-0.31893253326416016,
0.1394597440958023,
-0.062037330120801926,
-0.2386234849691391,
-0.4900131821632385,
-0.13729976117610931,
-0.17124809324741364,
0.12052840739488602,
0.07265905290842056,
0.2901451289653778,
-0.01407187432050705,
0.2997328042984009,
-0.31297942996025085,
0.04418884962797165,
0.35919618606567383,
-0.5186499357223511,
0.0907570868730545,
-0.12318912893533707,
0.4024581015110016,
0.04609111323952675,
-0.059423014521598816,
-0.32313552498817444,
-0.18843483924865723,
0.24850024282932281,
-0.34703871607780457,
-0.17388714849948883,
0.1872502565383911,
-0.12251490354537964,
0.29608142375946045,
-0.11559151113033295,
0.368219792842865,
0.10514265298843384,
-0.13334062695503235,
-0.1356043517589569,
-0.1360379308462143
] |
https://github.com/huggingface/datasets/issues/5513 | Some functions use a param named `type` shouldn't that be avoided since it's a Python reserved name? | Hi! Let's not do this - renaming it would be a breaking change, and going through the deprecation cycle is only worth it if it improves user experience. | Hi @mariosasko, @lhoestq, or whoever reads this! :)
After going through `ArrowDataset.set_format` I found out that the `type` param is actually named `type` which is a Python reserved name as you may already know, shouldn't that be renamed to `format_type` before the 3.0.0 is released?
Just wanted to get your input, and if applicable, tackle this issue myself! Thanks 🤗 | 28 | Some functions use a param named `type` shouldn't that be avoided since it's a Python reserved name?
Hi @mariosasko, @lhoestq, or whoever reads this! :)
After going through `ArrowDataset.set_format` I found out that the `type` param is actually named `type` which is a Python reserved name as you may already know, shouldn't that be renamed to `format_type` before the 3.0.0 is released?
Just wanted to get your input, and if applicable, tackle this issue myself! Thanks 🤗
Hi! Let's not do this - renaming it would be a breaking change, and going through the deprecation cycle is only worth it if it improves user experience. | [
0.4956384301185608,
-0.4932823181152344,
-0.031042398884892464,
-0.2522832155227661,
0.25889816880226135,
-0.2998834550380707,
0.3812841773033142,
0.26294997334480286,
-0.5981423854827881,
-0.1118878722190857,
0.13323892652988434,
0.40194812417030334,
-0.34347429871559143,
0.0024418681859970093,
-0.21091043949127197,
-0.37252408266067505,
0.32681185007095337,
-0.06254647672176361,
0.33731603622436523,
0.2000524252653122,
-0.37900498509407043,
0.08414764702320099,
-0.2323896586894989,
0.21535035967826843,
-0.05791381374001503,
0.10116814076900482,
0.43691062927246094,
-0.4285769760608673,
-0.26293596625328064,
-0.4532846212387085,
0.10652929544448853,
-0.10108613967895508,
-0.10174639523029327,
0.5431073307991028,
-0.000123570192954503,
-0.26675665378570557,
0.4800400733947754,
-0.1880846619606018,
0.016444867476820946,
0.07131556421518326,
-0.18724825978279114,
-0.08266576379537582,
0.5293068289756775,
-0.26650628447532654,
0.046177737414836884,
-0.31673768162727356,
-0.46669358015060425,
-0.46255096793174744,
0.020358160138130188,
0.16100941598415375,
0.16977080702781677,
0.18652252852916718,
-0.10684606432914734,
0.18847867846488953,
0.2756575345993042,
0.5026925206184387,
-0.3487025797367096,
0.03544335067272186,
0.22390857338905334,
0.3795962631702423,
0.4690355062484741,
0.47889724373817444,
-0.16357344388961792,
-0.12481376528739929,
0.3473805785179138,
-0.12499021738767624,
0.11471684277057648,
-0.06984943896532059,
0.001011587679386139,
-0.07376661151647568,
0.31986919045448303,
-0.2269546389579773,
-0.18426790833473206,
0.016195617616176605,
-0.08288554102182388,
-0.43954312801361084,
0.1144905537366867,
-0.18475517630577087,
-0.01360207051038742,
-0.07596684992313385,
0.10158534348011017,
-0.2886863052845001,
-0.07916571199893951,
0.04717811197042465,
0.24481424689292908,
0.39280200004577637,
-0.2500147223472595,
0.261083722114563,
-0.11859241127967834,
-0.2520011067390442,
-0.026721637696027756,
0.03674687072634697,
-0.1685522496700287,
0.1925669014453888,
0.3430195450782776,
-0.10605207085609436,
-0.4340515732765198,
-0.03657133877277374,
-0.19160407781600952,
0.17932480573654175,
-0.14718493819236755,
0.005925944074988365,
0.30886465311050415,
-0.025596067309379578,
0.23265504837036133,
0.025419875979423523,
0.3863676190376282,
0.21454335749149323,
0.2330593764781952,
-0.12469122558832169,
0.26586273312568665,
-0.05762320011854172,
0.17595122754573822,
-0.0373835526406765,
0.4116182327270508,
0.16588488221168518,
0.34062039852142334,
-0.21503812074661255,
0.2827942371368408,
-0.07990860939025879,
0.12434963136911392,
-0.1634136140346527,
-0.05817132070660591,
-0.01516219973564148,
0.36076119542121887,
0.5811305046081543,
0.15445895493030548,
0.13336622714996338,
-0.02248496748507023,
-0.008417383767664433,
0.14077787101268768,
-0.3193264305591583,
-0.13419991731643677,
-0.06971295177936554,
-0.10594342648983002,
0.06667228043079376,
-0.12273767590522766,
-0.052468519657850266,
-0.18889741599559784,
-0.03690429776906967,
-0.021685052663087845,
0.1346181482076645,
0.3430790305137634,
0.377007395029068,
-0.6113674640655518,
0.30580082535743713,
0.04869282245635986,
-0.07872892171144485,
-0.23770004510879517,
0.3291650712490082,
-0.420926034450531,
-0.29674965143203735,
-0.5983218550682068,
0.10984548181295395,
0.22579310834407806,
0.25931835174560547,
-0.3885188698768616,
-0.03229256346821785,
0.44245678186416626,
-0.18424254655838013,
0.3983830213546753,
-0.2453945428133011,
0.2455979883670807,
-0.27895399928092957,
-0.31870245933532715,
-0.1476244479417801,
-0.24460069835186005,
-0.12301936745643616,
-0.4096209406852722,
0.015252060256898403,
0.5701484084129333,
0.09927205741405487,
-0.09599099308252335,
-0.5348711609840393,
0.041918717324733734,
-0.10804001241922379,
0.5273374319076538,
-0.17921066284179688,
0.37189745903015137,
-0.025562206283211708,
0.09293995797634125,
-0.11574368178844452,
0.22551771998405457,
-0.42013120651245117,
-0.3629906177520752,
-0.38359543681144714,
0.10928690433502197,
-0.2587130069732666,
0.054999202489852905,
-0.05156265199184418,
-0.25972625613212585,
0.031371332705020905,
0.026267368346452713,
-0.30821412801742554,
-0.20584072172641754,
0.02931862697005272,
-0.20531627535820007,
-0.16928397119045258,
0.15825751423835754,
0.001640133559703827,
0.18423502147197723,
-0.22443072497844696,
0.706915557384491,
-0.025326326489448547,
0.29427507519721985,
-0.16031071543693542,
-0.2048792541027069,
-0.3352968394756317,
0.14141763746738434,
-0.3266478478908539,
-0.31980472803115845,
-0.3061835765838623,
-0.03641125559806824,
-0.019063003361225128,
0.20365378260612488,
0.05157935619354248,
-0.02074694260954857,
0.010157063603401184,
-0.16212843358516693,
0.15604422986507416,
-0.42062029242515564,
-0.5313204526901245,
0.13064178824424744,
0.028050679713487625,
0.18900421261787415,
-0.5994492173194885,
0.1186656579375267,
-0.17325304448604584,
-0.38304826617240906,
-0.043591901659965515,
0.12007622420787811,
0.11933582276105881,
-0.22337284684181213,
0.0903087630867958,
0.5479819774627686,
-0.14218385517597198,
-0.39385688304901123,
0.23301339149475098,
0.010195738635957241,
0.0035967715084552765,
-0.1502968817949295,
0.10925254225730896,
0.1812879741191864,
0.16707855463027954,
0.2855120003223419,
0.3481714725494385,
0.16651327908039093,
0.25546756386756897,
-0.30988162755966187,
0.07310538738965988,
-0.01038273610174656,
0.2531658709049225,
-0.16899879276752472,
-0.3588147461414337,
-0.17977166175842285,
0.22861473262310028,
-0.010785307735204697,
0.11526598781347275,
-0.006308570504188538,
-0.05104174464941025,
0.2469063550233841,
-0.09693115949630737,
0.23483726382255554,
0.010099973529577255,
0.004076659679412842,
0.2305883765220642,
0.1808692216873169,
0.06059473380446434,
0.2494480013847351,
0.02182760462164879,
-0.25829142332077026,
-0.20192942023277283,
0.37035658955574036,
-0.06569282710552216,
0.470865935087204,
0.3374459743499756,
0.40594494342803955,
-0.13109612464904785,
0.004187238402664661,
-0.07619688659906387,
0.17988061904907227,
0.0843028724193573,
-0.05329512059688568,
-0.22959482669830322,
-0.38395556807518005,
0.20615844428539276,
-0.29225412011146545,
0.20725655555725098,
-0.22824101150035858,
-0.11755254119634628,
-0.23888009786605835,
-0.03773724287748337,
-0.17423754930496216,
0.061143215745687485,
-0.3746388852596283,
0.1811891347169876,
-0.37798556685447693,
0.49913138151168823,
-0.08167807012796402,
-0.22085487842559814,
-0.3098548948764801,
0.036221545189619064,
-0.16480794548988342,
-0.08619952201843262,
0.062176719307899475,
-0.5265385508537292,
0.36697879433631897,
0.14164279401302338,
0.1582871973514557,
-0.008766181766986847,
-0.5371240973472595,
0.026568392291665077,
-0.349307119846344,
-0.05398980528116226,
0.08795296400785446,
-0.30990856885910034,
-0.14690908789634705,
-0.2172948122024536,
0.0014822708908468485,
-0.3826429545879364,
-0.05998729169368744,
-0.18454931676387787,
-0.05300847813487053,
0.2680934965610504,
-0.2658030092716217,
0.09964572638273239,
-0.26226404309272766,
-0.1529775857925415,
0.2754022777080536,
-0.19612839818000793,
0.11420890688896179,
0.12446693331003189,
-0.36893314123153687,
0.09341282397508621,
-0.06608859449625015,
0.2014373391866684,
-0.14872437715530396,
0.08111439645290375,
0.20800909399986267,
-0.12930311262607574,
0.07464665174484253,
-0.07243077456951141,
-0.007162043824791908,
0.02584254741668701,
0.13524334132671356,
0.09211312234401703,
-0.33681726455688477,
0.15359677374362946,
-0.16954222321510315,
0.08605745434761047,
-0.11914826929569244,
0.0631922110915184,
0.34123000502586365,
-0.09535662084817886,
-0.135736346244812,
-0.09270349144935608,
0.0056622326374053955,
0.03568442165851593,
0.20556709170341492,
0.46537020802497864,
-0.04621446877717972,
-0.15341249108314514,
0.6522459983825684,
-0.160766139626503,
0.126995250582695,
0.2489987164735794,
0.2560423016548157,
0.05998554825782776,
-0.007325589656829834,
-0.06876485049724579,
-0.3708663880825043,
0.040325410664081573,
0.1196552962064743,
-0.08836337924003601,
-0.03826342895627022,
-0.6516948342323303,
-0.023953303694725037,
0.13734228909015656,
-0.17266571521759033,
-0.22056078910827637,
0.11190863698720932,
-0.016830775886774063,
0.2927199900150299,
-0.0421137735247612,
0.1969870626926422,
-0.12238156795501709,
-0.17102938890457153,
0.044432494789361954,
0.20028425753116608,
-0.1848081648349762,
-0.1473138928413391,
-0.08378218114376068,
-0.34046345949172974,
-0.15963643789291382,
0.4456440210342407,
0.2844898998737335,
0.5546956062316895,
0.1736118644475937,
-0.42928481101989746,
0.19633719325065613,
0.21021558344364166,
0.12482226639986038,
-0.13039466738700867,
-0.4016050100326538,
0.33215251564979553,
-0.12546256184577942,
-0.3731616139411926,
-0.075053371489048,
-0.030265651643276215,
0.17479956150054932,
-0.20589520037174225,
0.05627300590276718,
-0.16943395137786865,
-0.38417235016822815,
-0.05873878300189972,
-0.20180867612361908,
0.007077392190694809,
0.040032900869846344,
-0.3660532534122467,
0.00652526319026947,
0.1575746238231659,
-0.049586646258831024,
0.22151485085487366,
0.07442368566989899,
-0.10807661712169647,
0.232522115111351,
-0.22336499392986298,
-0.05611112713813782,
0.10606344044208527,
-0.18185177445411682,
0.4680399000644684,
0.05415087938308716,
-0.32789382338523865,
0.03272680565714836,
0.32118871808052063,
0.11208590120077133,
0.05662621930241585,
0.12576811015605927,
-0.18760529160499573,
0.15772908926010132,
0.0406469963490963,
0.46177658438682556,
0.36404144763946533,
0.010814428329467773,
0.43194910883903503,
-0.14494402706623077,
0.154218852519989,
0.10334668308496475,
-0.04807155206799507,
0.3491096496582031,
-0.12889012694358826,
-0.36649057269096375,
-0.14577004313468933,
0.19407658278942108,
0.3586255609989166,
-0.04624159634113312,
0.4015257656574249,
0.5997577905654907,
-0.30850666761398315,
0.2878572344779968,
0.45246049761772156,
1.1215580701828003,
0.12973719835281372,
0.19058747589588165,
-0.20388713479042053,
-0.1965188980102539,
0.294491171836853,
0.36732053756713867,
0.007388019934296608,
-0.3165636956691742,
0.32315459847450256,
0.05760515481233597,
-0.13933910429477692,
0.285622775554657,
-0.4859080910682678,
-0.20753544569015503,
-0.04543020948767662,
-0.4827638864517212,
0.22725810110569,
-0.026990419253706932,
-0.1001027375459671,
-0.11833680421113968,
-0.2459886074066162,
-0.27471452951431274,
-0.0135280080139637,
-0.18708060681819916,
-0.1530902087688446,
0.027438770979642868,
-0.05245828256011009,
-0.052776999771595,
-0.2516120672225952,
-0.11442331969738007,
-0.2926108241081238,
0.08923425525426865,
0.0939406082034111,
0.0818028524518013,
-0.22198376059532166,
0.14350177347660065,
0.0011578425765037537,
0.04662436991930008,
-0.05859560891985893,
-0.08716972917318344,
0.14914077520370483,
0.565539538860321,
0.30705296993255615,
-0.06788122653961182,
-0.03212985023856163,
0.3214316666126251,
-0.14963214099407196,
0.25985726714134216,
0.2312973439693451,
0.112338587641716,
-0.33460646867752075,
-0.4340099096298218,
0.1258728951215744,
0.20516371726989746,
-0.20861035585403442,
0.06350909173488617,
-0.15823359787464142,
0.11023151874542236,
0.07830317318439484,
0.07992133498191833,
0.00880754366517067,
-0.22739362716674805,
0.39654266834259033,
0.13156752288341522,
-0.36076295375823975,
-0.021028418093919754,
0.08230804651975632,
0.424142450094223,
0.17853324115276337,
0.39061111211776733,
-0.150014728307724,
-0.26912111043930054,
-0.13412994146347046,
0.30284583568573,
0.20410320162773132,
-0.5353683233261108,
0.3546861410140991,
0.08048141747713089,
-0.40151405334472656,
0.023166295140981674,
0.2918092608451843,
-0.09248657524585724,
0.17605498433113098,
-0.4030306041240692,
0.24059125781059265,
-0.24188290536403656,
0.1893095225095749,
-0.03920089825987816,
0.02467762865126133,
-0.0727396160364151,
-0.1930067390203476,
-0.0994533970952034,
-0.21477918326854706,
-0.20409196615219116,
-0.06151130050420761,
0.33444836735725403,
0.31706467270851135,
-0.6497900485992432,
0.06185561418533325,
0.21109700202941895,
0.059345047920942307,
0.08313075453042984,
0.257010281085968,
-0.009903563186526299,
-0.12526839971542358,
-0.3365515470504761,
0.18281786143779755,
0.15418779850006104,
-0.11123330891132355,
-0.05482430011034012,
-0.1589781939983368,
-0.03423585742712021,
0.26995375752449036,
-0.1050170511007309,
0.10863599926233292,
0.11692309379577637,
0.19431929290294647,
0.3076104521751404,
-0.1821669638156891,
0.4266178607940674,
0.2103748321533203,
-0.13425473868846893,
0.4452431797981262,
0.07140402495861053,
-0.061440013349056244,
0.07602352648973465,
-0.032138556241989136,
0.2884688973426819,
0.029287509620189667,
0.10622013360261917,
0.3076041042804718,
-0.11930892616510391,
-0.11305570602416992,
-0.04446439817547798,
-0.2237257957458496,
0.1438293159008026,
0.5053350925445557,
-0.2587122321128845,
-0.24556714296340942,
0.39073359966278076,
0.04374139755964279,
0.06714548915624619,
-0.18390005826950073,
-0.17452938854694366,
0.3349000811576843,
-0.2674049139022827,
0.27128225564956665,
-0.17472775280475616,
0.2896890938282013,
0.28101617097854614,
0.06747189909219742,
-0.1635671854019165,
0.004887895658612251,
0.1994532346725464,
0.13704273104667664,
0.1655619889497757,
-0.029619652777910233,
0.4321722984313965,
0.2292717695236206,
0.041588760912418365,
-0.3782684803009033,
0.273182213306427,
0.17636893689632416,
0.207483172416687,
0.04027761518955231,
0.3979671597480774,
0.038159918040037155,
-0.08589255809783936,
-0.06825949251651764,
0.001506224274635315,
0.604534387588501,
0.5847960114479065,
0.15656504034996033,
0.08015098422765732,
-0.6930617690086365,
-0.06727669388055801,
-0.09689761698246002,
-0.023829016834497452,
-0.16384322941303253,
-0.22495537996292114,
0.176320880651474,
-0.13243333995342255,
0.001447930932044983,
-0.18425720930099487,
0.2261662632226944,
0.4206729233264923,
0.26981592178344727,
0.23800550401210785,
-0.2126377671957016,
-0.005157943814992905,
-0.13598552346229553,
0.7577775716781616,
-0.014349076896905899,
-0.059171900153160095,
-0.049481406807899475,
0.05455988273024559,
0.22119928896427155,
-0.014928752556443214,
-0.0029955506324768066,
0.33116310834884644,
-0.319781631231308,
-0.40110865235328674,
0.005524131469428539,
-0.012590810656547546,
0.22471226751804352,
0.3735921084880829,
0.3516210913658142,
0.3713090419769287,
0.14476899802684784,
0.043396443128585815,
-0.015907596796751022,
-0.13144034147262573,
0.011053714901208878,
-0.15170329809188843,
0.08879578113555908,
0.5351496338844299,
-0.09358888864517212,
0.08333120495080948,
-0.15030020475387573,
0.04814968630671501,
-0.4369909167289734,
-0.2689313292503357,
0.2360875904560089,
0.12578660249710083,
-0.001913178712129593,
-0.08522724360227585,
0.005598526448011398,
0.24114027619361877,
0.2784125804901123,
-0.17564193904399872,
0.1875992715358734,
0.046326473355293274,
-0.12904368340969086,
0.06733967363834381,
0.19107061624526978,
0.159174844622612,
0.06258247047662735,
0.2918633222579956,
-0.1342724710702896,
0.24008485674858093,
0.07020078599452972,
0.13922536373138428,
-0.20708736777305603,
-0.1486709862947464,
0.2052116096019745,
-0.38847315311431885,
0.023547232151031494,
-0.03272765129804611,
0.0020961984992027283,
0.024368278682231903,
-0.23043453693389893,
0.18379715085029602,
-0.20623283088207245,
-0.0523364394903183,
-0.18747229874134064,
-0.3069762587547302,
0.35256505012512207,
0.578019380569458,
0.5573976039886475,
0.057678066194057465,
-0.003089040517807007,
0.10050369054079056,
-0.20518037676811218,
0.21849556267261505,
0.14486493170261383,
-0.1891283243894577,
0.2217044234275818,
-0.21689942479133606,
-0.019564934074878693,
-0.1814538985490799,
0.0974060446023941,
-0.060635533183813095,
0.5469884276390076,
-0.35970425605773926,
0.25624963641166687,
-0.20987890660762787,
0.264617383480072,
0.1576874852180481,
-0.238058403134346,
-0.3200487494468689,
0.0616978295147419,
0.04735889658331871,
0.4484211504459381,
-0.2703205645084381,
-0.1616349220275879,
0.7782900929450989,
-0.2115984857082367,
-0.3607311248779297,
0.26549601554870605,
0.3116825222969055,
0.45301494002342224,
-0.1518813520669937,
-0.4562623202800751,
-0.3095739781856537,
0.09458840638399124,
0.05213552713394165,
-0.2087409496307373,
0.14568613469600677,
-0.26835304498672485,
-0.2710895836353302,
-0.18265904486179352,
0.4926009476184845,
-0.15329477190971375,
0.14966756105422974,
-0.1760803908109665,
0.10466255247592926
] |
https://github.com/huggingface/datasets/issues/5513 | Some functions use a param named `type` shouldn't that be avoided since it's a Python reserved name? | Hi @mariosasko, ok it makes sense. Anyway, don't you think it's worth it at some point to start a deprecation cycle e.g. `fs` in `load_from_disk`? It doesn't affect user experience but it's for sure a bad practice IMO, but's up to you 😄 Feel free to close this issue otherwise! | Hi @mariosasko, @lhoestq, or whoever reads this! :)
After going through `ArrowDataset.set_format` I found out that the `type` param is actually named `type` which is a Python reserved name as you may already know, shouldn't that be renamed to `format_type` before the 3.0.0 is released?
Just wanted to get your input, and if applicable, tackle this issue myself! Thanks 🤗 | 50 | Some functions use a param named `type` shouldn't that be avoided since it's a Python reserved name?
Hi @mariosasko, @lhoestq, or whoever reads this! :)
After going through `ArrowDataset.set_format` I found out that the `type` param is actually named `type` which is a Python reserved name as you may already know, shouldn't that be renamed to `format_type` before the 3.0.0 is released?
Just wanted to get your input, and if applicable, tackle this issue myself! Thanks 🤗
Hi @mariosasko, ok it makes sense. Anyway, don't you think it's worth it at some point to start a deprecation cycle e.g. `fs` in `load_from_disk`? It doesn't affect user experience but it's for sure a bad practice IMO, but's up to you 😄 Feel free to close this issue otherwise! | [
0.4295054078102112,
-0.5103021860122681,
-0.06425859779119492,
-0.09285256266593933,
0.3008670210838318,
-0.3707627058029175,
0.4326748251914978,
0.21824632585048676,
-0.445772647857666,
0.0075672343373298645,
0.14417414367198944,
0.461667001247406,
-0.33134087920188904,
0.02457948587834835,
-0.3399498462677002,
-0.2890332341194153,
0.341844767332077,
-0.019043758511543274,
0.1867656409740448,
0.1494310051202774,
-0.37300488352775574,
0.12344232946634293,
-0.1697506308555603,
0.20613592863082886,
-0.12164033949375153,
0.04455147683620453,
0.3672172427177429,
-0.3664785623550415,
-0.2607489824295044,
-0.4306184947490692,
0.04429840296506882,
-0.11687739193439484,
-0.042305149137973785,
0.6024560332298279,
-0.00011713366984622553,
-0.28631383180618286,
0.48731786012649536,
-0.156574085354805,
-0.12389881908893585,
0.038337722420692444,
-0.057436976581811905,
-0.045707590878009796,
0.5658392906188965,
-0.3268210291862488,
0.08582361787557602,
-0.23883940279483795,
-0.4706345200538635,
-0.4774914085865021,
0.1848219931125641,
0.1227600947022438,
0.23651929199695587,
0.26163771748542786,
-0.1276765614748001,
0.14921988546848297,
0.35598623752593994,
0.5189352035522461,
-0.33345943689346313,
0.13168731331825256,
0.24919630587100983,
0.32642698287963867,
0.38002726435661316,
0.4756815433502197,
-0.17414818704128265,
-0.10716390609741211,
0.34399762749671936,
-0.10182439535856247,
0.215545654296875,
-0.14342902600765228,
-0.08341852575540543,
-0.0713171735405922,
0.3691041171550751,
-0.17020079493522644,
-0.34275883436203003,
-0.0468166321516037,
-0.08365515619516373,
-0.5025078058242798,
0.20364564657211304,
-0.19162094593048096,
-0.05544351786375046,
-0.0014358758926391602,
0.057248398661613464,
-0.29055941104888916,
-0.10792718827724457,
0.019273538142442703,
0.2475770115852356,
0.3517843186855316,
-0.30360159277915955,
0.17191845178604126,
-0.05432228371500969,
-0.21279306709766388,
0.06520628929138184,
0.05124934762716293,
-0.22107791900634766,
0.1608208864927292,
0.3041713535785675,
-0.16729560494422913,
-0.4006419777870178,
-0.04164871573448181,
-0.14186930656433105,
0.19999970495700836,
-0.07236125320196152,
0.0778036117553711,
0.2835390865802765,
0.003860756754875183,
0.23812700808048248,
0.06983114778995514,
0.3331253230571747,
0.07153978943824768,
0.3015116751194,
-0.15164890885353088,
0.29284778237342834,
-0.11880027502775192,
0.12204008549451828,
-0.04604972526431084,
0.37233757972717285,
0.13657891750335693,
0.2337789088487625,
-0.24625326693058014,
0.3233989477157593,
-0.09801431745290756,
0.209318608045578,
-0.1406775414943695,
-0.07707901298999786,
0.041294701397418976,
0.36057794094085693,
0.6017614603042603,
0.09344053268432617,
0.16048897802829742,
-0.08428746461868286,
0.005850805900990963,
0.12187256664037704,
-0.32330676913261414,
-0.24326872825622559,
-0.07655511051416397,
-0.0878746509552002,
0.08845260739326477,
-0.1051846593618393,
0.002977464348077774,
-0.2125871330499649,
0.03736768662929535,
-0.03631873428821564,
0.032045070081949234,
0.3011299669742584,
0.3152872323989868,
-0.5670138597488403,
0.32337048649787903,
-0.015225403010845184,
0.01414286345243454,
-0.21135640144348145,
0.30630186200141907,
-0.4030446708202362,
-0.3350151479244232,
-0.6390774250030518,
0.18196317553520203,
0.18398301303386688,
0.23643545806407928,
-0.36409637331962585,
-0.0916721522808075,
0.31891414523124695,
-0.17541000247001648,
0.3520869314670563,
-0.23944927752017975,
0.1785718947649002,
-0.3273783028125763,
-0.3315903842449188,
-0.1133158802986145,
-0.197345569729805,
-0.15008777379989624,
-0.4203619360923767,
-0.032052718102931976,
0.5486806631088257,
0.2052430659532547,
-0.19171184301376343,
-0.5118725299835205,
-0.06738031655550003,
-0.16221392154693604,
0.6066491007804871,
-0.17266437411308289,
0.3845832943916321,
0.16775105893611908,
0.14355365931987762,
-0.10507983714342117,
0.27393725514411926,
-0.37340104579925537,
-0.2666360139846802,
-0.35750091075897217,
0.07002242654561996,
-0.20292043685913086,
0.13507790863513947,
-0.05736498534679413,
-0.30071592330932617,
-0.013624388724565506,
0.030814386904239655,
-0.2781374156475067,
-0.18037553131580353,
0.005975648760795593,
-0.06575556844472885,
-0.28773945569992065,
0.17039582133293152,
-0.08522184193134308,
0.17107735574245453,
-0.12947356700897217,
0.7124373912811279,
0.0014458969235420227,
0.24252749979496002,
-0.17341551184654236,
-0.2862093448638916,
-0.1990879476070404,
0.12209086120128632,
-0.3299596309661865,
-0.2604038715362549,
-0.2339867353439331,
0.02917652577161789,
-0.030597984790802002,
0.20238368213176727,
0.1601199209690094,
0.03037547692656517,
0.042791400104761124,
-0.22797925770282745,
0.13246802985668182,
-0.4395396113395691,
-0.46951448917388916,
0.09630706906318665,
0.009616158902645111,
0.19262777268886566,
-0.43075132369995117,
0.0335879810154438,
-0.23919324576854706,
-0.3387291729450226,
-0.0688856765627861,
0.06544874608516693,
0.0839899554848671,
-0.2237723171710968,
0.14619183540344238,
0.586115837097168,
0.04334518313407898,
-0.40300366282463074,
0.2977102994918823,
0.06915676593780518,
0.050381001085042953,
-0.07606909424066544,
0.12001316249370575,
0.22300946712493896,
0.16838517785072327,
0.20844677090644836,
0.43521493673324585,
0.1464819461107254,
0.2115306407213211,
-0.23458069562911987,
0.025780627503991127,
0.054060183465480804,
0.21289768815040588,
-0.12188821285963058,
-0.336412250995636,
-0.12758652865886688,
0.25271883606910706,
0.02274637296795845,
0.09429934620857239,
-0.03166719153523445,
-0.07299686223268509,
0.27890634536743164,
-0.06913279742002487,
0.19681105017662048,
0.07962356507778168,
0.08155768364667892,
0.1754220724105835,
0.2603059411048889,
0.02724410966038704,
0.254332959651947,
0.10007282346487045,
-0.20832395553588867,
-0.315619558095932,
0.30536413192749023,
-0.09983580559492111,
0.5359922647476196,
0.27061641216278076,
0.5101257562637329,
-0.007996179163455963,
0.033443450927734375,
0.04494115337729454,
0.11177480965852737,
0.010356254875659943,
-0.07538996636867523,
-0.2509615123271942,
-0.3884069323539734,
0.19215121865272522,
-0.25030338764190674,
0.09857607632875443,
-0.20538491010665894,
-0.09130717068910599,
-0.22173723578453064,
-0.016307413578033447,
-0.1756599247455597,
0.12253068387508392,
-0.3886752724647522,
0.15656836330890656,
-0.22983618080615997,
0.5571576952934265,
-0.12023090571165085,
-0.02697327919304371,
-0.371757835149765,
-0.004988980013877153,
-0.18403083086013794,
-0.02847113274037838,
0.1388573944568634,
-0.47514015436172485,
0.412716269493103,
0.1501139998435974,
0.09183359146118164,
-0.020768621936440468,
-0.4970925450325012,
0.08544574677944183,
-0.31476008892059326,
-0.029804354533553123,
0.06707987189292908,
-0.29133081436157227,
-0.14468726515769958,
-0.21698097884655,
0.007287213578820229,
-0.4740370512008667,
-0.12031597644090652,
-0.14937461912631989,
0.01464978139847517,
0.26203104853630066,
-0.3552130162715912,
0.12032972276210785,
-0.21896982192993164,
-0.28664496541023254,
0.24942980706691742,
-0.12135086953639984,
0.13880307972431183,
0.13459867238998413,
-0.3223453164100647,
0.10587884485721588,
0.04574071615934372,
0.24462278187274933,
-0.12512658536434174,
0.044574763625860214,
0.2629989683628082,
-0.11899540573358536,
-0.03762108460068703,
0.018419232219457626,
0.026966530829668045,
0.013875734061002731,
0.1460469663143158,
-0.021450698375701904,
-0.3433580994606018,
0.15514971315860748,
-0.14948005974292755,
-0.02678937464952469,
-0.0646844133734703,
0.0756896585226059,
0.33778640627861023,
-0.16188320517539978,
-0.13152877986431122,
-0.05724614858627319,
-0.04065024107694626,
0.018035247921943665,
0.16572792828083038,
0.4488751292228699,
-0.05814501643180847,
-0.1427489072084427,
0.5946142673492432,
-0.18166981637477875,
0.10986357927322388,
0.2328139841556549,
0.28923022747039795,
0.1586402803659439,
-0.08944863826036453,
-0.0010472480207681656,
-0.40066659450531006,
-0.05668814480304718,
0.06129316985607147,
-0.04394473135471344,
-0.07054544985294342,
-0.651848554611206,
-0.08925892412662506,
0.18688668310642242,
-0.19251546263694763,
-0.22558198869228363,
0.08409179747104645,
-0.09353667497634888,
0.24054789543151855,
-0.14620879292488098,
0.27015775442123413,
-0.05651805177330971,
-0.1029704138636589,
0.16743449866771698,
0.12421580404043198,
-0.07219826430082321,
-0.21251000463962555,
-0.11384640634059906,
-0.24372757971286774,
-0.12431059032678604,
0.44950443506240845,
0.2431383579969406,
0.515531063079834,
0.08834841847419739,
-0.4550706744194031,
0.17195312678813934,
0.11523926258087158,
0.2359803318977356,
-0.15908771753311157,
-0.33377641439437866,
0.32297003269195557,
-0.1850011795759201,
-0.4389100670814514,
-0.034041740000247955,
-0.19048495590686798,
0.07300037145614624,
-0.2525478005409241,
0.18571221828460693,
-0.15332889556884766,
-0.46844178438186646,
-0.21098515391349792,
-0.2453581839799881,
-0.0011048689484596252,
-0.009967784397304058,
-0.32219401001930237,
0.14025256037712097,
0.03458240628242493,
-0.08965609222650528,
0.20346345007419586,
0.03594648838043213,
-0.26367226243019104,
0.12067443132400513,
-0.2289932370185852,
-0.07508046180009842,
0.057400405406951904,
-0.13691046833992004,
0.5081785321235657,
0.006951369345188141,
-0.27602463960647583,
0.04026396572589874,
0.35532015562057495,
0.1185685247182846,
0.09027576446533203,
0.009388066828250885,
-0.07761290669441223,
0.25454452633857727,
-0.03805992007255554,
0.38228753209114075,
0.45365914702415466,
0.12224899232387543,
0.33613747358322144,
-0.2063630223274231,
0.20157238841056824,
0.024633843451738358,
-0.1631995439529419,
0.3246312439441681,
-0.1403813511133194,
-0.21996663510799408,
-0.0696793794631958,
0.16173598170280457,
0.3272920548915863,
-0.1077011376619339,
0.3621786832809448,
0.5306976437568665,
-0.3260100781917572,
0.4603755474090576,
0.4691894054412842,
1.1989326477050781,
0.1939070075750351,
0.3240436315536499,
-0.11282443255186081,
-0.2092016339302063,
0.3168231248855591,
0.4198645353317261,
-0.0486002117395401,
-0.33628106117248535,
0.2765800356864929,
0.06971879303455353,
-0.11790834367275238,
0.2923201322555542,
-0.3986768126487732,
-0.22281458973884583,
-0.059904422610998154,
-0.40659618377685547,
0.15961220860481262,
-0.13420914113521576,
0.012627627700567245,
-0.22868721187114716,
-0.2776402235031128,
-0.3594707250595093,
0.041804686188697815,
-0.10718363523483276,
-0.16326773166656494,
-0.03369157388806343,
-0.09238645434379578,
-0.03574904799461365,
-0.20131421089172363,
-0.017233610153198242,
-0.27618369460105896,
0.030460871756076813,
0.1320430338382721,
0.021781103685498238,
-0.24206958711147308,
0.13371984660625458,
0.057264089584350586,
0.08654613047838211,
-0.06508712470531464,
-0.10693113505840302,
0.0789334625005722,
0.49683380126953125,
0.3363626003265381,
-0.09913773834705353,
0.005139726214110851,
0.2684737741947174,
-0.16431072354316711,
0.2453814446926117,
0.2204250693321228,
0.06379152834415436,
-0.25525182485580444,
-0.2771478295326233,
0.06514903157949448,
0.0656404048204422,
-0.20274044573307037,
0.08033342659473419,
-0.16680121421813965,
0.05678180977702141,
0.06870684027671814,
0.13872499763965607,
0.0194687657058239,
-0.22487658262252808,
0.3755885064601898,
0.13015729188919067,
-0.3176725506782532,
-0.08968214690685272,
0.12384335696697235,
0.35414204001426697,
0.18660825490951538,
0.3440338671207428,
-0.12403671443462372,
-0.34088826179504395,
-0.2146604061126709,
0.2890457510948181,
0.13512934744358063,
-0.5068833231925964,
0.29734286665916443,
0.10604782402515411,
-0.4449716806411743,
0.013374466449022293,
0.2915540635585785,
0.025992587208747864,
0.1798497438430786,
-0.324611634016037,
0.19801875948905945,
-0.2237691879272461,
0.26743084192276,
-0.021524477750062943,
0.12411464750766754,
-0.1648244559764862,
-0.3545747697353363,
-0.17224183678627014,
-0.27639201283454895,
-0.2902594804763794,
0.03103194572031498,
0.34758543968200684,
0.2151593416929245,
-0.5564957857131958,
-0.06900966167449951,
0.1530551016330719,
0.05059020221233368,
0.13343895971775055,
0.24999119341373444,
-0.145220085978508,
-0.16678103804588318,
-0.2619228661060333,
0.16363570094108582,
0.11204694211483002,
-0.14267481863498688,
-0.05694415047764778,
-0.221267431974411,
-0.05010330304503441,
0.20337459444999695,
-0.047736093401908875,
0.1463373601436615,
0.057841069996356964,
0.2597862780094147,
0.35723912715911865,
-0.08268121629953384,
0.3187389373779297,
0.29799604415893555,
-0.07342056930065155,
0.4917100667953491,
0.013373717665672302,
-0.0566277876496315,
0.036606501787900925,
-0.0530659556388855,
0.23813724517822266,
0.05061515420675278,
0.13374291360378265,
0.28909772634506226,
-0.07548246532678604,
-0.08639448881149292,
-0.018799129873514175,
-0.20075473189353943,
0.20766815543174744,
0.5302243232727051,
-0.35412105917930603,
-0.2922913730144501,
0.48360055685043335,
0.16241081058979034,
0.10544250905513763,
-0.18626545369625092,
-0.34322160482406616,
0.22029902040958405,
-0.2782406508922577,
0.3286714553833008,
-0.07220788300037384,
0.2414286732673645,
0.2969273328781128,
0.11301291733980179,
-0.19186921417713165,
0.05734088271856308,
0.10232365131378174,
0.08150801807641983,
0.15102055668830872,
-0.054243054240942,
0.4312881529331207,
0.1910516321659088,
0.0634627491235733,
-0.3218555450439453,
0.18057775497436523,
0.18282058835029602,
0.1586853563785553,
0.12824048101902008,
0.31139934062957764,
-0.03780561685562134,
0.01956384815275669,
-0.07037599384784698,
-0.057989463210105896,
0.49789541959762573,
0.49341800808906555,
0.1672205924987793,
0.014236651360988617,
-0.7052101492881775,
-0.14655102789402008,
-0.09087714552879333,
-0.08575773239135742,
-0.12495435774326324,
-0.23458659648895264,
0.11472339183092117,
-0.15068146586418152,
-0.005285922437906265,
-0.2834579050540924,
0.25946980714797974,
0.37983301281929016,
0.3800892233848572,
0.20803704857826233,
-0.17033986747264862,
0.012062286958098412,
-0.1430407166481018,
0.7489029765129089,
-0.05276193469762802,
-0.01576034538447857,
-0.0820591002702713,
0.07259005308151245,
0.11052548885345459,
0.04635637253522873,
0.10915836691856384,
0.3011954128742218,
-0.36812448501586914,
-0.4029213488101959,
0.05676497891545296,
-0.05209704488515854,
0.19419808685779572,
0.39918529987335205,
0.3310653269290924,
0.4255278706550598,
0.24516282975673676,
0.0844089537858963,
-0.10322115570306778,
-0.1474967747926712,
-0.031968120485544205,
-0.15879549086093903,
-0.008749689906835556,
0.5214709043502808,
-0.04202869534492493,
0.012570656836032867,
-0.10081970691680908,
0.04720161110162735,
-0.4766635298728943,
-0.21763111650943756,
0.2758274972438812,
0.021579790860414505,
0.02181927114725113,
-0.055973395705223083,
0.04907510429620743,
0.2026652693748474,
0.3525847792625427,
-0.09153531491756439,
0.12975940108299255,
0.006641624961048365,
-0.1273316740989685,
-0.0374545194208622,
0.18043994903564453,
0.19822150468826294,
0.12763246893882751,
0.283142626285553,
-0.11715499311685562,
0.21478360891342163,
0.1303997039794922,
0.06161242350935936,
-0.20798122882843018,
-0.14137987792491913,
0.18115490674972534,
-0.524208128452301,
0.06375721842050552,
-0.0009050145745277405,
-0.033473387360572815,
0.01169506460428238,
-0.3293450176715851,
0.23618927597999573,
-0.23385433852672577,
0.008632685989141464,
-0.10442687571048737,
-0.2213204801082611,
0.37616685032844543,
0.6564996242523193,
0.6274042129516602,
0.06479835510253906,
-0.05670583248138428,
0.16388249397277832,
-0.2819175720214844,
0.26384785771369934,
0.020875800400972366,
-0.07008307427167892,
0.1643584966659546,
-0.14480066299438477,
0.06585926562547684,
-0.2198241502046585,
0.1292387992143631,
-0.15254813432693481,
0.4884144961833954,
-0.3269554376602173,
0.2996586263179779,
-0.21721111238002777,
0.25218096375465393,
0.13239488005638123,
-0.26047950983047485,
-0.27006152272224426,
0.1208333671092987,
0.024087805300951004,
0.3564004600048065,
-0.3393970727920532,
-0.1426519751548767,
0.6673740148544312,
-0.21597109735012054,
-0.3277983069419861,
0.1877175271511078,
0.3883751630783081,
0.45123401284217834,
-0.1549728959798813,
-0.5113276839256287,
-0.2696390450000763,
0.11522529274225235,
0.022713007405400276,
-0.2555255591869354,
0.22721295058727264,
-0.2905024588108063,
-0.3311936557292938,
-0.1656152307987213,
0.4775794446468353,
-0.14561140537261963,
0.11518752574920654,
-0.18300487101078033,
0.07631092518568039
] |
https://github.com/huggingface/datasets/issues/5513 | Some functions use a param named `type` shouldn't that be avoided since it's a Python reserved name? | I don't think deprecating a param name in this particular instance is worth the hassle, so I'm closing the issue 🙂. | Hi @mariosasko, @lhoestq, or whoever reads this! :)
After going through `ArrowDataset.set_format` I found out that the `type` param is actually named `type` which is a Python reserved name as you may already know, shouldn't that be renamed to `format_type` before the 3.0.0 is released?
Just wanted to get your input, and if applicable, tackle this issue myself! Thanks 🤗 | 21 | Some functions use a param named `type` shouldn't that be avoided since it's a Python reserved name?
Hi @mariosasko, @lhoestq, or whoever reads this! :)
After going through `ArrowDataset.set_format` I found out that the `type` param is actually named `type` which is a Python reserved name as you may already know, shouldn't that be renamed to `format_type` before the 3.0.0 is released?
Just wanted to get your input, and if applicable, tackle this issue myself! Thanks 🤗
I don't think deprecating a param name in this particular instance is worth the hassle, so I'm closing the issue 🙂. | [
0.42970770597457886,
-0.49249494075775146,
-0.03554302453994751,
-0.20596645772457123,
0.2383749783039093,
-0.31972241401672363,
0.3596762418746948,
0.2973921597003937,
-0.5891165137290955,
-0.09301255643367767,
0.1290222853422165,
0.45158031582832336,
-0.3416737914085388,
-0.07738611847162247,
-0.3109307289123535,
-0.3482349216938019,
0.29859501123428345,
-0.06342272460460663,
0.3181183338165283,
0.2155575007200241,
-0.3441128730773926,
0.13064375519752502,
-0.23528628051280975,
0.2338036298751831,
-0.05339372903108597,
0.08167868107557297,
0.4302455186843872,
-0.38044974207878113,
-0.23854215443134308,
-0.45732957124710083,
0.1097504049539566,
-0.14313863217830658,
-0.09845611453056335,
0.570611298084259,
-0.00012042936577927321,
-0.23023605346679688,
0.45477956533432007,
-0.1800929754972458,
-0.012683895416557789,
0.033481791615486145,
-0.11590540409088135,
-0.061430923640728,
0.524878740310669,
-0.24838608503341675,
-0.026853065937757492,
-0.29680195450782776,
-0.4953436255455017,
-0.5025763511657715,
0.1013699322938919,
0.1995522528886795,
0.20292580127716064,
0.19975842535495758,
-0.08862128108739853,
0.17765042185783386,
0.22462448477745056,
0.4346877932548523,
-0.3568190038204193,
0.06461864709854126,
0.22330042719841003,
0.36046114563941956,
0.4603303074836731,
0.4559183418750763,
-0.20677399635314941,
-0.09390677511692047,
0.3045980632305145,
-0.1586960405111313,
0.1281071901321411,
-0.09070119261741638,
0.0002229064702987671,
-0.06292229890823364,
0.25632965564727783,
-0.21508106589317322,
-0.218002051115036,
0.031237982213497162,
-0.15934240818023682,
-0.45984628796577454,
0.1311143934726715,
-0.18406632542610168,
-0.017787372693419456,
-0.037084635347127914,
0.12315347790718079,
-0.27170267701148987,
-0.0943654328584671,
0.030751019716262817,
0.23159348964691162,
0.41462889313697815,
-0.27422675490379333,
0.2648763954639435,
-0.162618488073349,
-0.2955247759819031,
-0.03900740295648575,
0.11283700168132782,
-0.17299261689186096,
0.1563604772090912,
0.305418461561203,
-0.046829819679260254,
-0.4480218291282654,
-0.04533211886882782,
-0.17780056595802307,
0.1747519075870514,
-0.12051635980606079,
0.10366795212030411,
0.3402668237686157,
-0.03538912534713745,
0.18891549110412598,
0.08007967472076416,
0.36727404594421387,
0.20336563885211945,
0.24484452605247498,
-0.10203660279512405,
0.26094168424606323,
-0.09197723120450974,
0.14837458729743958,
-0.1064877137541771,
0.39223602414131165,
0.1911093294620514,
0.3436651825904846,
-0.22418330609798431,
0.22794723510742188,
-0.08392578363418579,
0.13679131865501404,
-0.122268907725811,
-0.0699358880519867,
0.01379995048046112,
0.3581598997116089,
0.5381054282188416,
0.14734302461147308,
0.14483624696731567,
-0.08934129029512405,
-0.08484945446252823,
0.15149465203285217,
-0.31903576850891113,
-0.16186247766017914,
-0.08560590445995331,
-0.08934369683265686,
0.07085948437452316,
-0.12227129936218262,
-0.0931142121553421,
-0.18757741153240204,
-0.04207783192396164,
-0.047380998730659485,
0.13113635778427124,
0.38732627034187317,
0.3421235680580139,
-0.5885934829711914,
0.3009619414806366,
0.06523488461971283,
-0.08726939558982849,
-0.20804083347320557,
0.31024742126464844,
-0.45950525999069214,
-0.3216259479522705,
-0.6126813888549805,
0.12313274294137955,
0.18854403495788574,
0.2957881987094879,
-0.3321666121482849,
-0.035278964787721634,
0.4169381558895111,
-0.19885249435901642,
0.4018924832344055,
-0.2578948736190796,
0.24821999669075012,
-0.31542375683784485,
-0.24884779751300812,
-0.11259259283542633,
-0.25303393602371216,
-0.0846213549375534,
-0.45930394530296326,
-0.015019744634628296,
0.5760165452957153,
0.1031411737203598,
-0.08782369643449783,
-0.5844364762306213,
0.05354790389537811,
-0.1357065737247467,
0.5129006505012512,
-0.17482580244541168,
0.32524374127388,
-0.020724356174468994,
0.10292303562164307,
-0.09902583807706833,
0.200138658285141,
-0.44803449511528015,
-0.3452342748641968,
-0.3881128132343292,
0.11570955812931061,
-0.3147139549255371,
0.12496569752693176,
-0.10463769733905792,
-0.29077377915382385,
0.014663761481642723,
0.048980627208948135,
-0.30045318603515625,
-0.20968396961688995,
0.02442842721939087,
-0.18836051225662231,
-0.20516766607761383,
0.17255058884620667,
-0.022268075495958328,
0.19749711453914642,
-0.1543828845024109,
0.6802477836608887,
-0.028700970113277435,
0.3230430781841278,
-0.16209125518798828,
-0.2007494866847992,
-0.24445784091949463,
0.14713776111602783,
-0.33540716767311096,
-0.38130056858062744,
-0.2504645586013794,
-0.03609911724925041,
0.003439664840698242,
0.1937466263771057,
0.02559933066368103,
0.016945648938417435,
-0.032295189797878265,
-0.14312174916267395,
0.14481884241104126,
-0.3830093741416931,
-0.507224977016449,
0.11098863184452057,
0.004890844225883484,
0.20600715279579163,
-0.5800527930259705,
0.0776781216263771,
-0.23623767495155334,
-0.3157179355621338,
-0.0046627819538116455,
0.14416049420833588,
0.09082488715648651,
-0.23401370644569397,
0.11954079568386078,
0.5148308277130127,
-0.08576375246047974,
-0.45819512009620667,
0.18826571106910706,
-0.03201901167631149,
-0.04937019944190979,
-0.09534061700105667,
0.1416066586971283,
0.14687605202198029,
0.20538893342018127,
0.27412813901901245,
0.4140118360519409,
0.19277192652225494,
0.2159450799226761,
-0.28307753801345825,
0.1114271804690361,
0.04100800305604935,
0.23769855499267578,
-0.14290563762187958,
-0.37712839245796204,
-0.17480455338954926,
0.20491014420986176,
0.009011711925268173,
0.03304445743560791,
0.015497714281082153,
-0.056239061057567596,
0.26164618134498596,
-0.03938335180282593,
0.28579360246658325,
0.04745220020413399,
0.02294287458062172,
0.23418915271759033,
0.21081818640232086,
0.07123346626758575,
0.17955046892166138,
0.026087015867233276,
-0.2487410604953766,
-0.22092431783676147,
0.3009395897388458,
-0.04877665638923645,
0.4622943699359894,
0.2824274003505707,
0.4635736644268036,
-0.10739121586084366,
0.06122090667486191,
-0.055780816823244095,
0.14067110419273376,
0.08251743018627167,
-0.048299677670001984,
-0.20549729466438293,
-0.397667795419693,
0.24325914680957794,
-0.3073894679546356,
0.2003617286682129,
-0.22801969945430756,
-0.09541025012731552,
-0.22788658738136292,
-0.02505960687994957,
-0.21816016733646393,
0.0647520199418068,
-0.3219565451145172,
0.19162091612815857,
-0.3503928780555725,
0.4943556785583496,
-0.06937400996685028,
-0.16967561841011047,
-0.304690420627594,
0.013868968933820724,
-0.19156214594841003,
-0.07564032077789307,
0.04861538112163544,
-0.5231363773345947,
0.35018038749694824,
0.17179904878139496,
0.09704399853944778,
0.013319858349859715,
-0.5327385067939758,
0.08668988943099976,
-0.2885096073150635,
-0.05463962256908417,
0.07669277489185333,
-0.3177209496498108,
-0.09838607907295227,
-0.21801792085170746,
0.02569020725786686,
-0.38246360421180725,
-0.019038887694478035,
-0.16590461134910583,
-0.043857403099536896,
0.23758934438228607,
-0.265824556350708,
0.10959294438362122,
-0.22629009187221527,
-0.16175852715969086,
0.2554317116737366,
-0.17302462458610535,
0.13382123410701752,
0.09255631268024445,
-0.3450483977794647,
0.115058533847332,
-0.041344888508319855,
0.22533974051475525,
-0.12005720287561417,
0.14783906936645508,
0.255839467048645,
-0.1174909844994545,
0.019762244075536728,
-0.030422424897551537,
0.021729271858930588,
0.06915852427482605,
0.14177031815052032,
0.10393545031547546,
-0.3032192289829254,
0.16975337266921997,
-0.150272399187088,
0.07530835270881653,
-0.2446276694536209,
0.03619487211108208,
0.33978983759880066,
-0.1014176458120346,
-0.15347902476787567,
-0.1290135234594345,
0.00837048888206482,
0.0009008981287479401,
0.159542977809906,
0.4794141948223114,
-0.05239935964345932,
-0.11671270430088043,
0.603558361530304,
-0.11020021140575409,
0.09119623899459839,
0.23672904074192047,
0.24757008254528046,
0.05971112102270126,
-0.005042217671871185,
-0.045470330864191055,
-0.38087737560272217,
-0.022824108600616455,
0.14472860097885132,
-0.07544183731079102,
-0.028877846896648407,
-0.7083380818367004,
-0.026042332872748375,
0.10923901200294495,
-0.149209126830101,
-0.2449468970298767,
0.0316721647977829,
-0.05073288083076477,
0.2866760194301605,
-0.03637588396668434,
0.24568015336990356,
-0.11329907178878784,
-0.1523829996585846,
0.08429841697216034,
0.14592589437961578,
-0.232628732919693,
-0.15874475240707397,
-0.03768644481897354,
-0.24867935478687286,
-0.19168278574943542,
0.46333998441696167,
0.24738946557044983,
0.6566361784934998,
0.18395017087459564,
-0.3832828104496002,
0.1465940773487091,
0.10388053208589554,
0.11255184561014175,
-0.1702495515346527,
-0.31065821647644043,
0.3561995029449463,
-0.12470004707574844,
-0.38994482159614563,
-0.09244737029075623,
-0.08844362944364548,
0.19747494161128998,
-0.20804929733276367,
0.07641260325908661,
-0.14334441721439362,
-0.421646386384964,
-0.08099406212568283,
-0.28376317024230957,
0.013093803077936172,
0.07645159959793091,
-0.36460554599761963,
0.02260248363018036,
0.117094486951828,
-0.09271188825368881,
0.22846604883670807,
0.048336211591959,
-0.11756454408168793,
0.23964039981365204,
-0.2010532021522522,
-0.026331020519137383,
0.07735072821378708,
-0.1942347288131714,
0.5013853907585144,
0.05944312736392021,
-0.3381679654121399,
0.04663099721074104,
0.3188741207122803,
0.10042358189821243,
0.0831167995929718,
0.12147639691829681,
-0.20938998460769653,
0.18935254216194153,
0.04224471002817154,
0.42035287618637085,
0.3852314352989197,
0.014738244004547596,
0.4088037312030792,
-0.16449791193008423,
0.1823248267173767,
0.10423731803894043,
-0.09555646777153015,
0.3726550042629242,
-0.13650986552238464,
-0.2995133697986603,
-0.09613070636987686,
0.1355368196964264,
0.3735315501689911,
-0.03119499608874321,
0.40429529547691345,
0.5422404408454895,
-0.312085896730423,
0.33625948429107666,
0.5064260959625244,
1.0766607522964478,
0.15883846580982208,
0.19530567526817322,
-0.16628959774971008,
-0.1787802278995514,
0.27479201555252075,
0.42421412467956543,
0.05152420699596405,
-0.32347142696380615,
0.3134329617023468,
0.058447323739528656,
-0.0884954184293747,
0.3128431439399719,
-0.5173831582069397,
-0.19042706489562988,
-0.028022401034832,
-0.47446101903915405,
0.19942142069339752,
-0.01831425540149212,
-0.08535975217819214,
-0.08005061000585556,
-0.24130529165267944,
-0.27350497245788574,
0.009451813995838165,
-0.21497537195682526,
-0.20390920341014862,
0.02525017037987709,
-0.058653876185417175,
-0.0021969713270664215,
-0.22993475198745728,
-0.1481313407421112,
-0.2386176884174347,
0.0826544538140297,
0.08826393634080887,
0.08237655460834503,
-0.20776012539863586,
0.19251473248004913,
-0.004364326596260071,
0.044073618948459625,
-0.0975320041179657,
-0.1303582638502121,
0.1135450154542923,
0.5183418989181519,
0.24321284890174866,
-0.07568076997995377,
-0.00579433050006628,
0.25678619742393494,
-0.1477275788784027,
0.2665148675441742,
0.1934097707271576,
0.09848449379205704,
-0.258949875831604,
-0.3397589921951294,
0.1404186189174652,
0.19650885462760925,
-0.17817333340644836,
0.08711746335029602,
-0.18563398718833923,
0.10664661228656769,
0.0461234487593174,
0.09967055916786194,
-0.01643943041563034,
-0.23408839106559753,
0.3260127902030945,
0.1813402771949768,
-0.352146178483963,
-0.003763720393180847,
0.12177309393882751,
0.4073698818683624,
0.20244191586971283,
0.41697901487350464,
-0.09274893254041672,
-0.2598363161087036,
-0.14095762372016907,
0.21152815222740173,
0.1677311658859253,
-0.5237751007080078,
0.3148174583911896,
0.003451582742854953,
-0.3844974637031555,
0.09493532031774521,
0.30400848388671875,
-0.07120108604431152,
0.16040371358394623,
-0.38796284794807434,
0.21388953924179077,
-0.18745167553424835,
0.15238821506500244,
-0.06290574371814728,
-0.0024494528770446777,
-0.11981025338172913,
-0.2726810872554779,
-0.11405634880065918,
-0.22479672729969025,
-0.23531703650951385,
-0.025387616828083992,
0.34423574805259705,
0.28216612339019775,
-0.648114800453186,
0.007371746003627777,
0.19629134237766266,
0.0963606983423233,
0.0997685119509697,
0.31643497943878174,
-0.09967675805091858,
-0.13008162379264832,
-0.30282118916511536,
0.17338286340236664,
0.13774386048316956,
-0.18192768096923828,
-0.06592927873134613,
-0.18192963302135468,
-0.06536784768104553,
0.24741606414318085,
-0.10967978835105896,
0.15467646718025208,
0.10295256972312927,
0.17329877614974976,
0.29924485087394714,
-0.13911756873130798,
0.38061171770095825,
0.1352478265762329,
-0.08509950339794159,
0.42307889461517334,
0.0783257707953453,
-0.07209588587284088,
0.08022699505090714,
-0.019622504711151123,
0.305769145488739,
0.0280817411839962,
0.12212855368852615,
0.31275084614753723,
-0.08629331737756729,
-0.15113961696624756,
-0.028769858181476593,
-0.32459068298339844,
0.1381981372833252,
0.5214415788650513,
-0.2730410099029541,
-0.27337849140167236,
0.42924126982688904,
0.06461114436388016,
0.0768112987279892,
-0.18378913402557373,
-0.1471838653087616,
0.29840123653411865,
-0.2768622040748596,
0.31255343556404114,
-0.13183347880840302,
0.3037436604499817,
0.3008050322532654,
0.11247364431619644,
-0.13361012935638428,
-0.046164482831954956,
0.15166708827018738,
0.1270129680633545,
0.22199507057666779,
-0.004498433321714401,
0.4894646406173706,
0.2495764195919037,
0.09594123810529709,
-0.32395273447036743,
0.24891123175621033,
0.1872197687625885,
0.24644330143928528,
0.07611632347106934,
0.34663498401641846,
0.02315463125705719,
-0.03443660959601402,
-0.05726531147956848,
0.026015229523181915,
0.5993472933769226,
0.5345604419708252,
0.15345366299152374,
0.0589633584022522,
-0.6883808970451355,
-0.09242645651102066,
-0.0845089852809906,
-0.06594368815422058,
-0.17777687311172485,
-0.2293468415737152,
0.1489032506942749,
-0.15252792835235596,
-0.009800594300031662,
-0.21490228176116943,
0.2782749533653259,
0.44228336215019226,
0.2750363349914551,
0.23097576200962067,
-0.1902952790260315,
-0.02845713496208191,
-0.1449500322341919,
0.727122962474823,
-0.030715858563780785,
-0.006017452105879784,
0.018202029168605804,
0.0186053104698658,
0.14236654341220856,
-0.03674603998661041,
0.07463248819112778,
0.3245846927165985,
-0.366299569606781,
-0.42919600009918213,
0.01885935105383396,
-0.02501462586224079,
0.22811993956565857,
0.3770216703414917,
0.3728601932525635,
0.3618183732032776,
0.21000459790229797,
0.052894413471221924,
-0.03449929133057594,
-0.14361459016799927,
0.03389619290828705,
-0.13913562893867493,
0.05403856933116913,
0.5004515647888184,
-0.12569831311702728,
0.10412811487913132,
-0.173539400100708,
0.027814500033855438,
-0.4223807752132416,
-0.24346955120563507,
0.27470409870147705,
0.10138514637947083,
0.018420930951833725,
-0.0593753419816494,
0.020228713750839233,
0.26109832525253296,
0.3330841660499573,
-0.17039558291435242,
0.18806177377700806,
0.06896325200796127,
-0.16312000155448914,
-0.013041093945503235,
0.21739614009857178,
0.09963454306125641,
0.04918642342090607,
0.32661545276641846,
-0.13221794366836548,
0.2642974853515625,
0.07955487072467804,
0.08037367463111877,
-0.21520693600177765,
-0.13288381695747375,
0.14948973059654236,
-0.4263216555118561,
0.030505171045660973,
-0.0023977309465408325,
-0.004434281960129738,
0.04424722492694855,
-0.2761344909667969,
0.1698625087738037,
-0.2542118430137634,
-0.02834472805261612,
-0.13579589128494263,
-0.31053632497787476,
0.3481792211532593,
0.5906084775924683,
0.5515189170837402,
0.030795171856880188,
-0.03702844679355621,
0.11478810757398605,
-0.2738128900527954,
0.17705775797367096,
0.1828327625989914,
-0.13296611607074738,
0.19670811295509338,
-0.19181908667087555,
0.015537980943918228,
-0.18285325169563293,
0.12231288850307465,
-0.10362023115158081,
0.5012380480766296,
-0.3270602822303772,
0.3203830420970917,
-0.2142350822687149,
0.33545804023742676,
0.14531296491622925,
-0.2414424866437912,
-0.330133318901062,
0.03638312965631485,
0.04212787374854088,
0.4182613492012024,
-0.33884698152542114,
-0.14551864564418793,
0.7752823233604431,
-0.24594581127166748,
-0.3639642298221588,
0.24571166932582855,
0.37899652123451233,
0.4525190591812134,
-0.17124487459659576,
-0.42957425117492676,
-0.2764989733695984,
0.11250700056552887,
0.07581815868616104,
-0.27391475439071655,
0.12354764342308044,
-0.30809104442596436,
-0.27938777208328247,
-0.15910877287387848,
0.46725186705589294,
-0.13067105412483215,
0.11418609321117401,
-0.18536561727523804,
0.09292641282081604
] |
https://github.com/huggingface/datasets/issues/5511 | Creating a dummy dataset from a bigger one | Update `datasets` or downgrade `huggingface-hub` ;)
The `huggingface-hub` lib did a breaking change a few months ago, and you're using an old version of `datasets` that does't support it | ### Describe the bug
I often want to create a dummy dataset from a bigger dataset for fast iteration when training. However, I'm having a hard time doing this especially when trying to upload the dataset to the Hub.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("lambdalabs/pokemon-blip-captions")
dataset["train"] = dataset["train"].select(range(20))
dataset.push_to_hub("patrickvonplaten/dummy_image_data")
```
gives:
```
~/python_bin/datasets/arrow_dataset.py in _push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, embed_external_files)
4003 base_wait_time=2.0,
4004 max_retries=5,
-> 4005 max_wait_time=20.0,
4006 )
4007 return repo_id, split, uploaded_size, dataset_nbytes
~/python_bin/datasets/utils/file_utils.py in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time)
328 while True:
329 try:
--> 330 return func(*func_args, **func_kwargs)
331 except exceptions as err:
332 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes):
~/hf/lib/python3.7/site-packages/huggingface_hub/utils/_validators.py in _inner_fn(*args, **kwargs)
122 )
123
--> 124 return fn(*args, **kwargs)
125
126 return _inner_fn # type: ignore
TypeError: upload_file() got an unexpected keyword argument 'identical_ok'
In [2]:
```
### Expected behavior
I would have expected this to work. It's for me the most intuitive way of creating a dummy dataset.
### Environment info
```
- `datasets` version: 2.1.1.dev0
- Platform: Linux-4.19.0-22-cloud-amd64-x86_64-with-debian-10.13
- Python version: 3.7.3
- PyArrow version: 11.0.0
- Pandas version: 1.3.5
``` | 29 | Creating a dummy dataset from a bigger one
### Describe the bug
I often want to create a dummy dataset from a bigger dataset for fast iteration when training. However, I'm having a hard time doing this especially when trying to upload the dataset to the Hub.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("lambdalabs/pokemon-blip-captions")
dataset["train"] = dataset["train"].select(range(20))
dataset.push_to_hub("patrickvonplaten/dummy_image_data")
```
gives:
```
~/python_bin/datasets/arrow_dataset.py in _push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, embed_external_files)
4003 base_wait_time=2.0,
4004 max_retries=5,
-> 4005 max_wait_time=20.0,
4006 )
4007 return repo_id, split, uploaded_size, dataset_nbytes
~/python_bin/datasets/utils/file_utils.py in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time)
328 while True:
329 try:
--> 330 return func(*func_args, **func_kwargs)
331 except exceptions as err:
332 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes):
~/hf/lib/python3.7/site-packages/huggingface_hub/utils/_validators.py in _inner_fn(*args, **kwargs)
122 )
123
--> 124 return fn(*args, **kwargs)
125
126 return _inner_fn # type: ignore
TypeError: upload_file() got an unexpected keyword argument 'identical_ok'
In [2]:
```
### Expected behavior
I would have expected this to work. It's for me the most intuitive way of creating a dummy dataset.
### Environment info
```
- `datasets` version: 2.1.1.dev0
- Platform: Linux-4.19.0-22-cloud-amd64-x86_64-with-debian-10.13
- Python version: 3.7.3
- PyArrow version: 11.0.0
- Pandas version: 1.3.5
```
Update `datasets` or downgrade `huggingface-hub` ;)
The `huggingface-hub` lib did a breaking change a few months ago, and you're using an old version of `datasets` that does't support it | [
-0.10330459475517273,
-0.46017131209373474,
0.0648631751537323,
0.33494043350219727,
0.16239123046398163,
0.10790085047483444,
0.18772070109844208,
0.3316099941730499,
-0.1263197511434555,
0.2755588889122009,
0.06896834075450897,
0.13240064680576324,
-0.05003596842288971,
0.3932800889015198,
0.05632428452372551,
0.0004122629761695862,
0.22544978559017181,
-0.13627353310585022,
0.18161308765411377,
-0.11232036352157593,
-0.2257099151611328,
-0.12990550696849823,
-0.06454581767320633,
-0.13383875787258148,
-0.4212191700935364,
0.07566338777542114,
-0.1844501942396164,
0.43546783924102783,
-0.2619764506816864,
-0.17472320795059204,
0.16474522650241852,
-0.16532637178897858,
0.039093442261219025,
0.5192741751670837,
-0.0001165697249234654,
0.06880727410316467,
0.441261351108551,
-0.1739272177219391,
-0.36505135893821716,
0.012388058006763458,
-0.09257008135318756,
-0.2792017161846161,
-0.1478317826986313,
-0.2320796251296997,
0.07855288684368134,
0.06679729372262955,
-0.023783305659890175,
0.11251954734325409,
0.2025318741798401,
0.28824320435523987,
0.16569869220256805,
0.30787163972854614,
0.026724141091108322,
-0.3487095236778259,
0.06665050238370895,
0.20820054411888123,
-0.29174304008483887,
0.20179405808448792,
0.036070242524147034,
0.0545223206281662,
0.18234670162200928,
-0.038541264832019806,
0.024690845981240273,
0.018330901861190796,
0.23191750049591064,
0.1151256114244461,
-0.10734682530164719,
-0.19114677608013153,
0.10490575432777405,
0.1381157487630844,
-0.14277467131614685,
-0.3279273509979248,
-0.40451934933662415,
-0.46128731966018677,
-0.03056761622428894,
-0.2639901041984558,
0.133268803358078,
0.26867011189460754,
-0.07076916843652725,
0.10612252354621887,
0.025134557858109474,
-0.1393592804670334,
-0.059774186462163925,
0.09380819648504257,
0.0798034816980362,
-0.06914645433425903,
0.23767277598381042,
0.20188817381858826,
0.06695234030485153,
-0.054810814559459686,
0.0778227299451828,
-0.44674086570739746,
0.12458428740501404,
0.017979182302951813,
-0.26508015394210815,
-0.03549528121948242,
-0.07085918635129929,
0.17202666401863098,
0.2265581488609314,
0.12843528389930725,
-0.07060939818620682,
-0.10977590829133987,
-0.0974639281630516,
0.11475005745887756,
0.03389730677008629,
0.18157194554805756,
-0.1663891077041626,
0.45993557572364807,
-0.22014079988002777,
0.1807592660188675,
-0.06652414798736572,
-0.007481284439563751,
-0.05740322172641754,
-0.04242365062236786,
0.2084270864725113,
0.016519727185368538,
0.296375036239624,
-0.14591631293296814,
-0.3962271213531494,
0.1778719574213028,
-0.15518374741077423,
0.29106050729751587,
0.007433485705405474,
0.11090567708015442,
-0.24253137409687042,
-0.09355025738477707,
-0.07045795023441315,
0.35435205698013306,
-0.37851184606552124,
-0.2794768512248993,
-0.22110487520694733,
0.17090006172657013,
-0.20352904498577118,
0.16217319667339325,
0.007206514477729797,
-0.2480296790599823,
0.20025447010993958,
0.3085891306400299,
0.2828410565853119,
0.04464138299226761,
0.2690403163433075,
-0.15243999660015106,
-0.07200882583856583,
-0.01733236387372017,
0.22244253754615784,
0.11109281331300735,
0.1128673106431961,
-0.2928071618080139,
0.03611169755458832,
0.13408342003822327,
-0.30848485231399536,
-0.3365336060523987,
-0.3815392255783081,
0.16548526287078857,
-0.18437491357326508,
0.0319952555000782,
-0.5346553921699524,
0.15643969178199768,
-0.07316651195287704,
-0.18682648241519928,
-0.055109016597270966,
0.08323048055171967,
-0.22122927010059357,
-0.16675907373428345,
0.10854237526655197,
0.4562235474586487,
-0.3839060962200165,
0.17304304242134094,
0.008052263408899307,
0.31057119369506836,
0.04430431127548218,
0.12967821955680847,
-0.18193286657333374,
0.2522319257259369,
-0.3582543432712555,
0.33664512634277344,
0.06679195165634155,
-0.3485996127128601,
-0.378490149974823,
-0.16464470326900482,
-0.37816154956817627,
0.2515736222267151,
-0.018698930740356445,
0.21317028999328613,
0.042311012744903564,
-0.03741835057735443,
0.03745897114276886,
0.17740166187286377,
-0.07236666232347488,
-0.13623975217342377,
-0.3248036503791809,
-0.21015897393226624,
-0.04365331679582596,
0.047301288694143295,
0.0419740304350853,
0.16644582152366638,
-0.057824067771434784,
0.23405548930168152,
0.16544687747955322,
-0.1735888570547104,
0.03197837620973587,
0.27136537432670593,
0.19965319335460663,
-0.09355922043323517,
-0.01730314828455448,
-0.016785036772489548,
-0.4574649930000305,
0.3454832434654236,
-0.06732116639614105,
0.21662534773349762,
0.09412279725074768,
-0.2778322696685791,
-0.5873969197273254,
-0.11309950798749924,
-0.11306998133659363,
-0.06107385829091072,
0.08252900838851929,
-0.04073803871870041,
0.04259276017546654,
-0.14927950501441956,
-0.042416349053382874,
0.5441147089004517,
-0.4466340243816376,
0.2219727784395218,
-0.5805667042732239,
0.5349259972572327,
-0.04756882041692734,
-0.21364116668701172,
-0.02011604979634285,
0.031216587871313095,
0.2521478533744812,
-0.08761914074420929,
-0.13385942578315735,
0.2495311200618744,
0.20151984691619873,
0.3735331892967224,
0.07666713744401932,
-0.018424198031425476,
0.20112904906272888,
0.047672245651483536,
0.03596818819642067,
0.049721911549568176,
0.19208578765392303,
-0.014018811285495758,
-0.26803475618362427,
0.5150776505470276,
0.017438609153032303,
-0.03978096693754196,
-0.04732367768883705,
-0.12444225698709488,
0.014435375109314919,
-0.12563355267047882,
0.059364937245845795,
0.051999323070049286,
0.40997833013534546,
0.38689181208610535,
0.10101242363452911,
-0.05205950140953064,
0.0008500292897224426,
0.09608083963394165,
0.22135473787784576,
-0.058720871806144714,
-0.021610498428344727,
0.00782833993434906,
-0.033572882413864136,
-0.03567781299352646,
0.14324326813220978,
0.16991284489631653,
0.4975958466529846,
0.10069023072719574,
-0.12402147054672241,
0.24698390066623688,
-0.48241591453552246,
-0.11485165357589722,
0.2171708643436432,
-0.036406539380550385,
-0.16947320103645325,
0.1309049427509308,
0.22607575356960297,
-0.14838925004005432,
-0.28797000646591187,
0.11944027245044708,
0.17497363686561584,
0.32429182529449463,
-0.2845541834831238,
-0.009938565082848072,
-0.1689063310623169,
0.09441287070512772,
-0.18690888583660126,
0.08385676145553589,
-0.41440704464912415,
-0.39516013860702515,
0.07709086686372757,
0.41848224401474,
-0.022885113954544067,
0.10346628725528717,
0.11703073978424072,
0.20022714138031006,
-0.0014114100486040115,
-0.24405501782894135,
0.11294247210025787,
-0.042719513177871704,
-0.3055543899536133,
-0.0293157696723938,
0.2819431722164154,
0.09352246671915054,
0.3512909710407257,
-0.18551424145698547,
-0.01780407689511776,
-0.42333129048347473,
-0.31371256709098816,
0.10109511017799377,
-0.07664632052183151,
0.3859803378582001,
-0.032752975821495056,
0.04106151685118675,
-0.10217946767807007,
-0.06712693721055984,
0.1332181990146637,
-0.10524558275938034,
-0.23133297264575958,
0.14182014763355255,
-0.04075919836759567,
0.14430245757102966,
0.07178717851638794,
-0.30139756202697754,
-0.07017464190721512,
-0.1632128208875656,
-0.044494323432445526,
0.15594890713691711,
-0.008137911558151245,
0.23946361243724823,
0.27950331568717957,
0.13370859622955322,
0.29116421937942505,
-0.2048930674791336,
-0.4299851059913635,
-0.3294999301433563,
0.277249813079834,
-0.16678476333618164,
-0.1932619959115982,
-0.04593309760093689,
-0.31906265020370483,
0.2779427766799927,
-0.05996809899806976,
-0.47912484407424927,
-0.7952807545661926,
-0.02821269817650318,
0.18075212836265564,
-0.1107722669839859,
-0.06103166192770004,
0.28098931908607483,
-0.3071202337741852,
0.09159687906503677,
-0.2213391661643982,
-0.32460954785346985,
0.19207987189292908,
0.35838961601257324,
0.21731853485107422,
-0.23875179886817932,
0.24067288637161255,
-0.01707923598587513,
0.7010495066642761,
0.36007753014564514,
-0.0447884239256382,
0.40930232405662537,
-0.31252819299697876,
0.31950315833091736,
-0.3652919828891754,
-0.4200916886329651,
0.003297290997579694,
-0.023717164993286133,
-0.3168746829032898,
0.17139720916748047,
-0.16265738010406494,
0.018015295267105103,
-0.04275653883814812,
-0.07765726000070572,
-0.20515787601470947,
-0.2892651855945587,
-0.028356516733765602,
0.05427321419119835,
-0.1631646752357483,
0.2114451676607132,
0.10160072892904282,
-0.5265203714370728,
-0.15775445103645325,
0.1352476328611374,
-0.18405945599079132,
0.03293031081557274,
-0.14098285138607025,
-0.236362487077713,
-0.02788573130965233,
-0.37206023931503296,
0.37024229764938354,
0.09834218770265579,
0.2078358680009842,
0.11287821829319,
0.06558515876531601,
0.05298309028148651,
-0.029261965304613113,
0.6791943907737732,
-0.49106669425964355,
-0.021043822169303894,
-0.12510831654071808,
-0.0011715181171894073,
-0.667842447757721,
-0.14943593740463257,
-0.051411356776952744,
0.26240524649620056,
0.06222521886229515,
0.617866575717926,
-0.38233429193496704,
0.20621687173843384,
0.22801846265792847,
0.37558040022850037,
-0.15528604388237,
0.10237830132246017,
-0.28754889965057373,
-0.2238571047782898,
-0.3640056550502777,
-0.013163670897483826,
0.1629982441663742,
0.4937790334224701,
0.058396682143211365,
0.09893849492073059,
-0.18854740262031555,
-0.013232540339231491,
0.2515547275543213,
0.00029633473604917526,
0.4284307062625885,
0.04865892976522446,
0.3386782109737396,
0.1007920503616333,
0.07455082982778549,
0.08431737869977951,
0.8709908127784729,
0.018786417320370674,
-0.2656373381614685,
0.07827785611152649,
0.16791334748268127,
0.1891886591911316,
0.6274846792221069,
0.2369082272052765,
0.10327138006687164,
-0.2912108302116394,
0.04516932740807533,
-0.5295808911323547,
0.2756533622741699,
0.3262420892715454,
-0.10514508932828903,
-0.16360962390899658,
-0.11840400844812393,
0.5116987824440002,
0.26002490520477295,
0.08355185389518738,
0.5877997875213623,
0.2723090648651123,
-0.11152143031358719,
0.36245566606521606,
-0.046417273581027985,
1.0716772079467773,
0.22851423919200897,
0.2661794424057007,
0.2605392336845398,
-0.03883083909749985,
0.27228784561157227,
-0.287544310092926,
0.05041220411658287,
-0.4410717785358429,
-0.2873925268650055,
-0.029241589829325676,
-0.15464475750923157,
-0.052286677062511444,
0.0367589071393013,
-0.12839025259017944,
0.26613444089889526,
-0.27657395601272583,
0.7638376951217651,
-0.10883365571498871,
0.3893655836582184,
-0.4037608504295349,
-0.11543501913547516,
-0.028946109116077423,
0.1346101611852646,
0.14529412984848022,
-0.08519381284713745,
0.020955152809619904,
0.010787034407258034,
-0.42629143595695496,
-0.13619381189346313,
-0.27652162313461304,
0.1394282579421997,
-0.07400061190128326,
0.04642806947231293,
-0.04987454041838646,
-0.2031412422657013,
-0.26555177569389343,
0.020873375236988068,
0.5032464861869812,
0.08550223708152771,
-0.2051074057817459,
0.09732618927955627,
-0.08920376747846603,
0.07124146074056625,
-0.0593002587556839,
-0.34220564365386963,
0.19353023171424866,
0.06838691979646683,
-0.20178350806236267,
0.17708754539489746,
0.1368214637041092,
-0.17381006479263306,
-0.35204923152923584,
-0.15816999971866608,
0.1636446863412857,
-0.4731276333332062,
-0.22321726381778717,
-0.09541170299053192,
0.008465901017189026,
-0.36796122789382935,
0.0930589884519577,
0.004955857992172241,
-0.17954017221927643,
0.004703156650066376,
0.26351824402809143,
-0.3216284215450287,
-0.13585712015628815,
0.3506373465061188,
0.09727521240711212,
-0.15137308835983276,
0.4910559058189392,
-0.23744402825832367,
0.12575337290763855,
-0.09182071685791016,
0.31352299451828003,
0.29239222407341003,
-0.44892579317092896,
0.3881531059741974,
-0.24406588077545166,
-0.13704988360404968,
-0.19136634469032288,
0.0756814256310463,
0.3003513216972351,
0.15168282389640808,
-0.022453753277659416,
-0.18512164056301117,
-0.25847065448760986,
0.10929813235998154,
0.12122587859630585,
0.4647480249404907,
-0.2158585488796234,
-0.02762744575738907,
-0.07625773549079895,
0.1291467696428299,
-0.2797854244709015,
0.24849964678287506,
-0.2634509801864624,
0.24998243153095245,
-0.18804562091827393,
-0.10364007204771042,
0.05171757563948631,
-0.18308855593204498,
0.024318749085068703,
0.38597339391708374,
-0.17661379277706146,
-0.15212908387184143,
-0.3420252799987793,
0.18911290168762207,
0.2082728147506714,
-0.05522789806127548,
-0.003959898836910725,
-0.12528742849826813,
-0.04696263000369072,
-0.14030389487743378,
0.1324736624956131,
0.3105548024177551,
-0.048313796520233154,
-0.11313272267580032,
0.6638806462287903,
-0.05538765341043472,
-0.042247261852025986,
-0.09834334254264832,
0.1455933153629303,
0.4045630097389221,
-0.11443671584129333,
0.0036106109619140625,
0.07599160820245743,
-0.02884724736213684,
-0.06109574809670448,
0.10098975896835327,
0.11283724009990692,
0.08372804522514343,
0.04105166718363762,
-0.20552410185337067,
-0.02943706512451172,
-0.014955762773752213,
0.3830651342868805,
0.3586099445819855,
-0.19389654695987701,
-0.06682633608579636,
0.26430168747901917,
0.16592249274253845,
-0.20318838953971863,
-0.2039618194103241,
0.6596791744232178,
-0.10642864555120468,
0.10594673454761505,
0.2680385708808899,
0.23527106642723083,
0.29979005455970764,
-0.36450570821762085,
-0.005701419897377491,
0.12726296484470367,
-0.12221628427505493,
0.16053631901741028,
0.43027395009994507,
-0.2547568380832672,
-0.05624387785792351,
0.26936057209968567,
-0.09034658968448639,
0.2190122902393341,
0.5081992745399475,
0.025210749357938766,
0.5981035232543945,
-0.019763879477977753,
-0.14183320105075836,
0.26698458194732666,
0.02267889678478241,
-0.013790406286716461,
0.1725541651248932,
-0.02545669674873352,
0.31452301144599915,
0.01525847613811493,
0.3095254898071289,
-0.2263566106557846,
-0.2054332047700882,
-0.4822148084640503,
0.09596379101276398,
-0.21151667833328247,
0.009819123893976212,
-0.23062242567539215,
-0.28784415125846863,
-0.4420059621334076,
0.050930317491292953,
0.032873041927814484,
-0.28734058141708374,
0.345217227935791,
0.018557824194431305,
-0.11399601399898529,
0.2542950510978699,
-0.0958269014954567,
0.26722049713134766,
0.14602163434028625,
-0.18596963584423065,
0.10164836049079895,
0.1413508951663971,
-0.15277297794818878,
0.11096233129501343,
0.5440170168876648,
0.4661610424518585,
0.126226544380188,
-0.359395831823349,
0.021305587142705917,
0.47549206018447876,
0.025426344946026802,
0.191287100315094,
0.27362722158432007,
-0.14926010370254517,
0.000006798654794692993,
0.23201708495616913,
0.08973033726215363,
-0.19467251002788544,
-0.22073756158351898,
0.11819471418857574,
-0.209294393658638,
-0.619142472743988,
0.560858964920044,
-0.09557986259460449,
0.10263087600469589,
-0.2751429080963135,
0.07900846004486084,
-0.26880723237991333,
-0.18440517783164978,
0.48154300451278687,
-0.06540770083665848,
0.18444085121154785,
-0.10254204273223877,
0.055532388389110565,
-0.46445581316947937,
0.5062611699104309,
0.36278632283210754,
-0.11959845572710037,
-0.4753372371196747,
0.019457370042800903,
-0.554632306098938,
0.3154844641685486,
-0.533523440361023,
-0.2040170580148697,
0.12171760946512222,
0.1539931297302246,
0.023390598595142365,
0.1925329566001892,
0.15816619992256165,
0.03533753380179405,
-0.15790964663028717,
0.3822330832481384,
-0.3767208456993103,
-0.3311306834220886,
0.18107235431671143,
-0.3397972881793976,
0.09853020310401917,
-0.5765031576156616,
0.13775642216205597,
0.18187862634658813,
-0.029116613790392876,
0.08665010333061218,
-0.2453765720129013,
0.23866954445838928,
-0.2003011703491211,
0.5097670555114746,
0.015030499547719955,
0.48714783787727356,
-0.0578334704041481,
-0.18108005821704865,
-0.13229839503765106,
-0.17513538897037506,
-0.3495666980743408,
0.22581899166107178,
-0.09773869812488556,
0.43708309531211853,
-0.09647287428379059,
-0.19035975635051727,
-0.02273985557258129,
0.07561862468719482,
0.16385383903980255,
-0.07063328474760056,
-0.3188830316066742,
0.08759121596813202,
-0.2439376711845398,
0.18854251503944397,
-0.011173530481755733,
0.398918479681015,
-0.12128736078739166,
0.5707380771636963,
0.021190181374549866,
-0.4141327142715454,
0.584417462348938,
-0.15778128802776337,
-0.2674233019351959,
-0.00339497160166502,
0.06329122930765152,
0.06873318552970886,
-0.10248467326164246,
-0.34720972180366516,
-0.006103821098804474,
0.24037902057170868,
-0.01671236753463745,
0.1449025273323059,
0.3878733515739441,
0.04843640327453613,
0.024484481662511826,
0.038071442395448685,
0.33208826184272766,
-0.01949864625930786,
-0.18649983406066895,
0.6073604822158813,
-0.21617893874645233
] |
https://github.com/huggingface/datasets/issues/5511 | Creating a dummy dataset from a bigger one | Getting same error with latest versions.
```shell
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[99], line 1
----> 1 dataset.push_to_hub("mirfan899/kids_phoneme_asr")
File /opt/conda/lib/python3.10/site-packages/datasets/arrow_dataset.py:3538, in Dataset.push_to_hub(self, repo_id, split, private, token, branch, shard_size, embed_external_files)
3493 def push_to_hub(
3494 self,
3495 repo_id: str,
(...)
3501 embed_external_files: bool = True,
3502 ):
3503 """Pushes the dataset to the hub.
3504 The dataset is pushed using HTTP requests and does not need to have neither git or git-lfs installed.
3505
(...)
3536 ```
3537 """
-> 3538 repo_id, split, uploaded_size, dataset_nbytes = self._push_parquet_shards_to_hub(
3539 repo_id=repo_id,
3540 split=split,
3541 private=private,
3542 token=token,
3543 branch=branch,
3544 shard_size=shard_size,
3545 embed_external_files=embed_external_files,
3546 )
3547 organization, dataset_name = repo_id.split("/")
3548 info_to_dump = self.info.copy()
File /opt/conda/lib/python3.10/site-packages/datasets/arrow_dataset.py:3474, in Dataset._push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, shard_size, embed_external_files)
3472 shard.to_parquet(buffer)
3473 uploaded_size += buffer.tell()
-> 3474 _retry(
3475 api.upload_file,
3476 func_kwargs=dict(
3477 path_or_fileobj=buffer.getvalue(),
3478 path_in_repo=path_in_repo(index),
3479 repo_id=repo_id,
3480 token=token,
3481 repo_type="dataset",
3482 revision=branch,
3483 identical_ok=True,
3484 ),
3485 exceptions=HTTPError,
3486 status_codes=[504],
3487 base_wait_time=2.0,
3488 max_retries=5,
3489 max_wait_time=20.0,
3490 )
3491 return repo_id, split, uploaded_size, dataset_nbytes
File /opt/conda/lib/python3.10/site-packages/datasets/utils/file_utils.py:330, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time)
328 while True:
329 try:
--> 330 return func(*func_args, **func_kwargs)
331 except exceptions as err:
332 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes):
File /opt/conda/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs)
117 if check_use_auth_token:
118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs)
--> 120 return fn(*args, **kwargs)
TypeError: HfApi.upload_file() got an unexpected keyword argument 'identical_ok'
``` | ### Describe the bug
I often want to create a dummy dataset from a bigger dataset for fast iteration when training. However, I'm having a hard time doing this especially when trying to upload the dataset to the Hub.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("lambdalabs/pokemon-blip-captions")
dataset["train"] = dataset["train"].select(range(20))
dataset.push_to_hub("patrickvonplaten/dummy_image_data")
```
gives:
```
~/python_bin/datasets/arrow_dataset.py in _push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, embed_external_files)
4003 base_wait_time=2.0,
4004 max_retries=5,
-> 4005 max_wait_time=20.0,
4006 )
4007 return repo_id, split, uploaded_size, dataset_nbytes
~/python_bin/datasets/utils/file_utils.py in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time)
328 while True:
329 try:
--> 330 return func(*func_args, **func_kwargs)
331 except exceptions as err:
332 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes):
~/hf/lib/python3.7/site-packages/huggingface_hub/utils/_validators.py in _inner_fn(*args, **kwargs)
122 )
123
--> 124 return fn(*args, **kwargs)
125
126 return _inner_fn # type: ignore
TypeError: upload_file() got an unexpected keyword argument 'identical_ok'
In [2]:
```
### Expected behavior
I would have expected this to work. It's for me the most intuitive way of creating a dummy dataset.
### Environment info
```
- `datasets` version: 2.1.1.dev0
- Platform: Linux-4.19.0-22-cloud-amd64-x86_64-with-debian-10.13
- Python version: 3.7.3
- PyArrow version: 11.0.0
- Pandas version: 1.3.5
``` | 237 | Creating a dummy dataset from a bigger one
### Describe the bug
I often want to create a dummy dataset from a bigger dataset for fast iteration when training. However, I'm having a hard time doing this especially when trying to upload the dataset to the Hub.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("lambdalabs/pokemon-blip-captions")
dataset["train"] = dataset["train"].select(range(20))
dataset.push_to_hub("patrickvonplaten/dummy_image_data")
```
gives:
```
~/python_bin/datasets/arrow_dataset.py in _push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, embed_external_files)
4003 base_wait_time=2.0,
4004 max_retries=5,
-> 4005 max_wait_time=20.0,
4006 )
4007 return repo_id, split, uploaded_size, dataset_nbytes
~/python_bin/datasets/utils/file_utils.py in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time)
328 while True:
329 try:
--> 330 return func(*func_args, **func_kwargs)
331 except exceptions as err:
332 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes):
~/hf/lib/python3.7/site-packages/huggingface_hub/utils/_validators.py in _inner_fn(*args, **kwargs)
122 )
123
--> 124 return fn(*args, **kwargs)
125
126 return _inner_fn # type: ignore
TypeError: upload_file() got an unexpected keyword argument 'identical_ok'
In [2]:
```
### Expected behavior
I would have expected this to work. It's for me the most intuitive way of creating a dummy dataset.
### Environment info
```
- `datasets` version: 2.1.1.dev0
- Platform: Linux-4.19.0-22-cloud-amd64-x86_64-with-debian-10.13
- Python version: 3.7.3
- PyArrow version: 11.0.0
- Pandas version: 1.3.5
```
Getting same error with latest versions.
```shell
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[99], line 1
----> 1 dataset.push_to_hub("mirfan899/kids_phoneme_asr")
File /opt/conda/lib/python3.10/site-packages/datasets/arrow_dataset.py:3538, in Dataset.push_to_hub(self, repo_id, split, private, token, branch, shard_size, embed_external_files)
3493 def push_to_hub(
3494 self,
3495 repo_id: str,
(...)
3501 embed_external_files: bool = True,
3502 ):
3503 """Pushes the dataset to the hub.
3504 The dataset is pushed using HTTP requests and does not need to have neither git or git-lfs installed.
3505
(...)
3536 ```
3537 """
-> 3538 repo_id, split, uploaded_size, dataset_nbytes = self._push_parquet_shards_to_hub(
3539 repo_id=repo_id,
3540 split=split,
3541 private=private,
3542 token=token,
3543 branch=branch,
3544 shard_size=shard_size,
3545 embed_external_files=embed_external_files,
3546 )
3547 organization, dataset_name = repo_id.split("/")
3548 info_to_dump = self.info.copy()
File /opt/conda/lib/python3.10/site-packages/datasets/arrow_dataset.py:3474, in Dataset._push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, shard_size, embed_external_files)
3472 shard.to_parquet(buffer)
3473 uploaded_size += buffer.tell()
-> 3474 _retry(
3475 api.upload_file,
3476 func_kwargs=dict(
3477 path_or_fileobj=buffer.getvalue(),
3478 path_in_repo=path_in_repo(index),
3479 repo_id=repo_id,
3480 token=token,
3481 repo_type="dataset",
3482 revision=branch,
3483 identical_ok=True,
3484 ),
3485 exceptions=HTTPError,
3486 status_codes=[504],
3487 base_wait_time=2.0,
3488 max_retries=5,
3489 max_wait_time=20.0,
3490 )
3491 return repo_id, split, uploaded_size, dataset_nbytes
File /opt/conda/lib/python3.10/site-packages/datasets/utils/file_utils.py:330, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time)
328 while True:
329 try:
--> 330 return func(*func_args, **func_kwargs)
331 except exceptions as err:
332 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes):
File /opt/conda/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs)
117 if check_use_auth_token:
118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs)
--> 120 return fn(*args, **kwargs)
TypeError: HfApi.upload_file() got an unexpected keyword argument 'identical_ok'
``` | [
-0.10330459475517273,
-0.46017131209373474,
0.0648631751537323,
0.33494043350219727,
0.16239123046398163,
0.10790085047483444,
0.18772070109844208,
0.3316099941730499,
-0.1263197511434555,
0.2755588889122009,
0.06896834075450897,
0.13240064680576324,
-0.05003596842288971,
0.3932800889015198,
0.05632428452372551,
0.0004122629761695862,
0.22544978559017181,
-0.13627353310585022,
0.18161308765411377,
-0.11232036352157593,
-0.2257099151611328,
-0.12990550696849823,
-0.06454581767320633,
-0.13383875787258148,
-0.4212191700935364,
0.07566338777542114,
-0.1844501942396164,
0.43546783924102783,
-0.2619764506816864,
-0.17472320795059204,
0.16474522650241852,
-0.16532637178897858,
0.039093442261219025,
0.5192741751670837,
-0.0001165697249234654,
0.06880727410316467,
0.441261351108551,
-0.1739272177219391,
-0.36505135893821716,
0.012388058006763458,
-0.09257008135318756,
-0.2792017161846161,
-0.1478317826986313,
-0.2320796251296997,
0.07855288684368134,
0.06679729372262955,
-0.023783305659890175,
0.11251954734325409,
0.2025318741798401,
0.28824320435523987,
0.16569869220256805,
0.30787163972854614,
0.026724141091108322,
-0.3487095236778259,
0.06665050238370895,
0.20820054411888123,
-0.29174304008483887,
0.20179405808448792,
0.036070242524147034,
0.0545223206281662,
0.18234670162200928,
-0.038541264832019806,
0.024690845981240273,
0.018330901861190796,
0.23191750049591064,
0.1151256114244461,
-0.10734682530164719,
-0.19114677608013153,
0.10490575432777405,
0.1381157487630844,
-0.14277467131614685,
-0.3279273509979248,
-0.40451934933662415,
-0.46128731966018677,
-0.03056761622428894,
-0.2639901041984558,
0.133268803358078,
0.26867011189460754,
-0.07076916843652725,
0.10612252354621887,
0.025134557858109474,
-0.1393592804670334,
-0.059774186462163925,
0.09380819648504257,
0.0798034816980362,
-0.06914645433425903,
0.23767277598381042,
0.20188817381858826,
0.06695234030485153,
-0.054810814559459686,
0.0778227299451828,
-0.44674086570739746,
0.12458428740501404,
0.017979182302951813,
-0.26508015394210815,
-0.03549528121948242,
-0.07085918635129929,
0.17202666401863098,
0.2265581488609314,
0.12843528389930725,
-0.07060939818620682,
-0.10977590829133987,
-0.0974639281630516,
0.11475005745887756,
0.03389730677008629,
0.18157194554805756,
-0.1663891077041626,
0.45993557572364807,
-0.22014079988002777,
0.1807592660188675,
-0.06652414798736572,
-0.007481284439563751,
-0.05740322172641754,
-0.04242365062236786,
0.2084270864725113,
0.016519727185368538,
0.296375036239624,
-0.14591631293296814,
-0.3962271213531494,
0.1778719574213028,
-0.15518374741077423,
0.29106050729751587,
0.007433485705405474,
0.11090567708015442,
-0.24253137409687042,
-0.09355025738477707,
-0.07045795023441315,
0.35435205698013306,
-0.37851184606552124,
-0.2794768512248993,
-0.22110487520694733,
0.17090006172657013,
-0.20352904498577118,
0.16217319667339325,
0.007206514477729797,
-0.2480296790599823,
0.20025447010993958,
0.3085891306400299,
0.2828410565853119,
0.04464138299226761,
0.2690403163433075,
-0.15243999660015106,
-0.07200882583856583,
-0.01733236387372017,
0.22244253754615784,
0.11109281331300735,
0.1128673106431961,
-0.2928071618080139,
0.03611169755458832,
0.13408342003822327,
-0.30848485231399536,
-0.3365336060523987,
-0.3815392255783081,
0.16548526287078857,
-0.18437491357326508,
0.0319952555000782,
-0.5346553921699524,
0.15643969178199768,
-0.07316651195287704,
-0.18682648241519928,
-0.055109016597270966,
0.08323048055171967,
-0.22122927010059357,
-0.16675907373428345,
0.10854237526655197,
0.4562235474586487,
-0.3839060962200165,
0.17304304242134094,
0.008052263408899307,
0.31057119369506836,
0.04430431127548218,
0.12967821955680847,
-0.18193286657333374,
0.2522319257259369,
-0.3582543432712555,
0.33664512634277344,
0.06679195165634155,
-0.3485996127128601,
-0.378490149974823,
-0.16464470326900482,
-0.37816154956817627,
0.2515736222267151,
-0.018698930740356445,
0.21317028999328613,
0.042311012744903564,
-0.03741835057735443,
0.03745897114276886,
0.17740166187286377,
-0.07236666232347488,
-0.13623975217342377,
-0.3248036503791809,
-0.21015897393226624,
-0.04365331679582596,
0.047301288694143295,
0.0419740304350853,
0.16644582152366638,
-0.057824067771434784,
0.23405548930168152,
0.16544687747955322,
-0.1735888570547104,
0.03197837620973587,
0.27136537432670593,
0.19965319335460663,
-0.09355922043323517,
-0.01730314828455448,
-0.016785036772489548,
-0.4574649930000305,
0.3454832434654236,
-0.06732116639614105,
0.21662534773349762,
0.09412279725074768,
-0.2778322696685791,
-0.5873969197273254,
-0.11309950798749924,
-0.11306998133659363,
-0.06107385829091072,
0.08252900838851929,
-0.04073803871870041,
0.04259276017546654,
-0.14927950501441956,
-0.042416349053382874,
0.5441147089004517,
-0.4466340243816376,
0.2219727784395218,
-0.5805667042732239,
0.5349259972572327,
-0.04756882041692734,
-0.21364116668701172,
-0.02011604979634285,
0.031216587871313095,
0.2521478533744812,
-0.08761914074420929,
-0.13385942578315735,
0.2495311200618744,
0.20151984691619873,
0.3735331892967224,
0.07666713744401932,
-0.018424198031425476,
0.20112904906272888,
0.047672245651483536,
0.03596818819642067,
0.049721911549568176,
0.19208578765392303,
-0.014018811285495758,
-0.26803475618362427,
0.5150776505470276,
0.017438609153032303,
-0.03978096693754196,
-0.04732367768883705,
-0.12444225698709488,
0.014435375109314919,
-0.12563355267047882,
0.059364937245845795,
0.051999323070049286,
0.40997833013534546,
0.38689181208610535,
0.10101242363452911,
-0.05205950140953064,
0.0008500292897224426,
0.09608083963394165,
0.22135473787784576,
-0.058720871806144714,
-0.021610498428344727,
0.00782833993434906,
-0.033572882413864136,
-0.03567781299352646,
0.14324326813220978,
0.16991284489631653,
0.4975958466529846,
0.10069023072719574,
-0.12402147054672241,
0.24698390066623688,
-0.48241591453552246,
-0.11485165357589722,
0.2171708643436432,
-0.036406539380550385,
-0.16947320103645325,
0.1309049427509308,
0.22607575356960297,
-0.14838925004005432,
-0.28797000646591187,
0.11944027245044708,
0.17497363686561584,
0.32429182529449463,
-0.2845541834831238,
-0.009938565082848072,
-0.1689063310623169,
0.09441287070512772,
-0.18690888583660126,
0.08385676145553589,
-0.41440704464912415,
-0.39516013860702515,
0.07709086686372757,
0.41848224401474,
-0.022885113954544067,
0.10346628725528717,
0.11703073978424072,
0.20022714138031006,
-0.0014114100486040115,
-0.24405501782894135,
0.11294247210025787,
-0.042719513177871704,
-0.3055543899536133,
-0.0293157696723938,
0.2819431722164154,
0.09352246671915054,
0.3512909710407257,
-0.18551424145698547,
-0.01780407689511776,
-0.42333129048347473,
-0.31371256709098816,
0.10109511017799377,
-0.07664632052183151,
0.3859803378582001,
-0.032752975821495056,
0.04106151685118675,
-0.10217946767807007,
-0.06712693721055984,
0.1332181990146637,
-0.10524558275938034,
-0.23133297264575958,
0.14182014763355255,
-0.04075919836759567,
0.14430245757102966,
0.07178717851638794,
-0.30139756202697754,
-0.07017464190721512,
-0.1632128208875656,
-0.044494323432445526,
0.15594890713691711,
-0.008137911558151245,
0.23946361243724823,
0.27950331568717957,
0.13370859622955322,
0.29116421937942505,
-0.2048930674791336,
-0.4299851059913635,
-0.3294999301433563,
0.277249813079834,
-0.16678476333618164,
-0.1932619959115982,
-0.04593309760093689,
-0.31906265020370483,
0.2779427766799927,
-0.05996809899806976,
-0.47912484407424927,
-0.7952807545661926,
-0.02821269817650318,
0.18075212836265564,
-0.1107722669839859,
-0.06103166192770004,
0.28098931908607483,
-0.3071202337741852,
0.09159687906503677,
-0.2213391661643982,
-0.32460954785346985,
0.19207987189292908,
0.35838961601257324,
0.21731853485107422,
-0.23875179886817932,
0.24067288637161255,
-0.01707923598587513,
0.7010495066642761,
0.36007753014564514,
-0.0447884239256382,
0.40930232405662537,
-0.31252819299697876,
0.31950315833091736,
-0.3652919828891754,
-0.4200916886329651,
0.003297290997579694,
-0.023717164993286133,
-0.3168746829032898,
0.17139720916748047,
-0.16265738010406494,
0.018015295267105103,
-0.04275653883814812,
-0.07765726000070572,
-0.20515787601470947,
-0.2892651855945587,
-0.028356516733765602,
0.05427321419119835,
-0.1631646752357483,
0.2114451676607132,
0.10160072892904282,
-0.5265203714370728,
-0.15775445103645325,
0.1352476328611374,
-0.18405945599079132,
0.03293031081557274,
-0.14098285138607025,
-0.236362487077713,
-0.02788573130965233,
-0.37206023931503296,
0.37024229764938354,
0.09834218770265579,
0.2078358680009842,
0.11287821829319,
0.06558515876531601,
0.05298309028148651,
-0.029261965304613113,
0.6791943907737732,
-0.49106669425964355,
-0.021043822169303894,
-0.12510831654071808,
-0.0011715181171894073,
-0.667842447757721,
-0.14943593740463257,
-0.051411356776952744,
0.26240524649620056,
0.06222521886229515,
0.617866575717926,
-0.38233429193496704,
0.20621687173843384,
0.22801846265792847,
0.37558040022850037,
-0.15528604388237,
0.10237830132246017,
-0.28754889965057373,
-0.2238571047782898,
-0.3640056550502777,
-0.013163670897483826,
0.1629982441663742,
0.4937790334224701,
0.058396682143211365,
0.09893849492073059,
-0.18854740262031555,
-0.013232540339231491,
0.2515547275543213,
0.00029633473604917526,
0.4284307062625885,
0.04865892976522446,
0.3386782109737396,
0.1007920503616333,
0.07455082982778549,
0.08431737869977951,
0.8709908127784729,
0.018786417320370674,
-0.2656373381614685,
0.07827785611152649,
0.16791334748268127,
0.1891886591911316,
0.6274846792221069,
0.2369082272052765,
0.10327138006687164,
-0.2912108302116394,
0.04516932740807533,
-0.5295808911323547,
0.2756533622741699,
0.3262420892715454,
-0.10514508932828903,
-0.16360962390899658,
-0.11840400844812393,
0.5116987824440002,
0.26002490520477295,
0.08355185389518738,
0.5877997875213623,
0.2723090648651123,
-0.11152143031358719,
0.36245566606521606,
-0.046417273581027985,
1.0716772079467773,
0.22851423919200897,
0.2661794424057007,
0.2605392336845398,
-0.03883083909749985,
0.27228784561157227,
-0.287544310092926,
0.05041220411658287,
-0.4410717785358429,
-0.2873925268650055,
-0.029241589829325676,
-0.15464475750923157,
-0.052286677062511444,
0.0367589071393013,
-0.12839025259017944,
0.26613444089889526,
-0.27657395601272583,
0.7638376951217651,
-0.10883365571498871,
0.3893655836582184,
-0.4037608504295349,
-0.11543501913547516,
-0.028946109116077423,
0.1346101611852646,
0.14529412984848022,
-0.08519381284713745,
0.020955152809619904,
0.010787034407258034,
-0.42629143595695496,
-0.13619381189346313,
-0.27652162313461304,
0.1394282579421997,
-0.07400061190128326,
0.04642806947231293,
-0.04987454041838646,
-0.2031412422657013,
-0.26555177569389343,
0.020873375236988068,
0.5032464861869812,
0.08550223708152771,
-0.2051074057817459,
0.09732618927955627,
-0.08920376747846603,
0.07124146074056625,
-0.0593002587556839,
-0.34220564365386963,
0.19353023171424866,
0.06838691979646683,
-0.20178350806236267,
0.17708754539489746,
0.1368214637041092,
-0.17381006479263306,
-0.35204923152923584,
-0.15816999971866608,
0.1636446863412857,
-0.4731276333332062,
-0.22321726381778717,
-0.09541170299053192,
0.008465901017189026,
-0.36796122789382935,
0.0930589884519577,
0.004955857992172241,
-0.17954017221927643,
0.004703156650066376,
0.26351824402809143,
-0.3216284215450287,
-0.13585712015628815,
0.3506373465061188,
0.09727521240711212,
-0.15137308835983276,
0.4910559058189392,
-0.23744402825832367,
0.12575337290763855,
-0.09182071685791016,
0.31352299451828003,
0.29239222407341003,
-0.44892579317092896,
0.3881531059741974,
-0.24406588077545166,
-0.13704988360404968,
-0.19136634469032288,
0.0756814256310463,
0.3003513216972351,
0.15168282389640808,
-0.022453753277659416,
-0.18512164056301117,
-0.25847065448760986,
0.10929813235998154,
0.12122587859630585,
0.4647480249404907,
-0.2158585488796234,
-0.02762744575738907,
-0.07625773549079895,
0.1291467696428299,
-0.2797854244709015,
0.24849964678287506,
-0.2634509801864624,
0.24998243153095245,
-0.18804562091827393,
-0.10364007204771042,
0.05171757563948631,
-0.18308855593204498,
0.024318749085068703,
0.38597339391708374,
-0.17661379277706146,
-0.15212908387184143,
-0.3420252799987793,
0.18911290168762207,
0.2082728147506714,
-0.05522789806127548,
-0.003959898836910725,
-0.12528742849826813,
-0.04696263000369072,
-0.14030389487743378,
0.1324736624956131,
0.3105548024177551,
-0.048313796520233154,
-0.11313272267580032,
0.6638806462287903,
-0.05538765341043472,
-0.042247261852025986,
-0.09834334254264832,
0.1455933153629303,
0.4045630097389221,
-0.11443671584129333,
0.0036106109619140625,
0.07599160820245743,
-0.02884724736213684,
-0.06109574809670448,
0.10098975896835327,
0.11283724009990692,
0.08372804522514343,
0.04105166718363762,
-0.20552410185337067,
-0.02943706512451172,
-0.014955762773752213,
0.3830651342868805,
0.3586099445819855,
-0.19389654695987701,
-0.06682633608579636,
0.26430168747901917,
0.16592249274253845,
-0.20318838953971863,
-0.2039618194103241,
0.6596791744232178,
-0.10642864555120468,
0.10594673454761505,
0.2680385708808899,
0.23527106642723083,
0.29979005455970764,
-0.36450570821762085,
-0.005701419897377491,
0.12726296484470367,
-0.12221628427505493,
0.16053631901741028,
0.43027395009994507,
-0.2547568380832672,
-0.05624387785792351,
0.26936057209968567,
-0.09034658968448639,
0.2190122902393341,
0.5081992745399475,
0.025210749357938766,
0.5981035232543945,
-0.019763879477977753,
-0.14183320105075836,
0.26698458194732666,
0.02267889678478241,
-0.013790406286716461,
0.1725541651248932,
-0.02545669674873352,
0.31452301144599915,
0.01525847613811493,
0.3095254898071289,
-0.2263566106557846,
-0.2054332047700882,
-0.4822148084640503,
0.09596379101276398,
-0.21151667833328247,
0.009819123893976212,
-0.23062242567539215,
-0.28784415125846863,
-0.4420059621334076,
0.050930317491292953,
0.032873041927814484,
-0.28734058141708374,
0.345217227935791,
0.018557824194431305,
-0.11399601399898529,
0.2542950510978699,
-0.0958269014954567,
0.26722049713134766,
0.14602163434028625,
-0.18596963584423065,
0.10164836049079895,
0.1413508951663971,
-0.15277297794818878,
0.11096233129501343,
0.5440170168876648,
0.4661610424518585,
0.126226544380188,
-0.359395831823349,
0.021305587142705917,
0.47549206018447876,
0.025426344946026802,
0.191287100315094,
0.27362722158432007,
-0.14926010370254517,
0.000006798654794692993,
0.23201708495616913,
0.08973033726215363,
-0.19467251002788544,
-0.22073756158351898,
0.11819471418857574,
-0.209294393658638,
-0.619142472743988,
0.560858964920044,
-0.09557986259460449,
0.10263087600469589,
-0.2751429080963135,
0.07900846004486084,
-0.26880723237991333,
-0.18440517783164978,
0.48154300451278687,
-0.06540770083665848,
0.18444085121154785,
-0.10254204273223877,
0.055532388389110565,
-0.46445581316947937,
0.5062611699104309,
0.36278632283210754,
-0.11959845572710037,
-0.4753372371196747,
0.019457370042800903,
-0.554632306098938,
0.3154844641685486,
-0.533523440361023,
-0.2040170580148697,
0.12171760946512222,
0.1539931297302246,
0.023390598595142365,
0.1925329566001892,
0.15816619992256165,
0.03533753380179405,
-0.15790964663028717,
0.3822330832481384,
-0.3767208456993103,
-0.3311306834220886,
0.18107235431671143,
-0.3397972881793976,
0.09853020310401917,
-0.5765031576156616,
0.13775642216205597,
0.18187862634658813,
-0.029116613790392876,
0.08665010333061218,
-0.2453765720129013,
0.23866954445838928,
-0.2003011703491211,
0.5097670555114746,
0.015030499547719955,
0.48714783787727356,
-0.0578334704041481,
-0.18108005821704865,
-0.13229839503765106,
-0.17513538897037506,
-0.3495666980743408,
0.22581899166107178,
-0.09773869812488556,
0.43708309531211853,
-0.09647287428379059,
-0.19035975635051727,
-0.02273985557258129,
0.07561862468719482,
0.16385383903980255,
-0.07063328474760056,
-0.3188830316066742,
0.08759121596813202,
-0.2439376711845398,
0.18854251503944397,
-0.011173530481755733,
0.398918479681015,
-0.12128736078739166,
0.5707380771636963,
0.021190181374549866,
-0.4141327142715454,
0.584417462348938,
-0.15778128802776337,
-0.2674233019351959,
-0.00339497160166502,
0.06329122930765152,
0.06873318552970886,
-0.10248467326164246,
-0.34720972180366516,
-0.006103821098804474,
0.24037902057170868,
-0.01671236753463745,
0.1449025273323059,
0.3878733515739441,
0.04843640327453613,
0.024484481662511826,
0.038071442395448685,
0.33208826184272766,
-0.01949864625930786,
-0.18649983406066895,
0.6073604822158813,
-0.21617893874645233
] |
https://github.com/huggingface/datasets/issues/5508 | Saving a dataset after setting format to torch doesn't work, but only if filtering | Hey, I'm a research engineer working on language modelling wanting to contribute to open source. I was wondering if I could give it a shot? | ### Describe the bug
Saving a dataset after setting format to torch doesn't work, but only if filtering
### Steps to reproduce the bug
```
a = Dataset.from_dict({"b": [1, 2]})
a.set_format('torch')
a.save_to_disk("test_save") # saves successfully
a.filter(None).save_to_disk("test_save_filter") # does not
>> [...] TypeError: Provided `function` which is applied to all elements of table returns a `dict` of types [<class 'torch.Tensor'>]. When using `batched=True`, make sure provided `function` returns a `dict` of types like `(<class 'list'>, <class 'numpy.ndarray'>)`.
# note: skipping the format change to torch lets this work.
### Expected behavior
Saving to work
### Environment info
- `datasets` version: 2.4.0
- Platform: Linux-6.1.9-arch1-1-x86_64-with-glibc2.36
- Python version: 3.10.9
- PyArrow version: 9.0.0
- Pandas version: 1.4.4 | 25 | Saving a dataset after setting format to torch doesn't work, but only if filtering
### Describe the bug
Saving a dataset after setting format to torch doesn't work, but only if filtering
### Steps to reproduce the bug
```
a = Dataset.from_dict({"b": [1, 2]})
a.set_format('torch')
a.save_to_disk("test_save") # saves successfully
a.filter(None).save_to_disk("test_save_filter") # does not
>> [...] TypeError: Provided `function` which is applied to all elements of table returns a `dict` of types [<class 'torch.Tensor'>]. When using `batched=True`, make sure provided `function` returns a `dict` of types like `(<class 'list'>, <class 'numpy.ndarray'>)`.
# note: skipping the format change to torch lets this work.
### Expected behavior
Saving to work
### Environment info
- `datasets` version: 2.4.0
- Platform: Linux-6.1.9-arch1-1-x86_64-with-glibc2.36
- Python version: 3.10.9
- PyArrow version: 9.0.0
- Pandas version: 1.4.4
Hey, I'm a research engineer working on language modelling wanting to contribute to open source. I was wondering if I could give it a shot? | [
-0.37882277369499207,
-0.26239991188049316,
-0.03895370289683342,
0.09076978266239166,
0.3246902823448181,
0.060432739555835724,
0.5087522864341736,
0.22538132965564728,
-0.19273561239242554,
0.03264094144105911,
-0.21385417878627777,
0.32695838809013367,
-0.3333057761192322,
0.07247728854417801,
-0.12580972909927368,
-0.1057121753692627,
0.31711602210998535,
-0.19889986515045166,
-0.016324639320373535,
-0.0923621654510498,
-0.25513190031051636,
-0.009539959952235222,
-0.16693022847175598,
-0.07792380452156067,
-0.2637929320335388,
-0.15202999114990234,
0.12983927130699158,
-0.06342624872922897,
0.04875270277261734,
-0.004127717576920986,
0.24375276267528534,
-0.02294844761490822,
0.1834709644317627,
0.708757758140564,
-0.0001232753711519763,
-0.056395575404167175,
0.05590876564383507,
-0.32744330167770386,
-0.3406006991863251,
-0.3973183035850525,
0.2079601287841797,
-0.21857839822769165,
0.10979580134153366,
-0.16480624675750732,
-0.15628169476985931,
-0.028189562261104584,
-0.18271435797214508,
-0.6496939659118652,
0.3583154082298279,
0.38568469882011414,
0.16658547520637512,
0.13532350957393646,
0.056120630353689194,
-0.01450025662779808,
0.17835299670696259,
0.6417829990386963,
-0.23035553097724915,
0.0976942777633667,
0.2241978943347931,
0.14100109040737152,
0.23638984560966492,
0.4847755432128906,
-0.4636112451553345,
-0.1830522119998932,
0.12827733159065247,
-0.027539897710084915,
-0.401400089263916,
-0.2570321559906006,
0.15946288406848907,
0.0497494712471962,
0.6087917685508728,
-0.49731895327568054,
-0.3918181359767914,
-0.23777902126312256,
-0.2450658679008484,
-0.3203478157520294,
-0.010753534734249115,
0.2810061275959015,
-0.036746248602867126,
0.09062720835208893,
0.01635175570845604,
-0.06975682824850082,
-0.2547686696052551,
0.16683749854564667,
-0.04650423675775528,
0.1275608390569687,
-0.16588115692138672,
0.17676514387130737,
-0.2134196013212204,
-0.0629005953669548,
0.1938258558511734,
-0.1850799322128296,
0.05072805657982826,
0.15968547761440277,
-0.14242999255657196,
-0.03223681449890137,
0.05661780759692192,
-0.01466783881187439,
-0.0946580246090889,
0.11731553077697754,
-0.10195479542016983,
0.18858084082603455,
-0.07302050292491913,
0.09979470819234848,
0.20269177854061127,
0.017377633601427078,
0.30954068899154663,
0.4383750855922699,
0.2601568102836609,
-0.23284420371055603,
-0.0019229687750339508,
0.0030437298119068146,
0.29312121868133545,
-0.010899372398853302,
0.25840818881988525,
0.0030076857656240463,
0.3942028880119324,
-0.1371316909790039,
-0.2346346378326416,
0.15835785865783691,
-0.10560710728168488,
-0.2928388714790344,
-0.0821523517370224,
0.49065065383911133,
-0.09458162635564804,
-0.010299243032932281,
0.2003791332244873,
0.3987559676170349,
-0.1283969134092331,
0.012226118706166744,
-0.06764398515224457,
-0.1338166743516922,
0.001570776104927063,
-0.3323459327220917,
0.14554376900196075,
-0.23505890369415283,
0.09943664073944092,
0.1596817970275879,
-0.0620829313993454,
0.1788093000650406,
-0.03790605440735817,
-0.2983437180519104,
0.5827479362487793,
0.15516042709350586,
-0.06342829763889313,
0.3611838221549988,
0.32256126403808594,
-0.16290664672851562,
-0.21889132261276245,
0.17157888412475586,
-0.06285382062196732,
-0.016703367233276367,
-0.3021634817123413,
0.0632237046957016,
0.06456955522298813,
0.1151098757982254,
-0.08135979622602463,
0.11358749866485596,
0.6893264651298523,
-0.28469470143318176,
0.10205093771219254,
-0.37046265602111816,
-0.23934748768806458,
-0.48804590106010437,
0.16866318881511688,
0.37959638237953186,
-0.6418915390968323,
0.04029368609189987,
0.3310730457305908,
0.07896736264228821,
0.4057219624519348,
0.1598316729068756,
0.0218079574406147,
0.2309863567352295,
-0.08599811792373657,
-0.003063693642616272,
0.3610093295574188,
-0.20733383297920227,
-0.36471885442733765,
-0.16755612194538116,
0.14237765967845917,
0.22659911215305328,
0.13046763837337494,
0.11497500538825989,
0.32456180453300476,
-0.21166300773620605,
0.1980014443397522,
0.31349092721939087,
-0.0380702018737793,
-0.04621703922748566,
-0.2914997339248657,
0.295410692691803,
0.4136616587638855,
-0.07312413305044174,
0.1237674206495285,
0.03379013016819954,
0.02958017587661743,
-0.06380487978458405,
0.2855684161186218,
-0.10076400637626648,
0.09322578459978104,
-0.034086257219314575,
0.35955244302749634,
-0.0024278685450553894,
0.08814407885074615,
-0.2684958875179291,
-0.44125354290008545,
-0.004833858460187912,
0.06817846745252609,
-0.05454608052968979,
-0.231495663523674,
-0.13991007208824158,
-0.12767630815505981,
0.11614903062582016,
-0.26460519433021545,
-0.30661365389823914,
-0.07873378694057465,
0.035157497972249985,
-0.15052425861358643,
0.0981205403804779,
-0.2579612135887146,
0.2545323669910431,
-0.13690221309661865,
-0.0002881254185922444,
-0.24565036594867706,
0.032113999128341675,
-0.13275982439517975,
-0.5171400904655457,
-0.22330746054649353,
0.15436454117298126,
0.11079725623130798,
-0.09770260751247406,
-0.20983460545539856,
0.2915591895580292,
0.1179163008928299,
-0.19267676770687103,
-0.37499502301216125,
-0.1313198357820511,
-0.08830883353948593,
-0.08280421048402786,
-0.08824357390403748,
0.26887816190719604,
0.256847620010376,
-0.10974930226802826,
-0.6224663853645325,
0.5330853462219238,
0.2673186659812927,
0.15985199809074402,
-0.2915656566619873,
0.0943390503525734,
0.32327505946159363,
0.16367889940738678,
-0.16497033834457397,
-0.17817312479019165,
0.16346122324466705,
-0.04244795814156532,
-0.05743999034166336,
-0.19182820618152618,
-0.6285373568534851,
0.07279126346111298,
0.2710348963737488,
0.0628017783164978,
0.45895916223526,
0.041625332087278366,
0.05455116927623749,
-0.051527902483940125,
0.23823142051696777,
-0.2050780951976776,
0.4364280700683594,
0.06272140145301819,
-0.14941714704036713,
-0.03360844403505325,
-0.10874301940202713,
-0.1292792558670044,
0.13688641786575317,
0.002107881009578705,
-0.13649198412895203,
0.08442732691764832,
0.24169939756393433,
0.05447275936603546,
0.0008070208132266998,
0.2146715223789215,
-0.2841978073120117,
-0.06937427073717117,
-0.5156113505363464,
0.2195621281862259,
-0.2910425662994385,
-0.007220018655061722,
-0.031449757516384125,
-0.17061157524585724,
-0.19641166925430298,
-0.15273849666118622,
-0.10390380024909973,
0.3811820447444916,
-0.06749502569437027,
0.22434550523757935,
0.3516039252281189,
0.23284022510051727,
0.09939983487129211,
-0.391456663608551,
-0.14852078258991241,
-0.2577136754989624,
-0.1819053292274475,
0.01855476200580597,
0.15431129932403564,
-0.11694961786270142,
0.5980722308158875,
-0.06861916929483414,
-0.03761659562587738,
-0.32812026143074036,
-0.17466464638710022,
0.05339193716645241,
-0.12300878763198853,
0.30586543679237366,
0.17579056322574615,
0.2752659320831299,
-0.16823600232601166,
0.013197350315749645,
0.2723156809806824,
-0.14309383928775787,
-0.07369887083768845,
0.05944925546646118,
0.012228790670633316,
0.23811492323875427,
-0.08140543103218079,
-0.17844590544700623,
-0.3457691967487335,
-0.2531392276287079,
0.08328977972269058,
-0.05139141529798508,
0.13857945799827576,
-0.007306854240596294,
0.12534742057323456,
-0.04184424504637718,
-0.04063817486166954,
0.09913693368434906,
-0.26411256194114685,
-0.11420208215713501,
0.47234266996383667,
-0.17643019556999207,
-0.4759161174297333,
0.008696582168340683,
0.1117524653673172,
-0.07317584753036499,
0.275775671005249,
-0.27241694927215576,
0.060620177537202835,
0.06903394311666489,
0.16206981241703033,
0.16315528750419617,
0.4131602644920349,
0.3517288863658905,
-0.029858527705073357,
0.0853886604309082,
-0.21233317255973816,
-0.11821213364601135,
0.005943849682807922,
-0.1372247338294983,
0.5071853995323181,
0.08677355945110321,
0.6046748161315918,
0.00926889106631279,
0.6022028923034668,
0.03252995386719704,
-0.15585462749004364,
0.4024110436439514,
0.3045898675918579,
0.5960478186607361,
-0.3614523410797119,
-0.57413649559021,
-0.13991321623325348,
-0.1967736780643463,
-0.07004467397928238,
-0.03167983889579773,
0.011483732610940933,
-0.08106817305088043,
-0.19923648238182068,
-0.09003546833992004,
-0.14249573647975922,
-0.21223783493041992,
0.2595759630203247,
-0.40450504422187805,
0.28100600838661194,
0.05649856850504875,
0.35514193773269653,
-0.16937275230884552,
-0.09292566776275635,
-0.013083990663290024,
0.23413996398448944,
0.3401849865913391,
-0.11776597797870636,
-0.3013207018375397,
-0.10993324965238571,
-0.4124372601509094,
0.41893231868743896,
0.13840395212173462,
0.43315649032592773,
-0.17537027597427368,
-0.22896131873130798,
0.0631771832704544,
0.18804042041301727,
0.6798399090766907,
-0.1808730661869049,
-0.1817263662815094,
0.23976391553878784,
-0.1315111219882965,
-0.8143872618675232,
-0.03828384354710579,
0.03712138161063194,
0.07577250897884369,
0.1664910763502121,
0.17112784087657928,
-0.2056291401386261,
-0.10384359210729599,
-0.07056095451116562,
0.32774367928504944,
-0.1821330338716507,
-0.013066859915852547,
-0.21272212266921997,
-0.19829541444778442,
-0.4659220576286316,
0.11142361164093018,
0.2141076922416687,
0.023804929107427597,
0.09515149891376495,
0.12375657260417938,
-0.40866565704345703,
-0.22725370526313782,
0.1619659960269928,
-0.20378996431827545,
0.46584072709083557,
-0.00897083431482315,
0.02855633571743965,
-0.10875654220581055,
0.3495299816131592,
0.21632622182369232,
0.14200028777122498,
-0.4340537190437317,
0.14621710777282715,
0.27415913343429565,
-0.11059634387493134,
0.2664443552494049,
0.3365064859390259,
-0.14903971552848816,
0.004190966486930847,
-0.3183441758155823,
-0.044327519834041595,
-0.02286667376756668,
0.002199468668550253,
-0.03935015946626663,
0.17823907732963562,
-0.7075337171554565,
-0.43443769216537476,
0.3271666467189789,
0.18126071989536285,
-0.03290368616580963,
0.4336208403110504,
-0.07954400777816772,
-0.22751864790916443,
0.7079221606254578,
0.1419145166873932,
1.0164865255355835,
0.2316785305738449,
0.43656471371650696,
-0.028940100222826004,
-0.25845620036125183,
0.1535322070121765,
0.07652515172958374,
0.09446824342012405,
-0.17885605990886688,
0.059004850685596466,
-0.15022341907024384,
-0.2773105800151825,
0.18778502941131592,
-0.1266833394765854,
-0.29504865407943726,
0.13694287836551666,
-0.536436915397644,
0.4289124608039856,
0.11643978953361511,
-0.03884422034025192,
-0.10643311589956284,
-0.21177755296230316,
-0.24619507789611816,
0.04200344532728195,
0.09422819316387177,
0.18158240616321564,
-0.07097645103931427,
-0.03514335677027702,
-0.2929585576057434,
-0.11160534620285034,
-0.3530544638633728,
-0.08497631549835205,
-0.16689030826091766,
0.2738138437271118,
-0.02968132123351097,
-0.8620022535324097,
0.22376494109630585,
0.45335689187049866,
0.4967212677001953,
0.1941087543964386,
-0.07849059253931046,
-0.08069686591625214,
0.3217276334762573,
0.30084288120269775,
0.041577041149139404,
-0.23581421375274658,
0.48745986819267273,
-0.02509543113410473,
0.14521095156669617,
0.2524354159832001,
-0.1139204204082489,
-0.21605651080608368,
-0.2776382863521576,
0.3185279667377472,
0.10885408520698547,
-0.4450325071811676,
-0.3350431025028229,
-0.19285735487937927,
0.1923559308052063,
-0.29939186573028564,
0.08390636742115021,
0.21021762490272522,
0.004011329263448715,
0.5891839265823364,
-0.32467639446258545,
0.0008638128638267517,
-0.2245141714811325,
0.4748196005821228,
0.21781665086746216,
-0.0717267319560051,
0.47114378213882446,
0.29693013429641724,
-0.33306431770324707,
-0.1301267445087433,
0.39655598998069763,
0.2803158760070801,
-0.3681238293647766,
0.39649081230163574,
-0.14654900133609772,
-0.0715474858880043,
-0.2640531063079834,
0.2842489182949066,
0.029789641499519348,
-0.024684108793735504,
-0.18990777432918549,
-0.18091386556625366,
-0.15242306888103485,
-0.16725553572177887,
0.13171476125717163,
0.21716558933258057,
0.2519594728946686,
0.2171274572610855,
0.16086743772029877,
0.1973571926355362,
-0.25256043672561646,
-0.18683551251888275,
0.10218401998281479,
0.21980267763137817,
0.0954262763261795,
0.40409499406814575,
-0.00006096158176660538,
-0.3123056888580322,
-0.02014298178255558,
0.3242531418800354,
-0.09683159738779068,
-0.18306151032447815,
-0.054692067205905914,
0.16530221700668335,
-0.0959809273481369,
-0.1316583752632141,
-0.049027156084775925,
-0.2177172303199768,
-0.06853561103343964,
-0.1888371855020523,
-0.1361113339662552,
0.3831668198108673,
0.02258206158876419,
-0.17577914893627167,
0.2028607875108719,
0.3119376599788666,
0.17420388758182526,
-0.09498265385627747,
-0.26747220754623413,
-0.05786021053791046,
-0.005383046809583902,
0.020908750593662262,
-0.018668031319975853,
-0.07218901813030243,
-0.13009916245937347,
0.05408550798892975,
0.07467815279960632,
0.10462877154350281,
0.17388466000556946,
-0.2959864139556885,
-0.16686595976352692,
0.07267496734857559,
0.40046095848083496,
0.0008844360709190369,
-0.0819280818104744,
-0.08939889073371887,
0.3314332664012909,
0.049412719905376434,
-0.17287179827690125,
-0.006576273124665022,
0.1147056519985199,
-0.04529571533203125,
-0.017195865511894226,
0.11584944278001785,
0.17789016664028168,
0.25221776962280273,
-0.08420462906360626,
0.11486046761274338,
0.1348540037870407,
-0.21108084917068481,
0.3761942684650421,
0.3502171039581299,
0.19205006957054138,
0.2309386432170868,
0.3490508794784546,
-0.06881009042263031,
0.07601599395275116,
0.26444339752197266,
0.37367382645606995,
0.6379606127738953,
0.39592254161834717,
-0.060975152999162674,
0.13107094168663025,
-0.3575543165206909,
0.06247581169009209,
-0.34567615389823914,
-0.13317930698394775,
0.14895953238010406,
0.10513272136449814,
0.08259317278862,
-0.4340362250804901,
-0.35507234930992126,
0.24306389689445496,
0.4757700562477112,
-0.08349160850048065,
-0.00079380813986063,
-0.21763399243354797,
-0.17145892977714539,
0.3100613057613373,
-0.24968110024929047,
-0.263837069272995,
-0.18663589656352997,
-0.06880122423171997,
0.08337115496397018,
0.08299505710601807,
-0.06745975464582443,
0.07253830134868622,
-0.34109678864479065,
0.1173270046710968,
-0.15178781747817993,
-0.028042713180184364,
-0.10646888613700867,
-0.06675375998020172,
-0.11557985842227936,
0.0787825956940651,
0.6005696654319763,
0.37833669781684875,
-0.022210601717233658,
0.12667527794837952,
-0.1086319088935852,
-0.13208706676959991,
-0.04141491651535034,
0.30049997568130493,
0.05044182389974594,
-0.0702761709690094,
0.37387439608573914,
0.08648733049631119,
-0.06591974198818207,
0.0710156112909317,
0.32711467146873474,
0.1536121368408203,
-0.15557079017162323,
0.27482473850250244,
-0.3194608688354492,
-0.23007246851921082,
-0.14544805884361267,
-0.08068261295557022,
-0.20672094821929932,
0.2098051756620407,
0.5596137642860413,
-0.028909938409924507,
0.2021334171295166,
-0.09946057200431824,
0.029198646545410156,
0.15221832692623138,
0.2356129139661789,
0.20610524713993073,
0.1442268192768097,
-0.2738167941570282,
-0.09109717607498169,
-0.31028392910957336,
-0.13647741079330444,
0.060810189694166183,
0.20420899987220764,
-0.18449190258979797,
0.21458867192268372,
0.28558242321014404,
0.1399446725845337,
0.221396803855896,
0.1283281445503235,
0.058743566274642944,
0.47025322914123535,
-0.2515735924243927,
-0.17435786128044128,
-0.4154227375984192,
0.23256871104240417,
0.011960931122303009,
-0.24606844782829285,
0.12492887675762177,
0.016034256666898727,
0.132502019405365,
-0.36107176542282104,
-0.1842377632856369,
0.16906949877738953,
0.26663726568222046,
0.24460145831108093,
0.15746498107910156,
0.1990486979484558,
0.01475982740521431,
-0.02164394222199917,
0.13610921800136566,
0.15769238770008087,
-0.0703667402267456,
0.1651340126991272,
0.05707063525915146,
0.6488715410232544,
-0.2898736894130707,
-0.4246653914451599,
-0.2026476114988327,
0.5511094331741333,
0.016085494309663773,
-0.02957741543650627,
-0.09507105499505997,
0.2019060254096985,
0.05595408380031586,
-0.2085358202457428,
-0.1084328293800354,
0.16360914707183838,
-0.1570321023464203,
0.5124944448471069,
-0.6151114106178284,
-0.37184736132621765,
0.631006121635437,
-0.3220254182815552,
-0.4516286849975586,
-0.3001176714897156,
0.13397730886936188,
0.18919390439987183,
0.07171586155891418,
-0.4859809875488281,
-0.22686916589736938,
0.20277227461338043,
-0.18732672929763794,
0.06997498869895935,
0.058778949081897736,
0.08172528445720673,
0.17435935139656067,
-0.1546495109796524,
0.3295699656009674,
0.09720806777477264,
-0.1634213626384735,
-0.03201194852590561,
-0.3456347584724426
] |
https://github.com/huggingface/datasets/issues/5506 | IterableDataset and Dataset return different batch sizes when using Trainer with multiple GPUs | Hi ! `datasets` doesn't do batching - the PyTorch DataLoader does and is created by the `Trainer`. Do you pass other arguments to training_args with respect to data loading ?
Also we recently released `.to_iterable_dataset` that does pretty much what you implemented, but using contiguous shards to get a better speed:
```python
if use_iterable_dataset:
num_shards = 100
dataset = dataset.to_iterable_dataset(num_shards=num_shards)
``` | ### Describe the bug
I am training a Roberta model using 2 GPUs and the `Trainer` API with a batch size of 256.
Initially I used a standard `Dataset`, but had issues with slow data loading. After reading [this issue](https://github.com/huggingface/datasets/issues/2252), I swapped to loading my dataset as contiguous shards and passing those to an `IterableDataset`. I observed an unexpected drop in GPU memory utilization, and found the batch size returned from the model had been cut in half.
When using `Trainer` with 2 GPUs and a batch size of 256, `Dataset` returns a batch of size 512 (256 per GPU), while `IterableDataset` returns a batch size of 256 (256 total). My guess is `IterableDataset` isn't accounting for multiple cards.
### Steps to reproduce the bug
```python
import datasets
from datasets import IterableDataset
from transformers import RobertaConfig
from transformers import RobertaTokenizerFast
from transformers import RobertaForMaskedLM
from transformers import DataCollatorForLanguageModeling
from transformers import Trainer, TrainingArguments
use_iterable_dataset = True
def gen_from_shards(shards):
for shard in shards:
for example in shard:
yield example
dataset = datasets.load_from_disk('my_dataset.hf')
if use_iterable_dataset:
n_shards = 100
shards = [dataset.shard(num_shards=n_shards, index=i) for i in range(n_shards)]
dataset = IterableDataset.from_generator(gen_from_shards, gen_kwargs={"shards": shards})
tokenizer = RobertaTokenizerFast.from_pretrained("./my_tokenizer", max_len=160, use_fast=True)
config = RobertaConfig(
vocab_size=8248,
max_position_embeddings=256,
num_attention_heads=8,
num_hidden_layers=6,
type_vocab_size=1)
model = RobertaForMaskedLM(config=config)
data_collator = DataCollatorForLanguageModeling(tokenizer=tokenizer, mlm=True, mlm_probability=0.15)
training_args = TrainingArguments(
per_device_train_batch_size=256
# other args removed for brevity
)
trainer = Trainer(
model=model,
args=training_args,
data_collator=data_collator,
train_dataset=dataset,
)
trainer.train()
```
### Expected behavior
Expected `Dataset` and `IterableDataset` to have the same batch size behavior. If the current behavior is intentional, the batch size printout at the start of training should be updated. Currently, both dataset classes result in `Trainer` printing the same total batch size, even though the batch size sent to the GPUs are different.
### Environment info
datasets 2.7.1
transformers 4.25.1 | 61 | IterableDataset and Dataset return different batch sizes when using Trainer with multiple GPUs
### Describe the bug
I am training a Roberta model using 2 GPUs and the `Trainer` API with a batch size of 256.
Initially I used a standard `Dataset`, but had issues with slow data loading. After reading [this issue](https://github.com/huggingface/datasets/issues/2252), I swapped to loading my dataset as contiguous shards and passing those to an `IterableDataset`. I observed an unexpected drop in GPU memory utilization, and found the batch size returned from the model had been cut in half.
When using `Trainer` with 2 GPUs and a batch size of 256, `Dataset` returns a batch of size 512 (256 per GPU), while `IterableDataset` returns a batch size of 256 (256 total). My guess is `IterableDataset` isn't accounting for multiple cards.
### Steps to reproduce the bug
```python
import datasets
from datasets import IterableDataset
from transformers import RobertaConfig
from transformers import RobertaTokenizerFast
from transformers import RobertaForMaskedLM
from transformers import DataCollatorForLanguageModeling
from transformers import Trainer, TrainingArguments
use_iterable_dataset = True
def gen_from_shards(shards):
for shard in shards:
for example in shard:
yield example
dataset = datasets.load_from_disk('my_dataset.hf')
if use_iterable_dataset:
n_shards = 100
shards = [dataset.shard(num_shards=n_shards, index=i) for i in range(n_shards)]
dataset = IterableDataset.from_generator(gen_from_shards, gen_kwargs={"shards": shards})
tokenizer = RobertaTokenizerFast.from_pretrained("./my_tokenizer", max_len=160, use_fast=True)
config = RobertaConfig(
vocab_size=8248,
max_position_embeddings=256,
num_attention_heads=8,
num_hidden_layers=6,
type_vocab_size=1)
model = RobertaForMaskedLM(config=config)
data_collator = DataCollatorForLanguageModeling(tokenizer=tokenizer, mlm=True, mlm_probability=0.15)
training_args = TrainingArguments(
per_device_train_batch_size=256
# other args removed for brevity
)
trainer = Trainer(
model=model,
args=training_args,
data_collator=data_collator,
train_dataset=dataset,
)
trainer.train()
```
### Expected behavior
Expected `Dataset` and `IterableDataset` to have the same batch size behavior. If the current behavior is intentional, the batch size printout at the start of training should be updated. Currently, both dataset classes result in `Trainer` printing the same total batch size, even though the batch size sent to the GPUs are different.
### Environment info
datasets 2.7.1
transformers 4.25.1
Hi ! `datasets` doesn't do batching - the PyTorch DataLoader does and is created by the `Trainer`. Do you pass other arguments to training_args with respect to data loading ?
Also we recently released `.to_iterable_dataset` that does pretty much what you implemented, but using contiguous shards to get a better speed:
```python
if use_iterable_dataset:
num_shards = 100
dataset = dataset.to_iterable_dataset(num_shards=num_shards)
``` | [
-0.35720178484916687,
-0.1617143303155899,
-0.023187974467873573,
0.5625223517417908,
0.11427915096282959,
-0.0774904265999794,
0.3926452100276947,
0.4203515648841858,
-0.26587170362472534,
0.0382477268576622,
-0.030516652390360832,
0.03927403688430786,
-0.0694391131401062,
-0.18142354488372803,
0.0028640199452638626,
-0.042919665575027466,
0.11719058454036713,
-0.11124889552593231,
-0.12337689101696014,
-0.024346519261598587,
0.09590582549571991,
0.30203133821487427,
-0.08750700950622559,
-0.14051106572151184,
-0.49670010805130005,
0.1560959815979004,
-0.09354525804519653,
-0.029137879610061646,
0.13209787011146545,
-0.4260868430137634,
0.5181823968887329,
0.029809989035129547,
0.2605650722980499,
0.5086588859558105,
-0.00013049173867329955,
0.08863438665866852,
-0.12242898344993591,
-0.07355847209692001,
-0.05650714784860611,
0.30469459295272827,
0.19623225927352905,
-0.014202245511114597,
-0.05306411534547806,
-0.0894279032945633,
-0.230049729347229,
-0.19439318776130676,
-0.12085390090942383,
-0.30437424778938293,
0.026730217039585114,
0.05096898227930069,
0.038942355662584305,
0.26820531487464905,
-0.27527400851249695,
-0.19427432119846344,
0.026567157357931137,
0.07071744650602341,
-0.08038085699081421,
0.05458966642618179,
0.24467560648918152,
-0.24297767877578735,
-0.17003479599952698,
0.3691825866699219,
-0.025409121066331863,
0.2004147469997406,
-0.11691129952669144,
0.16041110455989838,
0.19886678457260132,
0.052018776535987854,
0.29393672943115234,
0.03517577424645424,
-0.032932132482528687,
-0.2106325924396515,
-0.17755116522312164,
-0.6819287538528442,
0.07393822818994522,
-0.28898125886917114,
0.06840639561414719,
0.11390415579080582,
-0.0973527580499649,
-0.051822129637002945,
-0.39852628111839294,
0.3188069462776184,
-0.0944196805357933,
-0.18839310109615326,
-0.032805800437927246,
0.3040376603603363,
0.1441192626953125,
0.37904632091522217,
0.15313120186328888,
-0.0329914316534996,
0.15530268847942352,
0.024491334334015846,
-0.13647668063640594,
-0.010814297012984753,
-0.4817275404930115,
0.016434386372566223,
0.2414737045764923,
-0.20778316259384155,
0.43044182658195496,
0.19510164856910706,
0.12628747522830963,
0.03791854903101921,
0.16657349467277527,
-0.32027825713157654,
0.3846334218978882,
0.14518389105796814,
-0.2796619236469269,
0.2543749511241913,
-0.0909794420003891,
0.1796896606683731,
-0.24850721657276154,
-0.08199331164360046,
-0.02034405618906021,
-0.049250755459070206,
0.05398787185549736,
-0.18906831741333008,
0.00520002655684948,
-0.02302372455596924,
-0.350502073764801,
-0.2100820094347,
-0.355171263217926,
-0.1282726675271988,
0.18507997691631317,
0.1256355345249176,
-0.11598961800336838,
0.21758010983467102,
-0.4266551733016968,
0.22117112576961517,
-0.16303053498268127,
-0.35729414224624634,
-0.20396269857883453,
-0.3754838705062866,
-0.26815763115882874,
0.1694190949201584,
0.20275187492370605,
-0.27241596579551697,
0.1860477775335312,
-0.0025149378925561905,
0.1578548103570938,
-0.2032584846019745,
0.07669704407453537,
-0.618906557559967,
0.5084382891654968,
0.16378571093082428,
0.21039289236068726,
0.29045942425727844,
0.06994102150201797,
-0.19505728781223297,
-0.04530620574951172,
0.26602399349212646,
-0.23043739795684814,
-0.28279879689216614,
0.12957215309143066,
-0.003373539075255394,
0.1492244005203247,
-0.15316054224967957,
-0.4515351951122284,
0.46208760142326355,
0.5097902417182922,
-0.13534462451934814,
-0.05629950016736984,
-0.4615370035171509,
-0.27767032384872437,
-0.21207295358181,
0.3054615259170532,
0.3445625603199005,
-0.22793793678283691,
-0.14653098583221436,
0.136402890086174,
-0.0614803247153759,
0.2848772406578064,
0.9374628067016602,
-0.2527640759944916,
0.3344199061393738,
-0.3524169623851776,
0.1768670529127121,
-0.18965336680412292,
-0.21663595736026764,
-0.672055184841156,
0.17244069278240204,
0.0490543395280838,
0.35024240612983704,
0.2941821813583374,
-0.06488776952028275,
0.289191335439682,
-0.09101321548223495,
0.31479963660240173,
0.31781721115112305,
-0.35781052708625793,
0.18903033435344696,
-0.10048159956932068,
-0.220501109957695,
0.16559264063835144,
0.1391592174768448,
0.4106932282447815,
-0.10219136625528336,
-0.14092698693275452,
-0.05060857906937599,
0.8445092439651489,
-0.2231059968471527,
0.15687893331050873,
-0.05725754052400589,
0.15542899072170258,
-0.1363242268562317,
0.0641484335064888,
0.028678186237812042,
-0.28256702423095703,
0.22827249765396118,
-0.39151638746261597,
-0.2070484161376953,
0.28528741002082825,
-0.07049363106489182,
0.15594226121902466,
0.0054816752672195435,
-0.17081443965435028,
-0.19225354492664337,
-0.01725294254720211,
0.275492399930954,
0.1141359955072403,
-0.18768393993377686,
-0.04302509129047394,
0.2030957192182541,
-0.26055285334587097,
0.01234323251992464,
0.022852730005979538,
0.04529348015785217,
0.25680068135261536,
-0.4135797619819641,
-0.0236628670245409,
0.27466392517089844,
0.09352646768093109,
-0.23723796010017395,
0.0020502768456935883,
0.18742001056671143,
0.06461524963378906,
-0.16452454030513763,
0.08104699105024338,
0.2958560585975647,
0.1967383623123169,
0.20974108576774597,
0.02416957914829254,
0.020675355568528175,
-0.011052832007408142,
-0.24350884556770325,
-0.015437617897987366,
0.332228422164917,
0.10781942307949066,
0.35399192571640015,
0.05424056947231293,
-0.12928229570388794,
0.17644013464450836,
0.13858164846897125,
-0.06401470303535461,
-0.09449402242898941,
-0.10246488451957703,
0.22191861271858215,
0.12102815508842468,
-0.04543840140104294,
-0.23553816974163055,
0.2635766267776489,
0.3906143307685852,
0.16015583276748657,
-0.1564396321773529,
-0.04035145044326782,
-0.3821651041507721,
-0.2544170618057251,
-0.07301121950149536,
0.08449731767177582,
0.7144879698753357,
0.05667731910943985,
0.2414155751466751,
-0.14549678564071655,
-0.03704164922237396,
-0.1760530173778534,
0.13047339022159576,
0.28036874532699585,
0.0012814328074455261,
0.19722440838813782,
0.1484793722629547,
-0.15174858272075653,
-0.18178895115852356,
-0.2590615153312683,
0.08916317671537399,
0.02669287659227848,
-0.11485603451728821,
0.19794076681137085,
-0.1294131875038147,
-0.045641373842954636,
-0.39608195424079895,
-0.30930349230766296,
-0.0032013878226280212,
-0.09931609034538269,
-0.1567525565624237,
0.3067472279071808,
0.09780345857143402,
0.04425036907196045,
0.08206555247306824,
0.3947477638721466,
-0.042388901114463806,
-0.000050727277994155884,
0.19643253087997437,
0.03799770772457123,
-0.40303635597229004,
-0.020192354917526245,
0.34737974405288696,
-0.659740149974823,
0.2282770276069641,
0.03118150122463703,
-0.0502341091632843,
-0.28941068053245544,
-0.08887869119644165,
0.15268771350383759,
-0.052038416266441345,
0.04044631868600845,
-0.11091010272502899,
-0.13614211976528168,
0.09057064354419708,
0.05972277373075485,
0.19970762729644775,
-0.0842851847410202,
0.1508355736732483,
-0.20598246157169342,
-0.376993328332901,
-0.19901850819587708,
0.24363166093826294,
0.08251231163740158,
-0.049616001546382904,
0.11258265376091003,
-0.00970892608165741,
0.23741696774959564,
0.003025289624929428,
0.29494258761405945,
0.20780819654464722,
0.14116619527339935,
-0.22556619346141815,
-0.2993522584438324,
-0.08944706618785858,
-0.3454711437225342,
0.007586587220430374,
-0.12940816581249237,
-0.26842397451400757,
-0.08210523426532745,
0.05993333458900452,
0.4456779360771179,
0.255237877368927,
-0.39098548889160156,
0.3753829300403595,
-0.123487189412117,
-0.027197493240237236,
0.007224045693874359,
-0.10448954999446869,
0.22737251222133636,
-0.054121796041727066,
0.04939189553260803,
0.029458031058311462,
-0.31423795223236084,
0.021310724318027496,
0.053473521023988724,
0.16231834888458252,
-0.12820276618003845,
0.023677099496126175,
0.30364516377449036,
0.8561155796051025,
0.6230773329734802,
-0.08955934643745422,
0.13156582415103912,
-0.21468186378479004,
-0.06586092710494995,
-0.21216997504234314,
-0.08548644185066223,
0.35207998752593994,
-0.25796470046043396,
-0.14901095628738403,
0.40249204635620117,
-0.21435943245887756,
-0.23808999359607697,
0.2466754913330078,
0.17007417976856232,
0.10902302712202072,
-0.34419798851013184,
0.4963151216506958,
0.025854498147964478,
0.1985015869140625,
0.10701219737529755,
0.11897449940443039,
-0.1729968786239624,
-0.06467754393815994,
-0.03822799772024155,
-0.13191017508506775,
-0.011400841176509857,
0.00012176275777164847,
-0.5115853548049927,
-0.3954834043979645,
-0.3241017758846283,
0.2890326976776123,
-0.02401650883257389,
0.36150577664375305,
0.0736832320690155,
-0.17823800444602966,
0.18355689942836761,
0.13346804678440094,
0.5844619870185852,
0.3506886959075928,
-0.2878977060317993,
0.03095770999789238,
-0.43866169452667236,
-0.2034391462802887,
-0.39180007576942444,
-0.25094854831695557,
0.15620194375514984,
0.016862597316503525,
0.2859821617603302,
-0.10604777932167053,
-0.29901009798049927,
0.3278062045574188,
-0.02540481463074684,
-0.13232533633708954,
0.18650726974010468,
-0.22763299942016602,
-0.05624029412865639,
-0.011003326624631882,
0.3674216568470001,
0.13268376886844635,
0.3736768960952759,
-0.26850277185440063,
-0.07786007970571518,
-0.38550615310668945,
-0.08190838992595673,
0.08651003986597061,
0.3545073866844177,
0.4836238622665405,
-0.042849209159612656,
0.2783176302909851,
0.37668901681900024,
0.12807434797286987,
0.3984660506248474,
0.19321638345718384,
0.18387527763843536,
-0.06897188723087311,
0.2182551622390747,
-0.025131117552518845,
0.3152579367160797,
0.501476526260376,
-0.16844569146633148,
0.07360690087080002,
0.2168988138437271,
0.2666212320327759,
-0.2759934365749359,
-0.03943187743425369,
0.3592265546321869,
-0.054523125290870667,
-0.49472689628601074,
-0.6190714240074158,
0.28342506289482117,
0.3151460886001587,
0.05431114137172699,
0.333686500787735,
0.1124017983675003,
-0.16021984815597534,
0.35769253969192505,
0.14251787960529327,
0.6714081764221191,
-0.05596163868904114,
0.39695701003074646,
0.30903932452201843,
0.0507730171084404,
-0.11356499791145325,
-0.14312702417373657,
0.5147721171379089,
-0.29023629426956177,
-0.09026224911212921,
0.03657540678977966,
-0.056723423302173615,
0.06669580936431885,
0.2157544493675232,
0.14513957500457764,
0.26649630069732666,
0.15650269389152527,
0.24734282493591309,
-0.19609519839286804,
-0.1468578279018402,
0.08937651664018631,
-0.3525870144367218,
-0.3101955056190491,
-0.03277529031038284,
-0.03116493672132492,
0.001001998782157898,
0.0014568502083420753,
-0.057452596724033356,
-0.030158324167132378,
0.0008243508636951447,
-0.3006128668785095,
-0.1155017539858818,
-0.5063133835792542,
0.0811278373003006,
0.1190820187330246,
-0.3948945999145508,
-0.05063587427139282,
0.2762005925178528,
0.1709635853767395,
-0.2230115383863449,
-0.15602456033229828,
0.1190725713968277,
-0.28045299649238586,
0.15996196866035461,
0.0405869260430336,
-0.39598706364631653,
0.12182285636663437,
0.14818942546844482,
-0.13686878979206085,
-0.01730700582265854,
0.093666210770607,
-0.060260698199272156,
-0.3399234712123871,
0.29327818751335144,
0.24118098616600037,
-0.2510788142681122,
-0.021432220935821533,
0.09706069529056549,
0.012788623571395874,
-0.1303669959306717,
-0.04201630502939224,
0.12016722559928894,
-0.047513362020254135,
0.5425683259963989,
-0.049785222858190536,
-0.34814485907554626,
-0.04830006882548332,
0.42215612530708313,
0.11213167756795883,
-0.20422089099884033,
0.5482888221740723,
-0.02552032098174095,
0.17915208637714386,
0.02933128923177719,
-0.0750548243522644,
0.3758014440536499,
-0.48180657625198364,
0.0830274373292923,
-0.3473280966281891,
0.2187414914369583,
0.12453298270702362,
0.025148659944534302,
0.08686657249927521,
-0.14928826689720154,
-0.2740706503391266,
-0.055844277143478394,
-0.3374427258968353,
0.01342163234949112,
-0.13213719427585602,
0.1313263177871704,
0.08251184970140457,
0.04243750125169754,
0.14353489875793457,
0.0705813616514206,
-0.10753794759511948,
-0.08244623243808746,
0.0015276800841093063,
0.007839376106858253,
-0.1793321669101715,
0.011731110513210297,
0.29224926233291626,
0.15855711698532104,
-0.08842826634645462,
0.22233916819095612,
0.08504492789506912,
-0.07877375930547714,
-0.22710071504116058,
0.13722506165504456,
0.1875874102115631,
-0.009525503031909466,
-0.05358542501926422,
-0.039933010935783386,
-0.17615951597690582,
-0.3644826412200928,
0.6090848445892334,
0.06557381898164749,
0.296793669462204,
-0.05713173374533653,
0.3627661466598511,
-0.18137681484222412,
-0.2428813874721527,
0.13904282450675964,
0.13635313510894775,
-0.13239149749279022,
0.32016927003860474,
0.16000518202781677,
0.008852762170135975,
-0.15346896648406982,
-0.06655340641736984,
0.11970773339271545,
0.5063158869743347,
0.22328874468803406,
-0.13645899295806885,
-0.28243452310562134,
-0.06643125414848328,
0.25156769156455994,
0.205007404088974,
0.3826693892478943,
-0.10400544106960297,
-0.22975338995456696,
-0.03424019739031792,
0.023740366101264954,
0.0480429083108902,
-0.18469549715518951,
0.013306347653269768,
-0.04110066220164299,
-0.08501134067773819,
0.49420928955078125,
0.23830094933509827,
0.1959669291973114,
-0.09986032545566559,
0.06901977211236954,
0.3266393542289734,
-0.3949275016784668,
0.057704512029886246,
0.17005746066570282,
0.1351684182882309,
0.11591558158397675,
0.10088271647691727,
-0.04923234507441521,
0.20978179574012756,
0.867747962474823,
0.0023780688643455505,
0.6582726240158081,
0.09748391807079315,
-0.2004915177822113,
0.09180179238319397,
-0.38326242566108704,
-0.5499930381774902,
0.29240018129348755,
-0.19049376249313354,
0.11853490024805069,
-0.13483314216136932,
0.3257465064525604,
-0.06473053991794586,
-0.28933244943618774,
-0.15826565027236938,
-0.22373606264591217,
-0.25566425919532776,
-0.2622195780277252,
-0.15281447768211365,
-0.05751332640647888,
-0.15855956077575684,
0.09042787551879883,
-0.16272437572479248,
-0.014530085027217865,
0.26411953568458557,
-0.02586715668439865,
-0.30154961347579956,
-0.3076474964618683,
-0.4871551990509033,
0.4129580855369568,
-0.02812797576189041,
-0.285539835691452,
0.14789696037769318,
0.17870481312274933,
-0.23567533493041992,
-0.022342462092638016,
0.2800773084163666,
0.5759568214416504,
0.1588985025882721,
0.0843992680311203,
-0.0780314952135086,
0.0536169670522213,
0.07267539948225021,
-0.2610965371131897,
0.10098657011985779,
0.10051281750202179,
-0.10146208107471466,
0.031125761568546295,
0.010621340945363045,
0.0413922443985939,
0.05993212014436722,
0.15360619127750397,
0.166110560297966,
-0.516396164894104,
0.26667842268943787,
-0.45091310143470764,
-0.10367685556411743,
-0.10571391880512238,
0.09398217499256134,
-0.07536344975233078,
0.06015772745013237,
0.5435569286346436,
-0.10296755284070969,
0.22493129968643188,
-0.08931700885295868,
-0.03696660324931145,
0.14523907005786896,
0.4774525761604309,
-0.10345323383808136,
-0.3305529057979584,
-0.4981316328048706,
-0.09699796885251999,
-0.250224232673645,
-0.06865508109331131,
-0.15520188212394714,
0.4265858232975006,
-0.0736573114991188,
0.6447681188583374,
-0.14831289649009705,
-0.16817690432071686,
0.568416178226471,
-0.3629189431667328,
0.40801841020584106,
0.5341712236404419,
-0.17238233983516693,
-0.02310514822602272,
-0.4512055516242981,
-0.03357234597206116,
0.15971782803535461,
-0.2995702028274536,
0.3254222571849823,
-0.01085568219423294,
-0.1836698353290558,
-0.2734447717666626,
-0.11354396492242813,
0.3629373013973236,
0.09771610796451569,
0.26930147409439087,
0.14215831458568573,
0.2811041474342346,
0.21068745851516724,
-0.16560646891593933,
-0.676226019859314,
0.16458864510059357,
-0.29618802666664124,
0.2593883275985718,
-0.005512505769729614,
0.36034491658210754,
-0.35746997594833374,
0.014495939016342163,
-0.09856396168470383,
-0.004681375343352556,
0.299612820148468,
-0.12234846502542496,
-0.21793505549430847,
0.20769727230072021,
0.05830616503953934,
0.21142305433750153,
0.2213965207338333,
0.45943090319633484,
0.06311433017253876,
0.06052577495574951,
-0.34418821334838867,
-0.1315685212612152,
0.35724788904190063,
-0.3906891644001007,
-0.33271366357803345,
-0.22496654093265533,
0.21636968851089478,
-0.1256616711616516,
-0.08406250923871994,
-0.4014934003353119,
-0.08236018568277359,
0.26035743951797485,
-0.04580423980951309,
-0.16614364087581635,
0.19992882013320923,
0.3680184483528137,
-0.00307532399892807,
-0.09139788895845413,
0.31496909260749817,
0.10783322900533676,
-0.3990747034549713,
0.25799092650413513,
-0.3066197633743286
] |
https://github.com/huggingface/datasets/issues/5506 | IterableDataset and Dataset return different batch sizes when using Trainer with multiple GPUs | This is the full set of training args passed. No training args were changed when switching dataset types.
```python
training_args = TrainingArguments(
output_dir="./checkpoints",
overwrite_output_dir=True,
num_train_epochs=1,
per_device_train_batch_size=256,
save_steps=2000,
save_total_limit=4,
prediction_loss_only=True,
report_to='none',
gradient_accumulation_steps=6,
fp16=True,
max_steps=60000,
lr_scheduler_type='linear',
warmup_ratio=0.1,
logging_steps=100,
weight_decay=0.01,
adam_beta1=0.9,
adam_beta2=0.98,
adam_epsilon=1e-6,
learning_rate=1e-4
)
``` | ### Describe the bug
I am training a Roberta model using 2 GPUs and the `Trainer` API with a batch size of 256.
Initially I used a standard `Dataset`, but had issues with slow data loading. After reading [this issue](https://github.com/huggingface/datasets/issues/2252), I swapped to loading my dataset as contiguous shards and passing those to an `IterableDataset`. I observed an unexpected drop in GPU memory utilization, and found the batch size returned from the model had been cut in half.
When using `Trainer` with 2 GPUs and a batch size of 256, `Dataset` returns a batch of size 512 (256 per GPU), while `IterableDataset` returns a batch size of 256 (256 total). My guess is `IterableDataset` isn't accounting for multiple cards.
### Steps to reproduce the bug
```python
import datasets
from datasets import IterableDataset
from transformers import RobertaConfig
from transformers import RobertaTokenizerFast
from transformers import RobertaForMaskedLM
from transformers import DataCollatorForLanguageModeling
from transformers import Trainer, TrainingArguments
use_iterable_dataset = True
def gen_from_shards(shards):
for shard in shards:
for example in shard:
yield example
dataset = datasets.load_from_disk('my_dataset.hf')
if use_iterable_dataset:
n_shards = 100
shards = [dataset.shard(num_shards=n_shards, index=i) for i in range(n_shards)]
dataset = IterableDataset.from_generator(gen_from_shards, gen_kwargs={"shards": shards})
tokenizer = RobertaTokenizerFast.from_pretrained("./my_tokenizer", max_len=160, use_fast=True)
config = RobertaConfig(
vocab_size=8248,
max_position_embeddings=256,
num_attention_heads=8,
num_hidden_layers=6,
type_vocab_size=1)
model = RobertaForMaskedLM(config=config)
data_collator = DataCollatorForLanguageModeling(tokenizer=tokenizer, mlm=True, mlm_probability=0.15)
training_args = TrainingArguments(
per_device_train_batch_size=256
# other args removed for brevity
)
trainer = Trainer(
model=model,
args=training_args,
data_collator=data_collator,
train_dataset=dataset,
)
trainer.train()
```
### Expected behavior
Expected `Dataset` and `IterableDataset` to have the same batch size behavior. If the current behavior is intentional, the batch size printout at the start of training should be updated. Currently, both dataset classes result in `Trainer` printing the same total batch size, even though the batch size sent to the GPUs are different.
### Environment info
datasets 2.7.1
transformers 4.25.1 | 43 | IterableDataset and Dataset return different batch sizes when using Trainer with multiple GPUs
### Describe the bug
I am training a Roberta model using 2 GPUs and the `Trainer` API with a batch size of 256.
Initially I used a standard `Dataset`, but had issues with slow data loading. After reading [this issue](https://github.com/huggingface/datasets/issues/2252), I swapped to loading my dataset as contiguous shards and passing those to an `IterableDataset`. I observed an unexpected drop in GPU memory utilization, and found the batch size returned from the model had been cut in half.
When using `Trainer` with 2 GPUs and a batch size of 256, `Dataset` returns a batch of size 512 (256 per GPU), while `IterableDataset` returns a batch size of 256 (256 total). My guess is `IterableDataset` isn't accounting for multiple cards.
### Steps to reproduce the bug
```python
import datasets
from datasets import IterableDataset
from transformers import RobertaConfig
from transformers import RobertaTokenizerFast
from transformers import RobertaForMaskedLM
from transformers import DataCollatorForLanguageModeling
from transformers import Trainer, TrainingArguments
use_iterable_dataset = True
def gen_from_shards(shards):
for shard in shards:
for example in shard:
yield example
dataset = datasets.load_from_disk('my_dataset.hf')
if use_iterable_dataset:
n_shards = 100
shards = [dataset.shard(num_shards=n_shards, index=i) for i in range(n_shards)]
dataset = IterableDataset.from_generator(gen_from_shards, gen_kwargs={"shards": shards})
tokenizer = RobertaTokenizerFast.from_pretrained("./my_tokenizer", max_len=160, use_fast=True)
config = RobertaConfig(
vocab_size=8248,
max_position_embeddings=256,
num_attention_heads=8,
num_hidden_layers=6,
type_vocab_size=1)
model = RobertaForMaskedLM(config=config)
data_collator = DataCollatorForLanguageModeling(tokenizer=tokenizer, mlm=True, mlm_probability=0.15)
training_args = TrainingArguments(
per_device_train_batch_size=256
# other args removed for brevity
)
trainer = Trainer(
model=model,
args=training_args,
data_collator=data_collator,
train_dataset=dataset,
)
trainer.train()
```
### Expected behavior
Expected `Dataset` and `IterableDataset` to have the same batch size behavior. If the current behavior is intentional, the batch size printout at the start of training should be updated. Currently, both dataset classes result in `Trainer` printing the same total batch size, even though the batch size sent to the GPUs are different.
### Environment info
datasets 2.7.1
transformers 4.25.1
This is the full set of training args passed. No training args were changed when switching dataset types.
```python
training_args = TrainingArguments(
output_dir="./checkpoints",
overwrite_output_dir=True,
num_train_epochs=1,
per_device_train_batch_size=256,
save_steps=2000,
save_total_limit=4,
prediction_loss_only=True,
report_to='none',
gradient_accumulation_steps=6,
fp16=True,
max_steps=60000,
lr_scheduler_type='linear',
warmup_ratio=0.1,
logging_steps=100,
weight_decay=0.01,
adam_beta1=0.9,
adam_beta2=0.98,
adam_epsilon=1e-6,
learning_rate=1e-4
)
``` | [
-0.35720178484916687,
-0.1617143303155899,
-0.023187974467873573,
0.5625223517417908,
0.11427915096282959,
-0.0774904265999794,
0.3926452100276947,
0.4203515648841858,
-0.26587170362472534,
0.0382477268576622,
-0.030516652390360832,
0.03927403688430786,
-0.0694391131401062,
-0.18142354488372803,
0.0028640199452638626,
-0.042919665575027466,
0.11719058454036713,
-0.11124889552593231,
-0.12337689101696014,
-0.024346519261598587,
0.09590582549571991,
0.30203133821487427,
-0.08750700950622559,
-0.14051106572151184,
-0.49670010805130005,
0.1560959815979004,
-0.09354525804519653,
-0.029137879610061646,
0.13209787011146545,
-0.4260868430137634,
0.5181823968887329,
0.029809989035129547,
0.2605650722980499,
0.5086588859558105,
-0.00013049173867329955,
0.08863438665866852,
-0.12242898344993591,
-0.07355847209692001,
-0.05650714784860611,
0.30469459295272827,
0.19623225927352905,
-0.014202245511114597,
-0.05306411534547806,
-0.0894279032945633,
-0.230049729347229,
-0.19439318776130676,
-0.12085390090942383,
-0.30437424778938293,
0.026730217039585114,
0.05096898227930069,
0.038942355662584305,
0.26820531487464905,
-0.27527400851249695,
-0.19427432119846344,
0.026567157357931137,
0.07071744650602341,
-0.08038085699081421,
0.05458966642618179,
0.24467560648918152,
-0.24297767877578735,
-0.17003479599952698,
0.3691825866699219,
-0.025409121066331863,
0.2004147469997406,
-0.11691129952669144,
0.16041110455989838,
0.19886678457260132,
0.052018776535987854,
0.29393672943115234,
0.03517577424645424,
-0.032932132482528687,
-0.2106325924396515,
-0.17755116522312164,
-0.6819287538528442,
0.07393822818994522,
-0.28898125886917114,
0.06840639561414719,
0.11390415579080582,
-0.0973527580499649,
-0.051822129637002945,
-0.39852628111839294,
0.3188069462776184,
-0.0944196805357933,
-0.18839310109615326,
-0.032805800437927246,
0.3040376603603363,
0.1441192626953125,
0.37904632091522217,
0.15313120186328888,
-0.0329914316534996,
0.15530268847942352,
0.024491334334015846,
-0.13647668063640594,
-0.010814297012984753,
-0.4817275404930115,
0.016434386372566223,
0.2414737045764923,
-0.20778316259384155,
0.43044182658195496,
0.19510164856910706,
0.12628747522830963,
0.03791854903101921,
0.16657349467277527,
-0.32027825713157654,
0.3846334218978882,
0.14518389105796814,
-0.2796619236469269,
0.2543749511241913,
-0.0909794420003891,
0.1796896606683731,
-0.24850721657276154,
-0.08199331164360046,
-0.02034405618906021,
-0.049250755459070206,
0.05398787185549736,
-0.18906831741333008,
0.00520002655684948,
-0.02302372455596924,
-0.350502073764801,
-0.2100820094347,
-0.355171263217926,
-0.1282726675271988,
0.18507997691631317,
0.1256355345249176,
-0.11598961800336838,
0.21758010983467102,
-0.4266551733016968,
0.22117112576961517,
-0.16303053498268127,
-0.35729414224624634,
-0.20396269857883453,
-0.3754838705062866,
-0.26815763115882874,
0.1694190949201584,
0.20275187492370605,
-0.27241596579551697,
0.1860477775335312,
-0.0025149378925561905,
0.1578548103570938,
-0.2032584846019745,
0.07669704407453537,
-0.618906557559967,
0.5084382891654968,
0.16378571093082428,
0.21039289236068726,
0.29045942425727844,
0.06994102150201797,
-0.19505728781223297,
-0.04530620574951172,
0.26602399349212646,
-0.23043739795684814,
-0.28279879689216614,
0.12957215309143066,
-0.003373539075255394,
0.1492244005203247,
-0.15316054224967957,
-0.4515351951122284,
0.46208760142326355,
0.5097902417182922,
-0.13534462451934814,
-0.05629950016736984,
-0.4615370035171509,
-0.27767032384872437,
-0.21207295358181,
0.3054615259170532,
0.3445625603199005,
-0.22793793678283691,
-0.14653098583221436,
0.136402890086174,
-0.0614803247153759,
0.2848772406578064,
0.9374628067016602,
-0.2527640759944916,
0.3344199061393738,
-0.3524169623851776,
0.1768670529127121,
-0.18965336680412292,
-0.21663595736026764,
-0.672055184841156,
0.17244069278240204,
0.0490543395280838,
0.35024240612983704,
0.2941821813583374,
-0.06488776952028275,
0.289191335439682,
-0.09101321548223495,
0.31479963660240173,
0.31781721115112305,
-0.35781052708625793,
0.18903033435344696,
-0.10048159956932068,
-0.220501109957695,
0.16559264063835144,
0.1391592174768448,
0.4106932282447815,
-0.10219136625528336,
-0.14092698693275452,
-0.05060857906937599,
0.8445092439651489,
-0.2231059968471527,
0.15687893331050873,
-0.05725754052400589,
0.15542899072170258,
-0.1363242268562317,
0.0641484335064888,
0.028678186237812042,
-0.28256702423095703,
0.22827249765396118,
-0.39151638746261597,
-0.2070484161376953,
0.28528741002082825,
-0.07049363106489182,
0.15594226121902466,
0.0054816752672195435,
-0.17081443965435028,
-0.19225354492664337,
-0.01725294254720211,
0.275492399930954,
0.1141359955072403,
-0.18768393993377686,
-0.04302509129047394,
0.2030957192182541,
-0.26055285334587097,
0.01234323251992464,
0.022852730005979538,
0.04529348015785217,
0.25680068135261536,
-0.4135797619819641,
-0.0236628670245409,
0.27466392517089844,
0.09352646768093109,
-0.23723796010017395,
0.0020502768456935883,
0.18742001056671143,
0.06461524963378906,
-0.16452454030513763,
0.08104699105024338,
0.2958560585975647,
0.1967383623123169,
0.20974108576774597,
0.02416957914829254,
0.020675355568528175,
-0.011052832007408142,
-0.24350884556770325,
-0.015437617897987366,
0.332228422164917,
0.10781942307949066,
0.35399192571640015,
0.05424056947231293,
-0.12928229570388794,
0.17644013464450836,
0.13858164846897125,
-0.06401470303535461,
-0.09449402242898941,
-0.10246488451957703,
0.22191861271858215,
0.12102815508842468,
-0.04543840140104294,
-0.23553816974163055,
0.2635766267776489,
0.3906143307685852,
0.16015583276748657,
-0.1564396321773529,
-0.04035145044326782,
-0.3821651041507721,
-0.2544170618057251,
-0.07301121950149536,
0.08449731767177582,
0.7144879698753357,
0.05667731910943985,
0.2414155751466751,
-0.14549678564071655,
-0.03704164922237396,
-0.1760530173778534,
0.13047339022159576,
0.28036874532699585,
0.0012814328074455261,
0.19722440838813782,
0.1484793722629547,
-0.15174858272075653,
-0.18178895115852356,
-0.2590615153312683,
0.08916317671537399,
0.02669287659227848,
-0.11485603451728821,
0.19794076681137085,
-0.1294131875038147,
-0.045641373842954636,
-0.39608195424079895,
-0.30930349230766296,
-0.0032013878226280212,
-0.09931609034538269,
-0.1567525565624237,
0.3067472279071808,
0.09780345857143402,
0.04425036907196045,
0.08206555247306824,
0.3947477638721466,
-0.042388901114463806,
-0.000050727277994155884,
0.19643253087997437,
0.03799770772457123,
-0.40303635597229004,
-0.020192354917526245,
0.34737974405288696,
-0.659740149974823,
0.2282770276069641,
0.03118150122463703,
-0.0502341091632843,
-0.28941068053245544,
-0.08887869119644165,
0.15268771350383759,
-0.052038416266441345,
0.04044631868600845,
-0.11091010272502899,
-0.13614211976528168,
0.09057064354419708,
0.05972277373075485,
0.19970762729644775,
-0.0842851847410202,
0.1508355736732483,
-0.20598246157169342,
-0.376993328332901,
-0.19901850819587708,
0.24363166093826294,
0.08251231163740158,
-0.049616001546382904,
0.11258265376091003,
-0.00970892608165741,
0.23741696774959564,
0.003025289624929428,
0.29494258761405945,
0.20780819654464722,
0.14116619527339935,
-0.22556619346141815,
-0.2993522584438324,
-0.08944706618785858,
-0.3454711437225342,
0.007586587220430374,
-0.12940816581249237,
-0.26842397451400757,
-0.08210523426532745,
0.05993333458900452,
0.4456779360771179,
0.255237877368927,
-0.39098548889160156,
0.3753829300403595,
-0.123487189412117,
-0.027197493240237236,
0.007224045693874359,
-0.10448954999446869,
0.22737251222133636,
-0.054121796041727066,
0.04939189553260803,
0.029458031058311462,
-0.31423795223236084,
0.021310724318027496,
0.053473521023988724,
0.16231834888458252,
-0.12820276618003845,
0.023677099496126175,
0.30364516377449036,
0.8561155796051025,
0.6230773329734802,
-0.08955934643745422,
0.13156582415103912,
-0.21468186378479004,
-0.06586092710494995,
-0.21216997504234314,
-0.08548644185066223,
0.35207998752593994,
-0.25796470046043396,
-0.14901095628738403,
0.40249204635620117,
-0.21435943245887756,
-0.23808999359607697,
0.2466754913330078,
0.17007417976856232,
0.10902302712202072,
-0.34419798851013184,
0.4963151216506958,
0.025854498147964478,
0.1985015869140625,
0.10701219737529755,
0.11897449940443039,
-0.1729968786239624,
-0.06467754393815994,
-0.03822799772024155,
-0.13191017508506775,
-0.011400841176509857,
0.00012176275777164847,
-0.5115853548049927,
-0.3954834043979645,
-0.3241017758846283,
0.2890326976776123,
-0.02401650883257389,
0.36150577664375305,
0.0736832320690155,
-0.17823800444602966,
0.18355689942836761,
0.13346804678440094,
0.5844619870185852,
0.3506886959075928,
-0.2878977060317993,
0.03095770999789238,
-0.43866169452667236,
-0.2034391462802887,
-0.39180007576942444,
-0.25094854831695557,
0.15620194375514984,
0.016862597316503525,
0.2859821617603302,
-0.10604777932167053,
-0.29901009798049927,
0.3278062045574188,
-0.02540481463074684,
-0.13232533633708954,
0.18650726974010468,
-0.22763299942016602,
-0.05624029412865639,
-0.011003326624631882,
0.3674216568470001,
0.13268376886844635,
0.3736768960952759,
-0.26850277185440063,
-0.07786007970571518,
-0.38550615310668945,
-0.08190838992595673,
0.08651003986597061,
0.3545073866844177,
0.4836238622665405,
-0.042849209159612656,
0.2783176302909851,
0.37668901681900024,
0.12807434797286987,
0.3984660506248474,
0.19321638345718384,
0.18387527763843536,
-0.06897188723087311,
0.2182551622390747,
-0.025131117552518845,
0.3152579367160797,
0.501476526260376,
-0.16844569146633148,
0.07360690087080002,
0.2168988138437271,
0.2666212320327759,
-0.2759934365749359,
-0.03943187743425369,
0.3592265546321869,
-0.054523125290870667,
-0.49472689628601074,
-0.6190714240074158,
0.28342506289482117,
0.3151460886001587,
0.05431114137172699,
0.333686500787735,
0.1124017983675003,
-0.16021984815597534,
0.35769253969192505,
0.14251787960529327,
0.6714081764221191,
-0.05596163868904114,
0.39695701003074646,
0.30903932452201843,
0.0507730171084404,
-0.11356499791145325,
-0.14312702417373657,
0.5147721171379089,
-0.29023629426956177,
-0.09026224911212921,
0.03657540678977966,
-0.056723423302173615,
0.06669580936431885,
0.2157544493675232,
0.14513957500457764,
0.26649630069732666,
0.15650269389152527,
0.24734282493591309,
-0.19609519839286804,
-0.1468578279018402,
0.08937651664018631,
-0.3525870144367218,
-0.3101955056190491,
-0.03277529031038284,
-0.03116493672132492,
0.001001998782157898,
0.0014568502083420753,
-0.057452596724033356,
-0.030158324167132378,
0.0008243508636951447,
-0.3006128668785095,
-0.1155017539858818,
-0.5063133835792542,
0.0811278373003006,
0.1190820187330246,
-0.3948945999145508,
-0.05063587427139282,
0.2762005925178528,
0.1709635853767395,
-0.2230115383863449,
-0.15602456033229828,
0.1190725713968277,
-0.28045299649238586,
0.15996196866035461,
0.0405869260430336,
-0.39598706364631653,
0.12182285636663437,
0.14818942546844482,
-0.13686878979206085,
-0.01730700582265854,
0.093666210770607,
-0.060260698199272156,
-0.3399234712123871,
0.29327818751335144,
0.24118098616600037,
-0.2510788142681122,
-0.021432220935821533,
0.09706069529056549,
0.012788623571395874,
-0.1303669959306717,
-0.04201630502939224,
0.12016722559928894,
-0.047513362020254135,
0.5425683259963989,
-0.049785222858190536,
-0.34814485907554626,
-0.04830006882548332,
0.42215612530708313,
0.11213167756795883,
-0.20422089099884033,
0.5482888221740723,
-0.02552032098174095,
0.17915208637714386,
0.02933128923177719,
-0.0750548243522644,
0.3758014440536499,
-0.48180657625198364,
0.0830274373292923,
-0.3473280966281891,
0.2187414914369583,
0.12453298270702362,
0.025148659944534302,
0.08686657249927521,
-0.14928826689720154,
-0.2740706503391266,
-0.055844277143478394,
-0.3374427258968353,
0.01342163234949112,
-0.13213719427585602,
0.1313263177871704,
0.08251184970140457,
0.04243750125169754,
0.14353489875793457,
0.0705813616514206,
-0.10753794759511948,
-0.08244623243808746,
0.0015276800841093063,
0.007839376106858253,
-0.1793321669101715,
0.011731110513210297,
0.29224926233291626,
0.15855711698532104,
-0.08842826634645462,
0.22233916819095612,
0.08504492789506912,
-0.07877375930547714,
-0.22710071504116058,
0.13722506165504456,
0.1875874102115631,
-0.009525503031909466,
-0.05358542501926422,
-0.039933010935783386,
-0.17615951597690582,
-0.3644826412200928,
0.6090848445892334,
0.06557381898164749,
0.296793669462204,
-0.05713173374533653,
0.3627661466598511,
-0.18137681484222412,
-0.2428813874721527,
0.13904282450675964,
0.13635313510894775,
-0.13239149749279022,
0.32016927003860474,
0.16000518202781677,
0.008852762170135975,
-0.15346896648406982,
-0.06655340641736984,
0.11970773339271545,
0.5063158869743347,
0.22328874468803406,
-0.13645899295806885,
-0.28243452310562134,
-0.06643125414848328,
0.25156769156455994,
0.205007404088974,
0.3826693892478943,
-0.10400544106960297,
-0.22975338995456696,
-0.03424019739031792,
0.023740366101264954,
0.0480429083108902,
-0.18469549715518951,
0.013306347653269768,
-0.04110066220164299,
-0.08501134067773819,
0.49420928955078125,
0.23830094933509827,
0.1959669291973114,
-0.09986032545566559,
0.06901977211236954,
0.3266393542289734,
-0.3949275016784668,
0.057704512029886246,
0.17005746066570282,
0.1351684182882309,
0.11591558158397675,
0.10088271647691727,
-0.04923234507441521,
0.20978179574012756,
0.867747962474823,
0.0023780688643455505,
0.6582726240158081,
0.09748391807079315,
-0.2004915177822113,
0.09180179238319397,
-0.38326242566108704,
-0.5499930381774902,
0.29240018129348755,
-0.19049376249313354,
0.11853490024805069,
-0.13483314216136932,
0.3257465064525604,
-0.06473053991794586,
-0.28933244943618774,
-0.15826565027236938,
-0.22373606264591217,
-0.25566425919532776,
-0.2622195780277252,
-0.15281447768211365,
-0.05751332640647888,
-0.15855956077575684,
0.09042787551879883,
-0.16272437572479248,
-0.014530085027217865,
0.26411953568458557,
-0.02586715668439865,
-0.30154961347579956,
-0.3076474964618683,
-0.4871551990509033,
0.4129580855369568,
-0.02812797576189041,
-0.285539835691452,
0.14789696037769318,
0.17870481312274933,
-0.23567533493041992,
-0.022342462092638016,
0.2800773084163666,
0.5759568214416504,
0.1588985025882721,
0.0843992680311203,
-0.0780314952135086,
0.0536169670522213,
0.07267539948225021,
-0.2610965371131897,
0.10098657011985779,
0.10051281750202179,
-0.10146208107471466,
0.031125761568546295,
0.010621340945363045,
0.0413922443985939,
0.05993212014436722,
0.15360619127750397,
0.166110560297966,
-0.516396164894104,
0.26667842268943787,
-0.45091310143470764,
-0.10367685556411743,
-0.10571391880512238,
0.09398217499256134,
-0.07536344975233078,
0.06015772745013237,
0.5435569286346436,
-0.10296755284070969,
0.22493129968643188,
-0.08931700885295868,
-0.03696660324931145,
0.14523907005786896,
0.4774525761604309,
-0.10345323383808136,
-0.3305529057979584,
-0.4981316328048706,
-0.09699796885251999,
-0.250224232673645,
-0.06865508109331131,
-0.15520188212394714,
0.4265858232975006,
-0.0736573114991188,
0.6447681188583374,
-0.14831289649009705,
-0.16817690432071686,
0.568416178226471,
-0.3629189431667328,
0.40801841020584106,
0.5341712236404419,
-0.17238233983516693,
-0.02310514822602272,
-0.4512055516242981,
-0.03357234597206116,
0.15971782803535461,
-0.2995702028274536,
0.3254222571849823,
-0.01085568219423294,
-0.1836698353290558,
-0.2734447717666626,
-0.11354396492242813,
0.3629373013973236,
0.09771610796451569,
0.26930147409439087,
0.14215831458568573,
0.2811041474342346,
0.21068745851516724,
-0.16560646891593933,
-0.676226019859314,
0.16458864510059357,
-0.29618802666664124,
0.2593883275985718,
-0.005512505769729614,
0.36034491658210754,
-0.35746997594833374,
0.014495939016342163,
-0.09856396168470383,
-0.004681375343352556,
0.299612820148468,
-0.12234846502542496,
-0.21793505549430847,
0.20769727230072021,
0.05830616503953934,
0.21142305433750153,
0.2213965207338333,
0.45943090319633484,
0.06311433017253876,
0.06052577495574951,
-0.34418821334838867,
-0.1315685212612152,
0.35724788904190063,
-0.3906891644001007,
-0.33271366357803345,
-0.22496654093265533,
0.21636968851089478,
-0.1256616711616516,
-0.08406250923871994,
-0.4014934003353119,
-0.08236018568277359,
0.26035743951797485,
-0.04580423980951309,
-0.16614364087581635,
0.19992882013320923,
0.3680184483528137,
-0.00307532399892807,
-0.09139788895845413,
0.31496909260749817,
0.10783322900533676,
-0.3990747034549713,
0.25799092650413513,
-0.3066197633743286
] |
https://github.com/huggingface/datasets/issues/5506 | IterableDataset and Dataset return different batch sizes when using Trainer with multiple GPUs | Makes sense. Given that it's a `transformers` issue and already being tracked, I'll close this out. | ### Describe the bug
I am training a Roberta model using 2 GPUs and the `Trainer` API with a batch size of 256.
Initially I used a standard `Dataset`, but had issues with slow data loading. After reading [this issue](https://github.com/huggingface/datasets/issues/2252), I swapped to loading my dataset as contiguous shards and passing those to an `IterableDataset`. I observed an unexpected drop in GPU memory utilization, and found the batch size returned from the model had been cut in half.
When using `Trainer` with 2 GPUs and a batch size of 256, `Dataset` returns a batch of size 512 (256 per GPU), while `IterableDataset` returns a batch size of 256 (256 total). My guess is `IterableDataset` isn't accounting for multiple cards.
### Steps to reproduce the bug
```python
import datasets
from datasets import IterableDataset
from transformers import RobertaConfig
from transformers import RobertaTokenizerFast
from transformers import RobertaForMaskedLM
from transformers import DataCollatorForLanguageModeling
from transformers import Trainer, TrainingArguments
use_iterable_dataset = True
def gen_from_shards(shards):
for shard in shards:
for example in shard:
yield example
dataset = datasets.load_from_disk('my_dataset.hf')
if use_iterable_dataset:
n_shards = 100
shards = [dataset.shard(num_shards=n_shards, index=i) for i in range(n_shards)]
dataset = IterableDataset.from_generator(gen_from_shards, gen_kwargs={"shards": shards})
tokenizer = RobertaTokenizerFast.from_pretrained("./my_tokenizer", max_len=160, use_fast=True)
config = RobertaConfig(
vocab_size=8248,
max_position_embeddings=256,
num_attention_heads=8,
num_hidden_layers=6,
type_vocab_size=1)
model = RobertaForMaskedLM(config=config)
data_collator = DataCollatorForLanguageModeling(tokenizer=tokenizer, mlm=True, mlm_probability=0.15)
training_args = TrainingArguments(
per_device_train_batch_size=256
# other args removed for brevity
)
trainer = Trainer(
model=model,
args=training_args,
data_collator=data_collator,
train_dataset=dataset,
)
trainer.train()
```
### Expected behavior
Expected `Dataset` and `IterableDataset` to have the same batch size behavior. If the current behavior is intentional, the batch size printout at the start of training should be updated. Currently, both dataset classes result in `Trainer` printing the same total batch size, even though the batch size sent to the GPUs are different.
### Environment info
datasets 2.7.1
transformers 4.25.1 | 16 | IterableDataset and Dataset return different batch sizes when using Trainer with multiple GPUs
### Describe the bug
I am training a Roberta model using 2 GPUs and the `Trainer` API with a batch size of 256.
Initially I used a standard `Dataset`, but had issues with slow data loading. After reading [this issue](https://github.com/huggingface/datasets/issues/2252), I swapped to loading my dataset as contiguous shards and passing those to an `IterableDataset`. I observed an unexpected drop in GPU memory utilization, and found the batch size returned from the model had been cut in half.
When using `Trainer` with 2 GPUs and a batch size of 256, `Dataset` returns a batch of size 512 (256 per GPU), while `IterableDataset` returns a batch size of 256 (256 total). My guess is `IterableDataset` isn't accounting for multiple cards.
### Steps to reproduce the bug
```python
import datasets
from datasets import IterableDataset
from transformers import RobertaConfig
from transformers import RobertaTokenizerFast
from transformers import RobertaForMaskedLM
from transformers import DataCollatorForLanguageModeling
from transformers import Trainer, TrainingArguments
use_iterable_dataset = True
def gen_from_shards(shards):
for shard in shards:
for example in shard:
yield example
dataset = datasets.load_from_disk('my_dataset.hf')
if use_iterable_dataset:
n_shards = 100
shards = [dataset.shard(num_shards=n_shards, index=i) for i in range(n_shards)]
dataset = IterableDataset.from_generator(gen_from_shards, gen_kwargs={"shards": shards})
tokenizer = RobertaTokenizerFast.from_pretrained("./my_tokenizer", max_len=160, use_fast=True)
config = RobertaConfig(
vocab_size=8248,
max_position_embeddings=256,
num_attention_heads=8,
num_hidden_layers=6,
type_vocab_size=1)
model = RobertaForMaskedLM(config=config)
data_collator = DataCollatorForLanguageModeling(tokenizer=tokenizer, mlm=True, mlm_probability=0.15)
training_args = TrainingArguments(
per_device_train_batch_size=256
# other args removed for brevity
)
trainer = Trainer(
model=model,
args=training_args,
data_collator=data_collator,
train_dataset=dataset,
)
trainer.train()
```
### Expected behavior
Expected `Dataset` and `IterableDataset` to have the same batch size behavior. If the current behavior is intentional, the batch size printout at the start of training should be updated. Currently, both dataset classes result in `Trainer` printing the same total batch size, even though the batch size sent to the GPUs are different.
### Environment info
datasets 2.7.1
transformers 4.25.1
Makes sense. Given that it's a `transformers` issue and already being tracked, I'll close this out. | [
-0.35720178484916687,
-0.1617143303155899,
-0.023187974467873573,
0.5625223517417908,
0.11427915096282959,
-0.0774904265999794,
0.3926452100276947,
0.4203515648841858,
-0.26587170362472534,
0.0382477268576622,
-0.030516652390360832,
0.03927403688430786,
-0.0694391131401062,
-0.18142354488372803,
0.0028640199452638626,
-0.042919665575027466,
0.11719058454036713,
-0.11124889552593231,
-0.12337689101696014,
-0.024346519261598587,
0.09590582549571991,
0.30203133821487427,
-0.08750700950622559,
-0.14051106572151184,
-0.49670010805130005,
0.1560959815979004,
-0.09354525804519653,
-0.029137879610061646,
0.13209787011146545,
-0.4260868430137634,
0.5181823968887329,
0.029809989035129547,
0.2605650722980499,
0.5086588859558105,
-0.00013049173867329955,
0.08863438665866852,
-0.12242898344993591,
-0.07355847209692001,
-0.05650714784860611,
0.30469459295272827,
0.19623225927352905,
-0.014202245511114597,
-0.05306411534547806,
-0.0894279032945633,
-0.230049729347229,
-0.19439318776130676,
-0.12085390090942383,
-0.30437424778938293,
0.026730217039585114,
0.05096898227930069,
0.038942355662584305,
0.26820531487464905,
-0.27527400851249695,
-0.19427432119846344,
0.026567157357931137,
0.07071744650602341,
-0.08038085699081421,
0.05458966642618179,
0.24467560648918152,
-0.24297767877578735,
-0.17003479599952698,
0.3691825866699219,
-0.025409121066331863,
0.2004147469997406,
-0.11691129952669144,
0.16041110455989838,
0.19886678457260132,
0.052018776535987854,
0.29393672943115234,
0.03517577424645424,
-0.032932132482528687,
-0.2106325924396515,
-0.17755116522312164,
-0.6819287538528442,
0.07393822818994522,
-0.28898125886917114,
0.06840639561414719,
0.11390415579080582,
-0.0973527580499649,
-0.051822129637002945,
-0.39852628111839294,
0.3188069462776184,
-0.0944196805357933,
-0.18839310109615326,
-0.032805800437927246,
0.3040376603603363,
0.1441192626953125,
0.37904632091522217,
0.15313120186328888,
-0.0329914316534996,
0.15530268847942352,
0.024491334334015846,
-0.13647668063640594,
-0.010814297012984753,
-0.4817275404930115,
0.016434386372566223,
0.2414737045764923,
-0.20778316259384155,
0.43044182658195496,
0.19510164856910706,
0.12628747522830963,
0.03791854903101921,
0.16657349467277527,
-0.32027825713157654,
0.3846334218978882,
0.14518389105796814,
-0.2796619236469269,
0.2543749511241913,
-0.0909794420003891,
0.1796896606683731,
-0.24850721657276154,
-0.08199331164360046,
-0.02034405618906021,
-0.049250755459070206,
0.05398787185549736,
-0.18906831741333008,
0.00520002655684948,
-0.02302372455596924,
-0.350502073764801,
-0.2100820094347,
-0.355171263217926,
-0.1282726675271988,
0.18507997691631317,
0.1256355345249176,
-0.11598961800336838,
0.21758010983467102,
-0.4266551733016968,
0.22117112576961517,
-0.16303053498268127,
-0.35729414224624634,
-0.20396269857883453,
-0.3754838705062866,
-0.26815763115882874,
0.1694190949201584,
0.20275187492370605,
-0.27241596579551697,
0.1860477775335312,
-0.0025149378925561905,
0.1578548103570938,
-0.2032584846019745,
0.07669704407453537,
-0.618906557559967,
0.5084382891654968,
0.16378571093082428,
0.21039289236068726,
0.29045942425727844,
0.06994102150201797,
-0.19505728781223297,
-0.04530620574951172,
0.26602399349212646,
-0.23043739795684814,
-0.28279879689216614,
0.12957215309143066,
-0.003373539075255394,
0.1492244005203247,
-0.15316054224967957,
-0.4515351951122284,
0.46208760142326355,
0.5097902417182922,
-0.13534462451934814,
-0.05629950016736984,
-0.4615370035171509,
-0.27767032384872437,
-0.21207295358181,
0.3054615259170532,
0.3445625603199005,
-0.22793793678283691,
-0.14653098583221436,
0.136402890086174,
-0.0614803247153759,
0.2848772406578064,
0.9374628067016602,
-0.2527640759944916,
0.3344199061393738,
-0.3524169623851776,
0.1768670529127121,
-0.18965336680412292,
-0.21663595736026764,
-0.672055184841156,
0.17244069278240204,
0.0490543395280838,
0.35024240612983704,
0.2941821813583374,
-0.06488776952028275,
0.289191335439682,
-0.09101321548223495,
0.31479963660240173,
0.31781721115112305,
-0.35781052708625793,
0.18903033435344696,
-0.10048159956932068,
-0.220501109957695,
0.16559264063835144,
0.1391592174768448,
0.4106932282447815,
-0.10219136625528336,
-0.14092698693275452,
-0.05060857906937599,
0.8445092439651489,
-0.2231059968471527,
0.15687893331050873,
-0.05725754052400589,
0.15542899072170258,
-0.1363242268562317,
0.0641484335064888,
0.028678186237812042,
-0.28256702423095703,
0.22827249765396118,
-0.39151638746261597,
-0.2070484161376953,
0.28528741002082825,
-0.07049363106489182,
0.15594226121902466,
0.0054816752672195435,
-0.17081443965435028,
-0.19225354492664337,
-0.01725294254720211,
0.275492399930954,
0.1141359955072403,
-0.18768393993377686,
-0.04302509129047394,
0.2030957192182541,
-0.26055285334587097,
0.01234323251992464,
0.022852730005979538,
0.04529348015785217,
0.25680068135261536,
-0.4135797619819641,
-0.0236628670245409,
0.27466392517089844,
0.09352646768093109,
-0.23723796010017395,
0.0020502768456935883,
0.18742001056671143,
0.06461524963378906,
-0.16452454030513763,
0.08104699105024338,
0.2958560585975647,
0.1967383623123169,
0.20974108576774597,
0.02416957914829254,
0.020675355568528175,
-0.011052832007408142,
-0.24350884556770325,
-0.015437617897987366,
0.332228422164917,
0.10781942307949066,
0.35399192571640015,
0.05424056947231293,
-0.12928229570388794,
0.17644013464450836,
0.13858164846897125,
-0.06401470303535461,
-0.09449402242898941,
-0.10246488451957703,
0.22191861271858215,
0.12102815508842468,
-0.04543840140104294,
-0.23553816974163055,
0.2635766267776489,
0.3906143307685852,
0.16015583276748657,
-0.1564396321773529,
-0.04035145044326782,
-0.3821651041507721,
-0.2544170618057251,
-0.07301121950149536,
0.08449731767177582,
0.7144879698753357,
0.05667731910943985,
0.2414155751466751,
-0.14549678564071655,
-0.03704164922237396,
-0.1760530173778534,
0.13047339022159576,
0.28036874532699585,
0.0012814328074455261,
0.19722440838813782,
0.1484793722629547,
-0.15174858272075653,
-0.18178895115852356,
-0.2590615153312683,
0.08916317671537399,
0.02669287659227848,
-0.11485603451728821,
0.19794076681137085,
-0.1294131875038147,
-0.045641373842954636,
-0.39608195424079895,
-0.30930349230766296,
-0.0032013878226280212,
-0.09931609034538269,
-0.1567525565624237,
0.3067472279071808,
0.09780345857143402,
0.04425036907196045,
0.08206555247306824,
0.3947477638721466,
-0.042388901114463806,
-0.000050727277994155884,
0.19643253087997437,
0.03799770772457123,
-0.40303635597229004,
-0.020192354917526245,
0.34737974405288696,
-0.659740149974823,
0.2282770276069641,
0.03118150122463703,
-0.0502341091632843,
-0.28941068053245544,
-0.08887869119644165,
0.15268771350383759,
-0.052038416266441345,
0.04044631868600845,
-0.11091010272502899,
-0.13614211976528168,
0.09057064354419708,
0.05972277373075485,
0.19970762729644775,
-0.0842851847410202,
0.1508355736732483,
-0.20598246157169342,
-0.376993328332901,
-0.19901850819587708,
0.24363166093826294,
0.08251231163740158,
-0.049616001546382904,
0.11258265376091003,
-0.00970892608165741,
0.23741696774959564,
0.003025289624929428,
0.29494258761405945,
0.20780819654464722,
0.14116619527339935,
-0.22556619346141815,
-0.2993522584438324,
-0.08944706618785858,
-0.3454711437225342,
0.007586587220430374,
-0.12940816581249237,
-0.26842397451400757,
-0.08210523426532745,
0.05993333458900452,
0.4456779360771179,
0.255237877368927,
-0.39098548889160156,
0.3753829300403595,
-0.123487189412117,
-0.027197493240237236,
0.007224045693874359,
-0.10448954999446869,
0.22737251222133636,
-0.054121796041727066,
0.04939189553260803,
0.029458031058311462,
-0.31423795223236084,
0.021310724318027496,
0.053473521023988724,
0.16231834888458252,
-0.12820276618003845,
0.023677099496126175,
0.30364516377449036,
0.8561155796051025,
0.6230773329734802,
-0.08955934643745422,
0.13156582415103912,
-0.21468186378479004,
-0.06586092710494995,
-0.21216997504234314,
-0.08548644185066223,
0.35207998752593994,
-0.25796470046043396,
-0.14901095628738403,
0.40249204635620117,
-0.21435943245887756,
-0.23808999359607697,
0.2466754913330078,
0.17007417976856232,
0.10902302712202072,
-0.34419798851013184,
0.4963151216506958,
0.025854498147964478,
0.1985015869140625,
0.10701219737529755,
0.11897449940443039,
-0.1729968786239624,
-0.06467754393815994,
-0.03822799772024155,
-0.13191017508506775,
-0.011400841176509857,
0.00012176275777164847,
-0.5115853548049927,
-0.3954834043979645,
-0.3241017758846283,
0.2890326976776123,
-0.02401650883257389,
0.36150577664375305,
0.0736832320690155,
-0.17823800444602966,
0.18355689942836761,
0.13346804678440094,
0.5844619870185852,
0.3506886959075928,
-0.2878977060317993,
0.03095770999789238,
-0.43866169452667236,
-0.2034391462802887,
-0.39180007576942444,
-0.25094854831695557,
0.15620194375514984,
0.016862597316503525,
0.2859821617603302,
-0.10604777932167053,
-0.29901009798049927,
0.3278062045574188,
-0.02540481463074684,
-0.13232533633708954,
0.18650726974010468,
-0.22763299942016602,
-0.05624029412865639,
-0.011003326624631882,
0.3674216568470001,
0.13268376886844635,
0.3736768960952759,
-0.26850277185440063,
-0.07786007970571518,
-0.38550615310668945,
-0.08190838992595673,
0.08651003986597061,
0.3545073866844177,
0.4836238622665405,
-0.042849209159612656,
0.2783176302909851,
0.37668901681900024,
0.12807434797286987,
0.3984660506248474,
0.19321638345718384,
0.18387527763843536,
-0.06897188723087311,
0.2182551622390747,
-0.025131117552518845,
0.3152579367160797,
0.501476526260376,
-0.16844569146633148,
0.07360690087080002,
0.2168988138437271,
0.2666212320327759,
-0.2759934365749359,
-0.03943187743425369,
0.3592265546321869,
-0.054523125290870667,
-0.49472689628601074,
-0.6190714240074158,
0.28342506289482117,
0.3151460886001587,
0.05431114137172699,
0.333686500787735,
0.1124017983675003,
-0.16021984815597534,
0.35769253969192505,
0.14251787960529327,
0.6714081764221191,
-0.05596163868904114,
0.39695701003074646,
0.30903932452201843,
0.0507730171084404,
-0.11356499791145325,
-0.14312702417373657,
0.5147721171379089,
-0.29023629426956177,
-0.09026224911212921,
0.03657540678977966,
-0.056723423302173615,
0.06669580936431885,
0.2157544493675232,
0.14513957500457764,
0.26649630069732666,
0.15650269389152527,
0.24734282493591309,
-0.19609519839286804,
-0.1468578279018402,
0.08937651664018631,
-0.3525870144367218,
-0.3101955056190491,
-0.03277529031038284,
-0.03116493672132492,
0.001001998782157898,
0.0014568502083420753,
-0.057452596724033356,
-0.030158324167132378,
0.0008243508636951447,
-0.3006128668785095,
-0.1155017539858818,
-0.5063133835792542,
0.0811278373003006,
0.1190820187330246,
-0.3948945999145508,
-0.05063587427139282,
0.2762005925178528,
0.1709635853767395,
-0.2230115383863449,
-0.15602456033229828,
0.1190725713968277,
-0.28045299649238586,
0.15996196866035461,
0.0405869260430336,
-0.39598706364631653,
0.12182285636663437,
0.14818942546844482,
-0.13686878979206085,
-0.01730700582265854,
0.093666210770607,
-0.060260698199272156,
-0.3399234712123871,
0.29327818751335144,
0.24118098616600037,
-0.2510788142681122,
-0.021432220935821533,
0.09706069529056549,
0.012788623571395874,
-0.1303669959306717,
-0.04201630502939224,
0.12016722559928894,
-0.047513362020254135,
0.5425683259963989,
-0.049785222858190536,
-0.34814485907554626,
-0.04830006882548332,
0.42215612530708313,
0.11213167756795883,
-0.20422089099884033,
0.5482888221740723,
-0.02552032098174095,
0.17915208637714386,
0.02933128923177719,
-0.0750548243522644,
0.3758014440536499,
-0.48180657625198364,
0.0830274373292923,
-0.3473280966281891,
0.2187414914369583,
0.12453298270702362,
0.025148659944534302,
0.08686657249927521,
-0.14928826689720154,
-0.2740706503391266,
-0.055844277143478394,
-0.3374427258968353,
0.01342163234949112,
-0.13213719427585602,
0.1313263177871704,
0.08251184970140457,
0.04243750125169754,
0.14353489875793457,
0.0705813616514206,
-0.10753794759511948,
-0.08244623243808746,
0.0015276800841093063,
0.007839376106858253,
-0.1793321669101715,
0.011731110513210297,
0.29224926233291626,
0.15855711698532104,
-0.08842826634645462,
0.22233916819095612,
0.08504492789506912,
-0.07877375930547714,
-0.22710071504116058,
0.13722506165504456,
0.1875874102115631,
-0.009525503031909466,
-0.05358542501926422,
-0.039933010935783386,
-0.17615951597690582,
-0.3644826412200928,
0.6090848445892334,
0.06557381898164749,
0.296793669462204,
-0.05713173374533653,
0.3627661466598511,
-0.18137681484222412,
-0.2428813874721527,
0.13904282450675964,
0.13635313510894775,
-0.13239149749279022,
0.32016927003860474,
0.16000518202781677,
0.008852762170135975,
-0.15346896648406982,
-0.06655340641736984,
0.11970773339271545,
0.5063158869743347,
0.22328874468803406,
-0.13645899295806885,
-0.28243452310562134,
-0.06643125414848328,
0.25156769156455994,
0.205007404088974,
0.3826693892478943,
-0.10400544106960297,
-0.22975338995456696,
-0.03424019739031792,
0.023740366101264954,
0.0480429083108902,
-0.18469549715518951,
0.013306347653269768,
-0.04110066220164299,
-0.08501134067773819,
0.49420928955078125,
0.23830094933509827,
0.1959669291973114,
-0.09986032545566559,
0.06901977211236954,
0.3266393542289734,
-0.3949275016784668,
0.057704512029886246,
0.17005746066570282,
0.1351684182882309,
0.11591558158397675,
0.10088271647691727,
-0.04923234507441521,
0.20978179574012756,
0.867747962474823,
0.0023780688643455505,
0.6582726240158081,
0.09748391807079315,
-0.2004915177822113,
0.09180179238319397,
-0.38326242566108704,
-0.5499930381774902,
0.29240018129348755,
-0.19049376249313354,
0.11853490024805069,
-0.13483314216136932,
0.3257465064525604,
-0.06473053991794586,
-0.28933244943618774,
-0.15826565027236938,
-0.22373606264591217,
-0.25566425919532776,
-0.2622195780277252,
-0.15281447768211365,
-0.05751332640647888,
-0.15855956077575684,
0.09042787551879883,
-0.16272437572479248,
-0.014530085027217865,
0.26411953568458557,
-0.02586715668439865,
-0.30154961347579956,
-0.3076474964618683,
-0.4871551990509033,
0.4129580855369568,
-0.02812797576189041,
-0.285539835691452,
0.14789696037769318,
0.17870481312274933,
-0.23567533493041992,
-0.022342462092638016,
0.2800773084163666,
0.5759568214416504,
0.1588985025882721,
0.0843992680311203,
-0.0780314952135086,
0.0536169670522213,
0.07267539948225021,
-0.2610965371131897,
0.10098657011985779,
0.10051281750202179,
-0.10146208107471466,
0.031125761568546295,
0.010621340945363045,
0.0413922443985939,
0.05993212014436722,
0.15360619127750397,
0.166110560297966,
-0.516396164894104,
0.26667842268943787,
-0.45091310143470764,
-0.10367685556411743,
-0.10571391880512238,
0.09398217499256134,
-0.07536344975233078,
0.06015772745013237,
0.5435569286346436,
-0.10296755284070969,
0.22493129968643188,
-0.08931700885295868,
-0.03696660324931145,
0.14523907005786896,
0.4774525761604309,
-0.10345323383808136,
-0.3305529057979584,
-0.4981316328048706,
-0.09699796885251999,
-0.250224232673645,
-0.06865508109331131,
-0.15520188212394714,
0.4265858232975006,
-0.0736573114991188,
0.6447681188583374,
-0.14831289649009705,
-0.16817690432071686,
0.568416178226471,
-0.3629189431667328,
0.40801841020584106,
0.5341712236404419,
-0.17238233983516693,
-0.02310514822602272,
-0.4512055516242981,
-0.03357234597206116,
0.15971782803535461,
-0.2995702028274536,
0.3254222571849823,
-0.01085568219423294,
-0.1836698353290558,
-0.2734447717666626,
-0.11354396492242813,
0.3629373013973236,
0.09771610796451569,
0.26930147409439087,
0.14215831458568573,
0.2811041474342346,
0.21068745851516724,
-0.16560646891593933,
-0.676226019859314,
0.16458864510059357,
-0.29618802666664124,
0.2593883275985718,
-0.005512505769729614,
0.36034491658210754,
-0.35746997594833374,
0.014495939016342163,
-0.09856396168470383,
-0.004681375343352556,
0.299612820148468,
-0.12234846502542496,
-0.21793505549430847,
0.20769727230072021,
0.05830616503953934,
0.21142305433750153,
0.2213965207338333,
0.45943090319633484,
0.06311433017253876,
0.06052577495574951,
-0.34418821334838867,
-0.1315685212612152,
0.35724788904190063,
-0.3906891644001007,
-0.33271366357803345,
-0.22496654093265533,
0.21636968851089478,
-0.1256616711616516,
-0.08406250923871994,
-0.4014934003353119,
-0.08236018568277359,
0.26035743951797485,
-0.04580423980951309,
-0.16614364087581635,
0.19992882013320923,
0.3680184483528137,
-0.00307532399892807,
-0.09139788895845413,
0.31496909260749817,
0.10783322900533676,
-0.3990747034549713,
0.25799092650413513,
-0.3066197633743286
] |
https://github.com/huggingface/datasets/issues/5505 | PyTorch BatchSampler still loads from Dataset one-by-one | This change seems to come from a few months ago in the PyTorch side. That's good news and it means we may not need to pass a batch_sampler as soon as we add `Dataset.__getitems__` to get the optimal speed :)
Thanks for reporting ! Would you like to open a PR to add `__getitems__` and remove this outdated documentation ? | ### Describe the bug
In [the docs here](https://huggingface.co/docs/datasets/use_with_pytorch#use-a-batchsampler), it mentions the issue of the Dataset being read one-by-one, then states that using a BatchSampler resolves the issue.
I'm not sure if this is a mistake in the docs or the code, but it seems that the only way for a Dataset to be passed a list of indexes by PyTorch (instead of one index at a time) is to define a `__getitems__` method (note the plural) on the Dataset object, and since the HF Dataset doesn't have this, PyTorch executes [this line of code](https://github.com/pytorch/pytorch/blob/master/torch/utils/data/_utils/fetch.py#L58), reverting to fetching one-by-one.
### Steps to reproduce the bug
You can put a breakpoint in `Dataset.__getitem__()` or just print the args from there and see that it's called multiple times for a single `next(iter(dataloader))`, even when using the code from the docs:
```py
from torch.utils.data.sampler import BatchSampler, RandomSampler
batch_sampler = BatchSampler(RandomSampler(ds), batch_size=32, drop_last=False)
dataloader = DataLoader(ds, batch_sampler=batch_sampler)
```
### Expected behavior
The expected behaviour would be for it to fetch batches from the dataset, rather than one-by-one.
To demonstrate that there is room for improvement: once I have a HF dataset `ds`, if I just add this line:
```py
ds.__getitems__ = ds.__getitem__
```
...then the time taken to loop over the dataset improves considerably (for wikitext-103, from one minute to 13 seconds with batch size 32). Probably not a big deal in the grand scheme of things, but seems like an easy win.
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31
- Python version: 3.10.8
- PyArrow version: 10.0.1
- Pandas version: 1.5.3 | 60 | PyTorch BatchSampler still loads from Dataset one-by-one
### Describe the bug
In [the docs here](https://huggingface.co/docs/datasets/use_with_pytorch#use-a-batchsampler), it mentions the issue of the Dataset being read one-by-one, then states that using a BatchSampler resolves the issue.
I'm not sure if this is a mistake in the docs or the code, but it seems that the only way for a Dataset to be passed a list of indexes by PyTorch (instead of one index at a time) is to define a `__getitems__` method (note the plural) on the Dataset object, and since the HF Dataset doesn't have this, PyTorch executes [this line of code](https://github.com/pytorch/pytorch/blob/master/torch/utils/data/_utils/fetch.py#L58), reverting to fetching one-by-one.
### Steps to reproduce the bug
You can put a breakpoint in `Dataset.__getitem__()` or just print the args from there and see that it's called multiple times for a single `next(iter(dataloader))`, even when using the code from the docs:
```py
from torch.utils.data.sampler import BatchSampler, RandomSampler
batch_sampler = BatchSampler(RandomSampler(ds), batch_size=32, drop_last=False)
dataloader = DataLoader(ds, batch_sampler=batch_sampler)
```
### Expected behavior
The expected behaviour would be for it to fetch batches from the dataset, rather than one-by-one.
To demonstrate that there is room for improvement: once I have a HF dataset `ds`, if I just add this line:
```py
ds.__getitems__ = ds.__getitem__
```
...then the time taken to loop over the dataset improves considerably (for wikitext-103, from one minute to 13 seconds with batch size 32). Probably not a big deal in the grand scheme of things, but seems like an easy win.
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31
- Python version: 3.10.8
- PyArrow version: 10.0.1
- Pandas version: 1.5.3
This change seems to come from a few months ago in the PyTorch side. That's good news and it means we may not need to pass a batch_sampler as soon as we add `Dataset.__getitems__` to get the optimal speed :)
Thanks for reporting ! Would you like to open a PR to add `__getitems__` and remove this outdated documentation ? | [
-0.1101192831993103,
-0.23176124691963196,
0.08417142927646637,
0.0453609898686409,
0.0064180102199316025,
-0.03963816165924072,
0.45273303985595703,
0.16254007816314697,
0.36948633193969727,
0.2220371663570404,
-0.22642146050930023,
0.371221661567688,
-0.052604660391807556,
-0.2659573256969452,
0.05249384418129921,
-0.2144881784915924,
0.0657806396484375,
0.06410275399684906,
-0.30984199047088623,
-0.15965457260608673,
-0.21209987998008728,
0.10024142265319824,
-0.1952689290046692,
0.030955146998167038,
-0.18657290935516357,
0.043942708522081375,
-0.23085522651672363,
0.16282501816749573,
0.20599240064620972,
-0.5052703619003296,
0.40034985542297363,
0.20296823978424072,
0.17643077671527863,
0.4679167568683624,
-0.00011519843974383548,
0.06753942370414734,
0.2907235324382782,
0.0015215873718261719,
-0.454206258058548,
-0.09685952961444855,
0.2587786912918091,
-0.011201798915863037,
0.39720475673675537,
-0.026308543980121613,
-0.18389752507209778,
-0.19861745834350586,
0.10316645354032516,
-0.30677348375320435,
-0.03878262639045715,
0.18665078282356262,
0.1761501282453537,
0.48593124747276306,
-0.28020161390304565,
-0.17512542009353638,
0.29963454604148865,
0.31643760204315186,
-0.008234839886426926,
-0.0043469201773405075,
0.43225958943367004,
-0.17435206472873688,
-0.5266691446304321,
0.4120333790779114,
-0.11673921346664429,
0.4579087197780609,
0.3332940638065338,
0.04228687286376953,
-0.2878371775150299,
-0.2973325848579407,
-0.11897177249193192,
0.27581343054771423,
0.14148035645484924,
-0.05424387753009796,
-0.4270371198654175,
-0.4172869324684143,
-0.21827445924282074,
-0.05186699703335762,
-0.10767961293458939,
0.20550188422203064,
-0.35841527581214905,
-0.09254378080368042,
-0.05961018428206444,
0.07403990626335144,
0.008760213851928711,
0.09117108583450317,
-0.053756676614284515,
0.27852684259414673,
-0.04044829308986664,
0.16314741969108582,
0.2793625593185425,
0.22815224528312683,
0.3486175537109375,
-0.1950673758983612,
0.16006873548030853,
0.11480560898780823,
-0.2661691904067993,
0.19725963473320007,
0.16464956104755402,
0.04557076469063759,
0.30117541551589966,
-0.10914193093776703,
-0.09130805730819702,
0.35692593455314636,
0.07327178865671158,
-0.10147815197706223,
0.42038291692733765,
-0.02587626874446869,
0.025166798382997513,
0.11456526070833206,
0.19271817803382874,
0.06356779485940933,
0.13304580748081207,
-0.00919259712100029,
0.10541846603155136,
-0.10894494503736496,
-0.008897475898265839,
-0.12399738281965256,
0.1749691516160965,
-0.14584757387638092,
-0.16021573543548584,
-0.17919427156448364,
0.04435720294713974,
-0.07694979012012482,
0.0007746638730168343,
0.5993673801422119,
-0.1027379035949707,
0.3017869293689728,
0.267147958278656,
-0.06562449783086777,
-0.40511274337768555,
0.006104425527155399,
-0.16414928436279297,
-0.18881864845752716,
-0.14245086908340454,
0.008706917986273766,
0.22174955904483795,
-0.6063511371612549,
0.229958176612854,
0.23728851974010468,
0.47800761461257935,
0.011691398918628693,
-0.058549217879772186,
-0.012135644443333149,
0.3954031467437744,
0.10855363309383392,
-0.013816222548484802,
0.3074050843715668,
0.2846143841743469,
0.41279274225234985,
-0.20951715111732483,
0.17383739352226257,
-0.5782018899917603,
-0.15756180882453918,
-0.24201004207134247,
0.12507358193397522,
0.17617663741111755,
-0.028464168310165405,
-0.22169402241706848,
0.04187372699379921,
0.009560912847518921,
0.03326672688126564,
0.12044741213321686,
-0.397219181060791,
-0.20249168574810028,
-0.052544232457876205,
0.11430666595697403,
0.2841375470161438,
-0.134804829955101,
-0.2332814484834671,
0.30294302105903625,
0.006577810272574425,
0.11093717068433762,
0.21983955800533295,
-0.5005888342857361,
0.08869265764951706,
-0.43954285979270935,
0.06889466941356659,
0.09589175134897232,
-0.3138168454170227,
-0.34662288427352905,
0.34314003586769104,
-0.01159634068608284,
0.28948909044265747,
-0.004024125635623932,
0.19217826426029205,
0.28379595279693604,
-0.09872575104236603,
0.2277088314294815,
0.2619098722934723,
-0.01077323965728283,
0.3322465121746063,
-0.2398962527513504,
-0.22735853493213654,
0.06975090503692627,
0.2719813585281372,
0.15699456632137299,
0.10737112909555435,
-0.09078469127416611,
-0.1455785632133484,
0.739646852016449,
-0.23904350399971008,
-0.024299444630742073,
0.2056194394826889,
-0.004437226802110672,
0.20714440941810608,
0.30707380175590515,
-0.014259438961744308,
-0.4944438338279724,
0.37828075885772705,
-0.2084779292345047,
0.055414579808712006,
-0.07160671055316925,
-0.20072144269943237,
0.30357393622398376,
0.17080722749233246,
-0.4206177592277527,
-0.20350231230258942,
-0.03102199360728264,
0.33386239409446716,
0.00785377249121666,
-0.21198271214962006,
-0.22078467905521393,
0.43171513080596924,
-0.037729356437921524,
0.07082663476467133,
-0.3344790041446686,
0.31239157915115356,
0.056178659200668335,
-0.007655736990272999,
-0.13644063472747803,
-0.04875008016824722,
0.1888769268989563,
-0.1678852140903473,
-0.03367892652750015,
0.27610155940055847,
0.11438911408185959,
-0.23599980771541595,
-0.17357614636421204,
-0.38305962085723877,
0.22442422807216644,
-0.0685865581035614,
0.21947608888149261,
0.37656906247138977,
0.1971297711133957,
-0.12453654408454895,
-0.341744989156723,
0.48946094512939453,
0.1460796445608139,
0.5335414409637451,
0.0507117435336113,
-0.05817843973636627,
-0.050554826855659485,
0.030704010277986526,
-0.13648544251918793,
0.0019781291484832764,
0.237839937210083,
-0.2644186019897461,
0.1325731873512268,
-0.048934340476989746,
-0.5065256953239441,
0.2522299289703369,
0.4477497339248657,
-0.05226418375968933,
-0.10168730467557907,
0.29683801531791687,
-0.2694445550441742,
-0.12380417436361313,
0.1257713884115219,
-0.26757314801216125,
0.24407917261123657,
0.18056121468544006,
-0.0009280480444431305,
-0.1841786503791809,
-0.08631152659654617,
-0.012898998335003853,
-0.0008205845952033997,
0.1863311231136322,
-0.16502954065799713,
0.037727728486061096,
0.22728583216667175,
-0.1369277387857437,
-0.3628956079483032,
-0.04023037478327751,
-0.11753188818693161,
0.029521051794290543,
-0.32501220703125,
0.32630783319473267,
-0.2723304033279419,
-0.017333190888166428,
-0.21878714859485626,
-0.21317675709724426,
-0.12606626749038696,
-0.3205726444721222,
-0.039483197033405304,
0.4573211371898651,
0.07430385053157806,
0.110926054418087,
-0.27881327271461487,
0.15350401401519775,
0.16119210422039032,
-0.12531091272830963,
-0.1844952553510666,
0.03843278810381889,
-0.22334682941436768,
-0.05535665899515152,
0.0294550321996212,
0.052613213658332825,
0.276263028383255,
-0.014774416573345661,
-0.23064017295837402,
-0.5013314485549927,
0.006468929350376129,
0.31891366839408875,
-0.05202028900384903,
0.17221540212631226,
0.1178915947675705,
-0.04885140061378479,
0.00039610639214515686,
-0.1129588708281517,
0.12909601628780365,
-0.43524086475372314,
-0.13783523440361023,
0.20390799641609192,
-0.024865426123142242,
0.1146920695900917,
0.06236894056200981,
-0.06463224440813065,
-0.22253337502479553,
-0.18015512824058533,
-0.11597608029842377,
0.07222287356853485,
0.24623335897922516,
0.14173372089862823,
0.10333676636219025,
0.07468812167644501,
-0.218499094247818,
-0.03202033042907715,
-0.1339896321296692,
-0.2582957148551941,
0.23521360754966736,
-0.10748212784528732,
-0.5556256175041199,
-0.27249976992607117,
-0.018354831263422966,
-0.279517263174057,
0.24598610401153564,
-0.5316359996795654,
-0.3801044821739197,
-0.2128870189189911,
0.36072075366973877,
-0.0004072263836860657,
0.26414135098457336,
0.2409428358078003,
-0.06311376392841339,
-0.0646449476480484,
-0.10993818938732147,
-0.05782254785299301,
0.016754642128944397,
-0.12679293751716614,
0.013756975531578064,
-0.019776728004217148,
0.29518282413482666,
0.012958068400621414,
0.8854247331619263,
0.2961239516735077,
-0.14278574287891388,
0.26171088218688965,
-0.1107771024107933,
0.340736985206604,
-0.31718140840530396,
-0.4627915322780609,
-0.00020982488058507442,
-0.3277145326137543,
0.052048973739147186,
0.2524036467075348,
-0.10009896755218506,
-0.1068849191069603,
0.052402131259441376,
0.11191670596599579,
0.00961415097117424,
-0.35117799043655396,
0.21574845910072327,
-0.08238908648490906,
0.008571445941925049,
-0.05345961079001427,
0.43657687306404114,
-0.337760329246521,
0.047278061509132385,
0.11179904639720917,
0.02301003783941269,
0.29562997817993164,
0.05992306396365166,
-0.13580860197544098,
0.14364539086818695,
-0.729990541934967,
0.17176522314548492,
0.18518291413784027,
0.42130863666534424,
0.1878955364227295,
-0.19194266200065613,
0.21372556686401367,
-0.18485794961452484,
0.5809088945388794,
0.41740286350250244,
0.04786856099963188,
0.10915675759315491,
-0.3057498335838318,
-0.3581658899784088,
-0.09282182157039642,
-0.1397889405488968,
0.5224247574806213,
-0.07661156356334686,
0.18606287240982056,
-0.24407225847244263,
-0.586450457572937,
0.23588044941425323,
0.24293461441993713,
-0.2691532075405121,
0.00532479677349329,
-0.3746045231819153,
-0.3561544418334961,
-0.1849498152732849,
0.08116602897644043,
0.06529480218887329,
-0.012918699532747269,
-0.042487069964408875,
0.04718129709362984,
-0.17371010780334473,
-0.11139854788780212,
-0.0019010528922080994,
-0.10441391170024872,
0.15294277667999268,
0.17097672820091248,
0.1745549589395523,
0.276777446269989,
0.335549533367157,
0.3300171494483948,
0.6021777391433716,
-0.28286266326904297,
-0.24972453713417053,
0.20415142178535461,
-0.004907219670712948,
0.14247460663318634,
0.4300113618373871,
-0.08797406405210495,
0.20959246158599854,
0.12950703501701355,
0.31986814737319946,
-0.3459964692592621,
-0.07018519192934036,
0.41670289635658264,
-0.05521148070693016,
-0.4658952057361603,
-0.3082437813282013,
0.653343915939331,
-0.018452538177371025,
-0.0999908298254013,
0.3870459198951721,
0.19484098255634308,
-0.11074373126029968,
0.4461764693260193,
0.15938153862953186,
0.5364529490470886,
-0.17467312514781952,
0.337428480386734,
0.3978163003921509,
-0.012361172586679459,
0.18781492114067078,
0.21875374019145966,
0.24334357678890228,
-0.3269762396812439,
-0.24602515995502472,
-0.005940888077020645,
-0.13716211915016174,
-0.18351849913597107,
0.04052122309803963,
0.048601020127534866,
0.3622986078262329,
-0.12545274198055267,
-0.01035219058394432,
0.05078341066837311,
0.23641887307167053,
0.011746656149625778,
-0.3817448019981384,
0.05368775129318237,
0.16330325603485107,
-0.05025576800107956,
0.37079519033432007,
-0.0012327171862125397,
-0.1194467693567276,
0.2788373529911041,
-0.35568249225616455,
-0.08975938707590103,
0.23989710211753845,
-0.2539539337158203,
-0.029049716889858246,
0.10614059865474701,
-0.4368721842765808,
-0.12212833762168884,
-0.2584696114063263,
0.12364145368337631,
-0.2788662910461426,
-0.023392869159579277,
0.07956516742706299,
0.06212927773594856,
0.2880665957927704,
-0.11397802084684372,
-0.2643490731716156,
0.31263843178749084,
0.13730072975158691,
-0.09905914962291718,
-0.06272821873426437,
-0.0558374784886837,
-0.5693119764328003,
0.043628349900245667,
0.33576542139053345,
0.08292855322360992,
-0.18196912109851837,
-0.10537974536418915,
0.11424922943115234,
0.11334539949893951,
-0.29947391152381897,
0.05389303341507912,
0.08551117777824402,
-0.14251478016376495,
0.25054681301116943,
-0.07423143088817596,
-0.18138499557971954,
-0.11003568768501282,
0.5676526427268982,
0.12196269631385803,
-0.22561046481132507,
0.3183690905570984,
0.5069891810417175,
-0.25887566804885864,
-0.08685776591300964,
-0.1623477041721344,
0.6028748154640198,
-0.3840513229370117,
0.21151317656040192,
-0.2115727812051773,
0.2877489924430847,
0.10296107083559036,
0.4567221999168396,
-0.2759571671485901,
-0.20853623747825623,
-0.41819655895233154,
-0.07427742332220078,
-0.3044596016407013,
0.07589706033468246,
0.050540853291749954,
0.30106502771377563,
0.044864341616630554,
-0.010160824283957481,
-0.039007753133773804,
0.12666630744934082,
-0.2924256920814514,
0.04395391047000885,
0.09179715812206268,
0.12056539207696915,
0.07324806600809097,
-0.027946501970291138,
0.11797087639570236,
0.12969528138637543,
0.05139375478029251,
-0.06207294017076492,
-0.018880534917116165,
-0.18375051021575928,
-0.13373945653438568,
0.10117185860872269,
-0.040536120533943176,
-0.019201811403036118,
-0.1425773799419403,
-0.24797309935092926,
-0.06321156024932861,
-0.28506529331207275,
0.48351383209228516,
0.40996575355529785,
-0.11497324705123901,
0.10153830051422119,
0.39741021394729614,
-0.18566635251045227,
0.29893434047698975,
0.13878381252288818,
-0.039248377084732056,
0.14679116010665894,
0.10933426767587662,
0.04723343998193741,
-0.10156405717134476,
0.0414922833442688,
-0.08769398927688599,
0.23386794328689575,
0.191905677318573,
0.043593112379312515,
0.1803620308637619,
-0.5162718892097473,
-0.0518144853413105,
-0.040308985859155655,
0.34396567940711975,
0.24758955836296082,
-0.023579370230436325,
-0.14230838418006897,
0.1431531012058258,
0.14471407234668732,
-0.272153377532959,
-0.4764670431613922,
-0.08364629745483398,
-0.03493331000208855,
0.20540815591812134,
0.2948664426803589,
-0.01663949340581894,
-0.00014442205429077148,
0.3127141296863556,
0.07374118268489838,
0.3510059118270874,
-0.011346094310283661,
-0.12660078704357147,
0.37997516989707947,
0.09757757186889648,
-0.1086207777261734,
0.3808860182762146,
0.19421327114105225,
0.17094114422798157,
0.37606358528137207,
-0.17914912104606628,
0.6928098201751709,
0.1295894980430603,
0.07919032871723175,
0.206192284822464,
-0.4288858473300934,
0.1328691989183426,
0.019923582673072815,
0.07402321696281433,
0.04393591731786728,
-0.1985209882259369,
0.38642340898513794,
-0.37541869282722473,
-0.40403175354003906,
-0.21929831802845,
0.2557191550731659,
-0.14212816953659058,
-0.17473037540912628,
-0.11211645603179932,
-0.14799442887306213,
0.14426304399967194,
0.12284529209136963,
-0.14314594864845276,
-0.11718210577964783,
0.24992217123508453,
0.04727404564619064,
-0.13422000408172607,
-0.24520523846149445,
-0.35902002453804016,
0.008642580360174179,
0.35634616017341614,
-0.026389800012111664,
0.07566055655479431,
0.024597518146038055,
0.019091986119747162,
0.052848320454359055,
0.22667144238948822,
0.14523737132549286,
0.3444693386554718,
-0.2487216293811798,
-0.06047353520989418,
-0.24007509648799896,
-0.08810092508792877,
0.007327506318688393,
0.020449409261345863,
-0.3913445472717285,
-0.15509290993213654,
0.34578394889831543,
0.10778677463531494,
-0.1246190220117569,
0.05248189717531204,
-0.13671301305294037,
-0.010936589911580086,
-0.28226715326309204,
0.27628976106643677,
-0.06253990530967712,
-0.05673033371567726,
-0.02135680615901947,
-0.13204821944236755,
-0.23270297050476074,
-0.15489237010478973,
0.4416027367115021,
-0.28344568610191345,
0.12090267986059189,
-0.11108097434043884,
0.07375212758779526,
-0.18402914702892303,
0.43222251534461975,
0.1572030484676361,
0.369459331035614,
-0.19644974172115326,
0.06353649497032166,
-0.3643825054168701,
0.0066616833209991455,
-0.46710073947906494,
-0.06430183351039886,
0.2413213849067688,
0.2496267706155777,
0.11052852123975754,
0.06593948602676392,
0.11867524683475494,
-0.0588698536157608,
0.19286233186721802,
0.34304121136665344,
-0.18160860240459442,
-0.019939560443162918,
-0.1668388694524765,
0.2856253683567047,
0.08356059342622757,
-0.5192334651947021,
0.15467488765716553,
0.013209342025220394,
0.053314581513404846,
-0.055790796875953674,
-0.006080441176891327,
0.18895740807056427,
-0.35481247305870056,
0.2887232303619385,
0.07602336257696152,
0.07115431129932404,
0.059512145817279816,
-0.13083939254283905,
-0.3622240424156189,
-0.031146975234150887,
-0.29245325922966003,
-0.33574068546295166,
-0.0992375910282135,
0.3273008465766907,
0.14238673448562622,
-0.34566211700439453,
-0.4594925343990326,
0.19925592839717865,
0.2674153447151184,
0.09032614529132843,
-0.16607914865016937,
0.4252464175224304,
-0.35331007838249207,
0.21989111602306366,
0.08483099192380905,
0.41536739468574524,
0.2278808057308197,
0.060382649302482605,
-0.34371012449264526,
-0.30361834168434143,
0.5765687823295593,
-0.6476643085479736,
-0.2774750292301178,
-0.24843990802764893,
0.31560754776000977,
-0.16565904021263123,
-0.13596348464488983,
-0.4676256775856018,
-0.057688161730766296,
0.12684562802314758,
0.06502385437488556,
-0.16842122375965118,
0.06099987402558327,
-0.032844047993421555,
-0.0009444728493690491,
-0.2696132957935333,
0.2899530529975891,
0.30861613154411316,
-0.15476560592651367,
-0.16339196264743805,
-0.2491406798362732
] |
https://github.com/huggingface/datasets/issues/5505 | PyTorch BatchSampler still loads from Dataset one-by-one | Yeah I figured this was the sort of thing that probably once worked. I can confirm that you no longer need the batch sampler, just `batch_size=n` in the `DataLoader`.
I'll pass on the PR, I'm flat out right now, sorry. | ### Describe the bug
In [the docs here](https://huggingface.co/docs/datasets/use_with_pytorch#use-a-batchsampler), it mentions the issue of the Dataset being read one-by-one, then states that using a BatchSampler resolves the issue.
I'm not sure if this is a mistake in the docs or the code, but it seems that the only way for a Dataset to be passed a list of indexes by PyTorch (instead of one index at a time) is to define a `__getitems__` method (note the plural) on the Dataset object, and since the HF Dataset doesn't have this, PyTorch executes [this line of code](https://github.com/pytorch/pytorch/blob/master/torch/utils/data/_utils/fetch.py#L58), reverting to fetching one-by-one.
### Steps to reproduce the bug
You can put a breakpoint in `Dataset.__getitem__()` or just print the args from there and see that it's called multiple times for a single `next(iter(dataloader))`, even when using the code from the docs:
```py
from torch.utils.data.sampler import BatchSampler, RandomSampler
batch_sampler = BatchSampler(RandomSampler(ds), batch_size=32, drop_last=False)
dataloader = DataLoader(ds, batch_sampler=batch_sampler)
```
### Expected behavior
The expected behaviour would be for it to fetch batches from the dataset, rather than one-by-one.
To demonstrate that there is room for improvement: once I have a HF dataset `ds`, if I just add this line:
```py
ds.__getitems__ = ds.__getitem__
```
...then the time taken to loop over the dataset improves considerably (for wikitext-103, from one minute to 13 seconds with batch size 32). Probably not a big deal in the grand scheme of things, but seems like an easy win.
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31
- Python version: 3.10.8
- PyArrow version: 10.0.1
- Pandas version: 1.5.3 | 40 | PyTorch BatchSampler still loads from Dataset one-by-one
### Describe the bug
In [the docs here](https://huggingface.co/docs/datasets/use_with_pytorch#use-a-batchsampler), it mentions the issue of the Dataset being read one-by-one, then states that using a BatchSampler resolves the issue.
I'm not sure if this is a mistake in the docs or the code, but it seems that the only way for a Dataset to be passed a list of indexes by PyTorch (instead of one index at a time) is to define a `__getitems__` method (note the plural) on the Dataset object, and since the HF Dataset doesn't have this, PyTorch executes [this line of code](https://github.com/pytorch/pytorch/blob/master/torch/utils/data/_utils/fetch.py#L58), reverting to fetching one-by-one.
### Steps to reproduce the bug
You can put a breakpoint in `Dataset.__getitem__()` or just print the args from there and see that it's called multiple times for a single `next(iter(dataloader))`, even when using the code from the docs:
```py
from torch.utils.data.sampler import BatchSampler, RandomSampler
batch_sampler = BatchSampler(RandomSampler(ds), batch_size=32, drop_last=False)
dataloader = DataLoader(ds, batch_sampler=batch_sampler)
```
### Expected behavior
The expected behaviour would be for it to fetch batches from the dataset, rather than one-by-one.
To demonstrate that there is room for improvement: once I have a HF dataset `ds`, if I just add this line:
```py
ds.__getitems__ = ds.__getitem__
```
...then the time taken to loop over the dataset improves considerably (for wikitext-103, from one minute to 13 seconds with batch size 32). Probably not a big deal in the grand scheme of things, but seems like an easy win.
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31
- Python version: 3.10.8
- PyArrow version: 10.0.1
- Pandas version: 1.5.3
Yeah I figured this was the sort of thing that probably once worked. I can confirm that you no longer need the batch sampler, just `batch_size=n` in the `DataLoader`.
I'll pass on the PR, I'm flat out right now, sorry. | [
-0.1101192831993103,
-0.23176124691963196,
0.08417142927646637,
0.0453609898686409,
0.0064180102199316025,
-0.03963816165924072,
0.45273303985595703,
0.16254007816314697,
0.36948633193969727,
0.2220371663570404,
-0.22642146050930023,
0.371221661567688,
-0.052604660391807556,
-0.2659573256969452,
0.05249384418129921,
-0.2144881784915924,
0.0657806396484375,
0.06410275399684906,
-0.30984199047088623,
-0.15965457260608673,
-0.21209987998008728,
0.10024142265319824,
-0.1952689290046692,
0.030955146998167038,
-0.18657290935516357,
0.043942708522081375,
-0.23085522651672363,
0.16282501816749573,
0.20599240064620972,
-0.5052703619003296,
0.40034985542297363,
0.20296823978424072,
0.17643077671527863,
0.4679167568683624,
-0.00011519843974383548,
0.06753942370414734,
0.2907235324382782,
0.0015215873718261719,
-0.454206258058548,
-0.09685952961444855,
0.2587786912918091,
-0.011201798915863037,
0.39720475673675537,
-0.026308543980121613,
-0.18389752507209778,
-0.19861745834350586,
0.10316645354032516,
-0.30677348375320435,
-0.03878262639045715,
0.18665078282356262,
0.1761501282453537,
0.48593124747276306,
-0.28020161390304565,
-0.17512542009353638,
0.29963454604148865,
0.31643760204315186,
-0.008234839886426926,
-0.0043469201773405075,
0.43225958943367004,
-0.17435206472873688,
-0.5266691446304321,
0.4120333790779114,
-0.11673921346664429,
0.4579087197780609,
0.3332940638065338,
0.04228687286376953,
-0.2878371775150299,
-0.2973325848579407,
-0.11897177249193192,
0.27581343054771423,
0.14148035645484924,
-0.05424387753009796,
-0.4270371198654175,
-0.4172869324684143,
-0.21827445924282074,
-0.05186699703335762,
-0.10767961293458939,
0.20550188422203064,
-0.35841527581214905,
-0.09254378080368042,
-0.05961018428206444,
0.07403990626335144,
0.008760213851928711,
0.09117108583450317,
-0.053756676614284515,
0.27852684259414673,
-0.04044829308986664,
0.16314741969108582,
0.2793625593185425,
0.22815224528312683,
0.3486175537109375,
-0.1950673758983612,
0.16006873548030853,
0.11480560898780823,
-0.2661691904067993,
0.19725963473320007,
0.16464956104755402,
0.04557076469063759,
0.30117541551589966,
-0.10914193093776703,
-0.09130805730819702,
0.35692593455314636,
0.07327178865671158,
-0.10147815197706223,
0.42038291692733765,
-0.02587626874446869,
0.025166798382997513,
0.11456526070833206,
0.19271817803382874,
0.06356779485940933,
0.13304580748081207,
-0.00919259712100029,
0.10541846603155136,
-0.10894494503736496,
-0.008897475898265839,
-0.12399738281965256,
0.1749691516160965,
-0.14584757387638092,
-0.16021573543548584,
-0.17919427156448364,
0.04435720294713974,
-0.07694979012012482,
0.0007746638730168343,
0.5993673801422119,
-0.1027379035949707,
0.3017869293689728,
0.267147958278656,
-0.06562449783086777,
-0.40511274337768555,
0.006104425527155399,
-0.16414928436279297,
-0.18881864845752716,
-0.14245086908340454,
0.008706917986273766,
0.22174955904483795,
-0.6063511371612549,
0.229958176612854,
0.23728851974010468,
0.47800761461257935,
0.011691398918628693,
-0.058549217879772186,
-0.012135644443333149,
0.3954031467437744,
0.10855363309383392,
-0.013816222548484802,
0.3074050843715668,
0.2846143841743469,
0.41279274225234985,
-0.20951715111732483,
0.17383739352226257,
-0.5782018899917603,
-0.15756180882453918,
-0.24201004207134247,
0.12507358193397522,
0.17617663741111755,
-0.028464168310165405,
-0.22169402241706848,
0.04187372699379921,
0.009560912847518921,
0.03326672688126564,
0.12044741213321686,
-0.397219181060791,
-0.20249168574810028,
-0.052544232457876205,
0.11430666595697403,
0.2841375470161438,
-0.134804829955101,
-0.2332814484834671,
0.30294302105903625,
0.006577810272574425,
0.11093717068433762,
0.21983955800533295,
-0.5005888342857361,
0.08869265764951706,
-0.43954285979270935,
0.06889466941356659,
0.09589175134897232,
-0.3138168454170227,
-0.34662288427352905,
0.34314003586769104,
-0.01159634068608284,
0.28948909044265747,
-0.004024125635623932,
0.19217826426029205,
0.28379595279693604,
-0.09872575104236603,
0.2277088314294815,
0.2619098722934723,
-0.01077323965728283,
0.3322465121746063,
-0.2398962527513504,
-0.22735853493213654,
0.06975090503692627,
0.2719813585281372,
0.15699456632137299,
0.10737112909555435,
-0.09078469127416611,
-0.1455785632133484,
0.739646852016449,
-0.23904350399971008,
-0.024299444630742073,
0.2056194394826889,
-0.004437226802110672,
0.20714440941810608,
0.30707380175590515,
-0.014259438961744308,
-0.4944438338279724,
0.37828075885772705,
-0.2084779292345047,
0.055414579808712006,
-0.07160671055316925,
-0.20072144269943237,
0.30357393622398376,
0.17080722749233246,
-0.4206177592277527,
-0.20350231230258942,
-0.03102199360728264,
0.33386239409446716,
0.00785377249121666,
-0.21198271214962006,
-0.22078467905521393,
0.43171513080596924,
-0.037729356437921524,
0.07082663476467133,
-0.3344790041446686,
0.31239157915115356,
0.056178659200668335,
-0.007655736990272999,
-0.13644063472747803,
-0.04875008016824722,
0.1888769268989563,
-0.1678852140903473,
-0.03367892652750015,
0.27610155940055847,
0.11438911408185959,
-0.23599980771541595,
-0.17357614636421204,
-0.38305962085723877,
0.22442422807216644,
-0.0685865581035614,
0.21947608888149261,
0.37656906247138977,
0.1971297711133957,
-0.12453654408454895,
-0.341744989156723,
0.48946094512939453,
0.1460796445608139,
0.5335414409637451,
0.0507117435336113,
-0.05817843973636627,
-0.050554826855659485,
0.030704010277986526,
-0.13648544251918793,
0.0019781291484832764,
0.237839937210083,
-0.2644186019897461,
0.1325731873512268,
-0.048934340476989746,
-0.5065256953239441,
0.2522299289703369,
0.4477497339248657,
-0.05226418375968933,
-0.10168730467557907,
0.29683801531791687,
-0.2694445550441742,
-0.12380417436361313,
0.1257713884115219,
-0.26757314801216125,
0.24407917261123657,
0.18056121468544006,
-0.0009280480444431305,
-0.1841786503791809,
-0.08631152659654617,
-0.012898998335003853,
-0.0008205845952033997,
0.1863311231136322,
-0.16502954065799713,
0.037727728486061096,
0.22728583216667175,
-0.1369277387857437,
-0.3628956079483032,
-0.04023037478327751,
-0.11753188818693161,
0.029521051794290543,
-0.32501220703125,
0.32630783319473267,
-0.2723304033279419,
-0.017333190888166428,
-0.21878714859485626,
-0.21317675709724426,
-0.12606626749038696,
-0.3205726444721222,
-0.039483197033405304,
0.4573211371898651,
0.07430385053157806,
0.110926054418087,
-0.27881327271461487,
0.15350401401519775,
0.16119210422039032,
-0.12531091272830963,
-0.1844952553510666,
0.03843278810381889,
-0.22334682941436768,
-0.05535665899515152,
0.0294550321996212,
0.052613213658332825,
0.276263028383255,
-0.014774416573345661,
-0.23064017295837402,
-0.5013314485549927,
0.006468929350376129,
0.31891366839408875,
-0.05202028900384903,
0.17221540212631226,
0.1178915947675705,
-0.04885140061378479,
0.00039610639214515686,
-0.1129588708281517,
0.12909601628780365,
-0.43524086475372314,
-0.13783523440361023,
0.20390799641609192,
-0.024865426123142242,
0.1146920695900917,
0.06236894056200981,
-0.06463224440813065,
-0.22253337502479553,
-0.18015512824058533,
-0.11597608029842377,
0.07222287356853485,
0.24623335897922516,
0.14173372089862823,
0.10333676636219025,
0.07468812167644501,
-0.218499094247818,
-0.03202033042907715,
-0.1339896321296692,
-0.2582957148551941,
0.23521360754966736,
-0.10748212784528732,
-0.5556256175041199,
-0.27249976992607117,
-0.018354831263422966,
-0.279517263174057,
0.24598610401153564,
-0.5316359996795654,
-0.3801044821739197,
-0.2128870189189911,
0.36072075366973877,
-0.0004072263836860657,
0.26414135098457336,
0.2409428358078003,
-0.06311376392841339,
-0.0646449476480484,
-0.10993818938732147,
-0.05782254785299301,
0.016754642128944397,
-0.12679293751716614,
0.013756975531578064,
-0.019776728004217148,
0.29518282413482666,
0.012958068400621414,
0.8854247331619263,
0.2961239516735077,
-0.14278574287891388,
0.26171088218688965,
-0.1107771024107933,
0.340736985206604,
-0.31718140840530396,
-0.4627915322780609,
-0.00020982488058507442,
-0.3277145326137543,
0.052048973739147186,
0.2524036467075348,
-0.10009896755218506,
-0.1068849191069603,
0.052402131259441376,
0.11191670596599579,
0.00961415097117424,
-0.35117799043655396,
0.21574845910072327,
-0.08238908648490906,
0.008571445941925049,
-0.05345961079001427,
0.43657687306404114,
-0.337760329246521,
0.047278061509132385,
0.11179904639720917,
0.02301003783941269,
0.29562997817993164,
0.05992306396365166,
-0.13580860197544098,
0.14364539086818695,
-0.729990541934967,
0.17176522314548492,
0.18518291413784027,
0.42130863666534424,
0.1878955364227295,
-0.19194266200065613,
0.21372556686401367,
-0.18485794961452484,
0.5809088945388794,
0.41740286350250244,
0.04786856099963188,
0.10915675759315491,
-0.3057498335838318,
-0.3581658899784088,
-0.09282182157039642,
-0.1397889405488968,
0.5224247574806213,
-0.07661156356334686,
0.18606287240982056,
-0.24407225847244263,
-0.586450457572937,
0.23588044941425323,
0.24293461441993713,
-0.2691532075405121,
0.00532479677349329,
-0.3746045231819153,
-0.3561544418334961,
-0.1849498152732849,
0.08116602897644043,
0.06529480218887329,
-0.012918699532747269,
-0.042487069964408875,
0.04718129709362984,
-0.17371010780334473,
-0.11139854788780212,
-0.0019010528922080994,
-0.10441391170024872,
0.15294277667999268,
0.17097672820091248,
0.1745549589395523,
0.276777446269989,
0.335549533367157,
0.3300171494483948,
0.6021777391433716,
-0.28286266326904297,
-0.24972453713417053,
0.20415142178535461,
-0.004907219670712948,
0.14247460663318634,
0.4300113618373871,
-0.08797406405210495,
0.20959246158599854,
0.12950703501701355,
0.31986814737319946,
-0.3459964692592621,
-0.07018519192934036,
0.41670289635658264,
-0.05521148070693016,
-0.4658952057361603,
-0.3082437813282013,
0.653343915939331,
-0.018452538177371025,
-0.0999908298254013,
0.3870459198951721,
0.19484098255634308,
-0.11074373126029968,
0.4461764693260193,
0.15938153862953186,
0.5364529490470886,
-0.17467312514781952,
0.337428480386734,
0.3978163003921509,
-0.012361172586679459,
0.18781492114067078,
0.21875374019145966,
0.24334357678890228,
-0.3269762396812439,
-0.24602515995502472,
-0.005940888077020645,
-0.13716211915016174,
-0.18351849913597107,
0.04052122309803963,
0.048601020127534866,
0.3622986078262329,
-0.12545274198055267,
-0.01035219058394432,
0.05078341066837311,
0.23641887307167053,
0.011746656149625778,
-0.3817448019981384,
0.05368775129318237,
0.16330325603485107,
-0.05025576800107956,
0.37079519033432007,
-0.0012327171862125397,
-0.1194467693567276,
0.2788373529911041,
-0.35568249225616455,
-0.08975938707590103,
0.23989710211753845,
-0.2539539337158203,
-0.029049716889858246,
0.10614059865474701,
-0.4368721842765808,
-0.12212833762168884,
-0.2584696114063263,
0.12364145368337631,
-0.2788662910461426,
-0.023392869159579277,
0.07956516742706299,
0.06212927773594856,
0.2880665957927704,
-0.11397802084684372,
-0.2643490731716156,
0.31263843178749084,
0.13730072975158691,
-0.09905914962291718,
-0.06272821873426437,
-0.0558374784886837,
-0.5693119764328003,
0.043628349900245667,
0.33576542139053345,
0.08292855322360992,
-0.18196912109851837,
-0.10537974536418915,
0.11424922943115234,
0.11334539949893951,
-0.29947391152381897,
0.05389303341507912,
0.08551117777824402,
-0.14251478016376495,
0.25054681301116943,
-0.07423143088817596,
-0.18138499557971954,
-0.11003568768501282,
0.5676526427268982,
0.12196269631385803,
-0.22561046481132507,
0.3183690905570984,
0.5069891810417175,
-0.25887566804885864,
-0.08685776591300964,
-0.1623477041721344,
0.6028748154640198,
-0.3840513229370117,
0.21151317656040192,
-0.2115727812051773,
0.2877489924430847,
0.10296107083559036,
0.4567221999168396,
-0.2759571671485901,
-0.20853623747825623,
-0.41819655895233154,
-0.07427742332220078,
-0.3044596016407013,
0.07589706033468246,
0.050540853291749954,
0.30106502771377563,
0.044864341616630554,
-0.010160824283957481,
-0.039007753133773804,
0.12666630744934082,
-0.2924256920814514,
0.04395391047000885,
0.09179715812206268,
0.12056539207696915,
0.07324806600809097,
-0.027946501970291138,
0.11797087639570236,
0.12969528138637543,
0.05139375478029251,
-0.06207294017076492,
-0.018880534917116165,
-0.18375051021575928,
-0.13373945653438568,
0.10117185860872269,
-0.040536120533943176,
-0.019201811403036118,
-0.1425773799419403,
-0.24797309935092926,
-0.06321156024932861,
-0.28506529331207275,
0.48351383209228516,
0.40996575355529785,
-0.11497324705123901,
0.10153830051422119,
0.39741021394729614,
-0.18566635251045227,
0.29893434047698975,
0.13878381252288818,
-0.039248377084732056,
0.14679116010665894,
0.10933426767587662,
0.04723343998193741,
-0.10156405717134476,
0.0414922833442688,
-0.08769398927688599,
0.23386794328689575,
0.191905677318573,
0.043593112379312515,
0.1803620308637619,
-0.5162718892097473,
-0.0518144853413105,
-0.040308985859155655,
0.34396567940711975,
0.24758955836296082,
-0.023579370230436325,
-0.14230838418006897,
0.1431531012058258,
0.14471407234668732,
-0.272153377532959,
-0.4764670431613922,
-0.08364629745483398,
-0.03493331000208855,
0.20540815591812134,
0.2948664426803589,
-0.01663949340581894,
-0.00014442205429077148,
0.3127141296863556,
0.07374118268489838,
0.3510059118270874,
-0.011346094310283661,
-0.12660078704357147,
0.37997516989707947,
0.09757757186889648,
-0.1086207777261734,
0.3808860182762146,
0.19421327114105225,
0.17094114422798157,
0.37606358528137207,
-0.17914912104606628,
0.6928098201751709,
0.1295894980430603,
0.07919032871723175,
0.206192284822464,
-0.4288858473300934,
0.1328691989183426,
0.019923582673072815,
0.07402321696281433,
0.04393591731786728,
-0.1985209882259369,
0.38642340898513794,
-0.37541869282722473,
-0.40403175354003906,
-0.21929831802845,
0.2557191550731659,
-0.14212816953659058,
-0.17473037540912628,
-0.11211645603179932,
-0.14799442887306213,
0.14426304399967194,
0.12284529209136963,
-0.14314594864845276,
-0.11718210577964783,
0.24992217123508453,
0.04727404564619064,
-0.13422000408172607,
-0.24520523846149445,
-0.35902002453804016,
0.008642580360174179,
0.35634616017341614,
-0.026389800012111664,
0.07566055655479431,
0.024597518146038055,
0.019091986119747162,
0.052848320454359055,
0.22667144238948822,
0.14523737132549286,
0.3444693386554718,
-0.2487216293811798,
-0.06047353520989418,
-0.24007509648799896,
-0.08810092508792877,
0.007327506318688393,
0.020449409261345863,
-0.3913445472717285,
-0.15509290993213654,
0.34578394889831543,
0.10778677463531494,
-0.1246190220117569,
0.05248189717531204,
-0.13671301305294037,
-0.010936589911580086,
-0.28226715326309204,
0.27628976106643677,
-0.06253990530967712,
-0.05673033371567726,
-0.02135680615901947,
-0.13204821944236755,
-0.23270297050476074,
-0.15489237010478973,
0.4416027367115021,
-0.28344568610191345,
0.12090267986059189,
-0.11108097434043884,
0.07375212758779526,
-0.18402914702892303,
0.43222251534461975,
0.1572030484676361,
0.369459331035614,
-0.19644974172115326,
0.06353649497032166,
-0.3643825054168701,
0.0066616833209991455,
-0.46710073947906494,
-0.06430183351039886,
0.2413213849067688,
0.2496267706155777,
0.11052852123975754,
0.06593948602676392,
0.11867524683475494,
-0.0588698536157608,
0.19286233186721802,
0.34304121136665344,
-0.18160860240459442,
-0.019939560443162918,
-0.1668388694524765,
0.2856253683567047,
0.08356059342622757,
-0.5192334651947021,
0.15467488765716553,
0.013209342025220394,
0.053314581513404846,
-0.055790796875953674,
-0.006080441176891327,
0.18895740807056427,
-0.35481247305870056,
0.2887232303619385,
0.07602336257696152,
0.07115431129932404,
0.059512145817279816,
-0.13083939254283905,
-0.3622240424156189,
-0.031146975234150887,
-0.29245325922966003,
-0.33574068546295166,
-0.0992375910282135,
0.3273008465766907,
0.14238673448562622,
-0.34566211700439453,
-0.4594925343990326,
0.19925592839717865,
0.2674153447151184,
0.09032614529132843,
-0.16607914865016937,
0.4252464175224304,
-0.35331007838249207,
0.21989111602306366,
0.08483099192380905,
0.41536739468574524,
0.2278808057308197,
0.060382649302482605,
-0.34371012449264526,
-0.30361834168434143,
0.5765687823295593,
-0.6476643085479736,
-0.2774750292301178,
-0.24843990802764893,
0.31560754776000977,
-0.16565904021263123,
-0.13596348464488983,
-0.4676256775856018,
-0.057688161730766296,
0.12684562802314758,
0.06502385437488556,
-0.16842122375965118,
0.06099987402558327,
-0.032844047993421555,
-0.0009444728493690491,
-0.2696132957935333,
0.2899530529975891,
0.30861613154411316,
-0.15476560592651367,
-0.16339196264743805,
-0.2491406798362732
] |
https://github.com/huggingface/datasets/issues/5499 | `load_dataset` has ~4 seconds of overhead for cached data | Hi ! To skip the verification step that checks if newer data exist, you can enable offline mode with `HF_DATASETS_OFFLINE=1`.
Although I agree this step should be much faster for datasets hosted on the HF Hub - we could just compare the commit hash from the local data and the remote git repository. We're not been leveraging the git commit hashes, since the library was built before we even had git repositories for each dataset on HF. | ### Feature request
When loading a dataset that has been cached locally, the `load_dataset` function takes a lot longer than it should take to fetch the dataset from disk (or memory).
This is particularly noticeable for smaller datasets. For example, wikitext-2, comparing `load_data` (once cached) and `load_from_disk`, the `load_dataset` method takes 40 times longer.
⏱ 4.84s ⮜ load_dataset
⏱ 119ms ⮜ load_from_disk
### Motivation
I assume this is doing something like checking for a newer version.
If so, that's an age old problem: do you make the user wait _every single time they load from cache_ or do you do something like load from cache always, _then_ check for a newer version and alert if they have stale data. The decision usually revolves around what percentage of the time the data will have been updated, and how dangerous old data is.
For most datasets it's extremely unlikely that there will be a newer version on any given run, so 99% of the time this is just wasted time.
Maybe you don't want to make that decision for all users, but at least having the _option_ to not wait for checks would be an improvement.
### Your contribution
. | 77 | `load_dataset` has ~4 seconds of overhead for cached data
### Feature request
When loading a dataset that has been cached locally, the `load_dataset` function takes a lot longer than it should take to fetch the dataset from disk (or memory).
This is particularly noticeable for smaller datasets. For example, wikitext-2, comparing `load_data` (once cached) and `load_from_disk`, the `load_dataset` method takes 40 times longer.
⏱ 4.84s ⮜ load_dataset
⏱ 119ms ⮜ load_from_disk
### Motivation
I assume this is doing something like checking for a newer version.
If so, that's an age old problem: do you make the user wait _every single time they load from cache_ or do you do something like load from cache always, _then_ check for a newer version and alert if they have stale data. The decision usually revolves around what percentage of the time the data will have been updated, and how dangerous old data is.
For most datasets it's extremely unlikely that there will be a newer version on any given run, so 99% of the time this is just wasted time.
Maybe you don't want to make that decision for all users, but at least having the _option_ to not wait for checks would be an improvement.
### Your contribution
.
Hi ! To skip the verification step that checks if newer data exist, you can enable offline mode with `HF_DATASETS_OFFLINE=1`.
Although I agree this step should be much faster for datasets hosted on the HF Hub - we could just compare the commit hash from the local data and the remote git repository. We're not been leveraging the git commit hashes, since the library was built before we even had git repositories for each dataset on HF. | [
-0.3865840435028076,
-0.02502131462097168,
-0.08470572531223297,
-0.10525839030742645,
-0.13569878041744232,
0.05334455519914627,
0.34366053342819214,
0.5788078904151917,
0.5157313942909241,
0.2465118020772934,
-0.021490031853318214,
0.08896809071302414,
0.19552995264530182,
-0.03234231472015381,
-0.08561548590660095,
-0.08792808651924133,
0.14924371242523193,
0.31831133365631104,
-0.0888872891664505,
-0.13471268117427826,
-0.1411086916923523,
-0.11635243892669678,
-0.017583440989255905,
-0.03902134299278259,
-0.05018030107021332,
0.14488700032234192,
0.041000522673130035,
0.1722564697265625,
-0.02140110917389393,
-0.5309178829193115,
0.361402690410614,
0.47142842411994934,
0.027351845055818558,
0.17948025465011597,
-0.00010911194840446115,
0.04759531468153,
0.1566344052553177,
0.09821314364671707,
-0.5640242099761963,
0.030550524592399597,
-0.1924547553062439,
-0.33092552423477173,
0.04553446173667908,
-0.1846827268600464,
-0.12365708500146866,
0.13461661338806152,
0.02097167633473873,
-0.44314712285995483,
0.02850113809108734,
-0.15869642794132233,
0.15603968501091003,
0.3585345149040222,
-0.4278644621372223,
-0.023079518228769302,
0.1636747419834137,
0.13157379627227783,
-0.180261492729187,
0.16532784700393677,
0.1067405641078949,
-0.09144119918346405,
-0.25470319390296936,
0.4887540340423584,
-0.01601792871952057,
0.2686290442943573,
0.5051451921463013,
-0.07946955412626266,
0.022687196731567383,
-0.004067815840244293,
0.011740600690245628,
0.4638342559337616,
0.623191773891449,
-0.09646407514810562,
-0.3124490976333618,
-0.37200310826301575,
-0.11255162954330444,
0.019857781007885933,
0.3618699014186859,
-0.032815009355545044,
-0.1540343016386032,
0.22003555297851562,
-0.29149550199508667,
-0.19158349931240082,
-0.06071475148200989,
-0.13641487061977386,
0.12472952902317047,
0.2033359408378601,
0.2322402149438858,
0.10105399787425995,
0.3321671485900879,
0.10970224440097809,
0.28048214316368103,
-0.3568360209465027,
0.03280381113290787,
0.28900614380836487,
-0.37324318289756775,
-0.29607683420181274,
0.09827364236116409,
0.12389709055423737,
0.25240176916122437,
0.2309550642967224,
-0.21111127734184265,
0.2909974455833435,
0.02500608190894127,
0.027084244415163994,
0.050747811794281006,
0.12120713293552399,
0.17649254202842712,
-0.31963637471199036,
0.2767722010612488,
-0.03363274037837982,
-0.05289776623249054,
-0.15062767267227173,
-0.06605594605207443,
-0.08880329877138138,
0.2266702502965927,
-0.13812005519866943,
-0.05079119652509689,
-0.3200039565563202,
0.063396155834198,
0.01659589819610119,
0.29100173711776733,
-0.1491631418466568,
0.12196484953165054,
0.46238526701927185,
-0.1595904529094696,
0.37535426020622253,
-0.15337112545967102,
-0.25381964445114136,
-0.3985656797885895,
-0.13582558929920197,
-0.08430377393960953,
-0.07506197690963745,
0.040677908807992935,
0.24875228106975555,
0.11812379956245422,
-0.3369637727737427,
0.1197294369339943,
0.018363799899816513,
0.19247493147850037,
0.35740888118743896,
0.2381136119365692,
-0.25782105326652527,
0.17256402969360352,
0.35189852118492126,
-0.1815125048160553,
0.020940298214554787,
0.19177395105361938,
0.13710156083106995,
-0.39273929595947266,
0.17145667970180511,
-0.42067933082580566,
-0.48711270093917847,
-0.13945913314819336,
0.15469880402088165,
-0.006476510316133499,
-0.05522725731134415,
-0.35831600427627563,
0.13425815105438232,
-0.2667437195777893,
-0.20143453776836395,
0.04517986625432968,
0.11457695811986923,
-0.3037589192390442,
-0.08735864609479904,
0.32795587182044983,
0.5445750951766968,
-0.26259472966194153,
-0.01875884085893631,
-0.2052825689315796,
-0.20272058248519897,
-0.1317538619041443,
0.10317844152450562,
-0.5577514171600342,
0.49146896600723267,
-0.20971380174160004,
0.10472998023033142,
0.39123809337615967,
-0.6382346153259277,
-0.37879350781440735,
0.4493339955806732,
0.017339445650577545,
0.3390655517578125,
-0.135961651802063,
0.3170224726200104,
0.005197745282202959,
-0.31489312648773193,
-0.1905883550643921,
0.32915884256362915,
0.04244200885295868,
0.3268822133541107,
-0.35984697937965393,
-0.43911704421043396,
0.17620190978050232,
0.23396427929401398,
-0.10084724426269531,
0.04546879231929779,
0.17869418859481812,
0.2854125201702118,
0.21478480100631714,
-0.11359958350658417,
-0.10797614604234695,
-0.04427221417427063,
0.2089771330356598,
-0.01208002120256424,
-0.05512496829032898,
0.1845155954360962,
-0.4481973648071289,
0.5274943113327026,
0.06754882633686066,
-0.13291588425636292,
0.1682811677455902,
-0.2626623809337616,
-0.006905694492161274,
0.07344073802232742,
-0.28628674149513245,
0.07818949222564697,
0.051047183573246,
0.15064078569412231,
0.23610803484916687,
0.050101976841688156,
-0.14552168548107147,
0.5471431612968445,
-0.16968493163585663,
-0.060470566153526306,
0.049345459789037704,
0.2573349177837372,
0.16882328689098358,
0.5465385913848877,
-0.16749295592308044,
-0.2789500951766968,
-0.011404857039451599,
-0.18308986723423004,
-0.24598002433776855,
0.4894642233848572,
0.016060739755630493,
0.38763320446014404,
0.3014757037162781,
0.11430711299180984,
0.07029535621404648,
0.21476009488105774,
0.24181047081947327,
-0.24708329141139984,
0.2578747272491455,
-0.04897647723555565,
-0.37413591146469116,
0.38607168197631836,
0.09046629816293716,
0.14685818552970886,
-0.06147933006286621,
-0.44583338499069214,
0.04980411380529404,
-0.07954584062099457,
0.13784371316432953,
-0.09173718839883804,
0.1563601791858673,
0.02792195789515972,
0.387959748506546,
0.01951921172440052,
0.016323141753673553,
0.31801530718803406,
0.8103203773498535,
-0.031737349927425385,
-0.16144782304763794,
0.4050734341144562,
0.19324827194213867,
-0.3739899694919586,
0.30418914556503296,
0.06875458359718323,
0.37865084409713745,
0.21465657651424408,
-0.04255982115864754,
0.00005202926695346832,
-0.012448647059500217,
-0.015236674807965755,
0.15132853388786316,
-0.12049861252307892,
0.3267572224140167,
0.08018344640731812,
0.08139456808567047,
0.020562950521707535,
-0.3284660279750824,
-0.09949994087219238,
0.018965912982821465,
0.250545859336853,
0.055451128631830215,
0.11255500465631485,
-0.15454158186912537,
0.13429763913154602,
0.18921609222888947,
0.03025991842150688,
-0.29433029890060425,
-0.39255693554878235,
0.20138637721538544,
0.24937626719474792,
-0.043443381786346436,
0.0012347716838121414,
-0.2857489287853241,
0.3816549777984619,
-0.04224741458892822,
-0.4845975637435913,
-0.3026406466960907,
-0.21712133288383484,
-0.19555702805519104,
0.027531661093235016,
0.1771191656589508,
0.10230995714664459,
0.4706234037876129,
-0.055937759578228,
0.060589224100112915,
-0.3803860545158386,
-0.26443785429000854,
0.13873961567878723,
-0.08072753995656967,
0.07267206907272339,
-0.06073731184005737,
0.21367904543876648,
-0.11694386601448059,
-0.06766676157712936,
0.04922335222363472,
-0.28293663263320923,
-0.1757325381040573,
-0.03103376179933548,
0.00044621649431064725,
0.1763613522052765,
-0.07696165144443512,
-0.07883269339799881,
-0.24838511645793915,
-0.2704300284385681,
-0.010155215859413147,
0.01734747365117073,
0.3229430913925171,
-0.07383428514003754,
-0.046909984201192856,
0.022963620722293854,
0.036286309361457825,
-0.12493988871574402,
-0.31434059143066406,
-0.7986220717430115,
0.11114147305488586,
-0.2320411056280136,
-0.184662863612175,
-0.06591849774122238,
0.24523399770259857,
0.0480794832110405,
0.12184041738510132,
-0.7336210012435913,
-0.1990298628807068,
-0.2588158845901489,
0.381490558385849,
-0.17748460173606873,
-0.11379198729991913,
0.34346693754196167,
0.03101625107228756,
-0.12612393498420715,
-0.11211013048887253,
0.15555712580680847,
0.14454533159732819,
-0.1399032175540924,
-0.07066663354635239,
0.06967020034790039,
0.26658764481544495,
0.06566092371940613,
0.785219669342041,
-0.12238809466362,
0.1637401580810547,
0.27985572814941406,
0.18023259937763214,
0.314893513917923,
-0.4109783172607422,
-0.01878448948264122,
0.15119923651218414,
0.05736532062292099,
0.2369503527879715,
0.4662781357765198,
-0.006603287532925606,
-0.32198575139045715,
-0.31687065958976746,
-0.4366631805896759,
-0.08283115923404694,
-0.3620043694972992,
0.06819382309913635,
-0.12720955908298492,
-0.03979058563709259,
0.1531739979982376,
0.12179040163755417,
-0.505315899848938,
-0.23629406094551086,
0.29785123467445374,
0.23253639042377472,
0.25199365615844727,
0.11053930222988129,
-0.20103295147418976,
0.08268037438392639,
-0.5338277816772461,
0.2633400857448578,
0.1311282515525818,
0.18803730607032776,
0.05748271569609642,
-0.25764036178588867,
0.15771818161010742,
-0.296513170003891,
0.2241164743900299,
-0.31758594512939453,
0.1820463240146637,
-0.06675664335489273,
-0.17278116941452026,
-0.0715511217713356,
-0.1785862147808075,
0.18696755170822144,
0.07402148097753525,
-0.28022390604019165,
0.24886055290699005,
-0.2612590789794922,
-0.5044926404953003,
-0.041932545602321625,
0.09121792018413544,
-0.1638234555721283,
-0.17723390460014343,
-0.35120323300361633,
-0.0030273422598838806,
-0.3630617558956146,
0.06760871410369873,
-0.443189799785614,
0.07402950525283813,
-0.2021722048521042,
0.08100484311580658,
-0.1581123024225235,
0.4346671402454376,
0.09998542815446854,
0.40008965134620667,
-0.031622469425201416,
0.08409111201763153,
0.1357307732105255,
0.07976602017879486,
0.09977991878986359,
0.18700379133224487,
0.42417585849761963,
-0.09267005324363708,
0.1661211997270584,
-0.01888321340084076,
0.019137069582939148,
-0.1127915009856224,
0.37075674533843994,
0.09391118586063385,
0.1140948012471199,
0.040369391441345215,
0.35504812002182007,
-0.4806345999240875,
0.09883860498666763,
0.042009904980659485,
-0.1591140180826187,
-0.40135878324508667,
-0.393197238445282,
0.6138904094696045,
-0.10557083785533905,
-0.05351816490292549,
0.3908076286315918,
0.3793995976448059,
0.012861381284892559,
0.20665499567985535,
0.1799660325050354,
0.8440194129943848,
-0.10087697207927704,
0.018640581518411636,
0.21561911702156067,
0.007709663361310959,
0.31110498309135437,
-0.7127015590667725,
-0.0005590040236711502,
-0.15421798825263977,
-0.2179514765739441,
-0.12580975890159607,
-0.017564326524734497,
0.2751242518424988,
0.07474318146705627,
-0.2040289342403412,
0.0863855853676796,
0.06306882202625275,
0.2549237608909607,
-0.35356149077415466,
0.5399267077445984,
-0.1965140551328659,
-0.3006173372268677,
-0.21711887419223785,
0.24460771679878235,
0.08437161147594452,
0.2473221719264984,
-0.20264989137649536,
0.0056060259230434895,
0.12080332636833191,
-0.11819028109312057,
-0.054754212498664856,
-0.015359148383140564,
0.13563387095928192,
0.2710365653038025,
-0.35097959637641907,
0.12003682553768158,
-0.08237887918949127,
-0.25751686096191406,
0.3506908416748047,
0.21486543118953705,
-0.25045713782310486,
0.3021511137485504,
-0.1401262879371643,
0.32760441303253174,
-0.08029205352067947,
-0.16757133603096008,
0.24102430045604706,
-0.2772643566131592,
-0.31244784593582153,
0.012401465326547623,
-0.3365088701248169,
-0.607077419757843,
0.2774016857147217,
0.02801629528403282,
0.21598808467388153,
0.04442232847213745,
-0.11611308157444,
0.3319282531738281,
-0.1283971518278122,
-0.09832176566123962,
0.09393763542175293,
-0.09950561821460724,
0.07745561748743057,
0.05426855757832527,
0.04662802070379257,
-0.43317824602127075,
-0.12831348180770874,
0.3329967260360718,
0.07229556888341904,
-0.028716938570141792,
0.14670273661613464,
-0.16920839250087738,
-0.3122078776359558,
-0.18406039476394653,
0.04849671572446823,
0.27509233355522156,
-0.40220218896865845,
-0.053377170115709305,
0.13321912288665771,
0.11378531157970428,
0.21337537467479706,
0.14373677968978882,
-0.051794327795505524,
-0.21538487076759338,
-0.059001319110393524,
-0.14713706076145172,
-0.16325391829013824,
-0.00462176650762558,
-0.20781801640987396,
0.35164937376976013,
0.307758629322052,
-0.11113271117210388,
-0.09695279598236084,
0.20606231689453125,
-0.34740182757377625,
-0.15057282149791718,
-0.2527174949645996,
0.005689818412065506,
-0.21726539731025696,
0.061777856200933456,
0.2567145824432373,
-0.1434580385684967,
0.011104708537459373,
0.04416711628437042,
-0.4422743618488312,
-0.21906638145446777,
-0.12125968933105469,
0.19173523783683777,
-0.22962912917137146,
0.053276002407073975,
-0.04111170768737793,
-0.1521974503993988,
-0.12397204339504242,
-0.28598493337631226,
0.45343276858329773,
-0.04767834395170212,
-0.25930142402648926,
-0.02096562460064888,
0.579752504825592,
-0.017012707889080048,
-0.19831512868404388,
0.19267253577709198,
0.2099291831254959,
0.2190942019224167,
-0.3399447500705719,
-0.02668479084968567,
-0.23552969098091125,
-0.10134470462799072,
0.19278967380523682,
0.3606473505496979,
0.3838788866996765,
0.09585809707641602,
0.1356096714735031,
0.06525137275457382,
0.15169110894203186,
-0.03615047037601471,
0.11168041825294495,
0.04279655963182449,
0.07040850818157196,
-0.32661008834838867,
0.27590212225914,
0.15971234440803528,
-0.19623202085494995,
-0.3913208544254303,
0.0297060776501894,
-0.2364412397146225,
0.15202808380126953,
0.07956059277057648,
0.4965684115886688,
0.19675415754318237,
0.2601310610771179,
0.06202321499586105,
0.3362758755683899,
-0.3302053213119507,
-0.07096095383167267,
0.4766194522380829,
0.040630172938108444,
-0.03583769127726555,
0.12320805341005325,
0.05780715495347977,
0.23264148831367493,
0.32838064432144165,
-0.1302088499069214,
0.22300966084003448,
0.1579989194869995,
0.3089270293712616,
-0.2628036439418793,
-0.46629250049591064,
0.37425142526626587,
0.45983001589775085,
-0.13976998627185822,
0.10093145072460175,
0.06633040308952332,
-0.21184653043746948,
0.1765616089105606,
-0.4151318073272705,
-0.295166552066803,
0.46252870559692383,
-0.013637572526931763,
-0.04231593757867813,
0.14732173085212708,
-0.05722155421972275,
-0.17162048816680908,
0.11859756708145142,
-0.014126446098089218,
-0.054948024451732635,
0.2625390589237213,
0.19627323746681213,
0.13373923301696777,
0.1079745814204216,
0.13976189494132996,
0.06230999901890755,
0.3758687973022461,
-0.1333736926317215,
-0.10824242979288101,
0.17349889874458313,
-0.07504825294017792,
0.21917074918746948,
0.1890823096036911,
-0.02972070500254631,
0.12489122152328491,
-0.03532871603965759,
0.1042243018746376,
0.006071683019399643,
0.10381989181041718,
0.022076942026615143,
0.15475653111934662,
-0.2810235619544983,
-0.05255855992436409,
0.4181642234325409,
0.10181964188814163,
-0.08123709261417389,
-0.032837558537721634,
-0.4015446901321411,
-0.030461955815553665,
-0.42714202404022217,
0.2210751622915268,
0.40359193086624146,
0.16176721453666687,
-0.05168680101633072,
0.2704821527004242,
-0.1827152669429779,
0.021362677216529846,
0.1222282350063324,
-0.09079679101705551,
0.19100478291511536,
-0.29876524209976196,
0.08053813129663467,
-0.047927241772413254,
0.6388474702835083,
0.17495089769363403,
-0.1299775242805481,
-0.07391588389873505,
-0.28255677223205566,
-0.5422003269195557,
-0.26726579666137695,
-0.3762161135673523,
0.08914034813642502,
0.4059433341026306,
0.16804268956184387,
0.1266237199306488,
0.3144112229347229,
0.18178150057792664,
-0.21758249402046204,
-0.0350155346095562,
-0.12033486366271973,
-0.25247693061828613,
0.16115213930606842,
-0.1425364464521408,
-0.2149655520915985,
-0.16689781844615936,
-0.6621971130371094,
0.38300397992134094,
0.0570891834795475,
0.004083860665559769,
0.06607033312320709,
0.15159465372562408,
0.41193100810050964,
-0.14584046602249146,
0.4441823363304138,
0.09664549678564072,
-0.1505104899406433,
-0.005782086402177811,
-0.014162953943014145,
-0.08808988332748413,
0.14768856763839722,
-0.12467952072620392,
-0.2421921193599701,
-0.19693227112293243,
0.28809770941734314,
-0.018373072147369385,
-0.1335315704345703,
-0.11858578026294708,
0.21779456734657288,
0.0710335299372673,
0.2769482135772705,
-0.17596787214279175,
-0.25096678733825684,
-0.08217357099056244,
0.17441973090171814,
0.10206739604473114,
0.18933534622192383,
0.22548158466815948,
0.16576087474822998,
-0.3304970860481262,
-0.012755077332258224,
0.43530887365341187,
-0.23940376937389374,
-0.0650925561785698,
-0.17448364198207855,
0.21868029236793518,
0.10230712592601776,
-0.14064228534698486,
-0.563054621219635,
0.06467405706644058,
0.3184380531311035,
0.20522353053092957,
0.05549534037709236,
0.42537999153137207,
-0.17206910252571106,
0.11387674510478973,
-0.08977490663528442,
0.2784087359905243,
-0.24986255168914795,
-0.16900020837783813,
-0.22488176822662354,
-0.1969233900308609
] |
https://github.com/huggingface/datasets/issues/5498 | TypeError: 'bool' object is not iterable when filtering a datasets.arrow_dataset.Dataset | Hi! Instead of a single boolean, your filter function should return an iterable (of booleans) in the batched mode like so:
```python
train_dataset = train_dataset.filter(
function=lambda batch: [image is not None for image in batch["image"]],
batched=True,
batch_size=10)
```
PS: You can make this operation much faster by operating directly on the arrow data to skip the decoding part:
```python
train_dataset = train_dataset.with_format("arrow")
train_dataset = train_dataset.filter(
function=lambda table: table["image"].is_valid().to_pylist(),
batched=True,
batch_size=100)
train_dataset = train_dataset.with_format(None)
``` | ### Describe the bug
Hi,
Thanks for the amazing work on the library!
**Describe the bug**
I think I might have noticed a small bug in the filter method.
Having loaded a dataset using `load_dataset`, when I try to filter out empty entries with `batched=True`, I get a TypeError.
### Steps to reproduce the bug
```
train_dataset = train_dataset.filter(
function=lambda example: example["image"] is not None,
batched=True,
batch_size=10)
```
Error message:
```
File .../lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
...
-> 5666 indices_array = [i for i, to_keep in zip(indices, mask) if to_keep]
5667 if indices_mapping is not None:
5668 indices_array = pa.array(indices_array, type=pa.uint64())
TypeError: 'bool' object is not iterable
```
**Removing batched=True allows to bypass the issue.**
### Expected behavior
According to the doc, "[batch_size corresponds to the] number of examples per batch provided to function if batched = True", so we shouldn't need to remove the batchd=True arg?
source: https://huggingface.co/docs/datasets/v2.9.0/en/package_reference/main_classes#datasets.Dataset.filter
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.4.0-122-generic-x86_64-with-glibc2.31
- Python version: 3.9.10
- PyArrow version: 10.0.1
- Pandas version: 1.5.3 | 74 | TypeError: 'bool' object is not iterable when filtering a datasets.arrow_dataset.Dataset
### Describe the bug
Hi,
Thanks for the amazing work on the library!
**Describe the bug**
I think I might have noticed a small bug in the filter method.
Having loaded a dataset using `load_dataset`, when I try to filter out empty entries with `batched=True`, I get a TypeError.
### Steps to reproduce the bug
```
train_dataset = train_dataset.filter(
function=lambda example: example["image"] is not None,
batched=True,
batch_size=10)
```
Error message:
```
File .../lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
...
-> 5666 indices_array = [i for i, to_keep in zip(indices, mask) if to_keep]
5667 if indices_mapping is not None:
5668 indices_array = pa.array(indices_array, type=pa.uint64())
TypeError: 'bool' object is not iterable
```
**Removing batched=True allows to bypass the issue.**
### Expected behavior
According to the doc, "[batch_size corresponds to the] number of examples per batch provided to function if batched = True", so we shouldn't need to remove the batchd=True arg?
source: https://huggingface.co/docs/datasets/v2.9.0/en/package_reference/main_classes#datasets.Dataset.filter
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.4.0-122-generic-x86_64-with-glibc2.31
- Python version: 3.9.10
- PyArrow version: 10.0.1
- Pandas version: 1.5.3
Hi! Instead of a single boolean, your filter function should return an iterable (of booleans) in the batched mode like so:
```python
train_dataset = train_dataset.filter(
function=lambda batch: [image is not None for image in batch["image"]],
batched=True,
batch_size=10)
```
PS: You can make this operation much faster by operating directly on the arrow data to skip the decoding part:
```python
train_dataset = train_dataset.with_format("arrow")
train_dataset = train_dataset.filter(
function=lambda table: table["image"].is_valid().to_pylist(),
batched=True,
batch_size=100)
train_dataset = train_dataset.with_format(None)
``` | [
-0.18260245025157928,
-0.2624393403530121,
0.019751515239477158,
0.10276506096124649,
-0.16956520080566406,
0.049563996493816376,
0.523794412612915,
0.17173705995082855,
0.12031163275241852,
0.0702308714389801,
0.05394410341978073,
0.1757829785346985,
-0.33603477478027344,
0.26592159271240234,
-0.20708732306957245,
0.14600390195846558,
-0.030682004988193512,
-0.014011017978191376,
-0.10432963073253632,
0.028197571635246277,
-0.17251403629779816,
0.19048358500003815,
-0.5462700128555298,
-0.061474546790122986,
0.061622973531484604,
-0.22912919521331787,
0.09569384157657623,
0.0022770948708057404,
-0.1513068974018097,
-0.3657219707965851,
0.40964892506599426,
-0.16455496847629547,
-0.0004556886851787567,
0.6191940307617188,
-0.00012971056276001036,
0.07227219641208649,
0.4056047797203064,
-0.023674989119172096,
-0.38034820556640625,
-0.3149179220199585,
-0.11497999727725983,
-0.1267060935497284,
0.24859431385993958,
-0.05935345217585564,
0.26042503118515015,
-0.2959209382534027,
-0.15341410040855408,
-0.1936548501253128,
0.30758169293403625,
0.2248927801847458,
0.06832705438137054,
0.4008297026157379,
-0.08384960144758224,
0.10001882910728455,
0.11787685751914978,
0.48755085468292236,
-0.09735974669456482,
0.22905871272087097,
0.1924411505460739,
-0.21444936096668243,
0.010810889303684235,
0.4200686812400818,
-0.2681780755519867,
-0.0491681732237339,
0.18749967217445374,
0.005272917915135622,
-0.04495236277580261,
-0.3456748127937317,
-0.0156727097928524,
0.2183188498020172,
0.31326714158058167,
-0.2714565694332123,
-0.47984611988067627,
-0.6546419262886047,
0.061565883457660675,
0.04571262747049332,
0.05011351406574249,
-0.08668188005685806,
-0.25026100873947144,
-0.07000504434108734,
-0.35951346158981323,
-0.07829328626394272,
-0.1043991893529892,
0.1146354228258133,
0.1399545967578888,
0.3798176348209381,
-0.09414178133010864,
0.2023550570011139,
0.0882420539855957,
-0.14092481136322021,
0.26828089356422424,
-0.20097045600414276,
0.11107257008552551,
0.31919988989830017,
-0.11460147798061371,
-0.040859490633010864,
0.19536784291267395,
0.22443616390228271,
0.2025853991508484,
0.0689920037984848,
0.04536755755543709,
-0.15989282727241516,
0.08533924072980881,
0.09848323464393616,
0.45026451349258423,
0.13174888491630554,
0.4219382107257843,
0.3562771677970886,
0.06751643866300583,
0.19091621041297913,
-0.013773461803793907,
0.10191259533166885,
0.01165116485208273,
-0.12741786241531372,
0.16752496361732483,
0.04799436032772064,
0.4797630310058594,
-0.06068509817123413,
-0.36630362272262573,
-0.12770609557628632,
-0.4822511076927185,
-0.02909686043858528,
0.4334378242492676,
0.17397204041481018,
0.13214518129825592,
-0.02733990177512169,
0.12608501315116882,
-0.06458001583814621,
-0.20254717767238617,
-0.09388814866542816,
-0.10362715274095535,
-0.030697736889123917,
-0.0887557864189148,
-0.16130371391773224,
-0.0877692699432373,
-0.5662897825241089,
0.15206657350063324,
0.04922998324036598,
-0.00728645920753479,
0.24387133121490479,
-0.00507087167352438,
-0.16190528869628906,
0.4948540925979614,
0.410553514957428,
-0.03303094580769539,
0.30391985177993774,
0.37872251868247986,
-0.1218612790107727,
-0.2503844201564789,
0.15987783670425415,
-0.4098230302333832,
-0.16010122001171112,
0.020584728568792343,
-0.023103918880224228,
-0.2239413559436798,
-0.11942651867866516,
-0.4588724672794342,
0.27417516708374023,
0.34528523683547974,
-0.23451445996761322,
0.09517008811235428,
-0.3195643424987793,
-0.25980591773986816,
-0.1831900030374527,
0.07675514370203018,
0.6123491525650024,
-0.6349001526832581,
-0.23735423386096954,
-0.38452351093292236,
-0.1930943876504898,
0.14622773230075836,
0.22973082959651947,
-0.06558182835578918,
0.32682010531425476,
-0.4249076247215271,
0.27437710762023926,
0.11702683568000793,
-0.3644866645336151,
-0.26275205612182617,
0.4349484443664551,
0.0634901374578476,
0.45692774653434753,
-0.1734398901462555,
-0.09623277187347412,
0.033449068665504456,
-0.13593389093875885,
0.054034676402807236,
0.18842867016792297,
-0.3707602620124817,
-0.03711363673210144,
0.0583760105073452,
0.012387512251734734,
0.3490718603134155,
-0.17583943903446198,
0.09523797035217285,
0.17502760887145996,
-0.08316690474748611,
-0.30150243639945984,
0.429088294506073,
0.011929042637348175,
0.12427707016468048,
0.2073517143726349,
0.6620073318481445,
-0.06151725351810455,
0.24604319036006927,
-0.23879459500312805,
-0.522494375705719,
0.012813016772270203,
0.09603959321975708,
-0.06665511429309845,
-0.32737094163894653,
-0.29167163372039795,
-0.0342070609331131,
0.37619492411613464,
-0.2330375462770462,
-0.006055921316146851,
-0.09835463762283325,
0.002951107919216156,
0.053472165018320084,
-0.10506756603717804,
-0.2678544819355011,
0.19122475385665894,
-0.21237559616565704,
0.0986686423420906,
-0.5302174687385559,
0.1606162041425705,
0.34563982486724854,
-0.21189142763614655,
-0.06545950472354889,
0.09052581340074539,
0.22204822301864624,
-0.15056255459785461,
-0.051582690328359604,
0.26211777329444885,
0.15753521025180817,
-0.2793048024177551,
-0.14000049233436584,
0.005599275231361389,
0.16710840165615082,
-0.1251540631055832,
-0.15133467316627502,
0.16042768955230713,
0.24753665924072266,
0.01911485195159912,
-0.01816670596599579,
0.5154664516448975,
-0.16697083413600922,
0.6456267237663269,
0.025371447205543518,
0.14026576280593872,
0.09708064794540405,
0.21919459104537964,
-0.4015662670135498,
-0.23551620543003082,
0.38117727637290955,
-0.36023980379104614,
0.25692659616470337,
-0.015553073957562447,
-0.1504025012254715,
0.09890710562467575,
0.16494187712669373,
0.22739538550376892,
-0.10512501746416092,
0.2191070318222046,
0.06779690086841583,
0.028465237468481064,
0.27401429414749146,
0.11373354494571686,
0.32328546047210693,
-0.009179172106087208,
-0.14134415984153748,
-0.0780894011259079,
0.10953691601753235,
0.021114274859428406,
0.1347701996564865,
0.16295373439788818,
0.15377295017242432,
0.10730737447738647,
0.06311526894569397,
0.04173046350479126,
-0.2587187588214874,
-0.37095925211906433,
-0.052557192742824554,
0.186984583735466,
-0.41972580552101135,
0.24790795147418976,
-0.19771341979503632,
-0.3682073652744293,
0.06372303515672684,
0.007792139891535044,
-0.191884383559227,
-0.40321463346481323,
-0.09812121093273163,
0.3520861864089966,
-0.1714879870414734,
0.13610801100730896,
-0.13619889318943024,
0.32961785793304443,
0.3038485050201416,
-0.35864749550819397,
-0.2665640115737915,
0.057528603821992874,
-0.28897809982299805,
-0.10329808294773102,
0.18626052141189575,
-0.10747026652097702,
0.2342410832643509,
0.127743661403656,
-0.09160718321800232,
-0.5097404718399048,
-0.3282932937145233,
0.16527682542800903,
-0.2507377862930298,
0.5278280973434448,
0.35254818201065063,
0.198011577129364,
-0.346065878868103,
-0.061121538281440735,
0.17455334961414337,
-0.2930017411708832,
-0.23445749282836914,
0.06994204223155975,
-0.04924306273460388,
0.17876586318016052,
-0.03291654214262962,
0.19503092765808105,
-0.2568061947822571,
-0.09280209243297577,
-0.050331518054008484,
-0.15952998399734497,
0.22587153315544128,
0.3696386218070984,
0.23085971176624298,
0.030528977513313293,
-0.21663253009319305,
-0.2743344008922577,
0.0007684368174523115,
-0.37714719772338867,
0.18178734183311462,
-0.011516313999891281,
-0.29480454325675964,
-0.2191023826599121,
-0.19298668205738068,
-0.13294412195682526,
0.27241039276123047,
-0.45869237184524536,
-0.32181012630462646,
-0.14059136807918549,
0.0006336197257041931,
0.059257201850414276,
-0.01068643294274807,
0.10905115306377411,
-0.13766929507255554,
0.122458815574646,
-0.2647709846496582,
-0.3862900733947754,
0.11568006128072739,
-0.12174015492200851,
0.35380643606185913,
0.2620132863521576,
0.419527530670166,
0.06254015862941742,
0.6670459508895874,
0.4675942063331604,
0.06168925762176514,
0.3541693687438965,
0.0009157638996839523,
0.34539100527763367,
0.024593837559223175,
-0.6044220328330994,
-0.1466955840587616,
0.10765926539897919,
-0.25088804960250854,
0.0564587265253067,
0.004550528712570667,
-0.02843211032450199,
-0.13895303010940552,
-0.037205662578344345,
-0.3607597053050995,
-0.33256998658180237,
0.1133674830198288,
-0.17461493611335754,
0.08709659427404404,
0.07233956456184387,
0.07029350847005844,
-0.18999621272087097,
-0.09402257949113846,
-0.10601213574409485,
0.0816020518541336,
0.41445478796958923,
-0.06268869340419769,
-0.3926561176776886,
-0.48281481862068176,
-0.3353835642337799,
0.25178781151771545,
0.23807977139949799,
0.5533871650695801,
-0.04141039773821831,
-0.09835827350616455,
0.11299294233322144,
0.15369968116283417,
1.098770260810852,
-0.09142591804265976,
-0.014555077999830246,
0.18253272771835327,
-0.35847046971321106,
-0.4940175414085388,
-0.03715500235557556,
-0.1757282167673111,
0.40217679738998413,
0.23755580186843872,
0.4086780846118927,
-0.2822544574737549,
-0.07379227131605148,
0.02929561398923397,
0.0009966364596039057,
-0.11713525652885437,
-0.24978519976139069,
-0.2722649574279785,
-0.3370494842529297,
-0.19326987862586975,
0.15840674936771393,
0.22869132459163666,
0.248011514544487,
0.16784264147281647,
-0.08847085386514664,
-0.12193182110786438,
-0.15783745050430298,
0.20621225237846375,
-0.05925069376826286,
0.11248745024204254,
0.1482742428779602,
0.195274218916893,
0.15908955037593842,
0.17339453101158142,
0.34432488679885864,
0.45527583360671997,
-0.1773754060268402,
-0.33063799142837524,
-0.07314415276050568,
0.10244343429803848,
0.29228919744491577,
0.4526316225528717,
-0.2725958228111267,
0.3101068139076233,
0.3528273105621338,
0.1908363699913025,
0.0641140416264534,
-0.09144952893257141,
0.005293641705065966,
0.16531559824943542,
-0.6033507585525513,
-0.2567853033542633,
0.3245929777622223,
0.18211740255355835,
0.09161047637462616,
0.745306670665741,
0.2495899349451065,
-0.1656855046749115,
0.2881648540496826,
0.026827368885278702,
0.7051457166671753,
0.07114622741937637,
-0.092863529920578,
0.49344712495803833,
0.41539716720581055,
0.4717779755592346,
0.44730865955352783,
0.17072314023971558,
-0.20670044422149658,
-0.14658473432064056,
-0.04359845444560051,
-0.11082204431295395,
0.13059954345226288,
-0.10243222117424011,
0.06114969775080681,
0.2279672920703888,
-0.2636086940765381,
0.312664657831192,
-0.08535441756248474,
-0.007106255739927292,
-0.1604447066783905,
-0.04671997204422951,
-0.3378375470638275,
-0.014560657553374767,
0.16587477922439575,
0.2582849860191345,
-0.10732994228601456,
-0.23287314176559448,
0.22748029232025146,
-0.3757096529006958,
-0.4654989242553711,
-0.10620681941509247,
-0.2548048496246338,
-0.05099073052406311,
0.486899733543396,
-0.415719211101532,
0.05435378476977348,
0.06889355927705765,
-0.04565645754337311,
-0.061251942068338394,
-0.14771322906017303,
0.0006416849792003632,
0.06464891135692596,
0.17756624519824982,
-0.22407187521457672,
-0.137083500623703,
0.4941721260547638,
0.103897325694561,
0.07841181010007858,
0.05322619527578354,
-0.1207350417971611,
-0.45732492208480835,
0.20816272497177124,
0.2525780200958252,
0.09858925640583038,
-0.37331709265708923,
-0.19967474043369293,
-0.251482218503952,
0.10465651750564575,
-0.24540328979492188,
-0.07316723465919495,
0.17892000079154968,
-0.09091345965862274,
0.2152191698551178,
0.14014099538326263,
-0.2617729902267456,
-0.009278379380702972,
0.35880494117736816,
-0.039735279977321625,
0.06813430041074753,
0.6160298585891724,
0.23178692162036896,
-0.13802289962768555,
-0.05806194990873337,
0.11699552088975906,
0.4604434370994568,
-0.2722877562046051,
0.6242834329605103,
-0.0520554780960083,
0.17115332186222076,
0.07386653125286102,
0.12132252752780914,
0.17171062529087067,
0.24720951914787292,
-0.33047202229499817,
-0.5001963376998901,
0.031802840530872345,
0.31904345750808716,
-0.11183708906173706,
-0.019798684865236282,
-0.0851527526974678,
0.0668230801820755,
0.13033059239387512,
-0.24813726544380188,
-0.1287972629070282,
-0.10956703126430511,
-0.14693452417850494,
0.13035501539707184,
0.007796313613653183,
0.3763064444065094,
0.1961425393819809,
0.00892522931098938,
-0.1072312667965889,
0.20350514352321625,
-0.0626295879483223,
-0.0543011799454689,
-0.11034630239009857,
0.18101583421230316,
0.18485864996910095,
-0.2785552740097046,
0.2125154584646225,
-0.21158376336097717,
-0.22522950172424316,
-0.2863898277282715,
0.08088041841983795,
0.1572880744934082,
0.05741671845316887,
-0.023935608565807343,
0.04333074018359184,
-0.0743945762515068,
0.11492964625358582,
0.20413707196712494,
-0.18525156378746033,
-0.2097511738538742,
0.10143032670021057,
0.2070481926202774,
0.01239481195807457,
0.0983230471611023,
0.05873013660311699,
-0.0083390474319458,
-0.05860729515552521,
0.016744883731007576,
0.004269320517778397,
-0.2789837121963501,
0.09569169580936432,
0.3010658025741577,
0.36241960525512695,
0.37323105335235596,
-0.2668246626853943,
0.07581827044487,
0.22282493114471436,
-0.02188759855926037,
-0.2583288550376892,
0.12739042937755585,
0.14511843025684357,
0.31468358635902405,
-0.02460446022450924,
0.1830737590789795,
-0.268436461687088,
-0.026416219770908356,
0.10464870929718018,
0.015570711344480515,
0.22276027500629425,
0.1048072800040245,
0.25674253702163696,
0.4392450749874115,
-0.13920199871063232,
0.071298748254776,
0.35902509093284607,
0.24586941301822662,
0.07454600930213928,
0.5257993340492249,
-0.16414335370063782,
0.23924985527992249,
0.011224452406167984,
0.21898899972438812,
-0.08502952009439468,
-0.5715962648391724,
-0.03213545307517052,
0.3489818572998047,
-0.03612662851810455,
0.0457577221095562,
0.06768345087766647,
0.1287977546453476,
-0.06240609660744667,
-0.23191703855991364,
0.10459118336439133,
0.21148942410945892,
-0.07490386068820953,
-0.059251029044389725,
-0.3777603507041931,
-0.08225132524967194,
0.169837087392807,
-0.023627180606126785,
0.08662168681621552,
-0.5039765238761902,
0.24300508201122284,
-0.11037945747375488,
-0.07710036635398865,
-0.7700532674789429,
-0.04081132262945175,
0.11010707914829254,
0.13492105901241302,
-0.18580320477485657,
0.0647023543715477,
-0.13829998672008514,
0.19437849521636963,
0.13525626063346863,
0.3394962251186371,
0.435016393661499,
0.5227665901184082,
0.15030096471309662,
0.024337563663721085,
-0.29194802045822144,
-0.1440356820821762,
-0.123055599629879,
0.3985375761985779,
-0.065045565366745,
0.1661413311958313,
0.24348415434360504,
-0.03269761800765991,
-0.00869046151638031,
0.1690852791070938,
0.06261660158634186,
0.20897158980369568,
-0.2820601761341095,
0.2736296057701111,
-0.4164859652519226,
0.20661917328834534,
-0.23017022013664246,
0.04185508191585541,
-0.1271265596151352,
-0.023504648357629776,
0.7190868854522705,
-0.104420967400074,
0.22812163829803467,
0.06545230746269226,
-0.012685297057032585,
-0.3033755421638489,
0.017974965274333954,
0.5871085524559021,
0.2767186462879181,
-0.21895773708820343,
0.1564313769340515,
-0.5647964477539062,
-0.09057647734880447,
-0.16885051131248474,
0.1019827276468277,
0.17467139661312103,
0.29313790798187256,
-0.16466334462165833,
0.010834798216819763,
0.3001141846179962,
0.00927751325070858,
0.10103623569011688,
0.22472414374351501,
-0.17701570689678192,
-0.24296744167804718,
-0.234905406832695,
0.21375927329063416,
0.09711688756942749,
-0.3847898840904236,
0.13538570702075958,
-0.38154157996177673,
-0.1404452621936798,
-0.043115779757499695,
-0.2692278027534485,
0.03662343695759773,
-0.0050347186625003815,
0.20742663741111755,
0.28390198945999146,
0.2687547504901886,
0.029910407960414886,
0.07026398181915283,
-0.4334636628627777,
-0.14940288662910461,
-0.31032484769821167,
0.3266192376613617,
0.09138937294483185,
0.3611447215080261,
-0.2811035215854645,
0.11040014028549194,
-0.06843738257884979,
0.21383336186408997,
0.08473943173885345,
-0.153431236743927,
-0.3456002175807953,
0.3910008370876312,
-0.23692873120307922,
0.054280392825603485,
-0.24868875741958618,
0.06542836129665375,
0.019732527434825897,
0.04442358762025833,
-0.24919335544109344,
-0.33545833826065063,
0.7279002070426941,
-0.8912284970283508,
-0.15414685010910034,
-0.08903653919696808,
0.11842652410268784,
0.49904316663742065,
-0.39301949739456177,
-0.40738749504089355,
-0.2233811914920807,
0.3692997992038727,
-0.14691022038459778,
-0.014438716694712639,
0.05250662565231323,
-0.22941654920578003,
0.2387799173593521,
-0.11567620933055878,
0.05131326988339424,
0.18633723258972168,
-0.1712288111448288,
0.47739705443382263,
-0.18239936232566833
] |
https://github.com/huggingface/datasets/issues/5498 | TypeError: 'bool' object is not iterable when filtering a datasets.arrow_dataset.Dataset | I hit the same issue and the error message isn't really clear on what's going wrong. It might be helpful to update the docs with a batched example. | ### Describe the bug
Hi,
Thanks for the amazing work on the library!
**Describe the bug**
I think I might have noticed a small bug in the filter method.
Having loaded a dataset using `load_dataset`, when I try to filter out empty entries with `batched=True`, I get a TypeError.
### Steps to reproduce the bug
```
train_dataset = train_dataset.filter(
function=lambda example: example["image"] is not None,
batched=True,
batch_size=10)
```
Error message:
```
File .../lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
...
-> 5666 indices_array = [i for i, to_keep in zip(indices, mask) if to_keep]
5667 if indices_mapping is not None:
5668 indices_array = pa.array(indices_array, type=pa.uint64())
TypeError: 'bool' object is not iterable
```
**Removing batched=True allows to bypass the issue.**
### Expected behavior
According to the doc, "[batch_size corresponds to the] number of examples per batch provided to function if batched = True", so we shouldn't need to remove the batchd=True arg?
source: https://huggingface.co/docs/datasets/v2.9.0/en/package_reference/main_classes#datasets.Dataset.filter
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.4.0-122-generic-x86_64-with-glibc2.31
- Python version: 3.9.10
- PyArrow version: 10.0.1
- Pandas version: 1.5.3 | 28 | TypeError: 'bool' object is not iterable when filtering a datasets.arrow_dataset.Dataset
### Describe the bug
Hi,
Thanks for the amazing work on the library!
**Describe the bug**
I think I might have noticed a small bug in the filter method.
Having loaded a dataset using `load_dataset`, when I try to filter out empty entries with `batched=True`, I get a TypeError.
### Steps to reproduce the bug
```
train_dataset = train_dataset.filter(
function=lambda example: example["image"] is not None,
batched=True,
batch_size=10)
```
Error message:
```
File .../lib/python3.9/site-packages/datasets/fingerprint.py:480, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs)
476 validate_fingerprint(kwargs[fingerprint_name])
478 # Call actual function
--> 480 out = func(self, *args, **kwargs)
...
-> 5666 indices_array = [i for i, to_keep in zip(indices, mask) if to_keep]
5667 if indices_mapping is not None:
5668 indices_array = pa.array(indices_array, type=pa.uint64())
TypeError: 'bool' object is not iterable
```
**Removing batched=True allows to bypass the issue.**
### Expected behavior
According to the doc, "[batch_size corresponds to the] number of examples per batch provided to function if batched = True", so we shouldn't need to remove the batchd=True arg?
source: https://huggingface.co/docs/datasets/v2.9.0/en/package_reference/main_classes#datasets.Dataset.filter
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.4.0-122-generic-x86_64-with-glibc2.31
- Python version: 3.9.10
- PyArrow version: 10.0.1
- Pandas version: 1.5.3
I hit the same issue and the error message isn't really clear on what's going wrong. It might be helpful to update the docs with a batched example. | [
-0.18260245025157928,
-0.2624393403530121,
0.019751515239477158,
0.10276506096124649,
-0.16956520080566406,
0.049563996493816376,
0.523794412612915,
0.17173705995082855,
0.12031163275241852,
0.0702308714389801,
0.05394410341978073,
0.1757829785346985,
-0.33603477478027344,
0.26592159271240234,
-0.20708732306957245,
0.14600390195846558,
-0.030682004988193512,
-0.014011017978191376,
-0.10432963073253632,
0.028197571635246277,
-0.17251403629779816,
0.19048358500003815,
-0.5462700128555298,
-0.061474546790122986,
0.061622973531484604,
-0.22912919521331787,
0.09569384157657623,
0.0022770948708057404,
-0.1513068974018097,
-0.3657219707965851,
0.40964892506599426,
-0.16455496847629547,
-0.0004556886851787567,
0.6191940307617188,
-0.00012971056276001036,
0.07227219641208649,
0.4056047797203064,
-0.023674989119172096,
-0.38034820556640625,
-0.3149179220199585,
-0.11497999727725983,
-0.1267060935497284,
0.24859431385993958,
-0.05935345217585564,
0.26042503118515015,
-0.2959209382534027,
-0.15341410040855408,
-0.1936548501253128,
0.30758169293403625,
0.2248927801847458,
0.06832705438137054,
0.4008297026157379,
-0.08384960144758224,
0.10001882910728455,
0.11787685751914978,
0.48755085468292236,
-0.09735974669456482,
0.22905871272087097,
0.1924411505460739,
-0.21444936096668243,
0.010810889303684235,
0.4200686812400818,
-0.2681780755519867,
-0.0491681732237339,
0.18749967217445374,
0.005272917915135622,
-0.04495236277580261,
-0.3456748127937317,
-0.0156727097928524,
0.2183188498020172,
0.31326714158058167,
-0.2714565694332123,
-0.47984611988067627,
-0.6546419262886047,
0.061565883457660675,
0.04571262747049332,
0.05011351406574249,
-0.08668188005685806,
-0.25026100873947144,
-0.07000504434108734,
-0.35951346158981323,
-0.07829328626394272,
-0.1043991893529892,
0.1146354228258133,
0.1399545967578888,
0.3798176348209381,
-0.09414178133010864,
0.2023550570011139,
0.0882420539855957,
-0.14092481136322021,
0.26828089356422424,
-0.20097045600414276,
0.11107257008552551,
0.31919988989830017,
-0.11460147798061371,
-0.040859490633010864,
0.19536784291267395,
0.22443616390228271,
0.2025853991508484,
0.0689920037984848,
0.04536755755543709,
-0.15989282727241516,
0.08533924072980881,
0.09848323464393616,
0.45026451349258423,
0.13174888491630554,
0.4219382107257843,
0.3562771677970886,
0.06751643866300583,
0.19091621041297913,
-0.013773461803793907,
0.10191259533166885,
0.01165116485208273,
-0.12741786241531372,
0.16752496361732483,
0.04799436032772064,
0.4797630310058594,
-0.06068509817123413,
-0.36630362272262573,
-0.12770609557628632,
-0.4822511076927185,
-0.02909686043858528,
0.4334378242492676,
0.17397204041481018,
0.13214518129825592,
-0.02733990177512169,
0.12608501315116882,
-0.06458001583814621,
-0.20254717767238617,
-0.09388814866542816,
-0.10362715274095535,
-0.030697736889123917,
-0.0887557864189148,
-0.16130371391773224,
-0.0877692699432373,
-0.5662897825241089,
0.15206657350063324,
0.04922998324036598,
-0.00728645920753479,
0.24387133121490479,
-0.00507087167352438,
-0.16190528869628906,
0.4948540925979614,
0.410553514957428,
-0.03303094580769539,
0.30391985177993774,
0.37872251868247986,
-0.1218612790107727,
-0.2503844201564789,
0.15987783670425415,
-0.4098230302333832,
-0.16010122001171112,
0.020584728568792343,
-0.023103918880224228,
-0.2239413559436798,
-0.11942651867866516,
-0.4588724672794342,
0.27417516708374023,
0.34528523683547974,
-0.23451445996761322,
0.09517008811235428,
-0.3195643424987793,
-0.25980591773986816,
-0.1831900030374527,
0.07675514370203018,
0.6123491525650024,
-0.6349001526832581,
-0.23735423386096954,
-0.38452351093292236,
-0.1930943876504898,
0.14622773230075836,
0.22973082959651947,
-0.06558182835578918,
0.32682010531425476,
-0.4249076247215271,
0.27437710762023926,
0.11702683568000793,
-0.3644866645336151,
-0.26275205612182617,
0.4349484443664551,
0.0634901374578476,
0.45692774653434753,
-0.1734398901462555,
-0.09623277187347412,
0.033449068665504456,
-0.13593389093875885,
0.054034676402807236,
0.18842867016792297,
-0.3707602620124817,
-0.03711363673210144,
0.0583760105073452,
0.012387512251734734,
0.3490718603134155,
-0.17583943903446198,
0.09523797035217285,
0.17502760887145996,
-0.08316690474748611,
-0.30150243639945984,
0.429088294506073,
0.011929042637348175,
0.12427707016468048,
0.2073517143726349,
0.6620073318481445,
-0.06151725351810455,
0.24604319036006927,
-0.23879459500312805,
-0.522494375705719,
0.012813016772270203,
0.09603959321975708,
-0.06665511429309845,
-0.32737094163894653,
-0.29167163372039795,
-0.0342070609331131,
0.37619492411613464,
-0.2330375462770462,
-0.006055921316146851,
-0.09835463762283325,
0.002951107919216156,
0.053472165018320084,
-0.10506756603717804,
-0.2678544819355011,
0.19122475385665894,
-0.21237559616565704,
0.0986686423420906,
-0.5302174687385559,
0.1606162041425705,
0.34563982486724854,
-0.21189142763614655,
-0.06545950472354889,
0.09052581340074539,
0.22204822301864624,
-0.15056255459785461,
-0.051582690328359604,
0.26211777329444885,
0.15753521025180817,
-0.2793048024177551,
-0.14000049233436584,
0.005599275231361389,
0.16710840165615082,
-0.1251540631055832,
-0.15133467316627502,
0.16042768955230713,
0.24753665924072266,
0.01911485195159912,
-0.01816670596599579,
0.5154664516448975,
-0.16697083413600922,
0.6456267237663269,
0.025371447205543518,
0.14026576280593872,
0.09708064794540405,
0.21919459104537964,
-0.4015662670135498,
-0.23551620543003082,
0.38117727637290955,
-0.36023980379104614,
0.25692659616470337,
-0.015553073957562447,
-0.1504025012254715,
0.09890710562467575,
0.16494187712669373,
0.22739538550376892,
-0.10512501746416092,
0.2191070318222046,
0.06779690086841583,
0.028465237468481064,
0.27401429414749146,
0.11373354494571686,
0.32328546047210693,
-0.009179172106087208,
-0.14134415984153748,
-0.0780894011259079,
0.10953691601753235,
0.021114274859428406,
0.1347701996564865,
0.16295373439788818,
0.15377295017242432,
0.10730737447738647,
0.06311526894569397,
0.04173046350479126,
-0.2587187588214874,
-0.37095925211906433,
-0.052557192742824554,
0.186984583735466,
-0.41972580552101135,
0.24790795147418976,
-0.19771341979503632,
-0.3682073652744293,
0.06372303515672684,
0.007792139891535044,
-0.191884383559227,
-0.40321463346481323,
-0.09812121093273163,
0.3520861864089966,
-0.1714879870414734,
0.13610801100730896,
-0.13619889318943024,
0.32961785793304443,
0.3038485050201416,
-0.35864749550819397,
-0.2665640115737915,
0.057528603821992874,
-0.28897809982299805,
-0.10329808294773102,
0.18626052141189575,
-0.10747026652097702,
0.2342410832643509,
0.127743661403656,
-0.09160718321800232,
-0.5097404718399048,
-0.3282932937145233,
0.16527682542800903,
-0.2507377862930298,
0.5278280973434448,
0.35254818201065063,
0.198011577129364,
-0.346065878868103,
-0.061121538281440735,
0.17455334961414337,
-0.2930017411708832,
-0.23445749282836914,
0.06994204223155975,
-0.04924306273460388,
0.17876586318016052,
-0.03291654214262962,
0.19503092765808105,
-0.2568061947822571,
-0.09280209243297577,
-0.050331518054008484,
-0.15952998399734497,
0.22587153315544128,
0.3696386218070984,
0.23085971176624298,
0.030528977513313293,
-0.21663253009319305,
-0.2743344008922577,
0.0007684368174523115,
-0.37714719772338867,
0.18178734183311462,
-0.011516313999891281,
-0.29480454325675964,
-0.2191023826599121,
-0.19298668205738068,
-0.13294412195682526,
0.27241039276123047,
-0.45869237184524536,
-0.32181012630462646,
-0.14059136807918549,
0.0006336197257041931,
0.059257201850414276,
-0.01068643294274807,
0.10905115306377411,
-0.13766929507255554,
0.122458815574646,
-0.2647709846496582,
-0.3862900733947754,
0.11568006128072739,
-0.12174015492200851,
0.35380643606185913,
0.2620132863521576,
0.419527530670166,
0.06254015862941742,
0.6670459508895874,
0.4675942063331604,
0.06168925762176514,
0.3541693687438965,
0.0009157638996839523,
0.34539100527763367,
0.024593837559223175,
-0.6044220328330994,
-0.1466955840587616,
0.10765926539897919,
-0.25088804960250854,
0.0564587265253067,
0.004550528712570667,
-0.02843211032450199,
-0.13895303010940552,
-0.037205662578344345,
-0.3607597053050995,
-0.33256998658180237,
0.1133674830198288,
-0.17461493611335754,
0.08709659427404404,
0.07233956456184387,
0.07029350847005844,
-0.18999621272087097,
-0.09402257949113846,
-0.10601213574409485,
0.0816020518541336,
0.41445478796958923,
-0.06268869340419769,
-0.3926561176776886,
-0.48281481862068176,
-0.3353835642337799,
0.25178781151771545,
0.23807977139949799,
0.5533871650695801,
-0.04141039773821831,
-0.09835827350616455,
0.11299294233322144,
0.15369968116283417,
1.098770260810852,
-0.09142591804265976,
-0.014555077999830246,
0.18253272771835327,
-0.35847046971321106,
-0.4940175414085388,
-0.03715500235557556,
-0.1757282167673111,
0.40217679738998413,
0.23755580186843872,
0.4086780846118927,
-0.2822544574737549,
-0.07379227131605148,
0.02929561398923397,
0.0009966364596039057,
-0.11713525652885437,
-0.24978519976139069,
-0.2722649574279785,
-0.3370494842529297,
-0.19326987862586975,
0.15840674936771393,
0.22869132459163666,
0.248011514544487,
0.16784264147281647,
-0.08847085386514664,
-0.12193182110786438,
-0.15783745050430298,
0.20621225237846375,
-0.05925069376826286,
0.11248745024204254,
0.1482742428779602,
0.195274218916893,
0.15908955037593842,
0.17339453101158142,
0.34432488679885864,
0.45527583360671997,
-0.1773754060268402,
-0.33063799142837524,
-0.07314415276050568,
0.10244343429803848,
0.29228919744491577,
0.4526316225528717,
-0.2725958228111267,
0.3101068139076233,
0.3528273105621338,
0.1908363699913025,
0.0641140416264534,
-0.09144952893257141,
0.005293641705065966,
0.16531559824943542,
-0.6033507585525513,
-0.2567853033542633,
0.3245929777622223,
0.18211740255355835,
0.09161047637462616,
0.745306670665741,
0.2495899349451065,
-0.1656855046749115,
0.2881648540496826,
0.026827368885278702,
0.7051457166671753,
0.07114622741937637,
-0.092863529920578,
0.49344712495803833,
0.41539716720581055,
0.4717779755592346,
0.44730865955352783,
0.17072314023971558,
-0.20670044422149658,
-0.14658473432064056,
-0.04359845444560051,
-0.11082204431295395,
0.13059954345226288,
-0.10243222117424011,
0.06114969775080681,
0.2279672920703888,
-0.2636086940765381,
0.312664657831192,
-0.08535441756248474,
-0.007106255739927292,
-0.1604447066783905,
-0.04671997204422951,
-0.3378375470638275,
-0.014560657553374767,
0.16587477922439575,
0.2582849860191345,
-0.10732994228601456,
-0.23287314176559448,
0.22748029232025146,
-0.3757096529006958,
-0.4654989242553711,
-0.10620681941509247,
-0.2548048496246338,
-0.05099073052406311,
0.486899733543396,
-0.415719211101532,
0.05435378476977348,
0.06889355927705765,
-0.04565645754337311,
-0.061251942068338394,
-0.14771322906017303,
0.0006416849792003632,
0.06464891135692596,
0.17756624519824982,
-0.22407187521457672,
-0.137083500623703,
0.4941721260547638,
0.103897325694561,
0.07841181010007858,
0.05322619527578354,
-0.1207350417971611,
-0.45732492208480835,
0.20816272497177124,
0.2525780200958252,
0.09858925640583038,
-0.37331709265708923,
-0.19967474043369293,
-0.251482218503952,
0.10465651750564575,
-0.24540328979492188,
-0.07316723465919495,
0.17892000079154968,
-0.09091345965862274,
0.2152191698551178,
0.14014099538326263,
-0.2617729902267456,
-0.009278379380702972,
0.35880494117736816,
-0.039735279977321625,
0.06813430041074753,
0.6160298585891724,
0.23178692162036896,
-0.13802289962768555,
-0.05806194990873337,
0.11699552088975906,
0.4604434370994568,
-0.2722877562046051,
0.6242834329605103,
-0.0520554780960083,
0.17115332186222076,
0.07386653125286102,
0.12132252752780914,
0.17171062529087067,
0.24720951914787292,
-0.33047202229499817,
-0.5001963376998901,
0.031802840530872345,
0.31904345750808716,
-0.11183708906173706,
-0.019798684865236282,
-0.0851527526974678,
0.0668230801820755,
0.13033059239387512,
-0.24813726544380188,
-0.1287972629070282,
-0.10956703126430511,
-0.14693452417850494,
0.13035501539707184,
0.007796313613653183,
0.3763064444065094,
0.1961425393819809,
0.00892522931098938,
-0.1072312667965889,
0.20350514352321625,
-0.0626295879483223,
-0.0543011799454689,
-0.11034630239009857,
0.18101583421230316,
0.18485864996910095,
-0.2785552740097046,
0.2125154584646225,
-0.21158376336097717,
-0.22522950172424316,
-0.2863898277282715,
0.08088041841983795,
0.1572880744934082,
0.05741671845316887,
-0.023935608565807343,
0.04333074018359184,
-0.0743945762515068,
0.11492964625358582,
0.20413707196712494,
-0.18525156378746033,
-0.2097511738538742,
0.10143032670021057,
0.2070481926202774,
0.01239481195807457,
0.0983230471611023,
0.05873013660311699,
-0.0083390474319458,
-0.05860729515552521,
0.016744883731007576,
0.004269320517778397,
-0.2789837121963501,
0.09569169580936432,
0.3010658025741577,
0.36241960525512695,
0.37323105335235596,
-0.2668246626853943,
0.07581827044487,
0.22282493114471436,
-0.02188759855926037,
-0.2583288550376892,
0.12739042937755585,
0.14511843025684357,
0.31468358635902405,
-0.02460446022450924,
0.1830737590789795,
-0.268436461687088,
-0.026416219770908356,
0.10464870929718018,
0.015570711344480515,
0.22276027500629425,
0.1048072800040245,
0.25674253702163696,
0.4392450749874115,
-0.13920199871063232,
0.071298748254776,
0.35902509093284607,
0.24586941301822662,
0.07454600930213928,
0.5257993340492249,
-0.16414335370063782,
0.23924985527992249,
0.011224452406167984,
0.21898899972438812,
-0.08502952009439468,
-0.5715962648391724,
-0.03213545307517052,
0.3489818572998047,
-0.03612662851810455,
0.0457577221095562,
0.06768345087766647,
0.1287977546453476,
-0.06240609660744667,
-0.23191703855991364,
0.10459118336439133,
0.21148942410945892,
-0.07490386068820953,
-0.059251029044389725,
-0.3777603507041931,
-0.08225132524967194,
0.169837087392807,
-0.023627180606126785,
0.08662168681621552,
-0.5039765238761902,
0.24300508201122284,
-0.11037945747375488,
-0.07710036635398865,
-0.7700532674789429,
-0.04081132262945175,
0.11010707914829254,
0.13492105901241302,
-0.18580320477485657,
0.0647023543715477,
-0.13829998672008514,
0.19437849521636963,
0.13525626063346863,
0.3394962251186371,
0.435016393661499,
0.5227665901184082,
0.15030096471309662,
0.024337563663721085,
-0.29194802045822144,
-0.1440356820821762,
-0.123055599629879,
0.3985375761985779,
-0.065045565366745,
0.1661413311958313,
0.24348415434360504,
-0.03269761800765991,
-0.00869046151638031,
0.1690852791070938,
0.06261660158634186,
0.20897158980369568,
-0.2820601761341095,
0.2736296057701111,
-0.4164859652519226,
0.20661917328834534,
-0.23017022013664246,
0.04185508191585541,
-0.1271265596151352,
-0.023504648357629776,
0.7190868854522705,
-0.104420967400074,
0.22812163829803467,
0.06545230746269226,
-0.012685297057032585,
-0.3033755421638489,
0.017974965274333954,
0.5871085524559021,
0.2767186462879181,
-0.21895773708820343,
0.1564313769340515,
-0.5647964477539062,
-0.09057647734880447,
-0.16885051131248474,
0.1019827276468277,
0.17467139661312103,
0.29313790798187256,
-0.16466334462165833,
0.010834798216819763,
0.3001141846179962,
0.00927751325070858,
0.10103623569011688,
0.22472414374351501,
-0.17701570689678192,
-0.24296744167804718,
-0.234905406832695,
0.21375927329063416,
0.09711688756942749,
-0.3847898840904236,
0.13538570702075958,
-0.38154157996177673,
-0.1404452621936798,
-0.043115779757499695,
-0.2692278027534485,
0.03662343695759773,
-0.0050347186625003815,
0.20742663741111755,
0.28390198945999146,
0.2687547504901886,
0.029910407960414886,
0.07026398181915283,
-0.4334636628627777,
-0.14940288662910461,
-0.31032484769821167,
0.3266192376613617,
0.09138937294483185,
0.3611447215080261,
-0.2811035215854645,
0.11040014028549194,
-0.06843738257884979,
0.21383336186408997,
0.08473943173885345,
-0.153431236743927,
-0.3456002175807953,
0.3910008370876312,
-0.23692873120307922,
0.054280392825603485,
-0.24868875741958618,
0.06542836129665375,
0.019732527434825897,
0.04442358762025833,
-0.24919335544109344,
-0.33545833826065063,
0.7279002070426941,
-0.8912284970283508,
-0.15414685010910034,
-0.08903653919696808,
0.11842652410268784,
0.49904316663742065,
-0.39301949739456177,
-0.40738749504089355,
-0.2233811914920807,
0.3692997992038727,
-0.14691022038459778,
-0.014438716694712639,
0.05250662565231323,
-0.22941654920578003,
0.2387799173593521,
-0.11567620933055878,
0.05131326988339424,
0.18633723258972168,
-0.1712288111448288,
0.47739705443382263,
-0.18239936232566833
] |
https://github.com/huggingface/datasets/issues/5496 | Add a `reduce` method | Hi! Sure, feel free to open a PR, so we can see the API you have in mind. | ### Feature request
Right now the `Dataset` class implements `map()` and `filter()`, but leaves out the third functional idiom popular among Python users: `reduce`.
### Motivation
A `reduce` method is often useful when calculating dataset statistics, for example, the occurrence of a particular n-gram or the average line length of a code dataset.
### Your contribution
I haven't contributed to `datasets` before, but I don't expect this will be too difficult, since the implementation will closely follow that of `map` and `filter`. I could have a crack over the weekend. | 18 | Add a `reduce` method
### Feature request
Right now the `Dataset` class implements `map()` and `filter()`, but leaves out the third functional idiom popular among Python users: `reduce`.
### Motivation
A `reduce` method is often useful when calculating dataset statistics, for example, the occurrence of a particular n-gram or the average line length of a code dataset.
### Your contribution
I haven't contributed to `datasets` before, but I don't expect this will be too difficult, since the implementation will closely follow that of `map` and `filter`. I could have a crack over the weekend.
Hi! Sure, feel free to open a PR, so we can see the API you have in mind. | [
-0.5358853340148926,
0.045247241854667664,
-0.31286129355430603,
-0.1601305603981018,
0.0483379140496254,
-0.12517549097537994,
-0.021992456167936325,
0.509962797164917,
0.09587521851062775,
0.24032767117023468,
-0.04271135479211807,
0.5281162261962891,
-0.15741084516048431,
0.32191944122314453,
-0.08578669279813766,
-0.05340757966041565,
-0.19443312287330627,
0.38832753896713257,
-0.24142643809318542,
0.058494970202445984,
-0.1265125870704651,
0.13813412189483643,
-0.10836231708526611,
-0.062167733907699585,
0.10494035482406616,
-0.11349988728761673,
-0.021013328805565834,
-0.2393733263015747,
-0.2181776463985443,
-0.30212345719337463,
-0.06848016381263733,
0.2517038881778717,
-0.18109309673309326,
0.16934823989868164,
-0.00009699074144009501,
-0.14579857885837555,
0.042048413306474686,
0.029046887531876564,
-0.25553059577941895,
-0.003365561366081238,
-0.16119039058685303,
-0.33178672194480896,
0.0590638741850853,
-0.2674940824508667,
-0.136592298746109,
-0.20194686949253082,
-0.08531981706619263,
-0.3446042835712433,
0.4499393701553345,
0.14971934258937836,
0.3263329863548279,
0.09307016432285309,
-0.14088700711727142,
0.04962516576051712,
0.12776736915111542,
0.23057907819747925,
-0.047402773052453995,
-0.06803245842456818,
0.06872091442346573,
-0.2609803080558777,
-0.3125877380371094,
0.3621315062046051,
-0.08706975728273392,
0.1526820808649063,
0.16341963410377502,
-0.09738068282604218,
-0.055839814245700836,
-0.14634552597999573,
0.06546172499656677,
0.09286347776651382,
0.2314428687095642,
-0.43557894229888916,
-0.3379654288291931,
-0.3249562382698059,
0.06806343048810959,
-0.25367096066474915,
-0.2198934257030487,
-0.038037389516830444,
-0.24771520495414734,
0.0653637945652008,
-0.27547386288642883,
-0.05349009111523628,
-0.07466482371091843,
0.048815011978149414,
0.004748016595840454,
0.21493980288505554,
-0.10131648927927017,
-0.020046725869178772,
0.19971691071987152,
-0.16169928014278412,
-0.010138056240975857,
-0.13982358574867249,
0.1479250192642212,
0.1832667738199234,
-0.09487178921699524,
-0.45815959572792053,
0.3110926151275635,
-0.0023756399750709534,
0.3051610291004181,
0.049237798899412155,
0.05416063591837883,
0.16168588399887085,
0.06380682438611984,
0.12898018956184387,
0.30147138237953186,
-0.13671287894248962,
0.25832048058509827,
0.06910817325115204,
0.2501857876777649,
-0.04191785305738449,
-0.11849711835384369,
0.010391077026724815,
0.1683851182460785,
-0.03760005161166191,
0.2708459496498108,
0.06489722430706024,
0.11459775269031525,
0.05127054080367088,
-0.229187473654747,
-0.26844871044158936,
-0.13181206583976746,
-0.10440188646316528,
0.1301088035106659,
0.15808941423892975,
0.0254400335252285,
0.2142401933670044,
-0.1081404909491539,
-0.04215368628501892,
-0.24576421082019806,
-0.19054152071475983,
-0.199120432138443,
0.0019347500056028366,
-0.003968484699726105,
-0.060170091688632965,
0.14509661495685577,
-0.06637175381183624,
0.01627545990049839,
-0.05412045121192932,
0.10071443021297455,
0.0031602904200553894,
0.4351143538951874,
-0.05474044010043144,
0.2722313702106476,
0.045247919857501984,
-0.10007108747959137,
-0.25762224197387695,
0.11920079588890076,
-0.18157131969928741,
-0.47338855266571045,
0.1154509037733078,
-0.18221479654312134,
-0.2642568349838257,
0.01656724140048027,
0.3306354880332947,
0.1805967390537262,
0.15966351330280304,
-0.1084405705332756,
0.5605047941207886,
0.032583922147750854,
-0.18317252397537231,
-0.18185105919837952,
-0.08539627492427826,
-0.16058620810508728,
-0.22101858258247375,
0.32835105061531067,
0.13381081819534302,
-0.26125046610832214,
-0.2237691730260849,
-0.3362788259983063,
-0.24900564551353455,
-0.053680889308452606,
0.1944231390953064,
-0.21318313479423523,
0.11465969681739807,
-0.0674189031124115,
0.2298509031534195,
0.3649711310863495,
-0.056893348693847656,
-0.3473113775253296,
0.1884681135416031,
-0.04584940895438194,
-0.05126471072435379,
-0.09798669070005417,
0.2832484543323517,
0.25091224908828735,
0.011894228868186474,
0.21012063324451447,
0.1301148682832718,
-0.259853333234787,
0.09249966591596603,
0.09361760318279266,
-0.24885131418704987,
0.23772597312927246,
0.0694538950920105,
0.08913171291351318,
-0.1989113688468933,
0.2799444794654846,
-0.1594364494085312,
0.2391044795513153,
-0.21465206146240234,
-0.1786719560623169,
0.07981337606906891,
0.2627275884151459,
-0.23556454479694366,
0.05459325388073921,
-0.5686723589897156,
-0.0011413916945457458,
-0.16231264173984528,
0.15892760455608368,
-0.08996906876564026,
-0.029235363006591797,
-0.49141496419906616,
-0.15515300631523132,
0.22944055497646332,
0.15419593453407288,
0.154011532664299,
0.4219052791595459,
-0.1638646125793457,
0.028250467032194138,
-0.22054046392440796,
-0.05917498096823692,
0.1419472098350525,
-0.1180129423737526,
-0.14832580089569092,
-0.13309690356254578,
0.1622413545846939,
0.12810251116752625,
-0.034002650529146194,
0.13727043569087982,
0.2173503339290619,
0.10344190895557404,
0.14915752410888672,
0.06549791991710663,
0.2396411895751953,
0.2308170050382614,
0.03235248476266861,
0.3208160400390625,
0.3182114362716675,
-0.04611547291278839,
-0.09975650161504745,
0.10563541203737259,
0.26816344261169434,
0.031610194593667984,
0.13655835390090942,
-0.42347052693367004,
0.31614217162132263,
0.025994038209319115,
0.06182584911584854,
0.09129554033279419,
0.07300754636526108,
0.24299976229667664,
0.06449548900127411,
-0.3114114999771118,
-0.2842105031013489,
-0.02728262171149254,
0.11210855841636658,
-0.03055392950773239,
0.03155328705906868,
-0.12692652642726898,
0.12872713804244995,
0.27231279015541077,
-0.1122928261756897,
0.3070932626724243,
0.24118494987487793,
-0.17236647009849548,
-0.21915996074676514,
0.13917183876037598,
0.2342446893453598,
0.19425207376480103,
0.4251483976840973,
0.14987236261367798,
-0.012989988550543785,
0.19712935388088226,
0.060580842196941376,
0.26128149032592773,
0.19901782274246216,
-0.047077830880880356,
-0.0018194019794464111,
0.2928689420223236,
0.01954064518213272,
-0.376106321811676,
-0.34714773297309875,
-0.2971916198730469,
-0.012100204825401306,
-0.15632613003253937,
-0.07189346104860306,
-0.05654764920473099,
-0.25947633385658264,
0.14673317968845367,
0.13603241741657257,
-0.016405358910560608,
-0.19408217072486877,
0.1726919561624527,
-0.09583573043346405,
-0.4310162663459778,
0.12104219943284988,
-0.06657743453979492,
0.45567774772644043,
0.2626338303089142,
0.037047624588012695,
0.16184596717357635,
-0.25812479853630066,
0.13149835169315338,
0.3285072147846222,
-0.030702676624059677,
0.21673275530338287,
0.7123206257820129,
-0.18338927626609802,
0.13251236081123352,
-0.2165576070547104,
-0.5144433379173279,
0.12857091426849365,
-0.05547308176755905,
0.19950906932353973,
0.3369150161743164,
0.11168154329061508,
-0.21052266657352448,
0.0011234842240810394,
-0.13215845823287964,
-0.26950910687446594,
-0.1365726739168167,
-0.06036074087023735,
-0.03806781396269798,
-0.03604560345411301,
-0.11392778158187866,
-0.20928362011909485,
-0.185224249958992,
-0.28597643971443176,
0.28444892168045044,
0.10421717166900635,
0.33989953994750977,
0.0005266470834612846,
0.0609159879386425,
0.14198093116283417,
-0.0168459415435791,
0.12203362584114075,
-0.20926590263843536,
-0.1611282378435135,
0.258114755153656,
-0.18315012753009796,
-0.07586716115474701,
-0.14786987006664276,
-0.23036816716194153,
-0.1282113790512085,
0.25925832986831665,
-0.027220286428928375,
-0.3132317364215851,
-0.1293390691280365,
0.194366917014122,
-0.09971180558204651,
0.2039427012205124,
0.20871701836585999,
0.4234597980976105,
-0.28292226791381836,
-0.06829945743083954,
-0.09956873953342438,
-0.0731678381562233,
-0.004289451986551285,
-0.17993509769439697,
0.12251366674900055,
0.26407647132873535,
0.18461427092552185,
0.2681528627872467,
0.2782535254955292,
-0.014984704554080963,
-0.018407337367534637,
-0.14052489399909973,
0.23421888053417206,
0.014740191400051117,
-0.12937994301319122,
-0.04575325921177864,
0.067534439265728,
0.03952229768037796,
0.19566327333450317,
0.25152888894081116,
-0.21297620236873627,
0.09263195097446442,
-0.18631868064403534,
-0.265649676322937,
-0.26962393522262573,
0.310580849647522,
-0.03451652079820633,
0.26828664541244507,
-0.10323557257652283,
0.0977538600564003,
-0.4567731022834778,
0.0019752858206629753,
-0.1364203691482544,
-0.1812971979379654,
0.06404955685138702,
-0.26542147994041443,
-0.2329207956790924,
-0.04983914643526077,
-0.3512771427631378,
0.289925217628479,
0.19486021995544434,
-0.15992498397827148,
0.07428131997585297,
-0.07736589014530182,
-0.3222827911376953,
-0.13063929975032806,
0.31237244606018066,
-0.2754513919353485,
-0.22101782262325287,
0.006752390414476395,
-0.07182642072439194,
-0.3517548441886902,
0.41039612889289856,
-0.3704943060874939,
0.1724049150943756,
0.12624262273311615,
0.2952823042869568,
-0.25022003054618835,
-0.04057861864566803,
0.38633963465690613,
0.3059801161289215,
0.11206364631652832,
0.004624716006219387,
0.050985340029001236,
-0.319230318069458,
-0.23949526250362396,
0.12898261845111847,
0.3245435357093811,
0.05351772531867027,
0.022509871050715446,
-0.31180474162101746,
-0.03351181000471115,
-0.11272303760051727,
0.31702905893325806,
0.16851092875003815,
0.37919512391090393,
0.13209687173366547,
-0.08046837151050568,
-0.02536027878522873,
-0.038368575274944305,
0.09697102010250092,
0.23100998997688293,
-0.20105156302452087,
-0.2554718554019928,
-0.17878586053848267,
-0.019753362983465195,
0.2903521955013275,
0.15182596445083618,
-0.15723875164985657,
0.07940026372671127,
-0.16763047873973846,
0.3030998706817627,
-0.25275224447250366,
0.10555759072303772,
-0.04770085960626602,
0.14035877585411072,
-0.21203695237636566,
-0.4234570264816284,
0.38913694024086,
0.2681562602519989,
-0.1656801998615265,
0.39241015911102295,
-0.0661134123802185,
-0.2365068644285202,
0.11535567790269852,
0.2821842432022095,
0.7224881052970886,
-0.05683252215385437,
-0.07503475248813629,
0.0235221479088068,
-0.26908934116363525,
0.38112279772758484,
-0.15646019577980042,
0.25817734003067017,
-0.1206437349319458,
-0.15529517829418182,
-0.02554192580282688,
-0.007701300084590912,
0.13031816482543945,
0.17688168585300446,
-0.26102522015571594,
0.15985284745693207,
-0.07676517963409424,
0.056406617164611816,
-0.06790853291749954,
0.2195761501789093,
-0.24820834398269653,
-0.2743977904319763,
-0.34534791111946106,
0.3326621949672699,
-0.1001398116350174,
-0.26407310366630554,
0.019427061080932617,
-0.003440062515437603,
0.22139224410057068,
-0.20896188914775848,
-0.20342743396759033,
-0.22544851899147034,
-0.12552006542682648,
0.2352994978427887,
-0.15404923260211945,
-0.08024412393569946,
-0.12216614186763763,
0.03960808366537094,
-0.2049931436777115,
0.37878623604774475,
0.05532083660364151,
0.07841884344816208,
-0.13818016648292542,
0.36772042512893677,
0.11999009549617767,
0.05331923067569733,
-0.018925534561276436,
0.08310161530971527,
0.05375533550977707,
-0.10835438221693039,
0.10633504390716553,
-0.20206110179424286,
-0.01297733187675476,
0.04061172530055046,
0.13499242067337036,
-0.28674399852752686,
-0.0016261981800198555,
0.009687229990959167,
-0.21682702004909515,
-0.0962434783577919,
0.2641240060329437,
0.18834757804870605,
0.0011888404842466116,
0.3905974328517914,
0.1260840892791748,
-0.09358865022659302,
0.045843616127967834,
0.042257651686668396,
0.2519720792770386,
0.012788485735654831,
0.12007882446050644,
-0.11295168101787567,
-0.3826100826263428,
-0.42034804821014404,
0.023671627044677734,
0.09947130084037781,
0.15258315205574036,
0.412872314453125,
-0.1814240664243698,
-0.07297364622354507,
0.14792825281620026,
-0.05234077200293541,
-0.17532020807266235,
0.28214699029922485,
0.009183283895254135,
-0.11858652532100677,
-0.2754143476486206,
0.18477779626846313,
0.15228308737277985,
0.38776785135269165,
0.10542184859514236,
-0.1312287598848343,
-0.21274851262569427,
0.11877741664648056,
-0.5174674987792969,
-0.20236583054065704,
-0.015391928143799305,
0.15606722235679626,
0.07434850931167603,
0.15054617822170258,
-0.05693453922867775,
-0.05299007147550583,
0.2876821756362915,
0.2092660814523697,
-0.12205755710601807,
-0.43975579738616943,
-0.019010283052921295,
0.028301849961280823,
-0.316355437040329,
-0.007509071379899979,
0.21143974363803864,
0.042440786957740784,
-0.20954665541648865,
-0.44163936376571655,
0.09488548338413239,
-0.03219261392951012,
-0.010847508907318115,
0.16571038961410522,
0.15091750025749207,
-0.2249242663383484,
0.17519548535346985,
0.06757999211549759,
0.06620916724205017,
0.10291067510843277,
-0.06294669955968857,
0.33513343334198,
-0.0031351272482424974,
-0.08285941183567047,
0.1949014812707901,
0.15623462200164795,
0.32797232270240784,
0.008563520386815071,
0.11217736452817917,
0.11030412465333939,
-0.09111359715461731,
0.4200783371925354,
0.3755113482475281,
0.18940173089504242,
-0.13261082768440247,
0.2516813576221466,
-0.1321183741092682,
0.4230891168117523,
-0.4288729131221771,
-0.01806512102484703,
0.33350053429603577,
0.03486763685941696,
0.34308379888534546,
0.10158143192529678,
-0.14419758319854736,
0.22041663527488708,
0.07000435143709183,
-0.12161925435066223,
0.14736109972000122,
-0.1953573375940323,
0.1974278688430786,
0.3873846232891083,
0.3395172655582428,
-0.2896791398525238,
-0.12149105221033096,
0.11655615270137787,
0.2464812994003296,
0.4034839868545532,
-0.14349162578582764,
0.4029286801815033,
0.1850820779800415,
0.1648501753807068,
-0.03413626551628113,
-0.07975585758686066,
0.36511680483818054,
0.34906819462776184,
-0.03253456950187683,
0.1545121967792511,
0.3649703860282898,
-0.0734172984957695,
0.0877520889043808,
-0.12056966125965118,
-0.08318144083023071,
0.2489720731973648,
-0.09301664680242538,
-0.020822325721383095,
-0.01125182956457138,
-0.09581981599330902,
-0.1103556752204895,
-0.21196062862873077,
0.008028998970985413,
-0.278298020362854,
0.22524462640285492,
0.055570460855960846,
0.4205257296562195,
-0.3865673243999481,
0.23967677354812622,
-0.0982038602232933,
0.45913225412368774,
-0.41816776990890503,
-0.24939756095409393,
0.0769239291548729,
0.21919332444667816,
-0.05128343030810356,
0.30126821994781494,
0.3597385287284851,
0.10977821052074432,
-0.16063253581523895,
0.23064841330051422,
-0.16280142962932587,
-0.2010815441608429,
-0.27659446001052856,
-0.1304726004600525,
0.06168239936232567,
0.19252018630504608,
0.33309921622276306,
0.32549092173576355,
-0.2140488177537918,
-0.031876664608716965,
0.13439205288887024,
-0.14808440208435059,
-0.4250578284263611,
0.2621767222881317,
0.31225210428237915,
-0.20328190922737122,
-0.1155383437871933,
-0.15013670921325684,
-0.1751977503299713,
-0.2778433561325073,
0.45054975152015686,
-0.07293117046356201,
0.06424454599618912,
-0.2193559855222702,
0.21436382830142975,
0.03910059854388237,
0.07416079938411713,
-0.15348920226097107,
0.3012901544570923,
-0.10343091934919357,
-0.17370489239692688,
-0.41763967275619507,
-0.15671184659004211,
-0.09655895829200745,
-0.2200758457183838,
0.19199839234352112,
0.1975981593132019,
0.10417521744966507,
0.4293617606163025,
0.0656093955039978,
-0.19022372364997864,
0.1006184071302414,
-0.2053341567516327,
-0.26095759868621826,
-0.028532546013593674,
-0.14204999804496765,
-0.2199285626411438,
0.22811737656593323,
-0.2827529013156891,
-0.08286422491073608,
-0.2028675377368927,
0.29465097188949585,
-0.1926041692495346,
0.098756805062294,
0.198903888463974,
-0.019220776855945587,
0.16743507981300354,
0.0945216715335846,
0.29229849576950073,
-0.2978452444076538,
0.05322419852018356,
0.20693381130695343,
-0.06904637813568115,
-0.18822456896305084,
0.36440300941467285,
0.10761360824108124,
0.11870329082012177,
-0.19672617316246033,
-0.1636064052581787,
0.0292544886469841,
0.05824583023786545,
0.023361146450042725,
0.03353622183203697,
-0.11486007273197174,
0.10584426671266556,
0.05712549388408661,
0.06591076403856277,
-0.3372988998889923,
0.18711575865745544,
-0.11810782551765442,
0.15498943626880646,
0.1490662395954132,
-0.42053237557411194,
0.0758034810423851,
-0.3178960978984833,
-0.2593095302581787,
-0.20945066213607788,
0.24962548911571503,
0.0028266161680221558,
-0.09137032181024551,
-0.26201900839805603,
0.021617509424686432,
0.3712780773639679,
-0.08254946768283844,
0.12590378522872925,
0.283091276884079,
-0.02884853631258011,
0.07444505393505096,
-0.19613437354564667,
0.21047182381153107,
-0.025113161653280258,
-0.1575637310743332,
0.07865606248378754,
-0.46846747398376465
] |
https://github.com/huggingface/datasets/issues/5495 | to_tf_dataset fails with datetime UTC columns even if not included in columns argument | Hi! This is indeed a bug in our zero-copy logic.
To fix it, instead of the line:
https://github.com/huggingface/datasets/blob/7cfac43b980ab9e4a69c2328f085770996323005/src/datasets/features/features.py#L702
we should have:
```python
return pa.types.is_primitive(pa_type) and not (pa.types.is_boolean(pa_type) or pa.types.is_temporal(pa_type))
``` | ### Describe the bug
There appears to be some eager behavior in `to_tf_dataset` that runs against every column in a dataset even if they aren't included in the columns argument. This is problematic with datetime UTC columns due to them not working with zero copy. If I don't have UTC information in my datetime column, then everything works as expected.
### Steps to reproduce the bug
```python
import numpy as np
import pandas as pd
from datasets import Dataset
df = pd.DataFrame(np.random.rand(2, 1), columns=["x"])
# df["dt"] = pd.to_datetime(["2023-01-01", "2023-01-01"]) # works fine
df["dt"] = pd.to_datetime(["2023-01-01 00:00:00.00000+00:00", "2023-01-01 00:00:00.00000+00:00"])
df.to_parquet("test.pq")
ds = Dataset.from_parquet("test.pq")
tf_ds = ds.to_tf_dataset(columns=["x"], batch_size=2, shuffle=True)
```
```
ArrowInvalid Traceback (most recent call last)
Cell In[1], line 12
8 df.to_parquet("test.pq")
11 ds = Dataset.from_parquet("test.pq")
---> 12 tf_ds = ds.to_tf_dataset(columns=["r"], batch_size=2, shuffle=True)
File ~/venv/lib/python3.8/site-packages/datasets/arrow_dataset.py:411, in TensorflowDatasetMixin.to_tf_dataset(self, batch_size, columns, shuffle, collate_fn, drop_remainder, collate_fn_args, label_cols, prefetch, num_workers)
407 dataset = self
409 # TODO(Matt, QL): deprecate the retention of label_ids and label
--> 411 output_signature, columns_to_np_types = dataset._get_output_signature(
412 dataset,
413 collate_fn=collate_fn,
414 collate_fn_args=collate_fn_args,
415 cols_to_retain=cols_to_retain,
416 batch_size=batch_size if drop_remainder else None,
417 )
419 if "labels" in output_signature:
420 if ("label_ids" in columns or "label" in columns) and "labels" not in columns:
File ~/venv/lib/python3.8/site-packages/datasets/arrow_dataset.py:254, in TensorflowDatasetMixin._get_output_signature(dataset, collate_fn, collate_fn_args, cols_to_retain, batch_size, num_test_batches)
252 for _ in range(num_test_batches):
253 indices = sample(range(len(dataset)), test_batch_size)
--> 254 test_batch = dataset[indices]
255 if cols_to_retain is not None:
256 test_batch = {key: value for key, value in test_batch.items() if key in cols_to_retain}
File ~/venv/lib/python3.8/site-packages/datasets/arrow_dataset.py:2590, in Dataset.__getitem__(self, key)
2588 def __getitem__(self, key): # noqa: F811
2589 """Can be used to index columns (by string names) or rows (by integer index or iterable of indices or bools)."""
-> 2590 return self._getitem(
2591 key,
2592 )
File ~/venv/lib/python3.8/site-packages/datasets/arrow_dataset.py:2575, in Dataset._getitem(self, key, **kwargs)
2573 formatter = get_formatter(format_type, features=self.features, **format_kwargs)
2574 pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
-> 2575 formatted_output = format_table(
2576 pa_subtable, key, formatter=formatter, format_columns=format_columns, output_all_columns=output_all_columns
2577 )
2578 return formatted_output
File ~/venv/lib/python3.8/site-packages/datasets/formatting/formatting.py:634, in format_table(table, key, formatter, format_columns, output_all_columns)
632 python_formatter = PythonFormatter(features=None)
633 if format_columns is None:
--> 634 return formatter(pa_table, query_type=query_type)
635 elif query_type == "column":
636 if key in format_columns:
File ~/venv/lib/python3.8/site-packages/datasets/formatting/formatting.py:410, in Formatter.__call__(self, pa_table, query_type)
408 return self.format_column(pa_table)
409 elif query_type == "batch":
--> 410 return self.format_batch(pa_table)
File ~/venv/lib/python3.8/site-packages/datasets/formatting/np_formatter.py:78, in NumpyFormatter.format_batch(self, pa_table)
77 def format_batch(self, pa_table: pa.Table) -> Mapping:
---> 78 batch = self.numpy_arrow_extractor().extract_batch(pa_table)
79 batch = self.python_features_decoder.decode_batch(batch)
80 batch = self.recursive_tensorize(batch)
File ~/venv/lib/python3.8/site-packages/datasets/formatting/formatting.py:164, in NumpyArrowExtractor.extract_batch(self, pa_table)
163 def extract_batch(self, pa_table: pa.Table) -> dict:
--> 164 return {col: self._arrow_array_to_numpy(pa_table[col]) for col in pa_table.column_names}
File ~/venv/lib/python3.8/site-packages/datasets/formatting/formatting.py:164, in <dictcomp>(.0)
163 def extract_batch(self, pa_table: pa.Table) -> dict:
--> 164 return {col: self._arrow_array_to_numpy(pa_table[col]) for col in pa_table.column_names}
File ~/venv/lib/python3.8/site-packages/datasets/formatting/formatting.py:185, in NumpyArrowExtractor._arrow_array_to_numpy(self, pa_array)
181 else:
182 zero_copy_only = _is_zero_copy_only(pa_array.type) and all(
183 not _is_array_with_nulls(chunk) for chunk in pa_array.chunks
184 )
--> 185 array: List = [
186 row for chunk in pa_array.chunks for row in chunk.to_numpy(zero_copy_only=zero_copy_only)
187 ]
188 else:
189 if isinstance(pa_array.type, _ArrayXDExtensionType):
190 # don't call to_pylist() to preserve dtype of the fixed-size array
File ~/venv/lib/python3.8/site-packages/datasets/formatting/formatting.py:186, in <listcomp>(.0)
181 else:
182 zero_copy_only = _is_zero_copy_only(pa_array.type) and all(
183 not _is_array_with_nulls(chunk) for chunk in pa_array.chunks
184 )
185 array: List = [
--> 186 row for chunk in pa_array.chunks for row in chunk.to_numpy(zero_copy_only=zero_copy_only)
187 ]
188 else:
189 if isinstance(pa_array.type, _ArrayXDExtensionType):
190 # don't call to_pylist() to preserve dtype of the fixed-size array
File ~/venv/lib/python3.8/site-packages/pyarrow/array.pxi:1475, in pyarrow.lib.Array.to_numpy()
File ~/venv/lib/python3.8/site-packages/pyarrow/error.pxi:100, in pyarrow.lib.check_status()
ArrowInvalid: Needed to copy 1 chunks with 0 nulls, but zero_copy_only was True
```
### Expected behavior
I think there are two potential issues/fixes
1. Proper handling of datetime UTC columns (perhaps there is something incorrect with zero copy handling here)
2. Not eagerly running against every column in a dataset when the columns argument of `to_tf_dataset` specifies a subset of columns (although I'm not sure if this is unavoidable)
### Environment info
- `datasets` version: 2.9.0
- Platform: macOS-13.2-x86_64-i386-64bit
- Python version: 3.8.12
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
| 30 | to_tf_dataset fails with datetime UTC columns even if not included in columns argument
### Describe the bug
There appears to be some eager behavior in `to_tf_dataset` that runs against every column in a dataset even if they aren't included in the columns argument. This is problematic with datetime UTC columns due to them not working with zero copy. If I don't have UTC information in my datetime column, then everything works as expected.
### Steps to reproduce the bug
```python
import numpy as np
import pandas as pd
from datasets import Dataset
df = pd.DataFrame(np.random.rand(2, 1), columns=["x"])
# df["dt"] = pd.to_datetime(["2023-01-01", "2023-01-01"]) # works fine
df["dt"] = pd.to_datetime(["2023-01-01 00:00:00.00000+00:00", "2023-01-01 00:00:00.00000+00:00"])
df.to_parquet("test.pq")
ds = Dataset.from_parquet("test.pq")
tf_ds = ds.to_tf_dataset(columns=["x"], batch_size=2, shuffle=True)
```
```
ArrowInvalid Traceback (most recent call last)
Cell In[1], line 12
8 df.to_parquet("test.pq")
11 ds = Dataset.from_parquet("test.pq")
---> 12 tf_ds = ds.to_tf_dataset(columns=["r"], batch_size=2, shuffle=True)
File ~/venv/lib/python3.8/site-packages/datasets/arrow_dataset.py:411, in TensorflowDatasetMixin.to_tf_dataset(self, batch_size, columns, shuffle, collate_fn, drop_remainder, collate_fn_args, label_cols, prefetch, num_workers)
407 dataset = self
409 # TODO(Matt, QL): deprecate the retention of label_ids and label
--> 411 output_signature, columns_to_np_types = dataset._get_output_signature(
412 dataset,
413 collate_fn=collate_fn,
414 collate_fn_args=collate_fn_args,
415 cols_to_retain=cols_to_retain,
416 batch_size=batch_size if drop_remainder else None,
417 )
419 if "labels" in output_signature:
420 if ("label_ids" in columns or "label" in columns) and "labels" not in columns:
File ~/venv/lib/python3.8/site-packages/datasets/arrow_dataset.py:254, in TensorflowDatasetMixin._get_output_signature(dataset, collate_fn, collate_fn_args, cols_to_retain, batch_size, num_test_batches)
252 for _ in range(num_test_batches):
253 indices = sample(range(len(dataset)), test_batch_size)
--> 254 test_batch = dataset[indices]
255 if cols_to_retain is not None:
256 test_batch = {key: value for key, value in test_batch.items() if key in cols_to_retain}
File ~/venv/lib/python3.8/site-packages/datasets/arrow_dataset.py:2590, in Dataset.__getitem__(self, key)
2588 def __getitem__(self, key): # noqa: F811
2589 """Can be used to index columns (by string names) or rows (by integer index or iterable of indices or bools)."""
-> 2590 return self._getitem(
2591 key,
2592 )
File ~/venv/lib/python3.8/site-packages/datasets/arrow_dataset.py:2575, in Dataset._getitem(self, key, **kwargs)
2573 formatter = get_formatter(format_type, features=self.features, **format_kwargs)
2574 pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
-> 2575 formatted_output = format_table(
2576 pa_subtable, key, formatter=formatter, format_columns=format_columns, output_all_columns=output_all_columns
2577 )
2578 return formatted_output
File ~/venv/lib/python3.8/site-packages/datasets/formatting/formatting.py:634, in format_table(table, key, formatter, format_columns, output_all_columns)
632 python_formatter = PythonFormatter(features=None)
633 if format_columns is None:
--> 634 return formatter(pa_table, query_type=query_type)
635 elif query_type == "column":
636 if key in format_columns:
File ~/venv/lib/python3.8/site-packages/datasets/formatting/formatting.py:410, in Formatter.__call__(self, pa_table, query_type)
408 return self.format_column(pa_table)
409 elif query_type == "batch":
--> 410 return self.format_batch(pa_table)
File ~/venv/lib/python3.8/site-packages/datasets/formatting/np_formatter.py:78, in NumpyFormatter.format_batch(self, pa_table)
77 def format_batch(self, pa_table: pa.Table) -> Mapping:
---> 78 batch = self.numpy_arrow_extractor().extract_batch(pa_table)
79 batch = self.python_features_decoder.decode_batch(batch)
80 batch = self.recursive_tensorize(batch)
File ~/venv/lib/python3.8/site-packages/datasets/formatting/formatting.py:164, in NumpyArrowExtractor.extract_batch(self, pa_table)
163 def extract_batch(self, pa_table: pa.Table) -> dict:
--> 164 return {col: self._arrow_array_to_numpy(pa_table[col]) for col in pa_table.column_names}
File ~/venv/lib/python3.8/site-packages/datasets/formatting/formatting.py:164, in <dictcomp>(.0)
163 def extract_batch(self, pa_table: pa.Table) -> dict:
--> 164 return {col: self._arrow_array_to_numpy(pa_table[col]) for col in pa_table.column_names}
File ~/venv/lib/python3.8/site-packages/datasets/formatting/formatting.py:185, in NumpyArrowExtractor._arrow_array_to_numpy(self, pa_array)
181 else:
182 zero_copy_only = _is_zero_copy_only(pa_array.type) and all(
183 not _is_array_with_nulls(chunk) for chunk in pa_array.chunks
184 )
--> 185 array: List = [
186 row for chunk in pa_array.chunks for row in chunk.to_numpy(zero_copy_only=zero_copy_only)
187 ]
188 else:
189 if isinstance(pa_array.type, _ArrayXDExtensionType):
190 # don't call to_pylist() to preserve dtype of the fixed-size array
File ~/venv/lib/python3.8/site-packages/datasets/formatting/formatting.py:186, in <listcomp>(.0)
181 else:
182 zero_copy_only = _is_zero_copy_only(pa_array.type) and all(
183 not _is_array_with_nulls(chunk) for chunk in pa_array.chunks
184 )
185 array: List = [
--> 186 row for chunk in pa_array.chunks for row in chunk.to_numpy(zero_copy_only=zero_copy_only)
187 ]
188 else:
189 if isinstance(pa_array.type, _ArrayXDExtensionType):
190 # don't call to_pylist() to preserve dtype of the fixed-size array
File ~/venv/lib/python3.8/site-packages/pyarrow/array.pxi:1475, in pyarrow.lib.Array.to_numpy()
File ~/venv/lib/python3.8/site-packages/pyarrow/error.pxi:100, in pyarrow.lib.check_status()
ArrowInvalid: Needed to copy 1 chunks with 0 nulls, but zero_copy_only was True
```
### Expected behavior
I think there are two potential issues/fixes
1. Proper handling of datetime UTC columns (perhaps there is something incorrect with zero copy handling here)
2. Not eagerly running against every column in a dataset when the columns argument of `to_tf_dataset` specifies a subset of columns (although I'm not sure if this is unavoidable)
### Environment info
- `datasets` version: 2.9.0
- Platform: macOS-13.2-x86_64-i386-64bit
- Python version: 3.8.12
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
Hi! This is indeed a bug in our zero-copy logic.
To fix it, instead of the line:
https://github.com/huggingface/datasets/blob/7cfac43b980ab9e4a69c2328f085770996323005/src/datasets/features/features.py#L702
we should have:
```python
return pa.types.is_primitive(pa_type) and not (pa.types.is_boolean(pa_type) or pa.types.is_temporal(pa_type))
``` | [
-0.03506900742650032,
-0.1291126310825348,
0.17251233756542206,
0.06727857142686844,
0.29345250129699707,
0.21920818090438843,
0.24181126058101654,
0.3881341218948364,
-0.027347443625330925,
0.14691618084907532,
0.31483665108680725,
0.4119403064250946,
-0.2279355376958847,
-0.25786292552948,
-0.05578989535570145,
-0.1794961541891098,
0.08810624480247498,
0.16409778594970703,
-0.3464879095554352,
-0.260128378868103,
-0.3857477605342865,
-0.11104799807071686,
-0.4728235602378845,
-0.1579056978225708,
0.21695107221603394,
-0.013901812955737114,
-0.13170742988586426,
-0.07259020954370499,
0.34366047382354736,
0.38242581486701965,
0.10894252359867096,
-0.32039105892181396,
0.004945345222949982,
0.6412931084632874,
-0.00012165834050392732,
0.24008305370807648,
0.08618377894163132,
-0.16653653979301453,
-0.1389394849538803,
-0.024984240531921387,
-0.10465371608734131,
0.11469608545303345,
0.08078935742378235,
-0.2905256748199463,
-0.2672325670719147,
-0.043209366500377655,
-0.0962214469909668,
-0.0456547811627388,
0.3140186071395874,
0.6122883558273315,
0.09285478293895721,
0.7864936590194702,
0.11205518245697021,
0.15450817346572876,
0.23850950598716736,
-0.1498202085494995,
-0.38039645552635193,
-0.13057589530944824,
0.14398033916950226,
0.012896545231342316,
0.426175057888031,
0.035457126796245575,
-0.07119729369878769,
-0.14215154945850372,
0.17580807209014893,
-0.19005247950553894,
0.0761728435754776,
-0.08532244712114334,
-0.002467833459377289,
0.27363473176956177,
0.39035457372665405,
-0.2163257598876953,
-0.22214572131633759,
-0.13208968937397003,
-0.2629028856754303,
-0.4877975285053253,
0.18219229578971863,
-0.20802725851535797,
0.3179818093776703,
0.03549081087112427,
0.08155893534421921,
0.3385648727416992,
-0.23777909576892853,
0.43775802850723267,
-0.22876396775245667,
0.31871122121810913,
-0.051716435700654984,
0.26381734013557434,
-0.304671049118042,
-0.2597469091415405,
0.037530869245529175,
-0.03310322016477585,
0.18033389747142792,
0.3600699007511139,
-0.41088899970054626,
-0.34718215465545654,
0.0456816628575325,
-0.35057634115219116,
-0.18386200070381165,
-0.06508166342973709,
-0.04423593357205391,
0.043744150549173355,
0.12993477284908295,
-0.0038331858813762665,
0.45817598700523376,
0.05811521038413048,
-0.3121388554573059,
0.445258229970932,
-0.06458660215139389,
-0.38048046827316284,
0.07691898941993713,
-0.04336082935333252,
0.2551586627960205,
-0.13188137114048004,
0.2569338083267212,
-0.16881823539733887,
0.28077614307403564,
-0.07668277621269226,
-0.2584260404109955,
0.08577880263328552,
0.05474527180194855,
0.12322141230106354,
-0.23025158047676086,
0.12902849912643433,
0.03744911029934883,
0.126069575548172,
-0.07378925383090973,
0.27811193466186523,
-0.009677933529019356,
-0.13527241349220276,
-0.446147620677948,
0.1336241364479065,
0.0872439444065094,
-0.05028846114873886,
-0.09728001058101654,
0.1635970026254654,
0.012592494487762451,
0.18378044664859772,
-0.01906297355890274,
0.15777571499347687,
0.08095257729291916,
-0.2549695372581482,
0.31273385882377625,
0.2350732833147049,
-0.1202714592218399,
0.28101521730422974,
0.21875570714473724,
-0.033115506172180176,
-0.06484173983335495,
0.09649010002613068,
-0.1880088746547699,
-0.4087834060192108,
-0.07424001395702362,
0.12749668955802917,
-0.30535537004470825,
-0.26759642362594604,
-0.3272450864315033,
0.05774672329425812,
0.35774004459381104,
-0.09741058945655823,
0.1846943348646164,
-0.3040282130241394,
-0.2120525985956192,
-0.1374104768037796,
0.03755400329828262,
0.25816527009010315,
-0.24655260145664215,
0.2916795313358307,
0.15128955245018005,
0.14166849851608276,
0.31741198897361755,
0.10105566680431366,
0.15654858946800232,
-0.11856482177972794,
0.0010385457426309586,
-0.392391562461853,
0.18593063950538635,
-0.3067682087421417,
0.08185351639986038,
0.10762721300125122,
-0.28877899050712585,
0.2025395929813385,
-0.21005558967590332,
-0.09876228868961334,
0.19585783779621124,
-0.27425047755241394,
0.1086525022983551,
0.1984892189502716,
-0.23684978485107422,
-0.044746026396751404,
-0.3937523365020752,
-0.029503002762794495,
0.13200977444648743,
0.215113565325737,
0.13893160223960876,
0.22764852643013,
-0.20346760749816895,
-0.12775729596614838,
0.12961433827877045,
-0.011531148105859756,
0.032127946615219116,
0.32127368450164795,
0.10393477976322174,
0.15118399262428284,
0.053836043924093246,
0.004406798630952835,
-0.28358107805252075,
0.2875112295150757,
1.0452909469604492,
0.08247870206832886,
0.21402883529663086,
0.06429910659790039,
-0.0752183049917221,
0.03302758187055588,
-0.053794536739587784,
0.11031962931156158,
-0.027203954756259918,
-0.07864613831043243,
0.04389132931828499,
0.34384894371032715,
-0.15828026831150055,
0.0089800376445055,
-0.753827691078186,
0.03480920568108559,
0.0016573835164308548,
0.08691653609275818,
0.24867752194404602,
-0.1393694132566452,
-0.04459074139595032,
0.25896525382995605,
0.3003801703453064,
-0.18941842019557953,
-0.023475859314203262,
0.008183363825082779,
-0.17893391847610474,
0.4182851314544678,
-0.5771943926811218,
0.14192485809326172,
0.0350654311478138,
-0.07761179655790329,
-0.4088437855243683,
0.20234254002571106,
0.2446291148662567,
-0.1937297284603119,
-0.06872396916151047,
0.30633658170700073,
0.03963011875748634,
0.293368399143219,
-0.01556793600320816,
-0.05793044716119766,
-0.007894741371273994,
0.010504376143217087,
0.1106373742222786,
-0.0670141726732254,
0.07175695896148682,
0.13156579434871674,
-0.11052201688289642,
-0.015231864526867867,
-0.6183964014053345,
0.2072920799255371,
0.41826173663139343,
0.12249350547790527,
-0.12874630093574524,
0.03760310262441635,
-0.013666331768035889,
0.07387342303991318,
0.10857918858528137,
0.2619847357273102,
0.19521477818489075,
0.20057058334350586,
0.2861458361148834,
-0.20026755332946777,
-0.11920417100191116,
-0.09985881298780441,
0.22439420223236084,
0.03145568445324898,
0.08954048901796341,
0.022402159869670868,
0.17314232885837555,
0.2854709029197693,
-0.3655630350112915,
0.014427490532398224,
0.29971614480018616,
0.3782307803630829,
-0.5229663252830505,
0.05342402309179306,
-0.3513619005680084,
0.11287865787744522,
0.05903812125325203,
0.34888580441474915,
0.13834093511104584,
-0.5545697808265686,
-0.06568776071071625,
0.49876296520233154,
-0.34752553701400757,
-0.04082336276769638,
-0.4201127588748932,
0.1629892736673355,
0.171775683760643,
-0.4519924521446228,
-0.15932193398475647,
-0.20294766128063202,
-0.32587215304374695,
-0.003861144185066223,
0.018374990671873093,
-0.23825663328170776,
0.25738999247550964,
0.037508249282836914,
-0.2070268839597702,
-0.014642836526036263,
-0.4623680114746094,
0.11549683660268784,
-0.3785144090652466,
0.21482844650745392,
-0.13164594769477844,
0.3249249756336212,
0.07624629884958267,
-0.1725246161222458,
-0.044824205338954926,
0.1063976138830185,
-0.10003224015235901,
0.2559446692466736,
-0.22012491524219513,
-0.053014665842056274,
-0.34264934062957764,
-0.16873592138290405,
-0.023552844300866127,
-0.3287467062473297,
-0.007652647793292999,
-0.05998002737760544,
0.1018560528755188,
0.3100162148475647,
0.07896607369184494,
-0.05821029469370842,
-0.2650581896305084,
-0.04856151342391968,
-0.3085843026638031,
-0.048839256167411804,
0.6170668601989746,
-0.09149151295423508,
-0.31208354234695435,
0.028621573001146317,
0.014220524579286575,
0.039645176380872726,
0.30208122730255127,
-0.29770970344543457,
-0.3778371512889862,
-0.1504138708114624,
-0.2552449107170105,
-0.1794431209564209,
-0.19721606373786926,
0.10988640785217285,
-0.2689521908760071,
0.01054595597088337,
-0.16615700721740723,
-0.037785857915878296,
0.38315048813819885,
0.4940067529678345,
-0.15468183159828186,
0.11618054658174515,
0.5064101219177246,
0.14800119400024414,
0.7461828589439392,
-0.21214018762111664,
-0.3557645082473755,
0.34964171051979065,
-0.3168981075286865,
0.3918376863002777,
0.010572366416454315,
-0.20080097019672394,
0.13714838027954102,
0.25023922324180603,
0.07037605345249176,
0.06917770206928253,
-0.30443769693374634,
-0.1957864612340927,
-0.013916172087192535,
0.15644221007823944,
0.03431384265422821,
-0.21880297362804413,
0.06700495630502701,
-0.16905470192432404,
0.10241396725177765,
0.2510823607444763,
0.38209664821624756,
-0.3542865216732025,
-0.2000066637992859,
0.049573905766010284,
0.046390350908041,
0.17197257280349731,
0.021804392337799072,
-0.021185489371418953,
0.10460498183965683,
-0.37411028146743774,
0.12708741426467896,
-0.1239951103925705,
0.816355288028717,
-0.18758399784564972,
-0.30502501130104065,
-0.0765700489282608,
0.09912722557783127,
0.7351512312889099,
-0.4834337830543518,
0.3355833888053894,
0.2700183093547821,
0.06337962299585342,
-0.7101334929466248,
-0.0207540113478899,
-0.05546688288450241,
-0.24742914736270905,
-0.174249529838562,
0.7305552363395691,
-0.28000709414482117,
-0.27913257479667664,
0.19710367918014526,
0.03730772063136101,
-0.07807187736034393,
-0.06237234175205231,
-0.0618990883231163,
-0.2581693232059479,
0.39219367504119873,
0.330645352602005,
0.4719172418117523,
0.3068731129169464,
-0.10717059671878815,
-0.13574209809303284,
-0.33641520142555237,
0.06397507339715958,
0.16904082894325256,
-0.09476776421070099,
0.3595488667488098,
-0.07145446538925171,
0.4010855555534363,
-0.29236626625061035,
-0.2582252323627472,
-0.0011840201914310455,
0.22075051069259644,
-0.0936630517244339,
-0.3729613125324249,
0.21437954902648926,
-0.28650155663490295,
0.2871478796005249,
0.3988809585571289,
-0.16783112287521362,
0.07980268448591232,
-0.38649284839630127,
0.0560469925403595,
0.050007931888103485,
-0.12237583845853806,
0.2673332393169403,
0.015747837722301483,
-0.01428141724318266,
-0.13441874086856842,
0.1708294302225113,
0.265173077583313,
0.1999039500951767,
0.7162020802497864,
0.2394097000360489,
-0.033957310020923615,
0.44574326276779175,
0.1088390052318573,
0.7683362364768982,
0.14399144053459167,
0.1109832227230072,
0.7998435497283936,
-0.32411646842956543,
0.528480589389801,
0.1283506602048874,
0.14768821001052856,
-0.09783929586410522,
-0.4238618314266205,
-0.04630391672253609,
-0.08610494434833527,
-0.17265009880065918,
0.24359677731990814,
0.0816643238067627,
0.37028205394744873,
-0.22778676450252533,
0.493215411901474,
0.33740052580833435,
0.027927719056606293,
0.0732106938958168,
0.018275940790772438,
0.06572265923023224,
0.05668359249830246,
0.2736731171607971,
0.018387731164693832,
0.10529010742902756,
-0.5105094909667969,
-0.13243596255779266,
-0.20223121345043182,
-0.0971379354596138,
0.06545815616846085,
-0.2082715481519699,
-0.1584797352552414,
0.01545785553753376,
-0.08994520455598831,
0.2825525999069214,
-0.09168803691864014,
0.3878946304321289,
-0.20991270244121552,
-0.18944722414016724,
-0.024919714778661728,
0.33264580368995667,
0.14549586176872253,
-0.06119143217802048,
0.19040672481060028,
0.3692561089992523,
0.007629029452800751,
0.10787611454725266,
0.010657954961061478,
-0.3366023302078247,
-0.3045652508735657,
-0.05505157262086868,
0.07969950884580612,
-0.17086735367774963,
0.05008378624916077,
-0.49417462944984436,
0.2695292830467224,
-0.06309428066015244,
-0.3399023413658142,
0.05243505910038948,
-0.30605876445770264,
0.026684116572141647,
0.24692952632904053,
-0.3172106146812439,
-0.3914116322994232,
0.06620171666145325,
0.32463210821151733,
-0.20435887575149536,
0.28494903445243835,
0.6066430807113647,
0.26849523186683655,
-0.09969444572925568,
-0.05928889662027359,
-0.10454974323511124,
0.4166204333305359,
-0.6805651187896729,
0.21691061556339264,
-0.431258887052536,
0.243336483836174,
0.19262869656085968,
0.38926663994789124,
-0.11397446691989899,
-0.04781985282897949,
-0.1792437732219696,
-0.20212405920028687,
0.04336107522249222,
0.0037492290139198303,
-0.010325539857149124,
-0.01342025026679039,
-0.13797666132450104,
0.3415191173553467,
-0.05731957405805588,
-0.25272467732429504,
-0.2251453697681427,
-0.09459859132766724,
-0.14916662871837616,
0.4274881184101105,
0.4239676594734192,
0.0034248344600200653,
0.12873952090740204,
0.0012580202892422676,
0.09229633957147598,
-0.0021254979074001312,
-0.1279771327972412,
-0.137559175491333,
-0.11568908393383026,
0.18502028286457062,
0.16803696751594543,
0.02810031734406948,
0.023661978542804718,
-0.26301899552345276,
-0.3364206552505493,
-0.03694962337613106,
0.08447739481925964,
0.14563295245170593,
-0.3170453906059265,
-0.0013175848871469498,
0.25363174080848694,
0.31930145621299744,
-0.14065350592136383,
-0.20041558146476746,
0.06238330155611038,
0.030926398932933807,
-0.030827060341835022,
0.2184101641178131,
0.0941879004240036,
-0.10733355581760406,
-0.12858544290065765,
-0.037860043346881866,
-0.428169846534729,
-0.2581777572631836,
0.16072151064872742,
-0.18023332953453064,
-0.18557427823543549,
0.12820859253406525,
-0.01055943313986063,
0.3491388261318207,
-0.2768053114414215,
-0.3197505474090576,
-0.07435674220323563,
0.06622003018856049,
-0.1959674209356308,
-0.016006743535399437,
-0.010722346603870392,
0.2711516320705414,
0.15560053288936615,
0.2855817675590515,
-0.12357991933822632,
-0.2639097571372986,
0.02213694155216217,
0.14591771364212036,
0.3299929201602936,
-0.7050777673721313,
0.014980071224272251,
0.4531121253967285,
-0.2699878215789795,
0.05662602186203003,
0.0004419814795255661,
0.030397068709135056,
0.127119243144989,
0.07559391111135483,
0.25983837246894836,
0.12755313515663147,
0.42367950081825256,
-0.256026029586792,
-0.08328665047883987,
-0.4349439740180969,
-0.012097768485546112,
0.29088860750198364,
0.12026587128639221,
0.4736446738243103,
0.12105818092823029,
0.26113930344581604,
0.031630489975214005,
-0.09912750869989395,
0.014829279854893684,
-0.020447030663490295,
-0.07618416845798492,
0.15928252041339874,
0.04402625560760498,
-0.023005995899438858,
-0.3461925983428955,
-0.18311084806919098,
-0.09114879369735718,
-0.1361222118139267,
0.16449135541915894,
0.1718706488609314,
0.13750240206718445,
-0.07871939986944199,
-0.17973196506500244,
-0.1029244139790535,
0.022409401834011078,
-0.11372721195220947,
0.4474276304244995,
-0.15629498660564423,
-0.4142517149448395,
-0.09906838834285736,
0.029450630769133568,
0.20548932254314423,
0.1758796125650406,
0.03955820947885513,
0.312968373298645,
0.16203929483890533,
-0.1296067088842392,
0.2262105792760849,
0.32319915294647217,
-0.2497483789920807,
-0.05784482881426811,
0.3873683512210846,
-0.009346365928649902,
-0.043794192373752594,
-0.1278279572725296,
0.08665686100721359,
0.004032352939248085,
-0.4898126423358917,
0.4487186670303345,
0.18416596949100494,
-0.09963449835777283,
0.00742306187748909,
0.13571512699127197,
0.003573015332221985,
0.053110141307115555,
0.07813501358032227,
-0.026747537776827812,
0.18839216232299805,
0.10330816358327866,
0.031901322305202484,
-0.20698952674865723,
0.1636214703321457,
0.1653193086385727,
0.024195604026317596,
-0.4785180985927582,
-0.10474203526973724,
-0.618925929069519,
0.21043720841407776,
-0.15864700078964233,
0.10269321501255035,
0.5172344446182251,
0.3687947690486908,
0.42236948013305664,
-0.22618095576763153,
0.0014437437057495117,
0.14776861667633057,
-0.2617023289203644,
0.2408238798379898,
-0.16965025663375854,
-0.14811745285987854,
-0.11421547830104828,
-0.06672906130552292,
0.09315028786659241,
-0.41882163286209106,
0.18950587511062622,
0.00635331217199564,
0.029173441231250763,
0.039654821157455444,
-0.08143067359924316,
-0.020780211314558983,
0.11524420976638794,
0.28119945526123047,
-0.1732676923274994,
0.04555521532893181,
0.04178842157125473,
0.11245336383581161,
-0.21794024109840393,
0.08744079619646072,
-0.375593364238739,
0.17827492952346802,
-0.2539767026901245,
-0.176333948969841,
-0.2192172408103943,
-0.024408508092164993,
-0.0002294500300195068,
0.016176145523786545,
-0.11921291053295135,
-0.1477016657590866,
-0.06939519941806793,
0.4361489713191986,
-0.08429009467363358,
0.2696419358253479,
0.18846333026885986,
-0.1692972481250763,
0.13851803541183472,
0.03620827943086624,
-0.24741198122501373,
-0.44465598464012146,
0.4217076003551483,
-0.42611151933670044,
-0.22126877307891846,
-0.06787745654582977,
0.08068320155143738,
0.5298150777816772,
0.18391044437885284,
-0.14740967750549316,
-0.21820420026779175,
0.386624276638031,
-0.13034087419509888,
0.11883962154388428,
0.11968651413917542,
0.15635362267494202,
0.1710408627986908,
-0.07676441967487335,
0.23772917687892914,
0.2098206877708435,
-0.16437256336212158,
0.06886203587055206,
-0.22151906788349152
] |
https://github.com/huggingface/datasets/issues/5494 | Update audio installation doc page | Totally agree, the docs should be in sync with our code.
Indeed to avoid confusing users, I think we should have updated the docs at the same time as this PR:
- #5167 | Our [installation documentation page](https://huggingface.co/docs/datasets/installation#audio) says that one can use Datasets for mp3 only with `torchaudio<0.12`. `torchaudio>0.12` is actually supported too but requires a specific version of ffmpeg which is not easily installed on all linux versions but there is a custom ubuntu repo for it, we have insctructions in the code: https://github.com/huggingface/datasets/blob/main/src/datasets/features/audio.py#L327
So we should update the doc page. But first investigate [this issue](5488). | 33 | Update audio installation doc page
Our [installation documentation page](https://huggingface.co/docs/datasets/installation#audio) says that one can use Datasets for mp3 only with `torchaudio<0.12`. `torchaudio>0.12` is actually supported too but requires a specific version of ffmpeg which is not easily installed on all linux versions but there is a custom ubuntu repo for it, we have insctructions in the code: https://github.com/huggingface/datasets/blob/main/src/datasets/features/audio.py#L327
So we should update the doc page. But first investigate [this issue](5488).
Totally agree, the docs should be in sync with our code.
Indeed to avoid confusing users, I think we should have updated the docs at the same time as this PR:
- #5167 | [
-0.29123711585998535,
-0.17746642231941223,
-0.007997283712029457,
0.19306111335754395,
0.30590444803237915,
-0.12155362218618393,
0.0991264283657074,
0.03717200458049774,
-0.1649681031703949,
0.2726282477378845,
-0.36509016156196594,
0.32531046867370605,
-0.11304717510938644,
-0.026876278221607208,
-0.08934114128351212,
-0.1374484747648239,
0.0765356793999672,
0.01781405508518219,
-0.4595697224140167,
-0.06881289929151535,
-0.08862394839525223,
0.21780431270599365,
-0.2132217437028885,
-0.0389396995306015,
-0.2614438831806183,
-0.05148301273584366,
0.14588406682014465,
-0.018477968871593475,
-0.5016326308250427,
-0.36268043518066406,
0.17352294921875,
0.07242760062217712,
-0.05090881511569023,
0.5803092122077942,
-0.00010097357153426856,
-0.14743705093860626,
0.44884663820266724,
-0.07084322720766068,
-0.2945616841316223,
-0.15957386791706085,
-0.134981170296669,
0.06626247614622116,
-0.09008508920669556,
0.05510563403367996,
-0.07056605070829391,
-0.256535142660141,
-0.09949882328510284,
-0.14471764862537384,
0.18468816578388214,
0.21087755262851715,
0.3513532876968384,
0.2809774577617645,
0.2670745551586151,
-0.1497664600610733,
0.10066235065460205,
0.31838175654411316,
-0.19416575133800507,
0.14765392243862152,
0.2374124974012375,
0.22897909581661224,
-0.02091420441865921,
0.3273884057998657,
-0.020746709778904915,
0.11201015114784241,
0.422873854637146,
-0.1609436422586441,
-0.42432403564453125,
-0.3460492789745331,
0.16299597918987274,
0.21871888637542725,
0.6733160614967346,
-0.3544063866138458,
-0.4418381154537201,
-0.14569668471813202,
0.04425938427448273,
-0.3586362600326538,
0.23474490642547607,
0.000897538848221302,
-0.21825028955936432,
0.1970403641462326,
-0.24648164212703705,
-0.17081235349178314,
0.07246245443820953,
0.055665045976638794,
0.24149733781814575,
0.0445060171186924,
-0.28006207942962646,
-0.13039913773536682,
0.30675241351127625,
-0.26192784309387207,
-0.24907037615776062,
0.09378783404827118,
0.04118800163269043,
0.1671091616153717,
0.09228988736867905,
-0.08556078374385834,
-0.015038751065731049,
0.27298569679260254,
0.24057212471961975,
-0.1405465006828308,
-0.15410864353179932,
0.05576201155781746,
-0.10622217506170273,
0.08290837705135345,
0.015835685655474663,
-0.1781756430864334,
0.14219193160533905,
-0.1681811362504959,
0.3554455041885376,
0.19354726374149323,
0.3766011893749237,
-0.13552027940750122,
0.12319469451904297,
-0.1988820731639862,
-0.47246187925338745,
-0.1004706621170044,
0.2616274356842041,
-0.40640830993652344,
-0.2639673054218292,
-0.07096342742443085,
0.0282934308052063,
-0.09746824204921722,
0.18060274422168732,
0.2003360241651535,
0.054167382419109344,
-0.06037541478872299,
-0.16055698692798615,
0.36536383628845215,
-0.10774486511945724,
-0.04095041751861572,
-0.0744260922074318,
-0.00452754832804203,
-0.10367143154144287,
0.15527091920375824,
0.27807047963142395,
-0.4079013168811798,
0.42730411887168884,
0.25183188915252686,
0.31566864252090454,
0.06143973767757416,
-0.1832660734653473,
0.1491854339838028,
-0.11730919033288956,
0.12211641669273376,
-0.14241859316825867,
0.21553075313568115,
-0.20626889169216156,
0.2619715929031372,
-0.039056044071912766,
-0.013990014791488647,
-0.0036577731370925903,
-0.1389111429452896,
-0.10586340725421906,
0.22168302536010742,
-0.13420450687408447,
0.07429403066635132,
-0.14610809087753296,
0.2756960093975067,
-0.19537889957427979,
-0.3760576546192169,
0.07053007185459137,
0.02171611785888672,
-0.42807939648628235,
0.028387682512402534,
0.29013365507125854,
0.26756536960601807,
-0.01913526840507984,
-0.2653026282787323,
0.2682282030582428,
0.00897701270878315,
-0.04652952402830124,
0.305650919675827,
-0.1492285579442978,
-0.10996729880571365,
-0.24314087629318237,
-0.000029280781745910645,
0.27234384417533875,
-0.4375445544719696,
-0.387479692697525,
-0.056334223598241806,
0.2147456556558609,
0.05072988569736481,
0.07350148260593414,
-0.21886946260929108,
0.02813112549483776,
-0.11059189587831497,
-0.10435815155506134,
0.02408798411488533,
0.08127368241548538,
0.033449895679950714,
-0.13928847014904022,
-0.22537538409233093,
-0.026906810700893402,
-0.045337796211242676,
-0.17753314971923828,
0.037324316799640656,
0.0951048955321312,
0.15506179630756378,
0.25420108437538147,
0.047958675771951675,
0.06855493783950806,
0.34928280115127563,
0.30394089221954346,
0.027131501585245132,
-0.10031559318304062,
-0.29956069588661194,
-0.018423639237880707,
-0.053268007934093475,
0.15585602819919586,
0.23442824184894562,
-0.15892232954502106,
-0.3288869857788086,
-0.03944098949432373,
-0.2869253158569336,
-0.21881188452243805,
-0.2855894863605499,
0.13134688138961792,
0.18790623545646667,
0.2056385725736618,
0.050523314625024796,
-0.08260468393564224,
0.20240949094295502,
0.22129647433757782,
0.08109770715236664,
-0.4223410487174988,
-0.03400511294603348,
-0.14591024816036224,
-0.004433328285813332,
0.4253879487514496,
0.22993871569633484,
0.13841542601585388,
-0.009913031943142414,
-0.10981854796409607,
0.4650419354438782,
0.06588059663772583,
0.3302752375602722,
-0.054394617676734924,
0.15070277452468872,
0.27335143089294434,
-0.2406921088695526,
0.20066897571086884,
0.02689475566148758,
0.1672634482383728,
0.05573198199272156,
-0.13148239254951477,
0.13650794327259064,
0.0900198221206665,
-0.03931640833616257,
0.226297065615654,
-0.11939705908298492,
0.2239185869693756,
0.45236560702323914,
-0.27080637216567993,
-0.08839701861143112,
-0.14288879930973053,
-0.0072256289422512054,
0.395342618227005,
-0.08202844113111496,
-0.34945130348205566,
-0.13346636295318604,
0.29710090160369873,
-0.06255747377872467,
-0.04580933600664139,
0.23644301295280457,
-0.1240643784403801,
-0.14681163430213928,
0.2413157820701599,
-0.19132263958454132,
0.2957209348678589,
0.3841343820095062,
0.24855168163776398,
0.02647976018488407,
0.011441819369792938,
-0.13642989099025726,
0.08576332777738571,
0.08540008962154388,
-0.1994989514350891,
0.18408283591270447,
-0.005082220304757357,
-0.09751208126544952,
-0.562883198261261,
0.14604216814041138,
-0.12069243937730789,
0.10845715552568436,
-0.34740152955055237,
-0.26460614800453186,
-0.32328858971595764,
-0.3467516005039215,
-0.28362420201301575,
-0.3383670747280121,
-0.5182469487190247,
-0.0543418750166893,
0.3507802486419678,
0.42388126254081726,
-0.02044842578470707,
0.34887200593948364,
0.11597275733947754,
0.34704887866973877,
-0.04932751506567001,
0.1364995688199997,
-0.20064884424209595,
0.30284208059310913,
-0.12392125278711319,
0.18915189802646637,
0.3144485652446747,
0.1979440301656723,
0.3009852468967438,
-0.165228471159935,
-0.026453133672475815,
-0.24808913469314575,
-0.24503085017204285,
0.17047303915023804,
-0.05417156219482422,
0.15316373109817505,
0.1173553541302681,
-0.0016316771507263184,
-0.055576030164957047,
-0.06079581379890442,
0.2074897140264511,
-0.13731639087200165,
-0.19880874454975128,
-0.10754863172769547,
0.05537976697087288,
0.07287269085645676,
-0.22086524963378906,
-0.30054715275764465,
-0.10703600198030472,
-0.5384280681610107,
0.2981188893318176,
-0.06718882918357849,
0.019308224320411682,
0.21025149524211884,
0.13041891157627106,
0.11956370621919632,
-0.20576737821102142,
0.34615758061408997,
-0.2819633483886719,
-0.4161067008972168,
0.3551757335662842,
-0.40239638090133667,
-0.37923943996429443,
-0.013117995113134384,
0.41272681951522827,
0.21789102256298065,
-0.03289521485567093,
-0.20774470269680023,
-0.31687670946121216,
-0.020469127222895622,
-0.04411199688911438,
0.07559077441692352,
0.3272837996482849,
0.2148667424917221,
0.09520517289638519,
-0.09555947035551071,
-0.19887635111808777,
-0.27029260993003845,
-0.1312183439731598,
-0.17012250423431396,
0.30160075426101685,
-0.0020945891737937927,
0.36021628975868225,
-0.058098435401916504,
0.5275207757949829,
0.38429445028305054,
-0.039869192987680435,
0.20613212883472443,
-0.09814301878213882,
0.5386860370635986,
-0.37282413244247437,
-0.21051061153411865,
0.1908179372549057,
-0.0007259994745254517,
0.13045743107795715,
0.22157055139541626,
0.33030784130096436,
0.33215805888175964,
-0.24414023756980896,
0.14432427287101746,
-0.14215756952762604,
-0.17529524862766266,
-0.2409142106771469,
0.22124242782592773,
0.004780285060405731,
0.05810154601931572,
0.3035576343536377,
0.12764856219291687,
0.010180523619055748,
0.21624156832695007,
0.2857440114021301,
0.12016411125659943,
0.13788680732250214,
-0.045621514320373535,
0.25458818674087524,
-0.4907805323600769,
0.06782561540603638,
-0.015170150436460972,
0.22861240804195404,
-0.21829405426979065,
-0.13884803652763367,
-0.008893467485904694,
0.13516491651535034,
0.22697366774082184,
-0.15156961977481842,
-0.11099414527416229,
-0.14618423581123352,
0.2227657437324524,
-0.20066039264202118,
0.17224906384944916,
-0.2518084645271301,
0.03580961748957634,
0.20794633030891418,
0.1954486072063446,
-0.23023274540901184,
-0.25384828448295593,
0.15673021972179413,
0.07189702242612839,
0.2313328981399536,
-0.08209900557994843,
-0.19938498735427856,
-0.21207141876220703,
-0.25809937715530396,
0.080836720764637,
0.1084575429558754,
0.0313798189163208,
-0.015999510884284973,
-0.06521733105182648,
0.3205796778202057,
-0.17418640851974487,
0.2604053020477295,
0.07398232817649841,
0.3381805717945099,
0.03810246288776398,
0.17158766090869904,
0.18524393439292908,
0.11080779135227203,
0.5458894371986389,
0.5079836845397949,
-0.107765793800354,
-0.0919172465801239,
0.042648762464523315,
-0.11061768233776093,
0.12166008353233337,
0.32481294870376587,
0.16188034415245056,
0.015831351280212402,
-0.05212175101041794,
0.161167174577713,
-0.3527132570743561,
0.07677634060382843,
0.4672059118747711,
0.13529691100120544,
-0.17286056280136108,
-0.29118970036506653,
0.3483869433403015,
0.028654851019382477,
-0.0567970797419548,
0.33618777990341187,
0.47084999084472656,
-0.09676463156938553,
-0.10367342084646225,
-0.10352649539709091,
0.8617024421691895,
0.25652968883514404,
0.09035969525575638,
0.3028271794319153,
-0.39882761240005493,
0.28793513774871826,
-0.126140296459198,
0.03572561964392662,
0.014992471784353256,
-0.030838798731565475,
-0.013338127173483372,
0.12455612421035767,
0.1968446969985962,
-0.05132777988910675,
-0.22486677765846252,
0.24636487662792206,
0.1759054809808731,
0.12920862436294556,
-0.07297816127538681,
0.15650081634521484,
-0.4157443344593048,
-0.21787875890731812,
-0.35459834337234497,
0.22707223892211914,
0.07891839742660522,
0.3565368056297302,
-0.03625298663973808,
-0.24005456268787384,
0.06855729222297668,
-0.3799440264701843,
-0.2160162329673767,
-0.07397960871458054,
-0.2445344626903534,
-0.06449087709188461,
0.053326018154621124,
-0.15502387285232544,
0.20107118785381317,
0.1511153280735016,
0.115505151450634,
0.1300487220287323,
-0.30767908692359924,
0.0639088898897171,
-0.2838699221611023,
0.19002757966518402,
-0.1616322100162506,
0.02622547373175621,
0.17779307067394257,
-0.11716050654649734,
-0.03692147880792618,
-0.13820132613182068,
0.09070879220962524,
-0.0601913183927536,
0.004387229681015015,
-0.2587268352508545,
-0.17125698924064636,
-0.29582661390304565,
-0.15131278336048126,
-0.09872399270534515,
0.035923149436712265,
-0.1577025204896927,
0.22237806022167206,
-0.12176744639873505,
-0.28475749492645264,
-0.01022648811340332,
0.020679788663983345,
0.036778971552848816,
-0.2983401119709015,
0.5050636529922485,
-0.4274548888206482,
-0.17820028960704803,
0.15570129454135895,
0.18002799153327942,
-0.3407222032546997,
-0.2356100082397461,
-0.016296684741973877,
0.19896775484085083,
-0.4632977545261383,
-0.2083728164434433,
0.20233328640460968,
-0.06824109703302383,
-0.02295655570924282,
-0.07982493937015533,
-0.04772637039422989,
-0.08354305475950241,
-0.05023109167814255,
-0.04207279160618782,
-0.5254504084587097,
0.3063085079193115,
0.006822049617767334,
0.2321482002735138,
-0.00019816681742668152,
-0.1120511144399643,
0.2651621699333191,
-0.12499335408210754,
-0.4150962829589844,
0.08799166232347488,
0.39531105756759644,
-0.026155009865760803,
0.2709389925003052,
-0.01581978052854538,
0.2968111038208008,
-0.13988399505615234,
0.17437267303466797,
0.1788472831249237,
-0.3119068145751953,
-0.16230082511901855,
-0.01984727941453457,
0.11495081335306168,
0.047315701842308044,
-0.3302640914916992,
-0.061149366199970245,
-0.012139185331761837,
-0.24944990873336792,
-0.21663421392440796,
0.2331303358078003,
0.5060389637947083,
-0.0036709383130073547,
0.05801874026656151,
0.022622156888246536,
-0.021415717899799347,
0.185515895485878,
-0.1487954705953598,
0.1858697533607483,
-0.01952030509710312,
0.21323080360889435,
0.023984184488654137,
-0.05639692768454552,
-0.15145139396190643,
0.05520607531070709,
0.3220829963684082,
0.03477535396814346,
-0.10763544589281082,
0.17267709970474243,
-0.09180933237075806,
0.24566829204559326,
0.2744393050670624,
0.6120283603668213,
0.3158279061317444,
-0.012552442029118538,
-0.25639840960502625,
0.29103460907936096,
0.3262423574924469,
-0.24706751108169556,
-0.20606477558612823,
-0.23056049644947052,
-0.07887110859155655,
0.05233598127961159,
0.035260096192359924,
0.13277289271354675,
0.10559546947479248,
0.0970909520983696,
0.0626225396990776,
0.06279967725276947,
-0.09130886942148209,
0.19260884821414948,
0.23067420721054077,
-0.12185055017471313,
-0.006295781582593918,
0.18134884536266327,
0.08913889527320862,
0.22565557062625885,
0.33967941999435425,
-0.4136226177215576,
0.4319586753845215,
0.02275090664625168,
-0.018889140337705612,
0.1573311984539032,
-0.23173831403255463,
-0.19866667687892914,
0.133125901222229,
0.225272998213768,
-0.0012787878513336182,
0.06037680804729462,
0.43861258029937744,
-0.43225446343421936,
-0.25795480608940125,
-0.14261092245578766,
0.06239600479602814,
-0.16209179162979126,
-0.18465936183929443,
0.037719473242759705,
-0.220757395029068,
-0.10833069682121277,
0.05013669654726982,
-0.1474037915468216,
-0.04152505099773407,
-0.016199223697185516,
-0.2117568701505661,
-0.05543002486228943,
-0.2794346511363983,
-0.1581251323223114,
0.023896390572190285,
0.254698783159256,
0.12018159031867981,
0.2567673325538635,
0.06847472488880157,
-0.21984854340553284,
0.3239949941635132,
0.5059257745742798,
0.5636990070343018,
0.07379426062107086,
0.1439530849456787,
0.05869963765144348,
-0.14144405722618103,
-0.0033859703689813614,
-0.007619158364832401,
0.2940715253353119,
-0.02360323816537857,
0.08557383716106415,
0.32556116580963135,
0.2292058765888214,
-0.23861823976039886,
0.016046885401010513,
-0.16868513822555542,
0.05767932906746864,
-0.2971036732196808,
0.11401958763599396,
-0.3575589954853058,
0.02663569152355194,
-0.15644647181034088,
-0.06477291136980057,
-0.367705762386322,
-0.07705280184745789,
0.4021977484226227,
0.027853108942508698,
0.04878971725702286,
-0.2220456600189209,
0.10578115284442902,
-0.017364222556352615,
0.28373581171035767,
0.3584538996219635,
-0.1325884461402893,
0.04586278274655342,
-0.15635764598846436,
-0.6760637164115906,
0.05937895551323891,
0.21367332339286804,
0.2241641879081726,
-0.18553562462329865,
-0.17542578279972076,
0.20986516773700714,
0.0330507718026638,
0.06291000545024872,
-0.12321451306343079,
0.16827163100242615,
-0.10286782681941986,
-0.07098425924777985,
0.08629415184259415,
-0.4552415609359741,
0.21531662344932556,
0.08638286590576172,
-0.12790447473526,
0.12377874553203583,
-0.11182422190904617,
0.0899222269654274,
-0.0669628456234932,
0.4002080261707306,
-0.41249358654022217,
-0.09931720793247223,
0.08439234644174576,
0.2657388746738434,
0.3368750810623169,
-0.2635232210159302,
-0.25812193751335144,
-0.20855528116226196,
-0.05673890933394432,
-0.06735464930534363,
0.2602457106113434,
-0.20115140080451965,
0.40450599789619446,
-0.09178061038255692,
-0.3784750998020172,
-0.3583337664604187,
0.44670185446739197,
-0.013311665505170822,
0.016069035977125168,
-0.341592013835907,
0.154951274394989,
-0.1821783483028412,
0.0026600759010761976,
0.16181600093841553,
0.04071666672825813,
-0.046477220952510834,
0.04260841757059097,
-0.40472495555877686,
-0.38683876395225525,
0.6636625528335571,
-0.04552837833762169,
0.0680161714553833,
-0.2117735594511032,
0.40400347113609314,
0.6181865334510803,
-0.28489547967910767,
-1.1916388273239136,
0.22473430633544922,
0.049760375171899796,
0.10983243584632874,
-0.11885839700698853,
0.17344364523887634,
-0.3334536552429199,
-0.08837949484586716,
-0.17430223524570465,
0.38960787653923035,
0.07548068463802338,
-0.08491616696119308,
0.40084442496299744,
-0.1426403522491455
] |
https://github.com/huggingface/datasets/issues/5494 | Update audio installation doc page | No, @polinaeterna, nothing to be sorry about.
My comment was for all of us datasets team, as a reminder: when making a PR, but also when reviewing some other's PR, we should not forget to update the corresponding docstring and doc pages. It is something we can improve if we help each other in reminding about it... :hugs: | Our [installation documentation page](https://huggingface.co/docs/datasets/installation#audio) says that one can use Datasets for mp3 only with `torchaudio<0.12`. `torchaudio>0.12` is actually supported too but requires a specific version of ffmpeg which is not easily installed on all linux versions but there is a custom ubuntu repo for it, we have insctructions in the code: https://github.com/huggingface/datasets/blob/main/src/datasets/features/audio.py#L327
So we should update the doc page. But first investigate [this issue](5488). | 58 | Update audio installation doc page
Our [installation documentation page](https://huggingface.co/docs/datasets/installation#audio) says that one can use Datasets for mp3 only with `torchaudio<0.12`. `torchaudio>0.12` is actually supported too but requires a specific version of ffmpeg which is not easily installed on all linux versions but there is a custom ubuntu repo for it, we have insctructions in the code: https://github.com/huggingface/datasets/blob/main/src/datasets/features/audio.py#L327
So we should update the doc page. But first investigate [this issue](5488).
No, @polinaeterna, nothing to be sorry about.
My comment was for all of us datasets team, as a reminder: when making a PR, but also when reviewing some other's PR, we should not forget to update the corresponding docstring and doc pages. It is something we can improve if we help each other in reminding about it... :hugs: | [
-0.37036871910095215,
-0.12612512707710266,
-0.022752484306693077,
0.12756696343421936,
0.39078015089035034,
-0.11761356145143509,
0.0820467472076416,
0.03473973274230957,
-0.20442403852939606,
0.2120751440525055,
-0.38398346304893494,
0.3296096920967102,
-0.0924934670329094,
-0.03305979073047638,
-0.11143293976783752,
-0.12027190625667572,
0.06485891342163086,
-0.018989458680152893,
-0.37944433093070984,
-0.03407113254070282,
-0.10084103047847748,
0.1707613617181778,
-0.2708192467689514,
-0.01863710582256317,
-0.2985153794288635,
-0.07978811860084534,
0.11533239483833313,
-0.04452937841415405,
-0.443735808134079,
-0.3729800581932068,
0.22665919363498688,
0.09698300063610077,
0.032630179077386856,
0.5438432097434998,
-0.00009970826067728922,
-0.12314287573099136,
0.47686827182769775,
-0.009933850727975368,
-0.30700501799583435,
-0.1531020849943161,
-0.19477775692939758,
0.09969058632850647,
-0.16360212862491608,
0.08624454587697983,
-0.07272833585739136,
-0.298002153635025,
-0.08784253150224686,
-0.21551692485809326,
0.17954659461975098,
0.24636778235435486,
0.36168771982192993,
0.28317493200302124,
0.25026875734329224,
-0.20516374707221985,
0.03798913210630417,
0.29869359731674194,
-0.17980718612670898,
0.11080843210220337,
0.17619769275188446,
0.2821928858757019,
0.06470934301614761,
0.2910822927951813,
-0.03224363923072815,
0.1573648899793625,
0.3585190773010254,
-0.1498645693063736,
-0.38757121562957764,
-0.3547506034374237,
0.24478334188461304,
0.26250842213630676,
0.7743517756462097,
-0.3691073954105377,
-0.425506591796875,
-0.15459391474723816,
0.10375481098890305,
-0.3291890621185303,
0.21380451321601868,
0.04193909093737602,
-0.21998046338558197,
0.24646656215190887,
-0.2604260742664337,
-0.15037749707698822,
0.04086434841156006,
0.013315439224243164,
0.18341843783855438,
-0.023104645311832428,
-0.29742711782455444,
-0.09351565688848495,
0.29259225726127625,
-0.2507745027542114,
-0.1243530884385109,
0.12759630382061005,
-0.037305798381567,
0.10958248376846313,
-0.02198740467429161,
-0.104834645986557,
-0.017660073935985565,
0.31207358837127686,
0.21747088432312012,
-0.1356319785118103,
-0.19743026793003082,
0.03248937055468559,
-0.14890703558921814,
0.04337664693593979,
0.06843913346529007,
-0.2539964020252228,
0.17955273389816284,
-0.00938798114657402,
0.3949930667877197,
0.12907415628433228,
0.3794848322868347,
-0.16988760232925415,
0.1101711243391037,
-0.1950289011001587,
-0.40384191274642944,
-0.1217971071600914,
0.29024630784988403,
-0.3977198600769043,
-0.3234741687774658,
-0.08743339776992798,
0.05155175179243088,
-0.06783152371644974,
0.11424678564071655,
0.2113606035709381,
-0.017581496387720108,
-0.028673946857452393,
-0.22342464327812195,
0.31935036182403564,
-0.07855191081762314,
-0.05965551361441612,
-0.08918449282646179,
-0.040294501930475235,
-0.0871843472123146,
0.1075512245297432,
0.24192969501018524,
-0.3724246025085449,
0.377733439207077,
0.2369842231273651,
0.3015707731246948,
0.05466204881668091,
-0.1223248839378357,
0.1141645759344101,
-0.10552795976400375,
0.1569124162197113,
-0.1078823059797287,
0.27001890540122986,
-0.21076379716396332,
0.16420742869377136,
-0.007701963186264038,
0.0016042329370975494,
-0.011922866106033325,
-0.08728338778018951,
-0.14814245700836182,
0.22952760756015778,
-0.2317315936088562,
0.0600496381521225,
-0.17781230807304382,
0.25181952118873596,
-0.29366186261177063,
-0.36083176732063293,
0.06540235877037048,
-0.024587228894233704,
-0.3781350553035736,
0.019775955006480217,
0.3450605273246765,
0.2570341229438782,
-0.0919460877776146,
-0.20688694715499878,
0.14150799810886383,
-0.04315689578652382,
-0.0012345090508460999,
0.27430200576782227,
-0.11989176273345947,
-0.1204691007733345,
-0.23672007024288177,
0.040620557963848114,
0.26949480175971985,
-0.3839787542819977,
-0.4204762279987335,
0.004585838411003351,
0.20657627284526825,
-0.059315674006938934,
0.048275887966156006,
-0.14123117923736572,
0.04992976039648056,
-0.16794195771217346,
-0.11355966329574585,
0.025781650096178055,
0.0368809849023819,
0.03197553753852844,
-0.14753764867782593,
-0.12241318076848984,
0.009187072515487671,
0.0021823272109031677,
-0.19634243845939636,
0.041532956063747406,
0.1177746132016182,
0.19392408430576324,
0.19136092066764832,
0.058669038116931915,
0.06644051522016525,
0.35101813077926636,
0.32761868834495544,
-0.03949309140443802,
-0.09299886971712112,
-0.3850115239620209,
-0.018536493182182312,
-0.05703454837203026,
0.20003284513950348,
0.21209990978240967,
-0.11929488182067871,
-0.34284472465515137,
-0.13646748661994934,
-0.21111086010932922,
-0.22854436933994293,
-0.3034174144268036,
0.1221204549074173,
0.20410512387752533,
0.17475640773773193,
0.03466453775763512,
-0.11555436253547668,
0.20719274878501892,
0.269845187664032,
0.02424808405339718,
-0.3758866786956787,
-0.013387279585003853,
-0.10484600812196732,
0.0005848398432135582,
0.4219820499420166,
0.1798393726348877,
0.13403531908988953,
0.08500637114048004,
-0.11009936034679413,
0.5109972953796387,
0.0456768237054348,
0.3015238046646118,
0.0737094134092331,
0.11133697628974915,
0.29934436082839966,
-0.27716249227523804,
0.22314175963401794,
-0.016021601855754852,
0.15183107554912567,
0.06339756399393082,
-0.1499972939491272,
0.13834024965763092,
0.04936404898762703,
-0.06829703599214554,
0.21671290695667267,
-0.07049437612295151,
0.26596197485923767,
0.4147024154663086,
-0.26723068952560425,
-0.07483479380607605,
-0.1656377762556076,
0.022037850692868233,
0.3655833601951599,
-0.04336848109960556,
-0.3486443758010864,
-0.14769026637077332,
0.32893791794776917,
-0.07076773047447205,
-0.0509403795003891,
0.2327653169631958,
-0.23700624704360962,
-0.14998582005500793,
0.26937416195869446,
-0.10399696975946426,
0.33754006028175354,
0.3974226415157318,
0.28483420610427856,
-0.00619363971054554,
0.010115568526089191,
-0.1180892139673233,
0.08656501770019531,
0.03149288892745972,
-0.23049889504909515,
0.13987450301647186,
0.008077016100287437,
-0.1301943063735962,
-0.5056523680686951,
0.12848161160945892,
-0.11431767046451569,
0.16365349292755127,
-0.33282753825187683,
-0.26935213804244995,
-0.37314194440841675,
-0.35828477144241333,
-0.24592846632003784,
-0.2666683495044708,
-0.4775669574737549,
-0.07007178664207458,
0.3575649857521057,
0.3593430519104004,
0.07523968815803528,
0.3522738814353943,
0.14465704560279846,
0.2988295555114746,
-0.03730146959424019,
0.14847132563591003,
-0.17452508211135864,
0.2467608004808426,
-0.14303714036941528,
0.20967307686805725,
0.32791754603385925,
0.23347824811935425,
0.3666757047176361,
-0.12004164606332779,
-0.04030325263738632,
-0.35545051097869873,
-0.19030091166496277,
0.17018625140190125,
-0.017229322344064713,
0.17600926756858826,
0.1145465299487114,
0.029699325561523438,
-0.08301088213920593,
0.021488040685653687,
0.201616108417511,
-0.12107153236865997,
-0.12669210135936737,
-0.026193562895059586,
0.022499293088912964,
0.09891865402460098,
-0.15270155668258667,
-0.30217546224594116,
-0.16731609404087067,
-0.44738122820854187,
0.3375598192214966,
-0.12471874058246613,
-0.08938084542751312,
0.17824210226535797,
0.13931548595428467,
0.09342920035123825,
-0.2309546023607254,
0.19420801103115082,
-0.29395365715026855,
-0.410013884305954,
0.4023374915122986,
-0.3484524190425873,
-0.38462355732917786,
0.016604464501142502,
0.4605063199996948,
0.22782108187675476,
-0.02892102301120758,
-0.20589733123779297,
-0.30531832575798035,
-0.038961343467235565,
0.039935898035764694,
0.07230990380048752,
0.30026209354400635,
0.23247483372688293,
0.050049953162670135,
-0.10488865524530411,
-0.14319536089897156,
-0.2711039185523987,
-0.18483376502990723,
-0.16992434859275818,
0.3335365355014801,
-0.03596771880984306,
0.3029424846172333,
-0.07987852394580841,
0.4562608599662781,
0.4225262403488159,
-0.13578298687934875,
0.15755969285964966,
-0.18280288577079773,
0.5486875176429749,
-0.30030009150505066,
-0.1916634887456894,
0.2374417781829834,
-0.02339351177215576,
0.052626319229602814,
0.20844648778438568,
0.32265377044677734,
0.32292890548706055,
-0.253747820854187,
0.12708280980587006,
-0.11134454607963562,
-0.15010122954845428,
-0.23011116683483124,
0.17015111446380615,
0.03649787977337837,
0.02549321949481964,
0.24607858061790466,
0.09712843596935272,
-0.05508165434002876,
0.17877961695194244,
0.2106519639492035,
0.14775386452674866,
0.10076624155044556,
-0.06715254485607147,
0.2889215350151062,
-0.46270138025283813,
0.08444187045097351,
-0.08165431022644043,
0.217901349067688,
-0.2104416936635971,
-0.0523582361638546,
0.05200411379337311,
0.1361948400735855,
0.23298533260822296,
-0.27945247292518616,
-0.05701827257871628,
-0.1087382584810257,
0.27701759338378906,
-0.21865974366664886,
0.21667222678661346,
-0.2958136796951294,
0.053807880729436874,
0.19133907556533813,
0.19324462115764618,
-0.23196348547935486,
-0.19931794703006744,
0.08887910842895508,
0.10535939037799835,
0.2471064031124115,
-0.09747113287448883,
-0.20071962475776672,
-0.20585569739341736,
-0.2841332256793976,
0.04600933939218521,
0.16346079111099243,
0.004614159930497408,
0.007210348267108202,
-0.11084257066249847,
0.22068800032138824,
-0.16104477643966675,
0.25213149189949036,
0.10341484844684601,
0.32254260778427124,
0.015936508774757385,
0.2033509761095047,
0.18633776903152466,
0.058796435594558716,
0.6009942293167114,
0.4952804744243622,
-0.06195152923464775,
-0.13960492610931396,
0.13547661900520325,
-0.10965651273727417,
0.13673126697540283,
0.25664222240448,
0.09167362004518509,
-0.02597726881504059,
-0.018150128424167633,
0.23068557679653168,
-0.3476257622241974,
0.07729534804821014,
0.4755209684371948,
0.1594456434249878,
-0.26365676522254944,
-0.33761587738990784,
0.3367130756378174,
0.0846715122461319,
-0.037212684750556946,
0.28713470697402954,
0.3977324366569519,
-0.009070653468370438,
-0.19209197163581848,
-0.0702895000576973,
0.8242487907409668,
0.21266210079193115,
0.03437085449695587,
0.24443000555038452,
-0.332480788230896,
0.37872061133384705,
-0.09691270440816879,
0.0007240045815706253,
0.00048603489995002747,
-0.07657302170991898,
-0.01580635830760002,
0.14585831761360168,
0.22814571857452393,
-0.012692458927631378,
-0.19884967803955078,
0.25324341654777527,
0.23964323103427887,
0.11771911382675171,
0.0150894271209836,
0.2336898148059845,
-0.4066196084022522,
-0.1856873482465744,
-0.3818139433860779,
0.2587875723838806,
-0.01002030074596405,
0.26093801856040955,
0.03416132554411888,
-0.1841401904821396,
0.12482479214668274,
-0.30034518241882324,
-0.28582650423049927,
-0.07348346710205078,
-0.26465362310409546,
-0.15130144357681274,
0.060055915266275406,
-0.15988659858703613,
0.2897808849811554,
0.23545537889003754,
0.16415396332740784,
0.1678992360830307,
-0.32721298933029175,
0.0860365778207779,
-0.35349521040916443,
0.19570903480052948,
-0.11628012359142303,
0.019235849380493164,
0.2014748901128769,
-0.14324039220809937,
-0.08023487031459808,
-0.05880440026521683,
0.1155296117067337,
-0.05673372372984886,
0.04248034954071045,
-0.29036837816238403,
-0.1705753356218338,
-0.26523110270500183,
-0.11998943984508514,
-0.15403833985328674,
0.030953560024499893,
-0.13938923180103302,
0.22801898419857025,
-0.12083594501018524,
-0.2852431833744049,
0.01625637710094452,
0.047408558428287506,
0.000954754650592804,
-0.2629753649234772,
0.5119012594223022,
-0.4339126944541931,
-0.1843675822019577,
0.1781522035598755,
0.15556953847408295,
-0.3330746293067932,
-0.2728733420372009,
-0.0009357258677482605,
0.1955113410949707,
-0.43958577513694763,
-0.17448951303958893,
0.2340567260980606,
0.046000272035598755,
-0.0029864537063986063,
-0.12965764105319977,
-0.09037019312381744,
-0.10448763519525528,
-0.11283254623413086,
-0.08739987015724182,
-0.500058114528656,
0.20428287982940674,
0.007553461939096451,
0.19539879262447357,
-0.030126560479402542,
-0.04290832206606865,
0.30500203371047974,
-0.1536237746477127,
-0.4191356301307678,
0.03643954545259476,
0.33694061636924744,
-0.03684607148170471,
0.19183692336082458,
0.02746955119073391,
0.25740376114845276,
-0.18190154433250427,
0.17997989058494568,
0.2020525485277176,
-0.29863405227661133,
-0.18250596523284912,
-0.024250652641057968,
0.11749193072319031,
0.022734148427844048,
-0.29132887721061707,
-0.052241452038288116,
-0.06753642857074738,
-0.27173635363578796,
-0.22320184111595154,
0.23210716247558594,
0.478127658367157,
0.005217351019382477,
0.06658428907394409,
0.0720941424369812,
0.013918038457632065,
0.14883239567279816,
-0.17060264945030212,
0.20068234205245972,
0.018522851169109344,
0.19352354109287262,
0.09288530796766281,
0.021989421918988228,
-0.1456204503774643,
-0.0013966402038931847,
0.28023630380630493,
0.03714779019355774,
-0.11610432714223862,
0.16847467422485352,
-0.1210678368806839,
0.2311403453350067,
0.2890370190143585,
0.6590311527252197,
0.3161480128765106,
-0.007136094383895397,
-0.2547317147254944,
0.3066421449184418,
0.32176467776298523,
-0.27058693766593933,
-0.14365136623382568,
-0.17948898673057556,
-0.08288315683603287,
0.05742892995476723,
-0.03441128879785538,
0.0980934351682663,
0.1081702709197998,
0.07930826395750046,
0.0555826798081398,
0.11859725415706635,
-0.23021169006824493,
0.15915954113006592,
0.29204946756362915,
-0.07875700294971466,
0.018906977027654648,
0.2344134896993637,
0.06396956741809845,
0.1644183099269867,
0.4026437997817993,
-0.3986397087574005,
0.4520430862903595,
0.11312165856361389,
-0.014123927801847458,
0.1536657214164734,
-0.21614637970924377,
-0.17058689892292023,
0.10975639522075653,
0.1784394085407257,
-0.06528068333864212,
0.019075416028499603,
0.407210111618042,
-0.43550369143486023,
-0.17521224915981293,
-0.11720531433820724,
0.06400264799594879,
-0.11526606231927872,
-0.15167464315891266,
-0.00847575068473816,
-0.2206096053123474,
-0.16212648153305054,
0.05797931179404259,
-0.18701454997062683,
-0.061863914132118225,
0.047892771661281586,
-0.2090136855840683,
-0.06811551749706268,
-0.3112105429172516,
-0.08200524002313614,
-0.0027485713362693787,
0.20847216248512268,
0.09524093568325043,
0.24750277400016785,
0.05287148058414459,
-0.1697341948747635,
0.34422415494918823,
0.48568350076675415,
0.5777968168258667,
0.05863732472062111,
0.11611823737621307,
0.09871313720941544,
-0.19011390209197998,
-0.04141024127602577,
0.038706470280885696,
0.3033043146133423,
-0.024402745068073273,
0.06977979838848114,
0.2879721522331238,
0.24124348163604736,
-0.2056572139263153,
0.06594671308994293,
-0.22389717400074005,
0.1146358847618103,
-0.33889272809028625,
0.18054720759391785,
-0.3462379574775696,
0.029148422181606293,
-0.1535690724849701,
-0.07129866629838943,
-0.3020910620689392,
-0.06852127611637115,
0.44660043716430664,
-0.026630455628037453,
0.02855309098958969,
-0.2731795310974121,
0.11311118304729462,
-0.03651807829737663,
0.298063188791275,
0.36574476957321167,
-0.11927574127912521,
0.06225157156586647,
-0.12196021527051926,
-0.7586310505867004,
0.07222741842269897,
0.19693492352962494,
0.1838301718235016,
-0.15705980360507965,
-0.23725207149982452,
0.20206314325332642,
0.08740518987178802,
0.05366116762161255,
-0.07478642463684082,
0.12461315840482712,
-0.044254280626773834,
-0.056058064103126526,
0.05177967995405197,
-0.45154494047164917,
0.2664824426174164,
0.06722863018512726,
-0.12721529603004456,
0.1269894689321518,
-0.06464187800884247,
0.07659903913736343,
-0.05467802286148071,
0.34740906953811646,
-0.3605981171131134,
-0.13919375836849213,
0.0938061848282814,
0.28916046023368835,
0.36870041489601135,
-0.2649492025375366,
-0.2178158462047577,
-0.20072966814041138,
-0.05765095725655556,
-0.06673707813024521,
0.23173809051513672,
-0.13771776854991913,
0.35493937134742737,
-0.07520739734172821,
-0.33267349004745483,
-0.35719841718673706,
0.4168728291988373,
-0.021754898130893707,
0.08011931926012039,
-0.34489503502845764,
0.07882682234048843,
-0.13396050035953522,
0.014615918509662151,
0.08960326015949249,
-0.06354660540819168,
-0.04335913062095642,
0.04804733395576477,
-0.3791666030883789,
-0.37009215354919434,
0.6463956832885742,
-0.050827328115701675,
0.032894354313611984,
-0.2152598351240158,
0.37765827775001526,
0.5817437171936035,
-0.28712302446365356,
-1.1366549730300903,
0.27642396092414856,
0.1300668865442276,
0.14054203033447266,
-0.09289675951004028,
0.1366003155708313,
-0.3381350040435791,
-0.0016647577285766602,
-0.15707889199256897,
0.42953357100486755,
0.062382932752370834,
-0.10115624964237213,
0.42693057656288147,
-0.17104044556617737
] |
https://github.com/huggingface/datasets/issues/5494 | Update audio installation doc page | @polinaeterna I think we can close this issue now as we no longer use `torchaudio` for decoding. | Our [installation documentation page](https://huggingface.co/docs/datasets/installation#audio) says that one can use Datasets for mp3 only with `torchaudio<0.12`. `torchaudio>0.12` is actually supported too but requires a specific version of ffmpeg which is not easily installed on all linux versions but there is a custom ubuntu repo for it, we have insctructions in the code: https://github.com/huggingface/datasets/blob/main/src/datasets/features/audio.py#L327
So we should update the doc page. But first investigate [this issue](5488). | 17 | Update audio installation doc page
Our [installation documentation page](https://huggingface.co/docs/datasets/installation#audio) says that one can use Datasets for mp3 only with `torchaudio<0.12`. `torchaudio>0.12` is actually supported too but requires a specific version of ffmpeg which is not easily installed on all linux versions but there is a custom ubuntu repo for it, we have insctructions in the code: https://github.com/huggingface/datasets/blob/main/src/datasets/features/audio.py#L327
So we should update the doc page. But first investigate [this issue](5488).
@polinaeterna I think we can close this issue now as we no longer use `torchaudio` for decoding. | [
-0.3492278754711151,
-0.27522164583206177,
-0.02893984131515026,
0.2887772023677826,
0.42535316944122314,
-0.09463135898113251,
0.011428140103816986,
0.09107545018196106,
-0.1292063295841217,
0.32439666986465454,
-0.4973611831665039,
0.4165091812610626,
-0.12207751721143723,
-0.03663776069879532,
-0.15453162789344788,
-0.19075705111026764,
-0.01987297832965851,
0.07607082277536392,
-0.39964574575424194,
-0.028308797627687454,
-0.07873126864433289,
0.30383390188217163,
-0.26380202174186707,
0.01910075545310974,
-0.19184361398220062,
0.03535473346710205,
0.16628141701221466,
-0.018445812165737152,
-0.48851579427719116,
-0.2851001024246216,
0.14256800711154938,
0.02239973284304142,
-0.08953391015529633,
0.5082709789276123,
-0.0000978536409093067,
-0.028544872999191284,
0.4911686182022095,
-0.09975297003984451,
-0.28699344396591187,
-0.24415011703968048,
-0.16264405846595764,
0.06371932476758957,
-0.06739883869886398,
0.14322975277900696,
-0.19971781969070435,
-0.3181791305541992,
-0.0802491307258606,
-0.26378872990608215,
0.2634238302707672,
0.2199019193649292,
0.37042373418807983,
0.22883374989032745,
0.23134125769138336,
-0.08651644736528397,
0.18150736391544342,
0.29037877917289734,
-0.22961732745170593,
0.12404663860797882,
0.11155387759208679,
0.3339691460132599,
-0.039755918085575104,
0.34532827138900757,
-0.033890120685100555,
0.22364726662635803,
0.373025506734848,
-0.09015040844678879,
-0.48094892501831055,
-0.3377874195575714,
0.14702540636062622,
0.26103076338768005,
0.6132243275642395,
-0.31606394052505493,
-0.33569708466529846,
-0.10924732685089111,
0.06993257254362106,
-0.3261374831199646,
0.17473885416984558,
0.02096748724579811,
-0.3277777135372162,
0.28652623295783997,
-0.20499782264232635,
-0.0643395334482193,
0.004861004650592804,
-0.0022980570793151855,
0.10408824682235718,
0.04220336675643921,
-0.3385181427001953,
-0.12256360799074173,
0.48459646105766296,
-0.22535686194896698,
-0.2531399726867676,
0.19076743721961975,
-0.05507012829184532,
0.11933743208646774,
0.006933748722076416,
-0.12301308661699295,
-0.07068450003862381,
0.25840309262275696,
0.2665949761867523,
-0.07112479954957962,
-0.11847971379756927,
0.24011456966400146,
-0.05629570782184601,
0.1178053468465805,
-0.033079393208026886,
-0.1870921552181244,
0.09971748292446136,
-0.1249174028635025,
0.4211428761482239,
0.04958350956439972,
0.37178781628608704,
-0.11657141894102097,
0.07224922627210617,
-0.2444043606519699,
-0.5480097532272339,
-0.019277825951576233,
0.300950288772583,
-0.3921370506286621,
-0.2577279806137085,
-0.13004282116889954,
-0.006272576749324799,
0.0061586895026266575,
0.17132948338985443,
0.30280938744544983,
0.0950857624411583,
-0.015341248363256454,
-0.18218861520290375,
0.3303060531616211,
-0.17421910166740417,
-0.11140400916337967,
-0.08501788228750229,
-0.07646171748638153,
-0.03075922094285488,
0.055264219641685486,
0.21536369621753693,
-0.3525289297103882,
0.3796863555908203,
0.286510169506073,
0.34086328744888306,
0.05811746418476105,
-0.00043609365820884705,
0.02490841969847679,
-0.04008717089891434,
0.13737830519676208,
-0.04496769234538078,
0.2095181941986084,
-0.10559111833572388,
0.22221730649471283,
-0.011396259069442749,
-0.08764398843050003,
-0.009451255202293396,
-0.09810774773359299,
-0.1284792274236679,
0.22727341949939728,
-0.09853994846343994,
0.05265643075108528,
-0.15409404039382935,
0.2852678894996643,
-0.2983171343803406,
-0.3122447431087494,
0.0009196028113365173,
0.012758474797010422,
-0.396314799785614,
0.03839506953954697,
0.28942903876304626,
0.19496896862983704,
-0.029615549370646477,
-0.19872784614562988,
0.21047955751419067,
-0.2096332460641861,
0.10887978971004486,
0.2851245403289795,
-0.14267775416374207,
-0.25394734740257263,
-0.22338205575942993,
0.022206448018550873,
0.25564369559288025,
-0.4185413420200348,
-0.43346258997917175,
0.11279661953449249,
0.2679784297943115,
-0.03165696561336517,
0.0585271492600441,
-0.17415599524974823,
0.00670727901160717,
-0.026758400723338127,
-0.09614838659763336,
0.05626964941620827,
0.09440954029560089,
-0.028064589947462082,
-0.10310448706150055,
-0.20448343455791473,
0.03333354368805885,
0.061024170368909836,
-0.19687356054782867,
0.06295093148946762,
0.06799183785915375,
0.13300171494483948,
0.16319671273231506,
0.008350592106580734,
0.06160946190357208,
0.30039191246032715,
0.3050135672092438,
-0.03699887543916702,
0.01599372923374176,
-0.3497960567474365,
0.037822723388671875,
0.0024230070412158966,
0.15121252834796906,
0.18041250109672546,
-0.2048155516386032,
-0.33697080612182617,
-0.061708901077508926,
-0.30772164463996887,
-0.26628533005714417,
-0.15942512452602386,
0.17074142396450043,
0.22016401588916779,
0.10824327170848846,
-0.025560064241290092,
-0.12761615216732025,
0.1497345268726349,
0.302852600812912,
0.05090703070163727,
-0.3542724847793579,
-0.08493844419717789,
-0.14333416521549225,
-0.03970813378691673,
0.3818204998970032,
0.1977231800556183,
0.09180666506290436,
-0.049039170145988464,
-0.0872102752327919,
0.30446672439575195,
0.12744896113872528,
0.3347233533859253,
-0.07106232643127441,
-0.04725247621536255,
0.25752609968185425,
-0.2766742408275604,
0.0963926911354065,
0.13088136911392212,
0.16765196621418,
-0.007391929626464844,
-0.05021296441555023,
0.19021987915039062,
0.12582911550998688,
-0.06240475922822952,
0.17141374945640564,
-0.041284941136837006,
0.3095400333404541,
0.3394748270511627,
-0.23458725214004517,
-0.1821308135986328,
-0.11567790806293488,
-0.16250228881835938,
0.42203179001808167,
-0.10020647943019867,
-0.42096683382987976,
-0.11002213507890701,
0.35878509283065796,
-0.08848671615123749,
0.020767278969287872,
0.20071831345558167,
-0.17935600876808167,
-0.09062574803829193,
0.21363891661167145,
-0.06877806782722473,
0.2952195703983307,
0.33676812052726746,
0.29693782329559326,
0.07709111273288727,
0.0352783165872097,
-0.09192391484975815,
0.08585229516029358,
0.09104964882135391,
-0.21188196539878845,
0.22542822360992432,
-0.1113116517663002,
-0.20000329613685608,
-0.5538403391838074,
0.08394719660282135,
-0.07143137603998184,
0.15987388789653778,
-0.2894776463508606,
-0.18010786175727844,
-0.46660563349723816,
-0.3573429584503174,
-0.22970350086688995,
-0.31519874930381775,
-0.3911181390285492,
-0.08076275140047073,
0.2712610363960266,
0.3390064537525177,
-0.013702033087611198,
0.31063544750213623,
0.1168484091758728,
0.2748328447341919,
-0.015110328793525696,
0.15148138999938965,
-0.20782820880413055,
0.13441471755504608,
-0.0930056944489479,
0.2238408923149109,
0.3543332517147064,
0.10207109153270721,
0.24780237674713135,
-0.22248788177967072,
-0.045724742114543915,
-0.20125964283943176,
-0.08718433231115341,
0.29982489347457886,
-0.13566061854362488,
0.15809844434261322,
0.13067521154880524,
0.02339758723974228,
-0.08119292557239532,
-0.06043250486254692,
0.252090185880661,
-0.11260581761598587,
-0.22277498245239258,
-0.008758540265262127,
0.04180806502699852,
0.04061131924390793,
-0.30755814909935,
-0.2281840741634369,
-0.1759851574897766,
-0.46748340129852295,
0.2984168827533722,
-0.09125757217407227,
-0.026142112910747528,
0.20969974994659424,
0.03608733415603638,
0.28784170746803284,
-0.1809082329273224,
0.277308851480484,
-0.3555642366409302,
-0.3978283107280731,
0.42144688963890076,
-0.4040667712688446,
-0.3681027293205261,
0.08999191224575043,
0.4866970181465149,
0.27795088291168213,
-0.005607808008790016,
-0.22617658972740173,
-0.19395741820335388,
-0.029292801395058632,
-0.06328841298818588,
0.0181259885430336,
0.2591670751571655,
0.10407320410013199,
0.07201530039310455,
-0.10475465655326843,
-0.16917742788791656,
-0.20542789995670319,
-0.13445189595222473,
-0.13991689682006836,
0.36782026290893555,
-0.02400348335504532,
0.37045785784721375,
-0.058096252381801605,
0.567419707775116,
0.33078569173812866,
-0.01917431131005287,
0.16573774814605713,
-0.14487813413143158,
0.4492720067501068,
-0.2799229323863983,
-0.1439324915409088,
0.18947555124759674,
-0.032548367977142334,
0.15476298332214355,
0.24152714014053345,
0.2914191782474518,
0.14981187880039215,
-0.30074211955070496,
0.08733616769313812,
-0.056620948016643524,
-0.20319101214408875,
-0.20512837171554565,
0.2459743320941925,
-0.14382925629615784,
-0.050594642758369446,
0.35242730379104614,
0.20065806806087494,
-0.04250272363424301,
0.2287345826625824,
0.1765819936990738,
0.10677245259284973,
0.11742603778839111,
-0.043855078518390656,
0.17655207216739655,
-0.49764126539230347,
0.09363432228565216,
-0.08267393708229065,
0.13836434483528137,
-0.2367897778749466,
-0.08883815258741379,
0.07427249848842621,
0.07585450261831284,
0.23136167228221893,
-0.05676007270812988,
-0.05381186306476593,
-0.08027349412441254,
0.20564861595630646,
-0.21735158562660217,
0.20739735662937164,
-0.3309272229671478,
0.07894513756036758,
0.10944250226020813,
0.1631244719028473,
-0.2829767167568207,
-0.27626726031303406,
0.07699631154537201,
0.09064225107431412,
0.1881473958492279,
-0.08250504732131958,
-0.27042850852012634,
-0.3523220717906952,
-0.2433728575706482,
0.07662642747163773,
0.1532466560602188,
0.00652466481551528,
0.062169149518013,
-0.13440831005573273,
0.16776132583618164,
-0.25735101103782654,
0.37808942794799805,
0.1233946681022644,
0.32725659012794495,
0.017899950966238976,
0.10964599251747131,
0.23419307172298431,
0.16651731729507446,
0.46944302320480347,
0.6077595353126526,
0.02040422335267067,
-0.22142934799194336,
0.15083134174346924,
-0.182376891374588,
0.14148730039596558,
0.2460668832063675,
0.019049983471632004,
0.008881255984306335,
-0.004763424396514893,
0.17777535319328308,
-0.4181555211544037,
0.07970559597015381,
0.4183585047721863,
0.16158750653266907,
-0.20951612293720245,
-0.2057153582572937,
0.36851009726524353,
-0.02237255685031414,
-0.002458028495311737,
0.2720740735530853,
0.470872700214386,
-0.05936878174543381,
-0.029147494584321976,
-0.043980278074741364,
0.8782608509063721,
0.25741341710090637,
-0.018124226480722427,
0.3047364354133606,
-0.3933389186859131,
0.24566926062107086,
-0.0892842561006546,
0.15949904918670654,
0.10260879993438721,
-0.06063807010650635,
-0.049370888620615005,
0.18996979296207428,
0.23919495940208435,
-0.06755222380161285,
-0.25376734137535095,
0.20704427361488342,
0.17560242116451263,
0.09276768565177917,
-0.08269969373941422,
0.15411755442619324,
-0.4502007067203522,
-0.21557103097438812,
-0.34702545404434204,
0.2596733868122101,
0.032934874296188354,
0.36767956614494324,
0.06558839976787567,
-0.2712082266807556,
0.12003530561923981,
-0.2663525640964508,
-0.1957867592573166,
-0.061802636831998825,
-0.23916099965572357,
0.011329765431582928,
0.006606504321098328,
-0.2249690294265747,
0.2467309534549713,
0.15941393375396729,
0.1268961876630783,
0.10015375912189484,
-0.33822864294052124,
0.044765129685401917,
-0.31066301465034485,
0.19182738661766052,
-0.1189001053571701,
0.007381371222436428,
0.09841812402009964,
-0.19293475151062012,
-0.1256611943244934,
-0.11790811270475388,
0.16613195836544037,
-0.09224896132946014,
0.07136723399162292,
-0.18730027973651886,
-0.21084512770175934,
-0.189316064119339,
-0.18907561898231506,
-0.14758428931236267,
0.04562505707144737,
-0.11233393847942352,
0.24297553300857544,
-0.11248987913131714,
-0.38250455260276794,
0.008055254817008972,
-0.011159606277942657,
-0.049028430134058,
-0.22612546384334564,
0.49971333146095276,
-0.32060760259628296,
-0.15339741110801697,
0.16808566451072693,
0.16610875725746155,
-0.3966100215911865,
-0.21837207674980164,
0.014957450330257416,
0.15544173121452332,
-0.39596086740493774,
-0.19091114401817322,
0.18756571412086487,
-0.03231866657733917,
-0.007217801176011562,
-0.14020287990570068,
-0.11651095747947693,
-0.15257152915000916,
-0.12469448149204254,
-0.04342079907655716,
-0.5328348875045776,
0.16373905539512634,
-0.01266150176525116,
0.20454290509223938,
0.08386752754449844,
-0.10547938942909241,
0.15975579619407654,
-0.11850835382938385,
-0.4273219704627991,
0.17758752405643463,
0.2599523663520813,
-0.06262002140283585,
0.09947439283132553,
-0.07505577057600021,
0.2459840476512909,
-0.1161680519580841,
0.2036541849374771,
0.31053411960601807,
-0.2805787920951843,
-0.19305014610290527,
-0.056018102914094925,
0.10836993157863617,
-0.05058812350034714,
-0.3127773404121399,
-0.03629918769001961,
-0.01964472234249115,
-0.2548559904098511,
-0.13437867164611816,
0.38401585817337036,
0.5374206304550171,
0.07353980094194412,
0.10441026091575623,
0.0642240047454834,
-0.051722973585128784,
0.13571807742118835,
-0.1868719905614853,
0.26737335324287415,
0.10854924470186234,
0.22413478791713715,
0.00363009050488472,
-0.022224485874176025,
-0.12829741835594177,
0.09511499106884003,
0.23974567651748657,
0.03028387576341629,
-0.21322983503341675,
0.23855003714561462,
-0.06712837517261505,
0.19159002602100372,
0.2894490957260132,
0.6025418043136597,
0.2400987297296524,
0.02073052152991295,
-0.2560994029045105,
0.3384149670600891,
0.3217710852622986,
-0.2800743877887726,
-0.19362841546535492,
-0.19683803617954254,
-0.04952926188707352,
0.07871869206428528,
0.0075895339250564575,
0.013423208147287369,
0.08964966237545013,
0.08764100074768066,
-0.03364347666501999,
0.057781800627708435,
-0.06399546563625336,
0.18381421267986298,
0.23093929886817932,
-0.1845206916332245,
-0.046989042311906815,
0.20426250994205475,
0.0875798910856247,
0.26073575019836426,
0.4576874375343323,
-0.5519594550132751,
0.4376010000705719,
0.0066379643976688385,
0.09380703419446945,
0.20765841007232666,
-0.2017284631729126,
-0.21559880673885345,
0.17137157917022705,
0.09710239619016647,
0.038229167461395264,
0.04965360462665558,
0.4455903172492981,
-0.47165200114250183,
-0.27423375844955444,
-0.14105825126171112,
0.1706746369600296,
-0.1853477954864502,
-0.18246351182460785,
0.08304712921380997,
-0.16288721561431885,
-0.16671991348266602,
0.09793417155742645,
-0.14025567471981049,
-0.09196874499320984,
-0.08219675719738007,
-0.04341895878314972,
0.034243687987327576,
-0.12153935432434082,
-0.14548930525779724,
-0.007091309875249863,
0.3320785462856293,
0.08770020306110382,
0.22081010043621063,
0.17069917917251587,
-0.12942369282245636,
0.3195120692253113,
0.4105910658836365,
0.4573726952075958,
-0.03538033366203308,
-0.030752692371606827,
0.09474378824234009,
-0.19969962537288666,
-0.041400086134672165,
-0.05271033197641373,
0.304292231798172,
0.06667281687259674,
0.1371636539697647,
0.3666944205760956,
0.24118107557296753,
-0.2300407886505127,
-0.06005741283297539,
-0.17436349391937256,
0.11963419616222382,
-0.3023553788661957,
0.19176162779331207,
-0.4014541804790497,
0.1755358874797821,
-0.1995704174041748,
-0.1663437783718109,
-0.4531722664833069,
-0.08942285180091858,
0.3353036344051361,
-0.010276568122208118,
0.07089638710021973,
-0.20696963369846344,
0.1150190681219101,
-0.04435717687010765,
0.2297350913286209,
0.23083549737930298,
-0.07908593863248825,
0.10653964430093765,
-0.11465422809123993,
-0.5665974020957947,
0.1388159692287445,
0.2227323204278946,
0.15338703989982605,
-0.2424839735031128,
-0.1607772707939148,
0.23944225907325745,
0.14669962227344513,
0.046838730573654175,
-0.09577734768390656,
0.22996433079242706,
-0.1173093318939209,
0.003862190991640091,
0.09756683558225632,
-0.4452904462814331,
0.1216498613357544,
0.0810503214597702,
-0.17304641008377075,
0.1405392736196518,
-0.06333241611719131,
0.11286964267492294,
-0.07555271685123444,
0.34943145513534546,
-0.4686717391014099,
-0.20213240385055542,
0.06358583271503448,
0.2960779070854187,
0.336208701133728,
-0.26941439509391785,
-0.24027805030345917,
-0.09439150989055634,
-0.03923608735203743,
-0.05305299162864685,
0.1540987193584442,
-0.13053005933761597,
0.3147992789745331,
-0.04925614595413208,
-0.24027474224567413,
-0.3801266849040985,
0.46403753757476807,
-0.00694931298494339,
0.09812457114458084,
-0.3487420380115509,
0.10901454836130142,
-0.27611270546913147,
-0.03183022513985634,
0.14122791588306427,
0.1039402037858963,
-0.0276266410946846,
-0.004719934426248074,
-0.29986661672592163,
-0.332744836807251,
0.6499868631362915,
-0.028492189943790436,
0.0398271419107914,
-0.1262124627828598,
0.3204209506511688,
0.5624309182167053,
-0.2470676302909851,
-1.078579306602478,
0.2533547878265381,
0.00021320395171642303,
0.05319690331816673,
-0.050662633031606674,
0.1407911330461502,
-0.2452758252620697,
-0.051906924694776535,
-0.18701234459877014,
0.3402770161628723,
0.2162412405014038,
-0.06077919155359268,
0.43227729201316833,
-0.18492576479911804
] |
https://github.com/huggingface/datasets/issues/5492 | Push_to_hub in a pull request | Assigned to myself and will get to it in the next week, but if someone finds this issue annoying and wants to submit a PR before I do, just ping me here and I'll reassign :). | Right now `ds.push_to_hub()` can push a dataset on `main` or on a new branch with `branch=`, but there is no way to open a pull request. Even passing `branch=refs/pr/x` doesn't seem to work: it tries to create a branch with that name
cc @nateraw
It should be possible to tweak the use of `huggingface_hub` in `push_to_hub` to make it open a PR or push to an existing PR | 36 | Push_to_hub in a pull request
Right now `ds.push_to_hub()` can push a dataset on `main` or on a new branch with `branch=`, but there is no way to open a pull request. Even passing `branch=refs/pr/x` doesn't seem to work: it tries to create a branch with that name
cc @nateraw
It should be possible to tweak the use of `huggingface_hub` in `push_to_hub` to make it open a PR or push to an existing PR
Assigned to myself and will get to it in the next week, but if someone finds this issue annoying and wants to submit a PR before I do, just ping me here and I'll reassign :). | [
-0.2519308924674988,
-0.7133582234382629,
-0.03401563689112663,
-0.1695120632648468,
0.019431566819548607,
-0.07171181589365005,
-0.12493543326854706,
0.09702903032302856,
0.15460267663002014,
-0.011190623044967651,
-0.007204016670584679,
0.18875309824943542,
0.1796169877052307,
0.3043471872806549,
0.324003130197525,
0.06243827939033508,
0.40942537784576416,
0.1250319629907608,
0.4356074333190918,
-0.11532264202833176,
-0.4517774283885956,
0.054746851325035095,
0.1222696453332901,
0.22105151414871216,
-0.36562594771385193,
-0.21037939190864563,
0.008385082706809044,
0.4089793562889099,
-0.19379432499408722,
-0.13008776307106018,
0.3784349262714386,
0.25749993324279785,
-0.1393299251794815,
0.3874872624874115,
-0.00011315123992972076,
0.0698993057012558,
0.3330877423286438,
0.108517125248909,
-0.26886454224586487,
-0.3413044214248657,
-0.47576361894607544,
-0.02481408417224884,
-0.003638114780187607,
0.03947461396455765,
-0.15510955452919006,
-0.000006203539669513702,
0.3053305447101593,
0.2356317937374115,
0.236898735165596,
0.22955292463302612,
0.15760087966918945,
0.09787916392087936,
0.27612102031707764,
-0.5548152923583984,
0.21475282311439514,
0.3388860821723938,
-0.30079185962677,
-0.05456547811627388,
0.061862487345933914,
0.19841724634170532,
0.20935428142547607,
-0.3178269565105438,
0.16747012734413147,
-0.031731851398944855,
0.273384690284729,
-0.11447321623563766,
0.0010053664445877075,
-0.07747679948806763,
0.032662518322467804,
-0.009329013526439667,
0.10862090438604355,
-0.5414002537727356,
-0.4428952634334564,
-0.061529405415058136,
-0.2661118805408478,
-0.11340855807065964,
-0.012897886335849762,
0.17190752923488617,
-0.25954505801200867,
0.2808237373828888,
0.0006682412349618971,
-0.6078829169273376,
0.06482666730880737,
0.01060761883854866,
0.016230449080467224,
0.1665494441986084,
0.03354799002408981,
-0.07680482417345047,
0.5541089773178101,
0.053697891533374786,
0.2290947437286377,
0.13888287544250488,
-0.2596713900566101,
-0.288935124874115,
-0.37578698992729187,
-0.09523069858551025,
0.2731288969516754,
0.10059353709220886,
0.0454706996679306,
0.2895413637161255,
-0.014688684605062008,
0.21445155143737793,
-0.46109092235565186,
0.13347305357456207,
0.3879042863845825,
0.07541774213314056,
0.12530581653118134,
0.19321298599243164,
0.32036739587783813,
0.13305947184562683,
0.24262931942939758,
-0.12060541659593582,
-0.04594414308667183,
-0.13580802083015442,
-0.31394660472869873,
-0.06508594006299973,
0.25309139490127563,
0.057667043060064316,
0.001012152060866356,
-0.24411192536354065,
-0.03525332361459732,
0.2947540581226349,
0.012167706154286861,
0.2074459195137024,
0.07533927261829376,
0.4103834927082062,
0.05460464209318161,
0.033233970403671265,
0.0021466948091983795,
0.37824785709381104,
-0.3446817398071289,
0.014722850173711777,
-0.14759309589862823,
0.11171138286590576,
-0.16553600132465363,
-0.5107123851776123,
0.18174846470355988,
0.10389652103185654,
0.09673984348773956,
-0.04027973860502243,
-0.037530187517404556,
0.40714946389198303,
0.1131264716386795,
0.45479917526245117,
0.30014097690582275,
-0.026112150400877,
-0.0468333400785923,
-0.02320219576358795,
-0.187977597117424,
0.11003398895263672,
-0.2317555844783783,
-0.2673758864402771,
-0.07394242286682129,
0.1687534600496292,
-0.3205072283744812,
0.09113369882106781,
-0.5060020685195923,
0.13018012046813965,
-0.5149943232536316,
0.11818636953830719,
0.18486158549785614,
0.22934648394584656,
0.048903074115514755,
-0.16970881819725037,
0.25819268822669983,
-0.0642554759979248,
0.26712825894355774,
-0.05691943317651749,
-0.10573965311050415,
-0.05468599125742912,
-0.17445436120033264,
0.169065460562706,
-0.12462827563285828,
-0.01909768581390381,
0.024699566885828972,
0.13271796703338623,
0.2258554846048355,
-0.6413761973381042,
-0.17201131582260132,
-0.22438928484916687,
-0.4061739444732666,
-0.43558362126350403,
-0.11552498489618301,
0.2111288458108902,
0.019171256572008133,
0.0014179892605170608,
0.11026258766651154,
0.20682403445243835,
0.037461183965206146,
0.16540823876857758,
-0.14090752601623535,
-0.16985471546649933,
-0.523446261882782,
0.16875417530536652,
-0.24113203585147858,
0.2761363983154297,
0.371346116065979,
0.7119366526603699,
0.14250341057777405,
0.017911944538354874,
0.029027312994003296,
-0.07868389785289764,
0.47496092319488525,
-0.27982670068740845,
-0.18684843182563782,
-0.09638255089521408,
-0.06439516693353653,
0.05044200271368027,
0.04842346906661987,
0.21189714968204498,
0.3862345814704895,
-0.20960652828216553,
-0.24739044904708862,
0.21091309189796448,
-0.033391114324331284,
-0.0669303834438324,
0.06416681408882141,
-0.0481940358877182,
0.01677563413977623,
-0.07256141304969788,
-0.38233843445777893,
-0.047471366822719574,
-0.18995711207389832,
0.10944449156522751,
-0.1515604704618454,
0.22732070088386536,
0.07263365387916565,
-0.00939886923879385,
-0.08344944566488266,
0.17265649139881134,
0.11742907762527466,
0.06292758136987686,
0.16773560643196106,
0.1672946959733963,
0.17601068317890167,
0.17598837614059448,
0.1647873818874359,
0.20682193338871002,
0.2838086187839508,
-0.13426510989665985,
-0.10203588753938675,
0.00953400693833828,
-0.10211678594350815,
-0.10166480392217636,
-0.46018388867378235,
0.23384715616703033,
0.3080850839614868,
0.0604608952999115,
0.04436972737312317,
0.21906885504722595,
0.04062850773334503,
-0.06574943661689758,
0.04164537042379379,
0.2029157280921936,
-0.1781892627477646,
0.28763023018836975,
-0.05639685317873955,
-0.2604367434978485,
-0.12351922690868378,
0.1618139147758484,
0.11597655713558197,
0.024027686566114426,
0.1300928145647049,
0.26878631114959717,
-0.11447831243276596,
-0.03510338068008423,
0.27248749136924744,
0.07100237905979156,
-0.22806726396083832,
0.1199098452925682,
0.08206108957529068,
0.24215365946292877,
0.06158863380551338,
-0.28491419553756714,
-0.10260189324617386,
-0.09689663350582123,
0.005799940321594477,
-0.28097712993621826,
0.23824578523635864,
-0.35318878293037415,
-0.11150433123111725,
0.3325468897819519,
0.11658088117837906,
0.20384520292282104,
-0.17358262836933136,
-0.1878768503665924,
-0.08860301971435547,
-0.019558338448405266,
0.08021946996450424,
-0.2121097445487976,
-0.14526957273483276,
-0.2762940227985382,
0.07003684341907501,
0.591934859752655,
-0.045054953545331955,
0.08981294929981232,
0.26296108961105347,
0.1755630522966385,
-0.320391446352005,
0.021585194393992424,
-0.18234719336032867,
-0.3910973072052002,
0.14833515882492065,
0.10245698690414429,
0.07224533706903458,
0.20649473369121552,
0.19691351056098938,
0.03488082438707352,
0.09695696830749512,
-0.508948028087616,
0.1348416805267334,
0.15615388751029968,
0.18555596470832825,
-0.1512974351644516,
0.27377575635910034,
0.14182724058628082,
0.208541139960289,
-0.1493360847234726,
0.15217730402946472,
-0.16191346943378448,
-0.36767059564590454,
-0.24075528979301453,
-0.2079913169145584,
0.0013369645457714796,
-0.09206073731184006,
-0.04144779592752457,
0.021267065778374672,
-0.5120865702629089,
0.7955026030540466,
0.19506683945655823,
0.09922182559967041,
0.22013546526432037,
0.19189266860485077,
-0.15138506889343262,
0.18388459086418152,
-0.6160905361175537,
0.0005843143444508314,
-0.24361024796962738,
0.026259183883666992,
-0.23973922431468964,
-0.11444059014320374,
0.19765153527259827,
0.13571131229400635,
0.023190483450889587,
0.08499879390001297,
-0.0908917710185051,
-0.3791021406650543,
-0.09838617593050003,
0.39097708463668823,
0.3749459683895111,
0.13234609365463257,
0.38470232486724854,
-0.20558595657348633,
-0.1447029411792755,
-0.01573464274406433,
-0.47995561361312866,
0.20048370957374573,
0.5071227550506592,
0.039725229144096375,
0.2137961983680725,
-0.14565509557724,
-0.14202140271663666,
0.3001919686794281,
-0.06627719104290009,
-0.09077221155166626,
0.08866511285305023,
-0.246200293302536,
0.3206527829170227,
-0.16220813989639282,
-0.19880527257919312,
-0.14086072146892548,
0.07462465018033981,
-0.3016234040260315,
0.3158843517303467,
0.3712698519229889,
-0.07921048253774643,
-0.21821480989456177,
-0.46546199917793274,
0.08057951182126999,
-0.1527678668498993,
-0.25558409094810486,
-0.3847353160381317,
-0.19329243898391724,
-0.15691351890563965,
0.23815202713012695,
-0.423649400472641,
0.008862962946295738,
0.05573910102248192,
-0.03810901939868927,
0.16679728031158447,
-0.05850427225232124,
-0.07768850773572922,
-0.045075759291648865,
-0.3898753821849823,
-0.050354212522506714,
-0.04347987473011017,
-0.03180999681353569,
-0.02359994873404503,
0.017352037131786346,
0.1432475447654724,
-0.19029167294502258,
0.5090489983558655,
-0.4358315169811249,
0.05250581353902817,
-0.03306857496500015,
-0.3085551857948303,
-0.04336376488208771,
0.20313534140586853,
0.18923646211624146,
0.5190643668174744,
0.1457122415304184,
0.5078295469284058,
-0.29799884557724,
-0.1927950382232666,
-0.16490596532821655,
-0.3987300395965576,
-0.09068873524665833,
0.1870473325252533,
-0.220749631524086,
-0.6151711940765381,
-0.2343985140323639,
-0.049559660255908966,
0.2976796329021454,
-0.10742641985416412,
0.05682153254747391,
-0.020598113536834717,
0.09784309566020966,
0.07368297874927521,
-0.06043301522731781,
0.07873910665512085,
0.12247768044471741,
0.20481157302856445,
-0.14568307995796204,
0.3140083849430084,
0.15424546599388123,
0.1862463802099228,
0.5542114973068237,
0.20774932205677032,
-0.2233257293701172,
0.22097501158714294,
0.27785763144493103,
0.014843247830867767,
0.5021234750747681,
0.3974608778953552,
0.5663923621177673,
0.22857503592967987,
-0.06149184703826904,
-0.09272686392068863,
0.1012253388762474,
0.015783723443746567,
-0.11928724497556686,
-0.2421729564666748,
-0.43297645449638367,
0.39229297637939453,
0.02251414954662323,
-0.054289598017930984,
0.31398022174835205,
0.39350610971450806,
-0.04950448125600815,
0.14002913236618042,
0.1734604686498642,
1.006298542022705,
-0.13678030669689178,
0.14121808111667633,
0.08729321509599686,
-0.4338197708129883,
0.652940571308136,
-0.5526984333992004,
0.1984304040670395,
-0.3912774324417114,
-0.010742931626737118,
-0.08557729423046112,
-0.04516271874308586,
-0.3463383913040161,
-0.18337751924991608,
-0.10078704357147217,
-0.0340864434838295,
0.006331436336040497,
0.6068522930145264,
0.37347331643104553,
0.33899322152137756,
-0.09440179914236069,
-0.21354717016220093,
-0.3808138370513916,
0.21609531342983246,
0.08962360769510269,
0.0696696788072586,
-0.10340578854084015,
-0.3198341727256775,
-0.23991699516773224,
0.036226265132427216,
-0.4113277792930603,
0.2142532467842102,
0.05154240503907204,
-0.0907062441110611,
-0.11673501133918762,
-0.05215510353446007,
-0.072275809943676,
0.21692036092281342,
0.8235824108123779,
0.14373375475406647,
-0.36689260601997375,
0.49429500102996826,
0.03638508543372154,
-0.11798930168151855,
-0.02459300495684147,
-0.0698205903172493,
0.08120016008615494,
-0.12245170772075653,
-0.47239458560943604,
0.3321441113948822,
0.09090860188007355,
-0.6910927295684814,
-0.2587514817714691,
0.005760498344898224,
-0.239785298705101,
0.039143308997154236,
0.06744767725467682,
0.06637261807918549,
-0.02327508106827736,
-0.2532210052013397,
0.13376891613006592,
-0.045847587287425995,
-0.07344868034124374,
-0.22217166423797607,
0.16573236882686615,
-0.04584876075387001,
0.10795895755290985,
0.38245853781700134,
-0.09606047719717026,
-0.1746378391981125,
-0.23519444465637207,
0.21996907889842987,
0.0023223310708999634,
-0.10162827372550964,
-0.13502486050128937,
0.26892200112342834,
-0.2709886431694031,
0.3697870969772339,
-0.17090646922588348,
-0.5938950777053833,
-0.07704377919435501,
0.6165117025375366,
0.0873430147767067,
0.017378248274326324,
-0.20507434010505676,
0.04204845428466797,
-0.1454073190689087,
0.2173742949962616,
-0.08170144259929657,
0.2434658259153366,
0.01024894043803215,
0.09813137352466583,
0.10556484758853912,
-0.03361179679632187,
-0.2850547432899475,
-0.00016225874423980713,
-0.4080631136894226,
-0.18505102396011353,
-0.4584030210971832,
-0.2048472762107849,
0.14440424740314484,
-0.31743931770324707,
0.022158430889248848,
-0.1597975790500641,
-0.22108851373195648,
-0.12028072774410248,
-0.11194673180580139,
0.16812358796596527,
0.1093585193157196,
0.08154314756393433,
-0.01866147108376026,
0.05167268216609955,
-0.14413534104824066,
-0.05338161811232567,
0.13252414762973785,
0.24644717574119568,
-0.004400096833705902,
-0.3218485713005066,
0.6033684015274048,
0.2518516182899475,
-0.2321036159992218,
0.15656256675720215,
0.49155592918395996,
0.2865291237831116,
-0.6084754467010498,
0.09055449068546295,
-0.24693654477596283,
-0.010811589658260345,
0.1285754293203354,
0.34289559721946716,
0.5551697015762329,
0.09208615124225616,
0.194505512714386,
0.15151762962341309,
-0.24051004648208618,
-0.05789679288864136,
0.5106683969497681,
0.02250565215945244,
0.25313714146614075,
0.35616275668144226,
0.07226541638374329,
0.07609329372644424,
0.01246223971247673,
-0.0025600215885788202,
0.6225252747535706,
-0.10429129749536514,
-0.002157770097255707,
0.1575855016708374,
0.39829131960868835,
-0.11178463697433472,
-0.11554299294948578,
0.10999757796525955,
0.3460271954536438,
-0.21319209039211273,
0.10887347161769867,
0.17141331732273102,
0.04924977198243141,
0.06068584322929382,
0.1452668458223343,
0.05701405182480812,
0.3397648334503174,
0.21471066772937775,
0.038795847445726395,
0.4095650017261505,
0.26381680369377136,
-0.1589137762784958,
0.2611026465892792,
0.1220884621143341,
0.15827588737010956,
-0.300546258687973,
0.26210182905197144,
-0.14509817957878113,
0.1436537504196167,
0.6248999834060669,
-0.1500820815563202,
-0.05574694275856018,
-0.3075444996356964,
0.2940768599510193,
-0.15841928124427795,
0.042261701077222824,
-0.4929988384246826,
-0.053253211081027985,
-0.0022883340716362,
0.06359067559242249,
-0.060310717672109604,
-0.20699559152126312,
0.26997923851013184,
-0.26909005641937256,
0.26693105697631836,
0.31825461983680725,
0.03769083693623543,
0.11745830625295639,
0.1629326343536377,
-0.05228479951620102,
-0.06463656574487686,
-0.04652637243270874,
-0.29361778497695923,
0.1538010835647583,
0.34218260645866394,
0.21576863527297974,
0.06069841980934143,
-0.2255176156759262,
0.3038405179977417,
0.273185133934021,
-0.15596738457679749,
-0.023043224588036537,
-0.09417810291051865,
-0.060419961810112,
0.30035513639450073,
-0.11850471794605255,
0.25816118717193604,
-0.11445216089487076,
0.12900477647781372,
-0.33671578764915466,
0.1497088223695755,
0.03902985155582428,
0.3158828914165497,
-0.14676350355148315,
-0.2833811342716217,
-0.04692058265209198,
0.11288625001907349,
0.0905652716755867,
0.02980121597647667,
-0.20976504683494568,
-0.19785664975643158,
0.024584755301475525,
-0.13353027403354645,
0.09123016893863678,
0.013868317008018494,
0.43417131900787354,
0.013708949089050293,
0.20939496159553528,
0.09497028589248657,
-0.2639743685722351,
-0.18645265698432922,
0.2010193169116974,
-0.0859333872795105,
-0.16401872038841248,
0.13298529386520386,
-0.16448892652988434,
0.1754021793603897,
0.15916045010089874,
-0.5460743308067322,
-0.09985063970088959,
-0.13590125739574432,
0.26028138399124146,
0.08247105777263641,
0.07652659714221954,
0.17587684094905853,
-0.0634763166308403,
-0.002753444015979767,
-0.17673906683921814,
0.15605266392230988,
0.12880371510982513,
-0.0016127824783325195,
-0.05702146887779236,
0.17211772501468658,
0.2581334114074707,
-0.4993254244327545,
-0.08316640555858612,
-0.16796733438968658,
0.15634097158908844,
-0.17158743739128113,
0.03656574338674545,
-0.22270584106445312,
-0.38213232159614563,
-0.3566147983074188,
-0.5855793356895447,
-0.4817797839641571,
0.2465135157108307,
0.12341868132352829,
-0.34834781289100647,
-0.2424318790435791,
-0.015506511554121971,
0.16168898344039917,
0.27072519063949585,
-0.07299360632896423,
0.13705816864967346,
-0.5132471919059753,
-0.17206236720085144,
0.4521681070327759,
-0.02643590420484543,
-0.1477208435535431,
-0.017227118834853172,
-0.2555699944496155,
-0.17869555950164795,
0.39008206129074097,
-0.20056262612342834,
0.07855066657066345,
0.03448600694537163,
0.16248869895935059,
0.21630859375,
-0.24250295758247375,
0.04069796949625015,
0.01011781394481659,
-0.04849031940102577,
0.033452924340963364,
-0.2824746370315552,
0.19864140450954437,
-0.22827208042144775,
-0.12682600319385529,
-0.07973570376634598,
0.1873897910118103,
0.2211134135723114,
-0.3062058091163635,
0.0017349161207675934,
-0.1782877892255783
] |
https://github.com/huggingface/datasets/issues/5488 | Error loading MP3 files from CommonVoice | Hi @kradonneoh, thanks for reporting.
Please note that to work with audio datasets (and specifically with MP3 files) we have detailed installation instructions in our docs: https://huggingface.co/docs/datasets/installation#audio
- one of the requirements is torchaudio<0.12.0
Let us know if the problem persists after having followed them. | ### Describe the bug
When loading a CommonVoice dataset with `datasets==2.9.0` and `torchaudio>=0.12.0`, I get an error reading the audio arrays:
```python
---------------------------------------------------------------------------
LibsndfileError Traceback (most recent call last)
~/.local/lib/python3.8/site-packages/datasets/features/audio.py in _decode_mp3(self, path_or_file)
310 try: # try torchaudio anyway because sometimes it works (depending on the os and os packages installed)
--> 311 array, sampling_rate = self._decode_mp3_torchaudio(path_or_file)
312 except RuntimeError:
~/.local/lib/python3.8/site-packages/datasets/features/audio.py in _decode_mp3_torchaudio(self, path_or_file)
351
--> 352 array, sampling_rate = torchaudio.load(path_or_file, format="mp3")
353 if self.sampling_rate and self.sampling_rate != sampling_rate:
~/.local/lib/python3.8/site-packages/torchaudio/backend/soundfile_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format)
204 """
--> 205 with soundfile.SoundFile(filepath, "r") as file_:
206 if file_.format != "WAV" or normalize:
~/.local/lib/python3.8/site-packages/soundfile.py in __init__(self, file, mode, samplerate, channels, subtype, endian, format, closefd)
654 format, subtype, endian)
--> 655 self._file = self._open(file, mode_int, closefd)
656 if set(mode).issuperset('r+') and self.seekable():
~/.local/lib/python3.8/site-packages/soundfile.py in _open(self, file, mode_int, closefd)
1212 err = _snd.sf_error(file_ptr)
-> 1213 raise LibsndfileError(err, prefix="Error opening {0!r}: ".format(self.name))
1214 if mode_int == _snd.SFM_WRITE:
LibsndfileError: Error opening <_io.BytesIO object at 0x7fa539462090>: File contains data in an unknown format.
```
I assume this is because there's some issue with the mp3 decoding process. I've verified that I have `ffmpeg>=4` (on a Linux distro), which appears to be the fallback backend for `torchaudio,` (at least according to #4889).
### Steps to reproduce the bug
```python
dataset = load_dataset("mozilla-foundation/common_voice_11_0", "be", split="train")
dataset[0]
```
### Expected behavior
Similar behavior to `torchaudio<0.12.0`, which doesn't result in a `LibsndfileError`
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.15.0-52-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.5.1 | 45 | Error loading MP3 files from CommonVoice
### Describe the bug
When loading a CommonVoice dataset with `datasets==2.9.0` and `torchaudio>=0.12.0`, I get an error reading the audio arrays:
```python
---------------------------------------------------------------------------
LibsndfileError Traceback (most recent call last)
~/.local/lib/python3.8/site-packages/datasets/features/audio.py in _decode_mp3(self, path_or_file)
310 try: # try torchaudio anyway because sometimes it works (depending on the os and os packages installed)
--> 311 array, sampling_rate = self._decode_mp3_torchaudio(path_or_file)
312 except RuntimeError:
~/.local/lib/python3.8/site-packages/datasets/features/audio.py in _decode_mp3_torchaudio(self, path_or_file)
351
--> 352 array, sampling_rate = torchaudio.load(path_or_file, format="mp3")
353 if self.sampling_rate and self.sampling_rate != sampling_rate:
~/.local/lib/python3.8/site-packages/torchaudio/backend/soundfile_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format)
204 """
--> 205 with soundfile.SoundFile(filepath, "r") as file_:
206 if file_.format != "WAV" or normalize:
~/.local/lib/python3.8/site-packages/soundfile.py in __init__(self, file, mode, samplerate, channels, subtype, endian, format, closefd)
654 format, subtype, endian)
--> 655 self._file = self._open(file, mode_int, closefd)
656 if set(mode).issuperset('r+') and self.seekable():
~/.local/lib/python3.8/site-packages/soundfile.py in _open(self, file, mode_int, closefd)
1212 err = _snd.sf_error(file_ptr)
-> 1213 raise LibsndfileError(err, prefix="Error opening {0!r}: ".format(self.name))
1214 if mode_int == _snd.SFM_WRITE:
LibsndfileError: Error opening <_io.BytesIO object at 0x7fa539462090>: File contains data in an unknown format.
```
I assume this is because there's some issue with the mp3 decoding process. I've verified that I have `ffmpeg>=4` (on a Linux distro), which appears to be the fallback backend for `torchaudio,` (at least according to #4889).
### Steps to reproduce the bug
```python
dataset = load_dataset("mozilla-foundation/common_voice_11_0", "be", split="train")
dataset[0]
```
### Expected behavior
Similar behavior to `torchaudio<0.12.0`, which doesn't result in a `LibsndfileError`
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.15.0-52-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.5.1
Hi @kradonneoh, thanks for reporting.
Please note that to work with audio datasets (and specifically with MP3 files) we have detailed installation instructions in our docs: https://huggingface.co/docs/datasets/installation#audio
- one of the requirements is torchaudio<0.12.0
Let us know if the problem persists after having followed them. | [
-0.27887722849845886,
0.09802080690860748,
-0.0072275567799806595,
0.5162081122398376,
0.24328209459781647,
0.06495574861764908,
0.11021738499403,
0.31326258182525635,
0.04005209729075432,
0.313784122467041,
-0.48473861813545227,
0.43479225039482117,
-0.16472384333610535,
-0.48663079738616943,
-0.3553049862384796,
-0.05606759339570999,
-0.07243051379919052,
0.17206940054893494,
0.15351933240890503,
-0.16070109605789185,
-0.37290266156196594,
0.29986080527305603,
-0.3482664227485657,
0.28165191411972046,
-0.03334585577249527,
0.04327104985713959,
0.18097738921642303,
0.35714486241340637,
-0.304335355758667,
-0.29302966594696045,
0.17661690711975098,
0.06810978055000305,
0.0642351359128952,
0.3785887658596039,
-0.00011037534568458796,
-0.08496206253767014,
0.46104395389556885,
-0.20912490785121918,
-0.20325520634651184,
-0.22146128118038177,
-0.25276312232017517,
0.14620760083198547,
0.02747928537428379,
0.13467097282409668,
-0.014254571869969368,
-0.305462509393692,
-0.04304052144289017,
-0.3837215304374695,
0.17453135550022125,
0.30141279101371765,
0.21813246607780457,
-0.005605937913060188,
0.21694417297840118,
-0.05437111482024193,
0.29890286922454834,
-0.07590603828430176,
0.11550823599100113,
0.4474068880081177,
0.3648930788040161,
-0.13429412245750427,
-0.07006818801164627,
0.10392776131629944,
-0.3864500820636749,
0.1911262720823288,
0.2926178276538849,
-0.08303701877593994,
-0.0604410246014595,
-0.23786324262619019,
0.16847476363182068,
0.18411436676979065,
0.5313824415206909,
-0.24999463558197021,
-0.2918451130390167,
-0.05823642760515213,
-0.02472972869873047,
-0.37234771251678467,
0.20315176248550415,
0.15185245871543884,
-0.31589004397392273,
0.06615288555622101,
-0.08774640411138535,
0.2735731303691864,
0.0616832971572876,
0.3407682180404663,
0.1149863451719284,
-0.1322622448205948,
-0.036816518753767014,
0.018193509429693222,
0.45850667357444763,
-0.10447320342063904,
-0.15230955183506012,
0.054175566881895065,
0.05142951011657715,
0.4516109824180603,
-0.24731339514255524,
0.1928817629814148,
0.01013004407286644,
-0.3017526865005493,
0.21000036597251892,
-0.11830474436283112,
0.35964062809944153,
0.0533510185778141,
-0.25149813294410706,
0.326655775308609,
0.20271731913089752,
-0.0625203400850296,
-0.31680405139923096,
0.03447800502181053,
0.1898535043001175,
-0.05963919311761856,
0.1989010125398636,
-0.02063167095184326,
-0.16665445268154144,
-0.2857576310634613,
-0.199684277176857,
0.23360088467597961,
0.3549576997756958,
-0.6108478307723999,
-0.5549365282058716,
0.15032775700092316,
-0.2431057095527649,
0.14641176164150238,
0.10926825553178787,
0.3248218297958374,
0.23011942207813263,
0.309349000453949,
0.13355498015880585,
0.263350248336792,
-0.1644429713487625,
0.25085335969924927,
0.01673183962702751,
-0.08341699838638306,
-0.024395424872636795,
-0.06431275606155396,
0.3160926103591919,
-0.5023396611213684,
0.3328893482685089,
0.07621502876281738,
0.28565365076065063,
-0.3211345076560974,
-0.05366302281618118,
-0.0951378345489502,
-0.19009706377983093,
0.07428595423698425,
-0.08949527144432068,
0.23535360395908356,
-0.0029906928539276123,
0.3536822199821472,
-0.21792909502983093,
0.3155618906021118,
-0.4533764719963074,
-0.15346215665340424,
0.019315022975206375,
0.21353839337825775,
0.11035427451133728,
0.22703774273395538,
0.1587115377187729,
-0.11433777213096619,
0.13918115198612213,
-0.6915872693061829,
-0.19845089316368103,
-0.3624343276023865,
-0.2526106834411621,
-0.06089184805750847,
0.16125744581222534,
0.08332400023937225,
-0.2971940338611603,
0.13201040029525757,
0.16691118478775024,
-0.10864622890949249,
0.32748058438301086,
0.3221471607685089,
-0.17742933332920074,
-0.1316831409931183,
-0.37834420800209045,
-0.011322252452373505,
0.35007303953170776,
-0.41831424832344055,
-0.37559226155281067,
0.08337325602769852,
0.10495200753211975,
0.1219276413321495,
0.01775946468114853,
-0.012066751718521118,
0.15121212601661682,
-0.10382934659719467,
0.15346470475196838,
0.20735779404640198,
-0.025660531595349312,
0.25246042013168335,
-0.21282096207141876,
-0.3538457155227661,
0.1813177615404129,
0.2549491226673126,
-0.04195524379611015,
-0.06955347210168839,
0.08288731426000595,
0.12728391587734222,
0.28492793440818787,
0.04182683303952217,
-0.19913071393966675,
0.13324293494224548,
0.13474872708320618,
-0.06128692626953125,
0.2195938527584076,
-0.07657994329929352,
0.09849832952022552,
0.04070023447275162,
-0.15206235647201538,
0.009252257645130157,
0.17097413539886475,
-0.05283943563699722,
-0.2895798087120056,
-0.3100091218948364,
-0.3868606984615326,
0.10095380246639252,
0.10606785118579865,
0.40479588508605957,
-0.14311736822128296,
-0.2044955939054489,
-0.01877424493432045,
-0.1329593062400818,
0.35944879055023193,
-0.05341877043247223,
-0.28748708963394165,
0.13902944326400757,
-0.1279650628566742,
-0.13174061477184296,
0.31739744544029236,
0.25926098227500916,
0.27446702122688293,
0.140380397439003,
-0.37193045020103455,
0.28445467352867126,
0.12426308542490005,
0.38937556743621826,
-0.38119933009147644,
0.11065632104873657,
0.12440408021211624,
-0.09923452138900757,
0.28249967098236084,
0.36605116724967957,
0.4163641929626465,
-0.1431751847267151,
0.02298121154308319,
0.3458858132362366,
0.15941627323627472,
0.11495630443096161,
-0.006236191838979721,
-0.05685625225305557,
0.25167497992515564,
0.36967507004737854,
0.08303818851709366,
0.11978764832019806,
0.23405644297599792,
0.014215721748769283,
0.4933333396911621,
-0.08971595764160156,
-0.40727508068084717,
-0.23510059714317322,
0.1347896009683609,
0.011732194572687149,
-0.002873659133911133,
0.0710766613483429,
0.055447064340114594,
-0.05810260772705078,
0.07844371348619461,
-0.33108869194984436,
0.3565770983695984,
0.18479157984256744,
0.014992505311965942,
-0.1702381670475006,
-0.21835799515247345,
-0.16296762228012085,
0.03209001570940018,
0.304768443107605,
0.058424290269613266,
0.5285734534263611,
-0.024775279685854912,
0.008385373279452324,
-0.4000723958015442,
-0.27049246430397034,
0.003979476168751717,
0.2519024610519409,
-0.429099440574646,
-0.02050120383501053,
-0.1516111046075821,
0.07230634242296219,
-0.4052678942680359,
-0.501214325428009,
-0.13047826290130615,
-0.346069872379303,
0.22122712433338165,
0.6582697033882141,
-0.22441524267196655,
0.13700994849205017,
0.059918489307165146,
0.20863059163093567,
0.18812443315982819,
0.19637061655521393,
-0.1015646904706955,
0.06754350662231445,
-0.13760319352149963,
0.059657420963048935,
0.5302807092666626,
0.15875141322612762,
0.20484811067581177,
0.06966209411621094,
0.0095905102789402,
0.1087849959731102,
0.10930488258600235,
0.03901331499218941,
0.06548915803432465,
0.07749761641025543,
0.08606106787919998,
-0.11354449391365051,
0.23739351332187653,
-0.5247480273246765,
0.1653287410736084,
0.032559528946876526,
-0.06369134783744812,
0.33676448464393616,
0.10019905865192413,
0.06633609533309937,
-0.1866876631975174,
-0.4580583870410919,
-0.21661856770515442,
-0.5187015533447266,
-0.10061778128147125,
-0.16042278707027435,
0.16921564936637878,
0.07081250846385956,
0.020309437066316605,
0.25875192880630493,
0.15205425024032593,
0.560267984867096,
-0.19587641954421997,
0.034962061792612076,
0.18221621215343475,
-0.16816392540931702,
-0.24929825961589813,
-0.07906697690486908,
0.07315190136432648,
0.2784031629562378,
0.11478254944086075,
-0.13539141416549683,
-0.05352069064974785,
0.13951633870601654,
-0.4012981951236725,
-0.12006683647632599,
-0.23751689493656158,
-0.07573725283145905,
0.19805914163589478,
-0.04919207841157913,
-0.0886414647102356,
0.044410768896341324,
-0.2040511965751648,
-0.17529284954071045,
0.2444431483745575,
0.01721104606986046,
0.3472917973995209,
-0.3566562533378601,
0.5870956182479858,
0.1669521927833557,
0.09734340012073517,
0.14321407675743103,
-0.019824983552098274,
0.2692789137363434,
-0.21993505954742432,
-0.2715856730937958,
0.06294019520282745,
-0.05398412048816681,
-0.21649570763111115,
0.27110180258750916,
0.11644215881824493,
-0.28980547189712524,
-0.1348244547843933,
0.2615857720375061,
-0.14357686042785645,
-0.09160898625850677,
-0.020131243392825127,
0.034205324947834015,
0.03538881614804268,
-0.07838408648967743,
0.5020685791969299,
0.22272200882434845,
-0.2147061824798584,
-0.0938253104686737,
0.2177225947380066,
0.05520858243107796,
-0.11920724809169769,
0.18668080866336823,
-0.03160480037331581,
-0.03743550181388855,
0.20986926555633545,
0.12850598990917206,
0.6381375193595886,
-0.25213080644607544,
0.05642801523208618,
-0.1210940033197403,
0.013056805357336998,
0.19773204624652863,
0.2910407483577728,
0.2276030331850052,
0.347468763589859,
0.2610563337802887,
-0.01446647010743618,
-0.18804757297039032,
-0.36150214076042175,
0.0571628212928772,
0.018732130527496338,
-0.03524579852819443,
-0.006499528884887695,
-0.07636714726686478,
0.04576614871621132,
0.3997555077075958,
0.11166426539421082,
0.03660963475704193,
-0.28830018639564514,
-0.2844173014163971,
-0.454304039478302,
0.0714496523141861,
-0.12654542922973633,
0.40714433789253235,
-0.46114686131477356,
-0.07522790133953094,
0.2168559432029724,
-0.16339224576950073,
0.3763658404350281,
-0.12086057662963867,
0.5932883620262146,
0.1593848019838333,
0.3207898437976837,
0.1905243694782257,
-0.016515694558620453,
0.45957520604133606,
0.5064153671264648,
-0.01054728776216507,
0.04682166501879692,
0.2026759386062622,
-0.3746824562549591,
-0.021802105009555817,
0.3725692927837372,
-0.14646779000759125,
-0.31404367089271545,
-0.20492370426654816,
-0.2102670520544052,
-0.04106847941875458,
0.04737888649106026,
0.2732508182525635,
0.0658467635512352,
-0.1900949329137802,
-0.28010812401771545,
0.1668803095817566,
0.02589409425854683,
-0.22891688346862793,
0.34376683831214905,
-0.2667109966278076,
-0.1363770067691803,
0.20501163601875305,
-0.10467249900102615,
0.831502377986908,
0.16333100199699402,
0.06304041296243668,
0.364250510931015,
-0.28853344917297363,
-0.4272029995918274,
0.08571881055831909,
0.10752984881401062,
-0.35658326745033264,
-0.15885210037231445,
-0.05242495983839035,
-0.03999372571706772,
-0.04250294715166092,
0.1931026130914688,
-0.1041753813624382,
0.3739546835422516,
0.3055689334869385,
-0.25168198347091675,
-0.06539499014616013,
-0.037484683096408844,
-0.16903267800807953,
-0.10631059110164642,
-0.019683826714754105,
0.05854611098766327,
-0.1639423668384552,
0.3693901598453522,
0.022289004176855087,
-0.1963127702474594,
0.09753981232643127,
-0.4743947982788086,
-0.2941792607307434,
0.15916112065315247,
-0.27215105295181274,
0.17458485066890717,
-0.06053585186600685,
-0.10325875133275986,
-0.028518326580524445,
-0.09649181365966797,
-0.3370526432991028,
0.13316017389297485,
-0.25750061869621277,
-0.23753218352794647,
0.1257847547531128,
0.06675148755311966,
-0.06120190769433975,
0.12852683663368225,
0.22885073721408844,
0.017114143818616867,
-0.09774519503116608,
0.13592666387557983,
-0.07123734802007675,
-0.14401403069496155,
-0.06631075590848923,
-0.007883764803409576,
0.36457473039627075,
-0.02806626260280609,
-0.387755811214447,
-0.1928984820842743,
-0.10501550137996674,
-0.17926377058029175,
0.16735118627548218,
0.13723182678222656,
-0.22500136494636536,
0.09283492714166641,
0.043411701917648315,
-0.10607795417308807,
0.0489560067653656,
0.5442718267440796,
0.024799242615699768,
-0.41397327184677124,
0.4930139183998108,
-0.031954437494277954,
-0.3387773036956787,
-0.20490863919258118,
0.10323948413133621,
0.019492322579026222,
-0.5620840191841125,
-0.013400007970631123,
-0.02991141937673092,
-0.15078504383563995,
0.13299167156219482,
0.11614973843097687,
0.03586765006184578,
0.12821093201637268,
-0.14099858701229095,
-0.5076079368591309,
-0.3440180718898773,
0.09118612110614777,
0.08182717114686966,
0.3942595422267914,
0.02117549628019333,
-0.46123823523521423,
-0.020663419738411903,
-0.4130851626396179,
-0.3003000319004059,
0.21412909030914307,
-0.09421256184577942,
0.09535825997591019,
-0.052257560193538666,
0.10627637803554535,
-0.028661362826824188,
0.07691533863544464,
0.1625266969203949,
0.12472234666347504,
-0.14187604188919067,
-0.09238426387310028,
0.08951695263385773,
0.2204386293888092,
0.019751744344830513,
-0.3753351867198944,
-0.0500456839799881,
-0.12001514434814453,
-0.21765418350696564,
-0.15946106612682343,
0.07220558822154999,
0.19457265734672546,
-0.10927741229534149,
-0.05251501500606537,
-0.01244405284523964,
0.2012936770915985,
0.3658403754234314,
0.24191252887248993,
-0.11107386648654938,
-0.03726135194301605,
0.16223149001598358,
0.1252056509256363,
-0.19763095676898956,
-0.14476053416728973,
-0.026827195659279823,
0.11497420817613602,
-0.14197179675102234,
-0.09313266724348068,
0.3603018820285797,
-0.32700544595718384,
0.20476514101028442,
0.5185730457305908,
0.3009541928768158,
0.38692888617515564,
-0.20731015503406525,
0.004483511671423912,
0.16857585310935974,
0.20956121385097504,
-0.22895589470863342,
-0.03419234976172447,
-0.34090614318847656,
-0.13132505118846893,
-0.03116479516029358,
0.026154465973377228,
0.03972955420613289,
-0.3696536719799042,
0.16189701855182648,
0.00254841148853302,
0.3397213816642761,
0.032509781420230865,
0.057237643748521805,
0.3782612383365631,
-0.21809200942516327,
0.07691702991724014,
-0.2114741951227188,
-0.18524590134620667,
0.047394998371601105,
0.2880290746688843,
-0.58870530128479,
0.4851302206516266,
0.17615360021591187,
-0.1579228937625885,
0.12540583312511444,
-0.4981929659843445,
-0.11222034692764282,
0.40305984020233154,
0.010516226291656494,
0.22364071011543274,
0.1742524951696396,
0.3324972689151764,
-0.4453159272670746,
-0.11243429034948349,
-0.11564858257770538,
-0.05332106724381447,
-0.2360069751739502,
0.0564204640686512,
-0.011376464739441872,
-0.2786353528499603,
-0.21233981847763062,
0.023576002568006516,
-0.11706507205963135,
0.20845022797584534,
-0.14571993052959442,
-0.0716632604598999,
-0.09281951189041138,
-0.14286090433597565,
-0.11044063419103622,
0.2501644492149353,
0.039216749370098114,
-0.3226640224456787,
0.2185656875371933,
0.2214236855506897,
0.07028152793645859,
0.5237049460411072,
0.28308790922164917,
0.4648689925670624,
0.4636196792125702,
-0.13236767053604126,
-0.14081214368343353,
-0.1698145717382431,
0.014541806653141975,
0.07050628215074539,
0.14772137999534607,
0.1440293937921524,
0.4152223467826843,
0.4430978000164032,
0.12027384340763092,
-0.039414357393980026,
-0.03766823932528496,
0.2504693269729614,
-0.1314573436975479,
-0.11952506005764008,
0.20517292618751526,
-0.24369454383850098,
0.05096755921840668,
-0.19201098382472992,
-0.10455962270498276,
-0.4206346571445465,
-0.3122842311859131,
0.19639059901237488,
0.3235308825969696,
0.11882001906633377,
0.19972413778305054,
0.07191000878810883,
-0.000310409814119339,
0.09734341502189636,
0.3459545969963074,
-0.0826786682009697,
-0.3354732394218445,
0.008700862526893616,
-0.7803558707237244,
0.4033505320549011,
0.28063544631004333,
0.1605946123600006,
-0.09712868183851242,
-0.09627702832221985,
0.2143423706293106,
0.17000076174736023,
0.05763264745473862,
0.056353382766246796,
0.15832236409187317,
-0.06572051346302032,
-0.16873858869075775,
-0.3217656910419464,
0.1577012687921524,
-0.07172916829586029,
-0.07028047740459442,
-0.5920366644859314,
0.04414407163858414,
-0.1448364555835724,
0.07470870763063431,
-0.19394905865192413,
-0.09073978662490845,
-0.6025481224060059,
0.440952330827713,
-0.07045306265354156,
0.027925465255975723,
0.5803716778755188,
-0.21036875247955322,
-0.24160777032375336,
-0.24013841152191162,
-0.1287572979927063,
0.19374045729637146,
-0.020899802446365356,
-0.04648233577609062,
0.38583359122276306,
0.03244389593601227,
-0.03656427934765816,
-0.401336669921875,
0.2447579801082611,
-0.11216266453266144,
-0.012353277765214443,
-0.47376593947410583,
0.17823565006256104,
-0.2586615979671478,
0.1488875448703766,
-0.04092974588274956,
-0.30999261140823364,
0.1559247374534607,
0.17477348446846008,
-0.23643043637275696,
-0.3065199553966522,
0.6984711289405823,
0.09609677642583847,
-0.10957314074039459,
-0.20794807374477386,
0.2983524799346924,
0.1447426676750183,
0.1592939794063568,
-0.759312629699707,
0.2825165092945099,
0.19884192943572998,
0.03827900066971779,
-0.02932635135948658,
-0.14852939546108246,
-0.15207763016223907,
-0.11611662805080414,
-0.2042396515607834,
0.04475686699151993,
0.2829408347606659,
-0.2656159996986389,
0.25495994091033936,
-0.32821816205978394
] |
https://github.com/huggingface/datasets/issues/5488 | Error loading MP3 files from CommonVoice | I saw that and have followed it (hence the Expected Behavior section of the bug report).
Is there no intention of updating to the latest version? It does limit the version of `torch` I can use, which isn’t ideal. | ### Describe the bug
When loading a CommonVoice dataset with `datasets==2.9.0` and `torchaudio>=0.12.0`, I get an error reading the audio arrays:
```python
---------------------------------------------------------------------------
LibsndfileError Traceback (most recent call last)
~/.local/lib/python3.8/site-packages/datasets/features/audio.py in _decode_mp3(self, path_or_file)
310 try: # try torchaudio anyway because sometimes it works (depending on the os and os packages installed)
--> 311 array, sampling_rate = self._decode_mp3_torchaudio(path_or_file)
312 except RuntimeError:
~/.local/lib/python3.8/site-packages/datasets/features/audio.py in _decode_mp3_torchaudio(self, path_or_file)
351
--> 352 array, sampling_rate = torchaudio.load(path_or_file, format="mp3")
353 if self.sampling_rate and self.sampling_rate != sampling_rate:
~/.local/lib/python3.8/site-packages/torchaudio/backend/soundfile_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format)
204 """
--> 205 with soundfile.SoundFile(filepath, "r") as file_:
206 if file_.format != "WAV" or normalize:
~/.local/lib/python3.8/site-packages/soundfile.py in __init__(self, file, mode, samplerate, channels, subtype, endian, format, closefd)
654 format, subtype, endian)
--> 655 self._file = self._open(file, mode_int, closefd)
656 if set(mode).issuperset('r+') and self.seekable():
~/.local/lib/python3.8/site-packages/soundfile.py in _open(self, file, mode_int, closefd)
1212 err = _snd.sf_error(file_ptr)
-> 1213 raise LibsndfileError(err, prefix="Error opening {0!r}: ".format(self.name))
1214 if mode_int == _snd.SFM_WRITE:
LibsndfileError: Error opening <_io.BytesIO object at 0x7fa539462090>: File contains data in an unknown format.
```
I assume this is because there's some issue with the mp3 decoding process. I've verified that I have `ffmpeg>=4` (on a Linux distro), which appears to be the fallback backend for `torchaudio,` (at least according to #4889).
### Steps to reproduce the bug
```python
dataset = load_dataset("mozilla-foundation/common_voice_11_0", "be", split="train")
dataset[0]
```
### Expected behavior
Similar behavior to `torchaudio<0.12.0`, which doesn't result in a `LibsndfileError`
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.15.0-52-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.5.1 | 39 | Error loading MP3 files from CommonVoice
### Describe the bug
When loading a CommonVoice dataset with `datasets==2.9.0` and `torchaudio>=0.12.0`, I get an error reading the audio arrays:
```python
---------------------------------------------------------------------------
LibsndfileError Traceback (most recent call last)
~/.local/lib/python3.8/site-packages/datasets/features/audio.py in _decode_mp3(self, path_or_file)
310 try: # try torchaudio anyway because sometimes it works (depending on the os and os packages installed)
--> 311 array, sampling_rate = self._decode_mp3_torchaudio(path_or_file)
312 except RuntimeError:
~/.local/lib/python3.8/site-packages/datasets/features/audio.py in _decode_mp3_torchaudio(self, path_or_file)
351
--> 352 array, sampling_rate = torchaudio.load(path_or_file, format="mp3")
353 if self.sampling_rate and self.sampling_rate != sampling_rate:
~/.local/lib/python3.8/site-packages/torchaudio/backend/soundfile_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format)
204 """
--> 205 with soundfile.SoundFile(filepath, "r") as file_:
206 if file_.format != "WAV" or normalize:
~/.local/lib/python3.8/site-packages/soundfile.py in __init__(self, file, mode, samplerate, channels, subtype, endian, format, closefd)
654 format, subtype, endian)
--> 655 self._file = self._open(file, mode_int, closefd)
656 if set(mode).issuperset('r+') and self.seekable():
~/.local/lib/python3.8/site-packages/soundfile.py in _open(self, file, mode_int, closefd)
1212 err = _snd.sf_error(file_ptr)
-> 1213 raise LibsndfileError(err, prefix="Error opening {0!r}: ".format(self.name))
1214 if mode_int == _snd.SFM_WRITE:
LibsndfileError: Error opening <_io.BytesIO object at 0x7fa539462090>: File contains data in an unknown format.
```
I assume this is because there's some issue with the mp3 decoding process. I've verified that I have `ffmpeg>=4` (on a Linux distro), which appears to be the fallback backend for `torchaudio,` (at least according to #4889).
### Steps to reproduce the bug
```python
dataset = load_dataset("mozilla-foundation/common_voice_11_0", "be", split="train")
dataset[0]
```
### Expected behavior
Similar behavior to `torchaudio<0.12.0`, which doesn't result in a `LibsndfileError`
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.15.0-52-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.5.1
I saw that and have followed it (hence the Expected Behavior section of the bug report).
Is there no intention of updating to the latest version? It does limit the version of `torch` I can use, which isn’t ideal. | [
-0.27887722849845886,
0.09802080690860748,
-0.0072275567799806595,
0.5162081122398376,
0.24328209459781647,
0.06495574861764908,
0.11021738499403,
0.31326258182525635,
0.04005209729075432,
0.313784122467041,
-0.48473861813545227,
0.43479225039482117,
-0.16472384333610535,
-0.48663079738616943,
-0.3553049862384796,
-0.05606759339570999,
-0.07243051379919052,
0.17206940054893494,
0.15351933240890503,
-0.16070109605789185,
-0.37290266156196594,
0.29986080527305603,
-0.3482664227485657,
0.28165191411972046,
-0.03334585577249527,
0.04327104985713959,
0.18097738921642303,
0.35714486241340637,
-0.304335355758667,
-0.29302966594696045,
0.17661690711975098,
0.06810978055000305,
0.0642351359128952,
0.3785887658596039,
-0.00011037534568458796,
-0.08496206253767014,
0.46104395389556885,
-0.20912490785121918,
-0.20325520634651184,
-0.22146128118038177,
-0.25276312232017517,
0.14620760083198547,
0.02747928537428379,
0.13467097282409668,
-0.014254571869969368,
-0.305462509393692,
-0.04304052144289017,
-0.3837215304374695,
0.17453135550022125,
0.30141279101371765,
0.21813246607780457,
-0.005605937913060188,
0.21694417297840118,
-0.05437111482024193,
0.29890286922454834,
-0.07590603828430176,
0.11550823599100113,
0.4474068880081177,
0.3648930788040161,
-0.13429412245750427,
-0.07006818801164627,
0.10392776131629944,
-0.3864500820636749,
0.1911262720823288,
0.2926178276538849,
-0.08303701877593994,
-0.0604410246014595,
-0.23786324262619019,
0.16847476363182068,
0.18411436676979065,
0.5313824415206909,
-0.24999463558197021,
-0.2918451130390167,
-0.05823642760515213,
-0.02472972869873047,
-0.37234771251678467,
0.20315176248550415,
0.15185245871543884,
-0.31589004397392273,
0.06615288555622101,
-0.08774640411138535,
0.2735731303691864,
0.0616832971572876,
0.3407682180404663,
0.1149863451719284,
-0.1322622448205948,
-0.036816518753767014,
0.018193509429693222,
0.45850667357444763,
-0.10447320342063904,
-0.15230955183506012,
0.054175566881895065,
0.05142951011657715,
0.4516109824180603,
-0.24731339514255524,
0.1928817629814148,
0.01013004407286644,
-0.3017526865005493,
0.21000036597251892,
-0.11830474436283112,
0.35964062809944153,
0.0533510185778141,
-0.25149813294410706,
0.326655775308609,
0.20271731913089752,
-0.0625203400850296,
-0.31680405139923096,
0.03447800502181053,
0.1898535043001175,
-0.05963919311761856,
0.1989010125398636,
-0.02063167095184326,
-0.16665445268154144,
-0.2857576310634613,
-0.199684277176857,
0.23360088467597961,
0.3549576997756958,
-0.6108478307723999,
-0.5549365282058716,
0.15032775700092316,
-0.2431057095527649,
0.14641176164150238,
0.10926825553178787,
0.3248218297958374,
0.23011942207813263,
0.309349000453949,
0.13355498015880585,
0.263350248336792,
-0.1644429713487625,
0.25085335969924927,
0.01673183962702751,
-0.08341699838638306,
-0.024395424872636795,
-0.06431275606155396,
0.3160926103591919,
-0.5023396611213684,
0.3328893482685089,
0.07621502876281738,
0.28565365076065063,
-0.3211345076560974,
-0.05366302281618118,
-0.0951378345489502,
-0.19009706377983093,
0.07428595423698425,
-0.08949527144432068,
0.23535360395908356,
-0.0029906928539276123,
0.3536822199821472,
-0.21792909502983093,
0.3155618906021118,
-0.4533764719963074,
-0.15346215665340424,
0.019315022975206375,
0.21353839337825775,
0.11035427451133728,
0.22703774273395538,
0.1587115377187729,
-0.11433777213096619,
0.13918115198612213,
-0.6915872693061829,
-0.19845089316368103,
-0.3624343276023865,
-0.2526106834411621,
-0.06089184805750847,
0.16125744581222534,
0.08332400023937225,
-0.2971940338611603,
0.13201040029525757,
0.16691118478775024,
-0.10864622890949249,
0.32748058438301086,
0.3221471607685089,
-0.17742933332920074,
-0.1316831409931183,
-0.37834420800209045,
-0.011322252452373505,
0.35007303953170776,
-0.41831424832344055,
-0.37559226155281067,
0.08337325602769852,
0.10495200753211975,
0.1219276413321495,
0.01775946468114853,
-0.012066751718521118,
0.15121212601661682,
-0.10382934659719467,
0.15346470475196838,
0.20735779404640198,
-0.025660531595349312,
0.25246042013168335,
-0.21282096207141876,
-0.3538457155227661,
0.1813177615404129,
0.2549491226673126,
-0.04195524379611015,
-0.06955347210168839,
0.08288731426000595,
0.12728391587734222,
0.28492793440818787,
0.04182683303952217,
-0.19913071393966675,
0.13324293494224548,
0.13474872708320618,
-0.06128692626953125,
0.2195938527584076,
-0.07657994329929352,
0.09849832952022552,
0.04070023447275162,
-0.15206235647201538,
0.009252257645130157,
0.17097413539886475,
-0.05283943563699722,
-0.2895798087120056,
-0.3100091218948364,
-0.3868606984615326,
0.10095380246639252,
0.10606785118579865,
0.40479588508605957,
-0.14311736822128296,
-0.2044955939054489,
-0.01877424493432045,
-0.1329593062400818,
0.35944879055023193,
-0.05341877043247223,
-0.28748708963394165,
0.13902944326400757,
-0.1279650628566742,
-0.13174061477184296,
0.31739744544029236,
0.25926098227500916,
0.27446702122688293,
0.140380397439003,
-0.37193045020103455,
0.28445467352867126,
0.12426308542490005,
0.38937556743621826,
-0.38119933009147644,
0.11065632104873657,
0.12440408021211624,
-0.09923452138900757,
0.28249967098236084,
0.36605116724967957,
0.4163641929626465,
-0.1431751847267151,
0.02298121154308319,
0.3458858132362366,
0.15941627323627472,
0.11495630443096161,
-0.006236191838979721,
-0.05685625225305557,
0.25167497992515564,
0.36967507004737854,
0.08303818851709366,
0.11978764832019806,
0.23405644297599792,
0.014215721748769283,
0.4933333396911621,
-0.08971595764160156,
-0.40727508068084717,
-0.23510059714317322,
0.1347896009683609,
0.011732194572687149,
-0.002873659133911133,
0.0710766613483429,
0.055447064340114594,
-0.05810260772705078,
0.07844371348619461,
-0.33108869194984436,
0.3565770983695984,
0.18479157984256744,
0.014992505311965942,
-0.1702381670475006,
-0.21835799515247345,
-0.16296762228012085,
0.03209001570940018,
0.304768443107605,
0.058424290269613266,
0.5285734534263611,
-0.024775279685854912,
0.008385373279452324,
-0.4000723958015442,
-0.27049246430397034,
0.003979476168751717,
0.2519024610519409,
-0.429099440574646,
-0.02050120383501053,
-0.1516111046075821,
0.07230634242296219,
-0.4052678942680359,
-0.501214325428009,
-0.13047826290130615,
-0.346069872379303,
0.22122712433338165,
0.6582697033882141,
-0.22441524267196655,
0.13700994849205017,
0.059918489307165146,
0.20863059163093567,
0.18812443315982819,
0.19637061655521393,
-0.1015646904706955,
0.06754350662231445,
-0.13760319352149963,
0.059657420963048935,
0.5302807092666626,
0.15875141322612762,
0.20484811067581177,
0.06966209411621094,
0.0095905102789402,
0.1087849959731102,
0.10930488258600235,
0.03901331499218941,
0.06548915803432465,
0.07749761641025543,
0.08606106787919998,
-0.11354449391365051,
0.23739351332187653,
-0.5247480273246765,
0.1653287410736084,
0.032559528946876526,
-0.06369134783744812,
0.33676448464393616,
0.10019905865192413,
0.06633609533309937,
-0.1866876631975174,
-0.4580583870410919,
-0.21661856770515442,
-0.5187015533447266,
-0.10061778128147125,
-0.16042278707027435,
0.16921564936637878,
0.07081250846385956,
0.020309437066316605,
0.25875192880630493,
0.15205425024032593,
0.560267984867096,
-0.19587641954421997,
0.034962061792612076,
0.18221621215343475,
-0.16816392540931702,
-0.24929825961589813,
-0.07906697690486908,
0.07315190136432648,
0.2784031629562378,
0.11478254944086075,
-0.13539141416549683,
-0.05352069064974785,
0.13951633870601654,
-0.4012981951236725,
-0.12006683647632599,
-0.23751689493656158,
-0.07573725283145905,
0.19805914163589478,
-0.04919207841157913,
-0.0886414647102356,
0.044410768896341324,
-0.2040511965751648,
-0.17529284954071045,
0.2444431483745575,
0.01721104606986046,
0.3472917973995209,
-0.3566562533378601,
0.5870956182479858,
0.1669521927833557,
0.09734340012073517,
0.14321407675743103,
-0.019824983552098274,
0.2692789137363434,
-0.21993505954742432,
-0.2715856730937958,
0.06294019520282745,
-0.05398412048816681,
-0.21649570763111115,
0.27110180258750916,
0.11644215881824493,
-0.28980547189712524,
-0.1348244547843933,
0.2615857720375061,
-0.14357686042785645,
-0.09160898625850677,
-0.020131243392825127,
0.034205324947834015,
0.03538881614804268,
-0.07838408648967743,
0.5020685791969299,
0.22272200882434845,
-0.2147061824798584,
-0.0938253104686737,
0.2177225947380066,
0.05520858243107796,
-0.11920724809169769,
0.18668080866336823,
-0.03160480037331581,
-0.03743550181388855,
0.20986926555633545,
0.12850598990917206,
0.6381375193595886,
-0.25213080644607544,
0.05642801523208618,
-0.1210940033197403,
0.013056805357336998,
0.19773204624652863,
0.2910407483577728,
0.2276030331850052,
0.347468763589859,
0.2610563337802887,
-0.01446647010743618,
-0.18804757297039032,
-0.36150214076042175,
0.0571628212928772,
0.018732130527496338,
-0.03524579852819443,
-0.006499528884887695,
-0.07636714726686478,
0.04576614871621132,
0.3997555077075958,
0.11166426539421082,
0.03660963475704193,
-0.28830018639564514,
-0.2844173014163971,
-0.454304039478302,
0.0714496523141861,
-0.12654542922973633,
0.40714433789253235,
-0.46114686131477356,
-0.07522790133953094,
0.2168559432029724,
-0.16339224576950073,
0.3763658404350281,
-0.12086057662963867,
0.5932883620262146,
0.1593848019838333,
0.3207898437976837,
0.1905243694782257,
-0.016515694558620453,
0.45957520604133606,
0.5064153671264648,
-0.01054728776216507,
0.04682166501879692,
0.2026759386062622,
-0.3746824562549591,
-0.021802105009555817,
0.3725692927837372,
-0.14646779000759125,
-0.31404367089271545,
-0.20492370426654816,
-0.2102670520544052,
-0.04106847941875458,
0.04737888649106026,
0.2732508182525635,
0.0658467635512352,
-0.1900949329137802,
-0.28010812401771545,
0.1668803095817566,
0.02589409425854683,
-0.22891688346862793,
0.34376683831214905,
-0.2667109966278076,
-0.1363770067691803,
0.20501163601875305,
-0.10467249900102615,
0.831502377986908,
0.16333100199699402,
0.06304041296243668,
0.364250510931015,
-0.28853344917297363,
-0.4272029995918274,
0.08571881055831909,
0.10752984881401062,
-0.35658326745033264,
-0.15885210037231445,
-0.05242495983839035,
-0.03999372571706772,
-0.04250294715166092,
0.1931026130914688,
-0.1041753813624382,
0.3739546835422516,
0.3055689334869385,
-0.25168198347091675,
-0.06539499014616013,
-0.037484683096408844,
-0.16903267800807953,
-0.10631059110164642,
-0.019683826714754105,
0.05854611098766327,
-0.1639423668384552,
0.3693901598453522,
0.022289004176855087,
-0.1963127702474594,
0.09753981232643127,
-0.4743947982788086,
-0.2941792607307434,
0.15916112065315247,
-0.27215105295181274,
0.17458485066890717,
-0.06053585186600685,
-0.10325875133275986,
-0.028518326580524445,
-0.09649181365966797,
-0.3370526432991028,
0.13316017389297485,
-0.25750061869621277,
-0.23753218352794647,
0.1257847547531128,
0.06675148755311966,
-0.06120190769433975,
0.12852683663368225,
0.22885073721408844,
0.017114143818616867,
-0.09774519503116608,
0.13592666387557983,
-0.07123734802007675,
-0.14401403069496155,
-0.06631075590848923,
-0.007883764803409576,
0.36457473039627075,
-0.02806626260280609,
-0.387755811214447,
-0.1928984820842743,
-0.10501550137996674,
-0.17926377058029175,
0.16735118627548218,
0.13723182678222656,
-0.22500136494636536,
0.09283492714166641,
0.043411701917648315,
-0.10607795417308807,
0.0489560067653656,
0.5442718267440796,
0.024799242615699768,
-0.41397327184677124,
0.4930139183998108,
-0.031954437494277954,
-0.3387773036956787,
-0.20490863919258118,
0.10323948413133621,
0.019492322579026222,
-0.5620840191841125,
-0.013400007970631123,
-0.02991141937673092,
-0.15078504383563995,
0.13299167156219482,
0.11614973843097687,
0.03586765006184578,
0.12821093201637268,
-0.14099858701229095,
-0.5076079368591309,
-0.3440180718898773,
0.09118612110614777,
0.08182717114686966,
0.3942595422267914,
0.02117549628019333,
-0.46123823523521423,
-0.020663419738411903,
-0.4130851626396179,
-0.3003000319004059,
0.21412909030914307,
-0.09421256184577942,
0.09535825997591019,
-0.052257560193538666,
0.10627637803554535,
-0.028661362826824188,
0.07691533863544464,
0.1625266969203949,
0.12472234666347504,
-0.14187604188919067,
-0.09238426387310028,
0.08951695263385773,
0.2204386293888092,
0.019751744344830513,
-0.3753351867198944,
-0.0500456839799881,
-0.12001514434814453,
-0.21765418350696564,
-0.15946106612682343,
0.07220558822154999,
0.19457265734672546,
-0.10927741229534149,
-0.05251501500606537,
-0.01244405284523964,
0.2012936770915985,
0.3658403754234314,
0.24191252887248993,
-0.11107386648654938,
-0.03726135194301605,
0.16223149001598358,
0.1252056509256363,
-0.19763095676898956,
-0.14476053416728973,
-0.026827195659279823,
0.11497420817613602,
-0.14197179675102234,
-0.09313266724348068,
0.3603018820285797,
-0.32700544595718384,
0.20476514101028442,
0.5185730457305908,
0.3009541928768158,
0.38692888617515564,
-0.20731015503406525,
0.004483511671423912,
0.16857585310935974,
0.20956121385097504,
-0.22895589470863342,
-0.03419234976172447,
-0.34090614318847656,
-0.13132505118846893,
-0.03116479516029358,
0.026154465973377228,
0.03972955420613289,
-0.3696536719799042,
0.16189701855182648,
0.00254841148853302,
0.3397213816642761,
0.032509781420230865,
0.057237643748521805,
0.3782612383365631,
-0.21809200942516327,
0.07691702991724014,
-0.2114741951227188,
-0.18524590134620667,
0.047394998371601105,
0.2880290746688843,
-0.58870530128479,
0.4851302206516266,
0.17615360021591187,
-0.1579228937625885,
0.12540583312511444,
-0.4981929659843445,
-0.11222034692764282,
0.40305984020233154,
0.010516226291656494,
0.22364071011543274,
0.1742524951696396,
0.3324972689151764,
-0.4453159272670746,
-0.11243429034948349,
-0.11564858257770538,
-0.05332106724381447,
-0.2360069751739502,
0.0564204640686512,
-0.011376464739441872,
-0.2786353528499603,
-0.21233981847763062,
0.023576002568006516,
-0.11706507205963135,
0.20845022797584534,
-0.14571993052959442,
-0.0716632604598999,
-0.09281951189041138,
-0.14286090433597565,
-0.11044063419103622,
0.2501644492149353,
0.039216749370098114,
-0.3226640224456787,
0.2185656875371933,
0.2214236855506897,
0.07028152793645859,
0.5237049460411072,
0.28308790922164917,
0.4648689925670624,
0.4636196792125702,
-0.13236767053604126,
-0.14081214368343353,
-0.1698145717382431,
0.014541806653141975,
0.07050628215074539,
0.14772137999534607,
0.1440293937921524,
0.4152223467826843,
0.4430978000164032,
0.12027384340763092,
-0.039414357393980026,
-0.03766823932528496,
0.2504693269729614,
-0.1314573436975479,
-0.11952506005764008,
0.20517292618751526,
-0.24369454383850098,
0.05096755921840668,
-0.19201098382472992,
-0.10455962270498276,
-0.4206346571445465,
-0.3122842311859131,
0.19639059901237488,
0.3235308825969696,
0.11882001906633377,
0.19972413778305054,
0.07191000878810883,
-0.000310409814119339,
0.09734341502189636,
0.3459545969963074,
-0.0826786682009697,
-0.3354732394218445,
0.008700862526893616,
-0.7803558707237244,
0.4033505320549011,
0.28063544631004333,
0.1605946123600006,
-0.09712868183851242,
-0.09627702832221985,
0.2143423706293106,
0.17000076174736023,
0.05763264745473862,
0.056353382766246796,
0.15832236409187317,
-0.06572051346302032,
-0.16873858869075775,
-0.3217656910419464,
0.1577012687921524,
-0.07172916829586029,
-0.07028047740459442,
-0.5920366644859314,
0.04414407163858414,
-0.1448364555835724,
0.07470870763063431,
-0.19394905865192413,
-0.09073978662490845,
-0.6025481224060059,
0.440952330827713,
-0.07045306265354156,
0.027925465255975723,
0.5803716778755188,
-0.21036875247955322,
-0.24160777032375336,
-0.24013841152191162,
-0.1287572979927063,
0.19374045729637146,
-0.020899802446365356,
-0.04648233577609062,
0.38583359122276306,
0.03244389593601227,
-0.03656427934765816,
-0.401336669921875,
0.2447579801082611,
-0.11216266453266144,
-0.012353277765214443,
-0.47376593947410583,
0.17823565006256104,
-0.2586615979671478,
0.1488875448703766,
-0.04092974588274956,
-0.30999261140823364,
0.1559247374534607,
0.17477348446846008,
-0.23643043637275696,
-0.3065199553966522,
0.6984711289405823,
0.09609677642583847,
-0.10957314074039459,
-0.20794807374477386,
0.2983524799346924,
0.1447426676750183,
0.1592939794063568,
-0.759312629699707,
0.2825165092945099,
0.19884192943572998,
0.03827900066971779,
-0.02932635135948658,
-0.14852939546108246,
-0.15207763016223907,
-0.11611662805080414,
-0.2042396515607834,
0.04475686699151993,
0.2829408347606659,
-0.2656159996986389,
0.25495994091033936,
-0.32821816205978394
] |
https://github.com/huggingface/datasets/issues/5488 | Error loading MP3 files from CommonVoice | @kradonneoh hey! actually with `ffmpeg4` loading of mp3 files should work, so this is a not expected behavior and we need to investigate it. It works on my side with `torchaudio==0.13` and `ffmpeg==4.2.7`. Which `torchaudio` version do you use?
`datasets` should support decoding of mp3 files with `torchaudio` when its version is `>0.12` but as you noted it requires `ffmpeg>4`, we need to fix this in the documentation, thank you for pointing to this!
But according to your traceback it seems that it tries to use [`libsndfile`](https://github.com/libsndfile/libsndfile) backend for mp3 decoding. And `libsndfile` library supports mp3 decoding starting from version 1.1.0 which on Linux has to be compiled from source for now afaik.
fyi - we are aiming at getting rid of `torchaudio` dependency at all by the next major library release in favor of `libsndfile` too. | ### Describe the bug
When loading a CommonVoice dataset with `datasets==2.9.0` and `torchaudio>=0.12.0`, I get an error reading the audio arrays:
```python
---------------------------------------------------------------------------
LibsndfileError Traceback (most recent call last)
~/.local/lib/python3.8/site-packages/datasets/features/audio.py in _decode_mp3(self, path_or_file)
310 try: # try torchaudio anyway because sometimes it works (depending on the os and os packages installed)
--> 311 array, sampling_rate = self._decode_mp3_torchaudio(path_or_file)
312 except RuntimeError:
~/.local/lib/python3.8/site-packages/datasets/features/audio.py in _decode_mp3_torchaudio(self, path_or_file)
351
--> 352 array, sampling_rate = torchaudio.load(path_or_file, format="mp3")
353 if self.sampling_rate and self.sampling_rate != sampling_rate:
~/.local/lib/python3.8/site-packages/torchaudio/backend/soundfile_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format)
204 """
--> 205 with soundfile.SoundFile(filepath, "r") as file_:
206 if file_.format != "WAV" or normalize:
~/.local/lib/python3.8/site-packages/soundfile.py in __init__(self, file, mode, samplerate, channels, subtype, endian, format, closefd)
654 format, subtype, endian)
--> 655 self._file = self._open(file, mode_int, closefd)
656 if set(mode).issuperset('r+') and self.seekable():
~/.local/lib/python3.8/site-packages/soundfile.py in _open(self, file, mode_int, closefd)
1212 err = _snd.sf_error(file_ptr)
-> 1213 raise LibsndfileError(err, prefix="Error opening {0!r}: ".format(self.name))
1214 if mode_int == _snd.SFM_WRITE:
LibsndfileError: Error opening <_io.BytesIO object at 0x7fa539462090>: File contains data in an unknown format.
```
I assume this is because there's some issue with the mp3 decoding process. I've verified that I have `ffmpeg>=4` (on a Linux distro), which appears to be the fallback backend for `torchaudio,` (at least according to #4889).
### Steps to reproduce the bug
```python
dataset = load_dataset("mozilla-foundation/common_voice_11_0", "be", split="train")
dataset[0]
```
### Expected behavior
Similar behavior to `torchaudio<0.12.0`, which doesn't result in a `LibsndfileError`
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.15.0-52-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.5.1 | 137 | Error loading MP3 files from CommonVoice
### Describe the bug
When loading a CommonVoice dataset with `datasets==2.9.0` and `torchaudio>=0.12.0`, I get an error reading the audio arrays:
```python
---------------------------------------------------------------------------
LibsndfileError Traceback (most recent call last)
~/.local/lib/python3.8/site-packages/datasets/features/audio.py in _decode_mp3(self, path_or_file)
310 try: # try torchaudio anyway because sometimes it works (depending on the os and os packages installed)
--> 311 array, sampling_rate = self._decode_mp3_torchaudio(path_or_file)
312 except RuntimeError:
~/.local/lib/python3.8/site-packages/datasets/features/audio.py in _decode_mp3_torchaudio(self, path_or_file)
351
--> 352 array, sampling_rate = torchaudio.load(path_or_file, format="mp3")
353 if self.sampling_rate and self.sampling_rate != sampling_rate:
~/.local/lib/python3.8/site-packages/torchaudio/backend/soundfile_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format)
204 """
--> 205 with soundfile.SoundFile(filepath, "r") as file_:
206 if file_.format != "WAV" or normalize:
~/.local/lib/python3.8/site-packages/soundfile.py in __init__(self, file, mode, samplerate, channels, subtype, endian, format, closefd)
654 format, subtype, endian)
--> 655 self._file = self._open(file, mode_int, closefd)
656 if set(mode).issuperset('r+') and self.seekable():
~/.local/lib/python3.8/site-packages/soundfile.py in _open(self, file, mode_int, closefd)
1212 err = _snd.sf_error(file_ptr)
-> 1213 raise LibsndfileError(err, prefix="Error opening {0!r}: ".format(self.name))
1214 if mode_int == _snd.SFM_WRITE:
LibsndfileError: Error opening <_io.BytesIO object at 0x7fa539462090>: File contains data in an unknown format.
```
I assume this is because there's some issue with the mp3 decoding process. I've verified that I have `ffmpeg>=4` (on a Linux distro), which appears to be the fallback backend for `torchaudio,` (at least according to #4889).
### Steps to reproduce the bug
```python
dataset = load_dataset("mozilla-foundation/common_voice_11_0", "be", split="train")
dataset[0]
```
### Expected behavior
Similar behavior to `torchaudio<0.12.0`, which doesn't result in a `LibsndfileError`
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-5.15.0-52-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 10.0.1
- Pandas version: 1.5.1
@kradonneoh hey! actually with `ffmpeg4` loading of mp3 files should work, so this is a not expected behavior and we need to investigate it. It works on my side with `torchaudio==0.13` and `ffmpeg==4.2.7`. Which `torchaudio` version do you use?
`datasets` should support decoding of mp3 files with `torchaudio` when its version is `>0.12` but as you noted it requires `ffmpeg>4`, we need to fix this in the documentation, thank you for pointing to this!
But according to your traceback it seems that it tries to use [`libsndfile`](https://github.com/libsndfile/libsndfile) backend for mp3 decoding. And `libsndfile` library supports mp3 decoding starting from version 1.1.0 which on Linux has to be compiled from source for now afaik.
fyi - we are aiming at getting rid of `torchaudio` dependency at all by the next major library release in favor of `libsndfile` too. | [
-0.27887722849845886,
0.09802080690860748,
-0.0072275567799806595,
0.5162081122398376,
0.24328209459781647,
0.06495574861764908,
0.11021738499403,
0.31326258182525635,
0.04005209729075432,
0.313784122467041,
-0.48473861813545227,
0.43479225039482117,
-0.16472384333610535,
-0.48663079738616943,
-0.3553049862384796,
-0.05606759339570999,
-0.07243051379919052,
0.17206940054893494,
0.15351933240890503,
-0.16070109605789185,
-0.37290266156196594,
0.29986080527305603,
-0.3482664227485657,
0.28165191411972046,
-0.03334585577249527,
0.04327104985713959,
0.18097738921642303,
0.35714486241340637,
-0.304335355758667,
-0.29302966594696045,
0.17661690711975098,
0.06810978055000305,
0.0642351359128952,
0.3785887658596039,
-0.00011037534568458796,
-0.08496206253767014,
0.46104395389556885,
-0.20912490785121918,
-0.20325520634651184,
-0.22146128118038177,
-0.25276312232017517,
0.14620760083198547,
0.02747928537428379,
0.13467097282409668,
-0.014254571869969368,
-0.305462509393692,
-0.04304052144289017,
-0.3837215304374695,
0.17453135550022125,
0.30141279101371765,
0.21813246607780457,
-0.005605937913060188,
0.21694417297840118,
-0.05437111482024193,
0.29890286922454834,
-0.07590603828430176,
0.11550823599100113,
0.4474068880081177,
0.3648930788040161,
-0.13429412245750427,
-0.07006818801164627,
0.10392776131629944,
-0.3864500820636749,
0.1911262720823288,
0.2926178276538849,
-0.08303701877593994,
-0.0604410246014595,
-0.23786324262619019,
0.16847476363182068,
0.18411436676979065,
0.5313824415206909,
-0.24999463558197021,
-0.2918451130390167,
-0.05823642760515213,
-0.02472972869873047,
-0.37234771251678467,
0.20315176248550415,
0.15185245871543884,
-0.31589004397392273,
0.06615288555622101,
-0.08774640411138535,
0.2735731303691864,
0.0616832971572876,
0.3407682180404663,
0.1149863451719284,
-0.1322622448205948,
-0.036816518753767014,
0.018193509429693222,
0.45850667357444763,
-0.10447320342063904,
-0.15230955183506012,
0.054175566881895065,
0.05142951011657715,
0.4516109824180603,
-0.24731339514255524,
0.1928817629814148,
0.01013004407286644,
-0.3017526865005493,
0.21000036597251892,
-0.11830474436283112,
0.35964062809944153,
0.0533510185778141,
-0.25149813294410706,
0.326655775308609,
0.20271731913089752,
-0.0625203400850296,
-0.31680405139923096,
0.03447800502181053,
0.1898535043001175,
-0.05963919311761856,
0.1989010125398636,
-0.02063167095184326,
-0.16665445268154144,
-0.2857576310634613,
-0.199684277176857,
0.23360088467597961,
0.3549576997756958,
-0.6108478307723999,
-0.5549365282058716,
0.15032775700092316,
-0.2431057095527649,
0.14641176164150238,
0.10926825553178787,
0.3248218297958374,
0.23011942207813263,
0.309349000453949,
0.13355498015880585,
0.263350248336792,
-0.1644429713487625,
0.25085335969924927,
0.01673183962702751,
-0.08341699838638306,
-0.024395424872636795,
-0.06431275606155396,
0.3160926103591919,
-0.5023396611213684,
0.3328893482685089,
0.07621502876281738,
0.28565365076065063,
-0.3211345076560974,
-0.05366302281618118,
-0.0951378345489502,
-0.19009706377983093,
0.07428595423698425,
-0.08949527144432068,
0.23535360395908356,
-0.0029906928539276123,
0.3536822199821472,
-0.21792909502983093,
0.3155618906021118,
-0.4533764719963074,
-0.15346215665340424,
0.019315022975206375,
0.21353839337825775,
0.11035427451133728,
0.22703774273395538,
0.1587115377187729,
-0.11433777213096619,
0.13918115198612213,
-0.6915872693061829,
-0.19845089316368103,
-0.3624343276023865,
-0.2526106834411621,
-0.06089184805750847,
0.16125744581222534,
0.08332400023937225,
-0.2971940338611603,
0.13201040029525757,
0.16691118478775024,
-0.10864622890949249,
0.32748058438301086,
0.3221471607685089,
-0.17742933332920074,
-0.1316831409931183,
-0.37834420800209045,
-0.011322252452373505,
0.35007303953170776,
-0.41831424832344055,
-0.37559226155281067,
0.08337325602769852,
0.10495200753211975,
0.1219276413321495,
0.01775946468114853,
-0.012066751718521118,
0.15121212601661682,
-0.10382934659719467,
0.15346470475196838,
0.20735779404640198,
-0.025660531595349312,
0.25246042013168335,
-0.21282096207141876,
-0.3538457155227661,
0.1813177615404129,
0.2549491226673126,
-0.04195524379611015,
-0.06955347210168839,
0.08288731426000595,
0.12728391587734222,
0.28492793440818787,
0.04182683303952217,
-0.19913071393966675,
0.13324293494224548,
0.13474872708320618,
-0.06128692626953125,
0.2195938527584076,
-0.07657994329929352,
0.09849832952022552,
0.04070023447275162,
-0.15206235647201538,
0.009252257645130157,
0.17097413539886475,
-0.05283943563699722,
-0.2895798087120056,
-0.3100091218948364,
-0.3868606984615326,
0.10095380246639252,
0.10606785118579865,
0.40479588508605957,
-0.14311736822128296,
-0.2044955939054489,
-0.01877424493432045,
-0.1329593062400818,
0.35944879055023193,
-0.05341877043247223,
-0.28748708963394165,
0.13902944326400757,
-0.1279650628566742,
-0.13174061477184296,
0.31739744544029236,
0.25926098227500916,
0.27446702122688293,
0.140380397439003,
-0.37193045020103455,
0.28445467352867126,
0.12426308542490005,
0.38937556743621826,
-0.38119933009147644,
0.11065632104873657,
0.12440408021211624,
-0.09923452138900757,
0.28249967098236084,
0.36605116724967957,
0.4163641929626465,
-0.1431751847267151,
0.02298121154308319,
0.3458858132362366,
0.15941627323627472,
0.11495630443096161,
-0.006236191838979721,
-0.05685625225305557,
0.25167497992515564,
0.36967507004737854,
0.08303818851709366,
0.11978764832019806,
0.23405644297599792,
0.014215721748769283,
0.4933333396911621,
-0.08971595764160156,
-0.40727508068084717,
-0.23510059714317322,
0.1347896009683609,
0.011732194572687149,
-0.002873659133911133,
0.0710766613483429,
0.055447064340114594,
-0.05810260772705078,
0.07844371348619461,
-0.33108869194984436,
0.3565770983695984,
0.18479157984256744,
0.014992505311965942,
-0.1702381670475006,
-0.21835799515247345,
-0.16296762228012085,
0.03209001570940018,
0.304768443107605,
0.058424290269613266,
0.5285734534263611,
-0.024775279685854912,
0.008385373279452324,
-0.4000723958015442,
-0.27049246430397034,
0.003979476168751717,
0.2519024610519409,
-0.429099440574646,
-0.02050120383501053,
-0.1516111046075821,
0.07230634242296219,
-0.4052678942680359,
-0.501214325428009,
-0.13047826290130615,
-0.346069872379303,
0.22122712433338165,
0.6582697033882141,
-0.22441524267196655,
0.13700994849205017,
0.059918489307165146,
0.20863059163093567,
0.18812443315982819,
0.19637061655521393,
-0.1015646904706955,
0.06754350662231445,
-0.13760319352149963,
0.059657420963048935,
0.5302807092666626,
0.15875141322612762,
0.20484811067581177,
0.06966209411621094,
0.0095905102789402,
0.1087849959731102,
0.10930488258600235,
0.03901331499218941,
0.06548915803432465,
0.07749761641025543,
0.08606106787919998,
-0.11354449391365051,
0.23739351332187653,
-0.5247480273246765,
0.1653287410736084,
0.032559528946876526,
-0.06369134783744812,
0.33676448464393616,
0.10019905865192413,
0.06633609533309937,
-0.1866876631975174,
-0.4580583870410919,
-0.21661856770515442,
-0.5187015533447266,
-0.10061778128147125,
-0.16042278707027435,
0.16921564936637878,
0.07081250846385956,
0.020309437066316605,
0.25875192880630493,
0.15205425024032593,
0.560267984867096,
-0.19587641954421997,
0.034962061792612076,
0.18221621215343475,
-0.16816392540931702,
-0.24929825961589813,
-0.07906697690486908,
0.07315190136432648,
0.2784031629562378,
0.11478254944086075,
-0.13539141416549683,
-0.05352069064974785,
0.13951633870601654,
-0.4012981951236725,
-0.12006683647632599,
-0.23751689493656158,
-0.07573725283145905,
0.19805914163589478,
-0.04919207841157913,
-0.0886414647102356,
0.044410768896341324,
-0.2040511965751648,
-0.17529284954071045,
0.2444431483745575,
0.01721104606986046,
0.3472917973995209,
-0.3566562533378601,
0.5870956182479858,
0.1669521927833557,
0.09734340012073517,
0.14321407675743103,
-0.019824983552098274,
0.2692789137363434,
-0.21993505954742432,
-0.2715856730937958,
0.06294019520282745,
-0.05398412048816681,
-0.21649570763111115,
0.27110180258750916,
0.11644215881824493,
-0.28980547189712524,
-0.1348244547843933,
0.2615857720375061,
-0.14357686042785645,
-0.09160898625850677,
-0.020131243392825127,
0.034205324947834015,
0.03538881614804268,
-0.07838408648967743,
0.5020685791969299,
0.22272200882434845,
-0.2147061824798584,
-0.0938253104686737,
0.2177225947380066,
0.05520858243107796,
-0.11920724809169769,
0.18668080866336823,
-0.03160480037331581,
-0.03743550181388855,
0.20986926555633545,
0.12850598990917206,
0.6381375193595886,
-0.25213080644607544,
0.05642801523208618,
-0.1210940033197403,
0.013056805357336998,
0.19773204624652863,
0.2910407483577728,
0.2276030331850052,
0.347468763589859,
0.2610563337802887,
-0.01446647010743618,
-0.18804757297039032,
-0.36150214076042175,
0.0571628212928772,
0.018732130527496338,
-0.03524579852819443,
-0.006499528884887695,
-0.07636714726686478,
0.04576614871621132,
0.3997555077075958,
0.11166426539421082,
0.03660963475704193,
-0.28830018639564514,
-0.2844173014163971,
-0.454304039478302,
0.0714496523141861,
-0.12654542922973633,
0.40714433789253235,
-0.46114686131477356,
-0.07522790133953094,
0.2168559432029724,
-0.16339224576950073,
0.3763658404350281,
-0.12086057662963867,
0.5932883620262146,
0.1593848019838333,
0.3207898437976837,
0.1905243694782257,
-0.016515694558620453,
0.45957520604133606,
0.5064153671264648,
-0.01054728776216507,
0.04682166501879692,
0.2026759386062622,
-0.3746824562549591,
-0.021802105009555817,
0.3725692927837372,
-0.14646779000759125,
-0.31404367089271545,
-0.20492370426654816,
-0.2102670520544052,
-0.04106847941875458,
0.04737888649106026,
0.2732508182525635,
0.0658467635512352,
-0.1900949329137802,
-0.28010812401771545,
0.1668803095817566,
0.02589409425854683,
-0.22891688346862793,
0.34376683831214905,
-0.2667109966278076,
-0.1363770067691803,
0.20501163601875305,
-0.10467249900102615,
0.831502377986908,
0.16333100199699402,
0.06304041296243668,
0.364250510931015,
-0.28853344917297363,
-0.4272029995918274,
0.08571881055831909,
0.10752984881401062,
-0.35658326745033264,
-0.15885210037231445,
-0.05242495983839035,
-0.03999372571706772,
-0.04250294715166092,
0.1931026130914688,
-0.1041753813624382,
0.3739546835422516,
0.3055689334869385,
-0.25168198347091675,
-0.06539499014616013,
-0.037484683096408844,
-0.16903267800807953,
-0.10631059110164642,
-0.019683826714754105,
0.05854611098766327,
-0.1639423668384552,
0.3693901598453522,
0.022289004176855087,
-0.1963127702474594,
0.09753981232643127,
-0.4743947982788086,
-0.2941792607307434,
0.15916112065315247,
-0.27215105295181274,
0.17458485066890717,
-0.06053585186600685,
-0.10325875133275986,
-0.028518326580524445,
-0.09649181365966797,
-0.3370526432991028,
0.13316017389297485,
-0.25750061869621277,
-0.23753218352794647,
0.1257847547531128,
0.06675148755311966,
-0.06120190769433975,
0.12852683663368225,
0.22885073721408844,
0.017114143818616867,
-0.09774519503116608,
0.13592666387557983,
-0.07123734802007675,
-0.14401403069496155,
-0.06631075590848923,
-0.007883764803409576,
0.36457473039627075,
-0.02806626260280609,
-0.387755811214447,
-0.1928984820842743,
-0.10501550137996674,
-0.17926377058029175,
0.16735118627548218,
0.13723182678222656,
-0.22500136494636536,
0.09283492714166641,
0.043411701917648315,
-0.10607795417308807,
0.0489560067653656,
0.5442718267440796,
0.024799242615699768,
-0.41397327184677124,
0.4930139183998108,
-0.031954437494277954,
-0.3387773036956787,
-0.20490863919258118,
0.10323948413133621,
0.019492322579026222,
-0.5620840191841125,
-0.013400007970631123,
-0.02991141937673092,
-0.15078504383563995,
0.13299167156219482,
0.11614973843097687,
0.03586765006184578,
0.12821093201637268,
-0.14099858701229095,
-0.5076079368591309,
-0.3440180718898773,
0.09118612110614777,
0.08182717114686966,
0.3942595422267914,
0.02117549628019333,
-0.46123823523521423,
-0.020663419738411903,
-0.4130851626396179,
-0.3003000319004059,
0.21412909030914307,
-0.09421256184577942,
0.09535825997591019,
-0.052257560193538666,
0.10627637803554535,
-0.028661362826824188,
0.07691533863544464,
0.1625266969203949,
0.12472234666347504,
-0.14187604188919067,
-0.09238426387310028,
0.08951695263385773,
0.2204386293888092,
0.019751744344830513,
-0.3753351867198944,
-0.0500456839799881,
-0.12001514434814453,
-0.21765418350696564,
-0.15946106612682343,
0.07220558822154999,
0.19457265734672546,
-0.10927741229534149,
-0.05251501500606537,
-0.01244405284523964,
0.2012936770915985,
0.3658403754234314,
0.24191252887248993,
-0.11107386648654938,
-0.03726135194301605,
0.16223149001598358,
0.1252056509256363,
-0.19763095676898956,
-0.14476053416728973,
-0.026827195659279823,
0.11497420817613602,
-0.14197179675102234,
-0.09313266724348068,
0.3603018820285797,
-0.32700544595718384,
0.20476514101028442,
0.5185730457305908,
0.3009541928768158,
0.38692888617515564,
-0.20731015503406525,
0.004483511671423912,
0.16857585310935974,
0.20956121385097504,
-0.22895589470863342,
-0.03419234976172447,
-0.34090614318847656,
-0.13132505118846893,
-0.03116479516029358,
0.026154465973377228,
0.03972955420613289,
-0.3696536719799042,
0.16189701855182648,
0.00254841148853302,
0.3397213816642761,
0.032509781420230865,
0.057237643748521805,
0.3782612383365631,
-0.21809200942516327,
0.07691702991724014,
-0.2114741951227188,
-0.18524590134620667,
0.047394998371601105,
0.2880290746688843,
-0.58870530128479,
0.4851302206516266,
0.17615360021591187,
-0.1579228937625885,
0.12540583312511444,
-0.4981929659843445,
-0.11222034692764282,
0.40305984020233154,
0.010516226291656494,
0.22364071011543274,
0.1742524951696396,
0.3324972689151764,
-0.4453159272670746,
-0.11243429034948349,
-0.11564858257770538,
-0.05332106724381447,
-0.2360069751739502,
0.0564204640686512,
-0.011376464739441872,
-0.2786353528499603,
-0.21233981847763062,
0.023576002568006516,
-0.11706507205963135,
0.20845022797584534,
-0.14571993052959442,
-0.0716632604598999,
-0.09281951189041138,
-0.14286090433597565,
-0.11044063419103622,
0.2501644492149353,
0.039216749370098114,
-0.3226640224456787,
0.2185656875371933,
0.2214236855506897,
0.07028152793645859,
0.5237049460411072,
0.28308790922164917,
0.4648689925670624,
0.4636196792125702,
-0.13236767053604126,
-0.14081214368343353,
-0.1698145717382431,
0.014541806653141975,
0.07050628215074539,
0.14772137999534607,
0.1440293937921524,
0.4152223467826843,
0.4430978000164032,
0.12027384340763092,
-0.039414357393980026,
-0.03766823932528496,
0.2504693269729614,
-0.1314573436975479,
-0.11952506005764008,
0.20517292618751526,
-0.24369454383850098,
0.05096755921840668,
-0.19201098382472992,
-0.10455962270498276,
-0.4206346571445465,
-0.3122842311859131,
0.19639059901237488,
0.3235308825969696,
0.11882001906633377,
0.19972413778305054,
0.07191000878810883,
-0.000310409814119339,
0.09734341502189636,
0.3459545969963074,
-0.0826786682009697,
-0.3354732394218445,
0.008700862526893616,
-0.7803558707237244,
0.4033505320549011,
0.28063544631004333,
0.1605946123600006,
-0.09712868183851242,
-0.09627702832221985,
0.2143423706293106,
0.17000076174736023,
0.05763264745473862,
0.056353382766246796,
0.15832236409187317,
-0.06572051346302032,
-0.16873858869075775,
-0.3217656910419464,
0.1577012687921524,
-0.07172916829586029,
-0.07028047740459442,
-0.5920366644859314,
0.04414407163858414,
-0.1448364555835724,
0.07470870763063431,
-0.19394905865192413,
-0.09073978662490845,
-0.6025481224060059,
0.440952330827713,
-0.07045306265354156,
0.027925465255975723,
0.5803716778755188,
-0.21036875247955322,
-0.24160777032375336,
-0.24013841152191162,
-0.1287572979927063,
0.19374045729637146,
-0.020899802446365356,
-0.04648233577609062,
0.38583359122276306,
0.03244389593601227,
-0.03656427934765816,
-0.401336669921875,
0.2447579801082611,
-0.11216266453266144,
-0.012353277765214443,
-0.47376593947410583,
0.17823565006256104,
-0.2586615979671478,
0.1488875448703766,
-0.04092974588274956,
-0.30999261140823364,
0.1559247374534607,
0.17477348446846008,
-0.23643043637275696,
-0.3065199553966522,
0.6984711289405823,
0.09609677642583847,
-0.10957314074039459,
-0.20794807374477386,
0.2983524799346924,
0.1447426676750183,
0.1592939794063568,
-0.759312629699707,
0.2825165092945099,
0.19884192943572998,
0.03827900066971779,
-0.02932635135948658,
-0.14852939546108246,
-0.15207763016223907,
-0.11611662805080414,
-0.2042396515607834,
0.04475686699151993,
0.2829408347606659,
-0.2656159996986389,
0.25495994091033936,
-0.32821816205978394
] |
https://github.com/huggingface/datasets/issues/5487 | Incorrect filepath for dill module | Hi! The correct path is still `dill._dill.XXXX` in the latest release. What do you get when you run `python -c "import dill; print(dill.__version__)"` in your environment? | ### Describe the bug
I installed the `datasets` package and when I try to `import` it, I get the following error:
```
Traceback (most recent call last):
File "/var/folders/jt/zw5g74ln6tqfdzsl8tx378j00000gn/T/ipykernel_3805/3458380017.py", line 1, in <module>
import datasets
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module>
from .arrow_dataset import Dataset
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 66, in <module>
from .arrow_writer import ArrowWriter, OptimizedTypedSequence
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/arrow_writer.py", line 27, in <module>
from .features import Features, Image, Value
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/features/__init__.py", line 17, in <module>
from .audio import Audio
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/features/audio.py", line 12, in <module>
from ..download.streaming_download_manager import xopen
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/download/__init__.py", line 9, in <module>
from .download_manager import DownloadManager, DownloadMode
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/download/download_manager.py", line 36, in <module>
from ..utils.py_utils import NestedDataStructure, map_nested, size_str
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 602, in <module>
class Pickler(dill.Pickler):
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 605, in Pickler
dispatch = dill._dill.MetaCatchingDict(dill.Pickler.dispatch.copy())
AttributeError: module 'dill' has no attribute '_dill'
```
Looking at the github source code for dill, it appears that `datasets` has a bug or is not compatible with the latest `dill`. Specifically, rather than `dill._dill.XXXX` it should be `dill.dill._dill.XXXX`. But given the popularity of `datasets` I feel confused about me being the first person to have this issue, so it makes me wonder if I'm misdiagnosing the issue.
### Steps to reproduce the bug
Install `dill` and `datasets` packages and then `import datasets`
### Expected behavior
I expect `datasets` to import.
### Environment info
- `datasets` version: 2.9.0
- Platform: macOS-10.16-x86_64-i386-64bit
- Python version: 3.9.13
- PyArrow version: 11.0.0
- Pandas version: 1.4.4 | 26 | Incorrect filepath for dill module
### Describe the bug
I installed the `datasets` package and when I try to `import` it, I get the following error:
```
Traceback (most recent call last):
File "/var/folders/jt/zw5g74ln6tqfdzsl8tx378j00000gn/T/ipykernel_3805/3458380017.py", line 1, in <module>
import datasets
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module>
from .arrow_dataset import Dataset
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 66, in <module>
from .arrow_writer import ArrowWriter, OptimizedTypedSequence
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/arrow_writer.py", line 27, in <module>
from .features import Features, Image, Value
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/features/__init__.py", line 17, in <module>
from .audio import Audio
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/features/audio.py", line 12, in <module>
from ..download.streaming_download_manager import xopen
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/download/__init__.py", line 9, in <module>
from .download_manager import DownloadManager, DownloadMode
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/download/download_manager.py", line 36, in <module>
from ..utils.py_utils import NestedDataStructure, map_nested, size_str
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 602, in <module>
class Pickler(dill.Pickler):
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 605, in Pickler
dispatch = dill._dill.MetaCatchingDict(dill.Pickler.dispatch.copy())
AttributeError: module 'dill' has no attribute '_dill'
```
Looking at the github source code for dill, it appears that `datasets` has a bug or is not compatible with the latest `dill`. Specifically, rather than `dill._dill.XXXX` it should be `dill.dill._dill.XXXX`. But given the popularity of `datasets` I feel confused about me being the first person to have this issue, so it makes me wonder if I'm misdiagnosing the issue.
### Steps to reproduce the bug
Install `dill` and `datasets` packages and then `import datasets`
### Expected behavior
I expect `datasets` to import.
### Environment info
- `datasets` version: 2.9.0
- Platform: macOS-10.16-x86_64-i386-64bit
- Python version: 3.9.13
- PyArrow version: 11.0.0
- Pandas version: 1.4.4
Hi! The correct path is still `dill._dill.XXXX` in the latest release. What do you get when you run `python -c "import dill; print(dill.__version__)"` in your environment? | [
-0.2769613564014435,
0.15094640851020813,
-0.10528561472892761,
0.3617427945137024,
0.1401957869529724,
0.010012879967689514,
0.4118015766143799,
0.19778048992156982,
-0.27519461512565613,
-0.2218220978975296,
-0.20238515734672546,
0.3167159855365753,
-0.3055160939693451,
-0.1868254691362381,
0.2882830798625946,
0.14931391179561615,
0.014746449887752533,
0.05478404462337494,
-0.4568239748477936,
-0.25448763370513916,
-0.2408495545387268,
0.17448607087135315,
-0.08812730014324188,
0.033067259937524796,
-0.245591938495636,
0.0523466095328331,
-0.07826235890388489,
0.3572179973125458,
-0.3561529517173767,
-0.5247761607170105,
0.13501222431659698,
0.018061116337776184,
0.4147813320159912,
0.5708177089691162,
-0.0001153880002675578,
0.08843380212783813,
0.17518916726112366,
-0.1414048820734024,
-0.4932999014854431,
-0.22929836809635162,
-0.07296933233737946,
-0.11493127048015594,
0.25392529368400574,
-0.2344495952129364,
0.20625081658363342,
-0.3550379276275635,
-0.13567861914634705,
-0.2701839208602905,
0.18568363785743713,
0.5231620073318481,
0.24089644849300385,
-0.08330292254686356,
0.2749316990375519,
0.067841537296772,
0.21703165769577026,
0.16517768800258636,
0.11653096228837967,
0.5183122754096985,
-0.045610278844833374,
0.08198279142379761,
0.13364124298095703,
0.1384005844593048,
-0.2124888002872467,
-0.03147679939866066,
0.5968560576438904,
-0.11905262619256973,
0.08772477507591248,
-0.04308632016181946,
0.08255895972251892,
0.09025569260120392,
0.6775444149971008,
-0.409673273563385,
-0.29934749007225037,
0.010494977235794067,
0.08927799016237259,
-0.20904278755187988,
0.29331234097480774,
-0.003450612537562847,
0.0666918009519577,
0.25882792472839355,
0.3676387667655945,
-0.3984561860561371,
-0.12847557663917542,
0.21803559362888336,
-0.27790722250938416,
0.2585434913635254,
-0.010620604269206524,
-0.009696818888187408,
-0.008990403264760971,
-0.21584342420101166,
0.5138744115829468,
-0.07314623892307281,
0.07722700387239456,
0.16387036442756653,
-0.11871510744094849,
0.2864995300769806,
0.17200690507888794,
-0.3627731502056122,
-0.14518104493618011,
-0.1428729146718979,
-0.000620952807366848,
-0.2531523108482361,
-0.21706147491931915,
0.18504738807678223,
0.2259688824415207,
-0.04517579823732376,
0.14422190189361572,
0.2421547919511795,
0.17417632043361664,
0.17238040268421173,
0.17567691206932068,
0.15309369564056396,
-0.31455424427986145,
-0.2797127664089203,
-0.07411470264196396,
0.0570397675037384,
0.2251526564359665,
-0.08282063156366348,
-0.41316354274749756,
0.12245345115661621,
-0.03723767027258873,
-0.1351868361234665,
0.1063648909330368,
0.23077094554901123,
-0.15064328908920288,
0.3059784471988678,
0.18081039190292358,
0.03208620846271515,
-0.0561554878950119,
0.3300568461418152,
-0.12105187773704529,
0.2784012258052826,
-0.07155194878578186,
-0.12487273663282394,
0.06226378306746483,
-0.021332360804080963,
0.24423831701278687,
-0.009378072805702686,
-0.19627363979816437,
-0.060652878135442734,
-0.044402532279491425,
-0.02063705027103424,
-0.005600236356258392,
0.17170752584934235,
-0.04066945239901543,
0.33206745982170105,
-0.013919688761234283,
-0.24904508888721466,
-0.2244744598865509,
0.25512760877609253,
-0.4341782331466675,
-0.2038404941558838,
-0.310813307762146,
0.24939195811748505,
-0.11758245527744293,
-0.0007130838930606842,
-0.1476217806339264,
-0.36788636445999146,
-0.17696532607078552,
-0.27703210711479187,
-0.1977478563785553,
-0.34166115522384644,
0.1496340036392212,
-0.23709112405776978,
0.27546828985214233,
0.39687395095825195,
-0.6089017391204834,
-0.03408437222242355,
-0.5003616213798523,
0.010249478742480278,
0.03268258273601532,
-0.02532579004764557,
-0.2470165342092514,
0.2396378219127655,
-0.2552063465118408,
-0.04519812762737274,
0.5282572507858276,
-0.6255922317504883,
-0.324076384305954,
-0.04166260361671448,
-0.1666393280029297,
-0.18906165659427643,
-0.045137129724025726,
-0.03509816154837608,
0.21595580875873566,
0.10156098753213882,
0.34537675976753235,
0.3314021825790405,
0.33436456322669983,
-0.022030025720596313,
-0.17913956940174103,
-0.2814503610134125,
0.059632740914821625,
0.23568762838840485,
-0.018470074981451035,
-0.23917195200920105,
0.11810183525085449,
-0.032237038016319275,
0.4003123641014099,
0.020786285400390625,
-0.15341158211231232,
0.5029639601707458,
0.2394540160894394,
0.08240155875682831,
0.047678977251052856,
-0.17202022671699524,
-0.6249172687530518,
-0.04069003835320473,
-0.03183992952108383,
-0.18431246280670166,
-0.505327582359314,
-0.1389666497707367,
-0.29143431782722473,
0.106507308781147,
-0.18736857175827026,
-0.09563905000686646,
0.17525841295719147,
0.23664407432079315,
-0.18291939795017242,
0.19503331184387207,
-0.2687174379825592,
-0.007818354293704033,
0.15463578701019287,
0.18903273344039917,
-0.1548318862915039,
0.2175544649362564,
-0.31576287746429443,
0.04034261405467987,
0.21039026975631714,
0.32848015427589417,
0.18557801842689514,
-0.20184655487537384,
-0.04278618097305298,
0.28091809153556824,
0.15948601067066193,
0.06862635165452957,
0.09620900452136993,
-0.10349814593791962,
0.18017525970935822,
-0.4422140419483185,
0.08399415016174316,
0.14558380842208862,
0.20832960307598114,
-0.02166115865111351,
0.07146437466144562,
-0.05604588985443115,
-0.2511817216873169,
0.14767515659332275,
0.19448751211166382,
0.15575453639030457,
0.28567245602607727,
0.09911054372787476,
0.013406945392489433,
-0.24102437496185303,
0.09661444276571274,
0.37140971422195435,
0.3415938913822174,
0.18534335494041443,
0.1290033459663391,
0.04111788794398308,
0.40307745337486267,
0.11371099948883057,
0.020906291902065277,
0.049892231822013855,
-0.37650588154792786,
0.08985895663499832,
0.2129472941160202,
0.419609397649765,
0.21176952123641968,
0.15518894791603088,
0.014725953340530396,
0.10523483157157898,
0.08532848209142685,
-0.07781475782394409,
0.26806384325027466,
-0.05323269963264465,
0.08607131242752075,
0.24235573410987854,
-0.044316235929727554,
0.006728389300405979,
-0.07056789845228195,
-0.36004090309143066,
-0.005789425224065781,
0.5259449481964111,
-0.33601152896881104,
0.041528381407260895,
-0.569640040397644,
-0.10397787392139435,
-0.44414564967155457,
-0.3171612024307251,
-0.2951538562774658,
-0.18585728108882904,
-0.18193863332271576,
-0.03959145024418831,
-0.18243487179279327,
0.07708463072776794,
-0.10846270620822906,
-0.13133342564105988,
-0.05415772646665573,
-0.4543383717536926,
-0.0014367848634719849,
-0.09542461484670639,
-0.16440510749816895,
0.052689384669065475,
0.4423617124557495,
0.3658410906791687,
0.27298593521118164,
-0.34799689054489136,
0.005974071100354195,
-0.1253732442855835,
-0.031212665140628815,
-0.008239984512329102,
0.3479877710342407,
0.056091584265232086,
0.27634453773498535,
0.1386100798845291,
0.09977151453495026,
-0.37354421615600586,
0.1695050150156021,
0.11594972014427185,
-0.025167789310216904,
-0.1250501275062561,
0.03690934181213379,
-0.13936132192611694,
-0.1630636602640152,
-0.38922616839408875,
-0.43863341212272644,
-0.4829597473144531,
-0.17739541828632355,
0.07507027685642242,
0.3655913472175598,
0.17163942754268646,
0.20897383987903595,
0.2922876179218292,
0.04306630790233612,
0.21220763027668,
0.22460179030895233,
0.011880885809659958,
0.3893257975578308,
-0.2756960093975067,
-0.3148689568042755,
0.16537144780158997,
-0.10916613042354584,
0.17438116669654846,
0.13840904831886292,
-0.42383909225463867,
-0.09599050134420395,
-0.01814163662493229,
0.2265034019947052,
-0.07275836169719696,
0.15906694531440735,
0.20842084288597107,
0.30083179473876953,
0.08430019021034241,
-0.11088274419307709,
-0.2166585624217987,
0.07152154296636581,
-0.026953574270009995,
0.1673475205898285,
-0.02155347540974617,
0.2876620590686798,
-0.20630748569965363,
0.6331831812858582,
0.10363863408565521,
-0.1602020412683487,
0.2856438159942627,
-0.10770488530397415,
0.49822601675987244,
-0.09114985913038254,
-0.3196216821670532,
0.009279200807213783,
0.17611703276634216,
0.06875021010637283,
0.14133253693580627,
-0.12090343981981277,
-0.10155200213193893,
-0.26098427176475525,
0.20330698788166046,
-0.28436410427093506,
-0.21626466512680054,
0.1596456617116928,
-0.30053916573524475,
0.05842360854148865,
0.020792022347450256,
-0.022247903048992157,
-0.13041134178638458,
0.05395574867725372,
0.1825629323720932,
0.34770315885543823,
0.031166329979896545,
0.25210684537887573,
-0.2750769555568695,
-0.10340466350317001,
-0.09675844758749008,
0.16281914710998535,
0.1300278753042221,
0.41383495926856995,
0.053842004388570786,
0.1319560706615448,
0.04090430215001106,
-0.053696610033512115,
0.39453840255737305,
-0.052475444972515106,
-0.18044190108776093,
0.2228674590587616,
0.3700033128261566,
-0.7515665292739868,
-0.05954684317111969,
-0.00046257302165031433,
0.25689589977264404,
0.28420159220695496,
-0.05428914725780487,
-0.4455950856208801,
-0.030076662078499794,
0.3680993914604187,
0.2810713052749634,
-0.06530231982469559,
-0.15425467491149902,
-0.2069275677204132,
-0.4045593738555908,
-0.1675783395767212,
-0.4718332886695862,
0.08909986168146133,
0.30030035972595215,
0.21374760568141937,
0.03326617553830147,
0.0594148114323616,
-0.012200433760881424,
0.01275072991847992,
-0.009922643192112446,
0.5848726630210876,
-0.0876447930932045,
0.14746302366256714,
0.20820128917694092,
0.5807342529296875,
0.5497838258743286,
0.5620353817939758,
-0.4488517940044403,
-0.24214035272598267,
-0.05564310401678085,
-0.2595219910144806,
0.08999380469322205,
0.045556969940662384,
-0.15826717019081116,
-0.04022695869207382,
-0.08982069045305252,
-0.1984967440366745,
0.19907180964946747,
0.21353936195373535,
0.328925222158432,
0.15892167389392853,
-0.01695222593843937,
-0.5565778017044067,
0.13888734579086304,
0.04541127756237984,
-0.014659978449344635,
0.5292743444442749,
0.09554177522659302,
-0.2936505675315857,
0.17226867377758026,
-0.18047228455543518,
0.7495894432067871,
0.2098604440689087,
0.11998073756694794,
0.35997334122657776,
-0.31690990924835205,
0.10035192221403122,
-0.05429333820939064,
-0.0977412760257721,
-0.36463847756385803,
0.030156508088111877,
0.057906925678253174,
-0.30162355303764343,
0.07656398415565491,
-0.07449476420879364,
0.0034738481044769287,
0.18557363748550415,
-0.40582627058029175,
-0.029671449214220047,
-0.175838440656662,
0.20880430936813354,
0.017661530524492264,
0.033993400633335114,
0.03285059705376625,
0.11276859045028687,
-0.07061342895030975,
0.1245613694190979,
-0.2354244887828827,
0.0765458270907402,
-0.3120984733104706,
-0.28525596857070923,
-0.19445636868476868,
-0.0825946182012558,
-0.11677277833223343,
0.3057859539985657,
-0.05761170759797096,
-0.30827561020851135,
-0.005533294752240181,
0.43214860558509827,
-0.02396935224533081,
0.11229851841926575,
-0.1062682718038559,
0.10867446660995483,
-0.43384671211242676,
0.08482324331998825,
0.1828416883945465,
0.02714492380619049,
0.2124510258436203,
-0.19661608338356018,
-0.13843019306659698,
0.07251192629337311,
0.05931845307350159,
-0.12112204730510712,
0.16658127307891846,
0.2439708709716797,
0.2389916032552719,
0.0036658132448792458,
-0.27265384793281555,
-0.0051269978284835815,
-0.026886265724897385,
-0.04448218643665314,
0.17057998478412628,
0.15033257007598877,
-0.006884932518005371,
0.2974034547805786,
-0.29095324873924255,
-0.07765321433544159,
0.014736785553395748,
0.3450012803077698,
-0.01237247884273529,
0.006561093032360077,
0.49853867292404175,
0.010722573846578598,
-0.3269122242927551,
-0.17628219723701477,
0.12411905080080032,
-0.09197854995727539,
-0.22198134660720825,
-0.036558058112859726,
-0.16782082617282867,
-0.10570000112056732,
-0.18863214552402496,
-0.4122649133205414,
0.14839237928390503,
0.11435659229755402,
-0.2438085526227951,
-0.3272925615310669,
-0.06491051614284515,
0.18396174907684326,
-0.12363554537296295,
-0.030613664537668228,
-0.13529272377490997,
0.14128157496452332,
0.08896699547767639,
-0.32071977853775024,
-0.2957530915737152,
0.38387197256088257,
0.04416018724441528,
0.047783784568309784,
-0.04446405917406082,
-0.05548034608364105,
0.022002635523676872,
-0.23741699755191803,
0.1522606760263443,
-0.07373399287462234,
0.023662755265831947,
-0.1967996060848236,
-0.2612542510032654,
0.08677531778812408,
-0.010960731655359268,
-0.14514847099781036,
0.14219118654727936,
-0.4102967381477356,
-0.20546723902225494,
0.055953528732061386,
-0.2494509071111679,
0.1029038056731224,
0.14737170934677124,
0.08997504413127899,
0.09702956676483154,
-0.20363643765449524,
-0.041160471737384796,
0.4532097280025482,
-0.15154868364334106,
0.3274773955345154,
0.03667675703763962,
0.38249874114990234,
-0.07287408411502838,
-0.10585446655750275,
-0.3209514617919922,
-0.042630814015865326,
-0.33216434717178345,
0.08810102939605713,
0.32776975631713867,
-0.13847850263118744,
0.050572145730257034,
0.15107716619968414,
0.28310665488243103,
0.6362085342407227,
-0.40401560068130493,
0.05872230976819992,
0.42122775316238403,
0.21493615210056305,
-0.23011475801467896,
-0.21735356748104095,
0.2856085002422333,
-0.06806813925504684,
0.020758498460054398,
0.013970807194709778,
-0.19279778003692627,
-0.2495023012161255,
0.051306240260601044,
0.14017009735107422,
0.15131880342960358,
0.21440227329730988,
0.24747098982334137,
0.46110042929649353,
-0.062790147960186,
0.142804816365242,
0.1695573329925537,
0.16989801824092865,
0.2019723355770111,
0.7694743275642395,
-0.2693654000759125,
0.04552743211388588,
0.07335393130779266,
-0.15104742348194122,
0.23061123490333557,
-0.44380369782447815,
0.07459712028503418,
0.03732875734567642,
0.17278003692626953,
0.035121217370033264,
0.19786113500595093,
0.3019651472568512,
-0.04612383991479874,
-0.001986320596188307,
0.13388586044311523,
0.04594632238149643,
-0.19270893931388855,
0.18199263513088226,
0.025317903608083725,
-0.14682786166667938,
0.04674098640680313,
0.026898521929979324,
-0.10909475386142731,
-0.2646369934082031,
-0.010542742908000946,
0.16690567135810852,
-0.21510453522205353,
-0.49089133739471436,
0.18352553248405457,
0.04324612021446228,
-0.0286155566573143,
-0.1637028455734253,
0.13650448620319366,
0.29922062158584595,
0.09832092374563217,
-0.11039626598358154,
0.24813544750213623,
0.3080308437347412,
0.5296769738197327,
0.25446563959121704,
-0.17346301674842834,
0.07621346414089203,
-0.09461160004138947,
-0.321832537651062,
-0.11483334004878998,
-0.13874128460884094,
0.18832451105117798,
0.43296298384666443,
0.2295549511909485,
-0.23870913684368134,
-0.16643710434436798,
0.16023476421833038,
0.15410718321800232,
-0.008520256727933884,
0.16185161471366882,
-0.26062101125717163,
-0.16912569105625153,
-0.25697028636932373,
0.15675236284732819,
-0.43953925371170044,
0.01283652801066637,
0.4906741976737976,
0.1295614391565323,
0.13312315940856934,
-0.28577810525894165,
0.05867942422628403,
-0.13340292870998383,
0.4096422493457794,
0.4653957188129425,
0.4635312855243683,
-0.060424186289310455,
-0.17961525917053223,
-0.9071447253227234,
0.268257737159729,
-0.02259490266442299,
-0.1326591670513153,
0.06103063002228737,
0.03619811683893204,
-0.10493610054254532,
0.06605127453804016,
0.39116156101226807,
0.2487116903066635,
0.13934338092803955,
0.09750212728977203,
-0.44417962431907654,
-0.27087491750717163,
-0.09473563730716705,
0.11129151284694672,
-0.08261778950691223,
-0.4625152051448822,
0.28332972526550293,
-0.17230704426765442,
0.04417632520198822,
-0.22653216123580933,
-0.053089577704668045,
-0.03912143036723137,
0.20685763657093048,
0.3561681807041168,
0.06800182908773422,
0.3527803122997284,
0.014647148549556732,
-0.23552660644054413,
-0.31625840067863464,
-0.13401830196380615,
-0.18259532749652863,
0.2041882872581482,
0.15604403614997864,
0.1720164567232132,
-0.3202742040157318,
-0.3478304147720337,
-0.34935638308525085,
0.5035495758056641,
-0.03407909348607063,
0.12424427270889282,
-0.28711172938346863,
0.15728913247585297,
0.01061633974313736,
0.18789957463741302,
0.11061631888151169,
0.041659384965896606,
0.045248374342918396,
0.053252704441547394,
-0.24386803805828094,
-0.3949972689151764,
0.47593197226524353,
0.09748194366693497,
-0.13433951139450073,
-0.02563822641968727,
0.35348016023635864,
0.09666343778371811,
-0.019612396135926247,
-0.3890353739261627,
-0.010366074740886688,
0.34223321080207825,
-0.09281620383262634,
-0.10641425848007202,
0.0976351946592331,
-0.0877896398305893,
0.23050574958324432,
-0.03445496782660484,
0.13931642472743988,
0.09539790451526642,
-0.27102532982826233,
0.04856446012854576,
-0.22038786113262177
] |
https://github.com/huggingface/datasets/issues/5487 | Incorrect filepath for dill module | `0.3.6` I feel like that's bad news, because it's probably not the issue.
My mistake, about the wrong path guess. I think I didn't notice that the first `dill` in the path isn't supposed to be included in the path specification in python.
<img width="146" alt="Screen Shot 2023-01-31 at 12 58 32 PM" src="https://user-images.githubusercontent.com/35349273/215844209-74af6a8f-9bff-4c75-9495-44c658c8e9f7.png">
| ### Describe the bug
I installed the `datasets` package and when I try to `import` it, I get the following error:
```
Traceback (most recent call last):
File "/var/folders/jt/zw5g74ln6tqfdzsl8tx378j00000gn/T/ipykernel_3805/3458380017.py", line 1, in <module>
import datasets
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module>
from .arrow_dataset import Dataset
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 66, in <module>
from .arrow_writer import ArrowWriter, OptimizedTypedSequence
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/arrow_writer.py", line 27, in <module>
from .features import Features, Image, Value
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/features/__init__.py", line 17, in <module>
from .audio import Audio
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/features/audio.py", line 12, in <module>
from ..download.streaming_download_manager import xopen
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/download/__init__.py", line 9, in <module>
from .download_manager import DownloadManager, DownloadMode
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/download/download_manager.py", line 36, in <module>
from ..utils.py_utils import NestedDataStructure, map_nested, size_str
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 602, in <module>
class Pickler(dill.Pickler):
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 605, in Pickler
dispatch = dill._dill.MetaCatchingDict(dill.Pickler.dispatch.copy())
AttributeError: module 'dill' has no attribute '_dill'
```
Looking at the github source code for dill, it appears that `datasets` has a bug or is not compatible with the latest `dill`. Specifically, rather than `dill._dill.XXXX` it should be `dill.dill._dill.XXXX`. But given the popularity of `datasets` I feel confused about me being the first person to have this issue, so it makes me wonder if I'm misdiagnosing the issue.
### Steps to reproduce the bug
Install `dill` and `datasets` packages and then `import datasets`
### Expected behavior
I expect `datasets` to import.
### Environment info
- `datasets` version: 2.9.0
- Platform: macOS-10.16-x86_64-i386-64bit
- Python version: 3.9.13
- PyArrow version: 11.0.0
- Pandas version: 1.4.4 | 54 | Incorrect filepath for dill module
### Describe the bug
I installed the `datasets` package and when I try to `import` it, I get the following error:
```
Traceback (most recent call last):
File "/var/folders/jt/zw5g74ln6tqfdzsl8tx378j00000gn/T/ipykernel_3805/3458380017.py", line 1, in <module>
import datasets
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module>
from .arrow_dataset import Dataset
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 66, in <module>
from .arrow_writer import ArrowWriter, OptimizedTypedSequence
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/arrow_writer.py", line 27, in <module>
from .features import Features, Image, Value
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/features/__init__.py", line 17, in <module>
from .audio import Audio
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/features/audio.py", line 12, in <module>
from ..download.streaming_download_manager import xopen
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/download/__init__.py", line 9, in <module>
from .download_manager import DownloadManager, DownloadMode
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/download/download_manager.py", line 36, in <module>
from ..utils.py_utils import NestedDataStructure, map_nested, size_str
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 602, in <module>
class Pickler(dill.Pickler):
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 605, in Pickler
dispatch = dill._dill.MetaCatchingDict(dill.Pickler.dispatch.copy())
AttributeError: module 'dill' has no attribute '_dill'
```
Looking at the github source code for dill, it appears that `datasets` has a bug or is not compatible with the latest `dill`. Specifically, rather than `dill._dill.XXXX` it should be `dill.dill._dill.XXXX`. But given the popularity of `datasets` I feel confused about me being the first person to have this issue, so it makes me wonder if I'm misdiagnosing the issue.
### Steps to reproduce the bug
Install `dill` and `datasets` packages and then `import datasets`
### Expected behavior
I expect `datasets` to import.
### Environment info
- `datasets` version: 2.9.0
- Platform: macOS-10.16-x86_64-i386-64bit
- Python version: 3.9.13
- PyArrow version: 11.0.0
- Pandas version: 1.4.4
`0.3.6` I feel like that's bad news, because it's probably not the issue.
My mistake, about the wrong path guess. I think I didn't notice that the first `dill` in the path isn't supposed to be included in the path specification in python.
<img width="146" alt="Screen Shot 2023-01-31 at 12 58 32 PM" src="https://user-images.githubusercontent.com/35349273/215844209-74af6a8f-9bff-4c75-9495-44c658c8e9f7.png">
| [
-0.2769613564014435,
0.15094640851020813,
-0.10528561472892761,
0.3617427945137024,
0.1401957869529724,
0.010012879967689514,
0.4118015766143799,
0.19778048992156982,
-0.27519461512565613,
-0.2218220978975296,
-0.20238515734672546,
0.3167159855365753,
-0.3055160939693451,
-0.1868254691362381,
0.2882830798625946,
0.14931391179561615,
0.014746449887752533,
0.05478404462337494,
-0.4568239748477936,
-0.25448763370513916,
-0.2408495545387268,
0.17448607087135315,
-0.08812730014324188,
0.033067259937524796,
-0.245591938495636,
0.0523466095328331,
-0.07826235890388489,
0.3572179973125458,
-0.3561529517173767,
-0.5247761607170105,
0.13501222431659698,
0.018061116337776184,
0.4147813320159912,
0.5708177089691162,
-0.0001153880002675578,
0.08843380212783813,
0.17518916726112366,
-0.1414048820734024,
-0.4932999014854431,
-0.22929836809635162,
-0.07296933233737946,
-0.11493127048015594,
0.25392529368400574,
-0.2344495952129364,
0.20625081658363342,
-0.3550379276275635,
-0.13567861914634705,
-0.2701839208602905,
0.18568363785743713,
0.5231620073318481,
0.24089644849300385,
-0.08330292254686356,
0.2749316990375519,
0.067841537296772,
0.21703165769577026,
0.16517768800258636,
0.11653096228837967,
0.5183122754096985,
-0.045610278844833374,
0.08198279142379761,
0.13364124298095703,
0.1384005844593048,
-0.2124888002872467,
-0.03147679939866066,
0.5968560576438904,
-0.11905262619256973,
0.08772477507591248,
-0.04308632016181946,
0.08255895972251892,
0.09025569260120392,
0.6775444149971008,
-0.409673273563385,
-0.29934749007225037,
0.010494977235794067,
0.08927799016237259,
-0.20904278755187988,
0.29331234097480774,
-0.003450612537562847,
0.0666918009519577,
0.25882792472839355,
0.3676387667655945,
-0.3984561860561371,
-0.12847557663917542,
0.21803559362888336,
-0.27790722250938416,
0.2585434913635254,
-0.010620604269206524,
-0.009696818888187408,
-0.008990403264760971,
-0.21584342420101166,
0.5138744115829468,
-0.07314623892307281,
0.07722700387239456,
0.16387036442756653,
-0.11871510744094849,
0.2864995300769806,
0.17200690507888794,
-0.3627731502056122,
-0.14518104493618011,
-0.1428729146718979,
-0.000620952807366848,
-0.2531523108482361,
-0.21706147491931915,
0.18504738807678223,
0.2259688824415207,
-0.04517579823732376,
0.14422190189361572,
0.2421547919511795,
0.17417632043361664,
0.17238040268421173,
0.17567691206932068,
0.15309369564056396,
-0.31455424427986145,
-0.2797127664089203,
-0.07411470264196396,
0.0570397675037384,
0.2251526564359665,
-0.08282063156366348,
-0.41316354274749756,
0.12245345115661621,
-0.03723767027258873,
-0.1351868361234665,
0.1063648909330368,
0.23077094554901123,
-0.15064328908920288,
0.3059784471988678,
0.18081039190292358,
0.03208620846271515,
-0.0561554878950119,
0.3300568461418152,
-0.12105187773704529,
0.2784012258052826,
-0.07155194878578186,
-0.12487273663282394,
0.06226378306746483,
-0.021332360804080963,
0.24423831701278687,
-0.009378072805702686,
-0.19627363979816437,
-0.060652878135442734,
-0.044402532279491425,
-0.02063705027103424,
-0.005600236356258392,
0.17170752584934235,
-0.04066945239901543,
0.33206745982170105,
-0.013919688761234283,
-0.24904508888721466,
-0.2244744598865509,
0.25512760877609253,
-0.4341782331466675,
-0.2038404941558838,
-0.310813307762146,
0.24939195811748505,
-0.11758245527744293,
-0.0007130838930606842,
-0.1476217806339264,
-0.36788636445999146,
-0.17696532607078552,
-0.27703210711479187,
-0.1977478563785553,
-0.34166115522384644,
0.1496340036392212,
-0.23709112405776978,
0.27546828985214233,
0.39687395095825195,
-0.6089017391204834,
-0.03408437222242355,
-0.5003616213798523,
0.010249478742480278,
0.03268258273601532,
-0.02532579004764557,
-0.2470165342092514,
0.2396378219127655,
-0.2552063465118408,
-0.04519812762737274,
0.5282572507858276,
-0.6255922317504883,
-0.324076384305954,
-0.04166260361671448,
-0.1666393280029297,
-0.18906165659427643,
-0.045137129724025726,
-0.03509816154837608,
0.21595580875873566,
0.10156098753213882,
0.34537675976753235,
0.3314021825790405,
0.33436456322669983,
-0.022030025720596313,
-0.17913956940174103,
-0.2814503610134125,
0.059632740914821625,
0.23568762838840485,
-0.018470074981451035,
-0.23917195200920105,
0.11810183525085449,
-0.032237038016319275,
0.4003123641014099,
0.020786285400390625,
-0.15341158211231232,
0.5029639601707458,
0.2394540160894394,
0.08240155875682831,
0.047678977251052856,
-0.17202022671699524,
-0.6249172687530518,
-0.04069003835320473,
-0.03183992952108383,
-0.18431246280670166,
-0.505327582359314,
-0.1389666497707367,
-0.29143431782722473,
0.106507308781147,
-0.18736857175827026,
-0.09563905000686646,
0.17525841295719147,
0.23664407432079315,
-0.18291939795017242,
0.19503331184387207,
-0.2687174379825592,
-0.007818354293704033,
0.15463578701019287,
0.18903273344039917,
-0.1548318862915039,
0.2175544649362564,
-0.31576287746429443,
0.04034261405467987,
0.21039026975631714,
0.32848015427589417,
0.18557801842689514,
-0.20184655487537384,
-0.04278618097305298,
0.28091809153556824,
0.15948601067066193,
0.06862635165452957,
0.09620900452136993,
-0.10349814593791962,
0.18017525970935822,
-0.4422140419483185,
0.08399415016174316,
0.14558380842208862,
0.20832960307598114,
-0.02166115865111351,
0.07146437466144562,
-0.05604588985443115,
-0.2511817216873169,
0.14767515659332275,
0.19448751211166382,
0.15575453639030457,
0.28567245602607727,
0.09911054372787476,
0.013406945392489433,
-0.24102437496185303,
0.09661444276571274,
0.37140971422195435,
0.3415938913822174,
0.18534335494041443,
0.1290033459663391,
0.04111788794398308,
0.40307745337486267,
0.11371099948883057,
0.020906291902065277,
0.049892231822013855,
-0.37650588154792786,
0.08985895663499832,
0.2129472941160202,
0.419609397649765,
0.21176952123641968,
0.15518894791603088,
0.014725953340530396,
0.10523483157157898,
0.08532848209142685,
-0.07781475782394409,
0.26806384325027466,
-0.05323269963264465,
0.08607131242752075,
0.24235573410987854,
-0.044316235929727554,
0.006728389300405979,
-0.07056789845228195,
-0.36004090309143066,
-0.005789425224065781,
0.5259449481964111,
-0.33601152896881104,
0.041528381407260895,
-0.569640040397644,
-0.10397787392139435,
-0.44414564967155457,
-0.3171612024307251,
-0.2951538562774658,
-0.18585728108882904,
-0.18193863332271576,
-0.03959145024418831,
-0.18243487179279327,
0.07708463072776794,
-0.10846270620822906,
-0.13133342564105988,
-0.05415772646665573,
-0.4543383717536926,
-0.0014367848634719849,
-0.09542461484670639,
-0.16440510749816895,
0.052689384669065475,
0.4423617124557495,
0.3658410906791687,
0.27298593521118164,
-0.34799689054489136,
0.005974071100354195,
-0.1253732442855835,
-0.031212665140628815,
-0.008239984512329102,
0.3479877710342407,
0.056091584265232086,
0.27634453773498535,
0.1386100798845291,
0.09977151453495026,
-0.37354421615600586,
0.1695050150156021,
0.11594972014427185,
-0.025167789310216904,
-0.1250501275062561,
0.03690934181213379,
-0.13936132192611694,
-0.1630636602640152,
-0.38922616839408875,
-0.43863341212272644,
-0.4829597473144531,
-0.17739541828632355,
0.07507027685642242,
0.3655913472175598,
0.17163942754268646,
0.20897383987903595,
0.2922876179218292,
0.04306630790233612,
0.21220763027668,
0.22460179030895233,
0.011880885809659958,
0.3893257975578308,
-0.2756960093975067,
-0.3148689568042755,
0.16537144780158997,
-0.10916613042354584,
0.17438116669654846,
0.13840904831886292,
-0.42383909225463867,
-0.09599050134420395,
-0.01814163662493229,
0.2265034019947052,
-0.07275836169719696,
0.15906694531440735,
0.20842084288597107,
0.30083179473876953,
0.08430019021034241,
-0.11088274419307709,
-0.2166585624217987,
0.07152154296636581,
-0.026953574270009995,
0.1673475205898285,
-0.02155347540974617,
0.2876620590686798,
-0.20630748569965363,
0.6331831812858582,
0.10363863408565521,
-0.1602020412683487,
0.2856438159942627,
-0.10770488530397415,
0.49822601675987244,
-0.09114985913038254,
-0.3196216821670532,
0.009279200807213783,
0.17611703276634216,
0.06875021010637283,
0.14133253693580627,
-0.12090343981981277,
-0.10155200213193893,
-0.26098427176475525,
0.20330698788166046,
-0.28436410427093506,
-0.21626466512680054,
0.1596456617116928,
-0.30053916573524475,
0.05842360854148865,
0.020792022347450256,
-0.022247903048992157,
-0.13041134178638458,
0.05395574867725372,
0.1825629323720932,
0.34770315885543823,
0.031166329979896545,
0.25210684537887573,
-0.2750769555568695,
-0.10340466350317001,
-0.09675844758749008,
0.16281914710998535,
0.1300278753042221,
0.41383495926856995,
0.053842004388570786,
0.1319560706615448,
0.04090430215001106,
-0.053696610033512115,
0.39453840255737305,
-0.052475444972515106,
-0.18044190108776093,
0.2228674590587616,
0.3700033128261566,
-0.7515665292739868,
-0.05954684317111969,
-0.00046257302165031433,
0.25689589977264404,
0.28420159220695496,
-0.05428914725780487,
-0.4455950856208801,
-0.030076662078499794,
0.3680993914604187,
0.2810713052749634,
-0.06530231982469559,
-0.15425467491149902,
-0.2069275677204132,
-0.4045593738555908,
-0.1675783395767212,
-0.4718332886695862,
0.08909986168146133,
0.30030035972595215,
0.21374760568141937,
0.03326617553830147,
0.0594148114323616,
-0.012200433760881424,
0.01275072991847992,
-0.009922643192112446,
0.5848726630210876,
-0.0876447930932045,
0.14746302366256714,
0.20820128917694092,
0.5807342529296875,
0.5497838258743286,
0.5620353817939758,
-0.4488517940044403,
-0.24214035272598267,
-0.05564310401678085,
-0.2595219910144806,
0.08999380469322205,
0.045556969940662384,
-0.15826717019081116,
-0.04022695869207382,
-0.08982069045305252,
-0.1984967440366745,
0.19907180964946747,
0.21353936195373535,
0.328925222158432,
0.15892167389392853,
-0.01695222593843937,
-0.5565778017044067,
0.13888734579086304,
0.04541127756237984,
-0.014659978449344635,
0.5292743444442749,
0.09554177522659302,
-0.2936505675315857,
0.17226867377758026,
-0.18047228455543518,
0.7495894432067871,
0.2098604440689087,
0.11998073756694794,
0.35997334122657776,
-0.31690990924835205,
0.10035192221403122,
-0.05429333820939064,
-0.0977412760257721,
-0.36463847756385803,
0.030156508088111877,
0.057906925678253174,
-0.30162355303764343,
0.07656398415565491,
-0.07449476420879364,
0.0034738481044769287,
0.18557363748550415,
-0.40582627058029175,
-0.029671449214220047,
-0.175838440656662,
0.20880430936813354,
0.017661530524492264,
0.033993400633335114,
0.03285059705376625,
0.11276859045028687,
-0.07061342895030975,
0.1245613694190979,
-0.2354244887828827,
0.0765458270907402,
-0.3120984733104706,
-0.28525596857070923,
-0.19445636868476868,
-0.0825946182012558,
-0.11677277833223343,
0.3057859539985657,
-0.05761170759797096,
-0.30827561020851135,
-0.005533294752240181,
0.43214860558509827,
-0.02396935224533081,
0.11229851841926575,
-0.1062682718038559,
0.10867446660995483,
-0.43384671211242676,
0.08482324331998825,
0.1828416883945465,
0.02714492380619049,
0.2124510258436203,
-0.19661608338356018,
-0.13843019306659698,
0.07251192629337311,
0.05931845307350159,
-0.12112204730510712,
0.16658127307891846,
0.2439708709716797,
0.2389916032552719,
0.0036658132448792458,
-0.27265384793281555,
-0.0051269978284835815,
-0.026886265724897385,
-0.04448218643665314,
0.17057998478412628,
0.15033257007598877,
-0.006884932518005371,
0.2974034547805786,
-0.29095324873924255,
-0.07765321433544159,
0.014736785553395748,
0.3450012803077698,
-0.01237247884273529,
0.006561093032360077,
0.49853867292404175,
0.010722573846578598,
-0.3269122242927551,
-0.17628219723701477,
0.12411905080080032,
-0.09197854995727539,
-0.22198134660720825,
-0.036558058112859726,
-0.16782082617282867,
-0.10570000112056732,
-0.18863214552402496,
-0.4122649133205414,
0.14839237928390503,
0.11435659229755402,
-0.2438085526227951,
-0.3272925615310669,
-0.06491051614284515,
0.18396174907684326,
-0.12363554537296295,
-0.030613664537668228,
-0.13529272377490997,
0.14128157496452332,
0.08896699547767639,
-0.32071977853775024,
-0.2957530915737152,
0.38387197256088257,
0.04416018724441528,
0.047783784568309784,
-0.04446405917406082,
-0.05548034608364105,
0.022002635523676872,
-0.23741699755191803,
0.1522606760263443,
-0.07373399287462234,
0.023662755265831947,
-0.1967996060848236,
-0.2612542510032654,
0.08677531778812408,
-0.010960731655359268,
-0.14514847099781036,
0.14219118654727936,
-0.4102967381477356,
-0.20546723902225494,
0.055953528732061386,
-0.2494509071111679,
0.1029038056731224,
0.14737170934677124,
0.08997504413127899,
0.09702956676483154,
-0.20363643765449524,
-0.041160471737384796,
0.4532097280025482,
-0.15154868364334106,
0.3274773955345154,
0.03667675703763962,
0.38249874114990234,
-0.07287408411502838,
-0.10585446655750275,
-0.3209514617919922,
-0.042630814015865326,
-0.33216434717178345,
0.08810102939605713,
0.32776975631713867,
-0.13847850263118744,
0.050572145730257034,
0.15107716619968414,
0.28310665488243103,
0.6362085342407227,
-0.40401560068130493,
0.05872230976819992,
0.42122775316238403,
0.21493615210056305,
-0.23011475801467896,
-0.21735356748104095,
0.2856085002422333,
-0.06806813925504684,
0.020758498460054398,
0.013970807194709778,
-0.19279778003692627,
-0.2495023012161255,
0.051306240260601044,
0.14017009735107422,
0.15131880342960358,
0.21440227329730988,
0.24747098982334137,
0.46110042929649353,
-0.062790147960186,
0.142804816365242,
0.1695573329925537,
0.16989801824092865,
0.2019723355770111,
0.7694743275642395,
-0.2693654000759125,
0.04552743211388588,
0.07335393130779266,
-0.15104742348194122,
0.23061123490333557,
-0.44380369782447815,
0.07459712028503418,
0.03732875734567642,
0.17278003692626953,
0.035121217370033264,
0.19786113500595093,
0.3019651472568512,
-0.04612383991479874,
-0.001986320596188307,
0.13388586044311523,
0.04594632238149643,
-0.19270893931388855,
0.18199263513088226,
0.025317903608083725,
-0.14682786166667938,
0.04674098640680313,
0.026898521929979324,
-0.10909475386142731,
-0.2646369934082031,
-0.010542742908000946,
0.16690567135810852,
-0.21510453522205353,
-0.49089133739471436,
0.18352553248405457,
0.04324612021446228,
-0.0286155566573143,
-0.1637028455734253,
0.13650448620319366,
0.29922062158584595,
0.09832092374563217,
-0.11039626598358154,
0.24813544750213623,
0.3080308437347412,
0.5296769738197327,
0.25446563959121704,
-0.17346301674842834,
0.07621346414089203,
-0.09461160004138947,
-0.321832537651062,
-0.11483334004878998,
-0.13874128460884094,
0.18832451105117798,
0.43296298384666443,
0.2295549511909485,
-0.23870913684368134,
-0.16643710434436798,
0.16023476421833038,
0.15410718321800232,
-0.008520256727933884,
0.16185161471366882,
-0.26062101125717163,
-0.16912569105625153,
-0.25697028636932373,
0.15675236284732819,
-0.43953925371170044,
0.01283652801066637,
0.4906741976737976,
0.1295614391565323,
0.13312315940856934,
-0.28577810525894165,
0.05867942422628403,
-0.13340292870998383,
0.4096422493457794,
0.4653957188129425,
0.4635312855243683,
-0.060424186289310455,
-0.17961525917053223,
-0.9071447253227234,
0.268257737159729,
-0.02259490266442299,
-0.1326591670513153,
0.06103063002228737,
0.03619811683893204,
-0.10493610054254532,
0.06605127453804016,
0.39116156101226807,
0.2487116903066635,
0.13934338092803955,
0.09750212728977203,
-0.44417962431907654,
-0.27087491750717163,
-0.09473563730716705,
0.11129151284694672,
-0.08261778950691223,
-0.4625152051448822,
0.28332972526550293,
-0.17230704426765442,
0.04417632520198822,
-0.22653216123580933,
-0.053089577704668045,
-0.03912143036723137,
0.20685763657093048,
0.3561681807041168,
0.06800182908773422,
0.3527803122997284,
0.014647148549556732,
-0.23552660644054413,
-0.31625840067863464,
-0.13401830196380615,
-0.18259532749652863,
0.2041882872581482,
0.15604403614997864,
0.1720164567232132,
-0.3202742040157318,
-0.3478304147720337,
-0.34935638308525085,
0.5035495758056641,
-0.03407909348607063,
0.12424427270889282,
-0.28711172938346863,
0.15728913247585297,
0.01061633974313736,
0.18789957463741302,
0.11061631888151169,
0.041659384965896606,
0.045248374342918396,
0.053252704441547394,
-0.24386803805828094,
-0.3949972689151764,
0.47593197226524353,
0.09748194366693497,
-0.13433951139450073,
-0.02563822641968727,
0.35348016023635864,
0.09666343778371811,
-0.019612396135926247,
-0.3890353739261627,
-0.010366074740886688,
0.34223321080207825,
-0.09281620383262634,
-0.10641425848007202,
0.0976351946592331,
-0.0877896398305893,
0.23050574958324432,
-0.03445496782660484,
0.13931642472743988,
0.09539790451526642,
-0.27102532982826233,
0.04856446012854576,
-0.22038786113262177
] |
https://github.com/huggingface/datasets/issues/5487 | Incorrect filepath for dill module | Hi, @avivbrokman, this issue you report appeared only with old versions of dill. See:
- #288
Are you sure you are in the right Python environment?
- Please note that Jupyter (where I guess you get the error) may have multiple execution backends (IPython kernels) that might be different from the Python environment your are using to get the dill version
- Have you run `import dill; print(dill.__version__)` in the same Jupyter/IPython that you were using when you got the error while executing `import datasets`? | ### Describe the bug
I installed the `datasets` package and when I try to `import` it, I get the following error:
```
Traceback (most recent call last):
File "/var/folders/jt/zw5g74ln6tqfdzsl8tx378j00000gn/T/ipykernel_3805/3458380017.py", line 1, in <module>
import datasets
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module>
from .arrow_dataset import Dataset
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 66, in <module>
from .arrow_writer import ArrowWriter, OptimizedTypedSequence
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/arrow_writer.py", line 27, in <module>
from .features import Features, Image, Value
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/features/__init__.py", line 17, in <module>
from .audio import Audio
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/features/audio.py", line 12, in <module>
from ..download.streaming_download_manager import xopen
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/download/__init__.py", line 9, in <module>
from .download_manager import DownloadManager, DownloadMode
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/download/download_manager.py", line 36, in <module>
from ..utils.py_utils import NestedDataStructure, map_nested, size_str
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 602, in <module>
class Pickler(dill.Pickler):
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 605, in Pickler
dispatch = dill._dill.MetaCatchingDict(dill.Pickler.dispatch.copy())
AttributeError: module 'dill' has no attribute '_dill'
```
Looking at the github source code for dill, it appears that `datasets` has a bug or is not compatible with the latest `dill`. Specifically, rather than `dill._dill.XXXX` it should be `dill.dill._dill.XXXX`. But given the popularity of `datasets` I feel confused about me being the first person to have this issue, so it makes me wonder if I'm misdiagnosing the issue.
### Steps to reproduce the bug
Install `dill` and `datasets` packages and then `import datasets`
### Expected behavior
I expect `datasets` to import.
### Environment info
- `datasets` version: 2.9.0
- Platform: macOS-10.16-x86_64-i386-64bit
- Python version: 3.9.13
- PyArrow version: 11.0.0
- Pandas version: 1.4.4 | 85 | Incorrect filepath for dill module
### Describe the bug
I installed the `datasets` package and when I try to `import` it, I get the following error:
```
Traceback (most recent call last):
File "/var/folders/jt/zw5g74ln6tqfdzsl8tx378j00000gn/T/ipykernel_3805/3458380017.py", line 1, in <module>
import datasets
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module>
from .arrow_dataset import Dataset
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 66, in <module>
from .arrow_writer import ArrowWriter, OptimizedTypedSequence
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/arrow_writer.py", line 27, in <module>
from .features import Features, Image, Value
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/features/__init__.py", line 17, in <module>
from .audio import Audio
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/features/audio.py", line 12, in <module>
from ..download.streaming_download_manager import xopen
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/download/__init__.py", line 9, in <module>
from .download_manager import DownloadManager, DownloadMode
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/download/download_manager.py", line 36, in <module>
from ..utils.py_utils import NestedDataStructure, map_nested, size_str
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 602, in <module>
class Pickler(dill.Pickler):
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 605, in Pickler
dispatch = dill._dill.MetaCatchingDict(dill.Pickler.dispatch.copy())
AttributeError: module 'dill' has no attribute '_dill'
```
Looking at the github source code for dill, it appears that `datasets` has a bug or is not compatible with the latest `dill`. Specifically, rather than `dill._dill.XXXX` it should be `dill.dill._dill.XXXX`. But given the popularity of `datasets` I feel confused about me being the first person to have this issue, so it makes me wonder if I'm misdiagnosing the issue.
### Steps to reproduce the bug
Install `dill` and `datasets` packages and then `import datasets`
### Expected behavior
I expect `datasets` to import.
### Environment info
- `datasets` version: 2.9.0
- Platform: macOS-10.16-x86_64-i386-64bit
- Python version: 3.9.13
- PyArrow version: 11.0.0
- Pandas version: 1.4.4
Hi, @avivbrokman, this issue you report appeared only with old versions of dill. See:
- #288
Are you sure you are in the right Python environment?
- Please note that Jupyter (where I guess you get the error) may have multiple execution backends (IPython kernels) that might be different from the Python environment your are using to get the dill version
- Have you run `import dill; print(dill.__version__)` in the same Jupyter/IPython that you were using when you got the error while executing `import datasets`? | [
-0.2769613564014435,
0.15094640851020813,
-0.10528561472892761,
0.3617427945137024,
0.1401957869529724,
0.010012879967689514,
0.4118015766143799,
0.19778048992156982,
-0.27519461512565613,
-0.2218220978975296,
-0.20238515734672546,
0.3167159855365753,
-0.3055160939693451,
-0.1868254691362381,
0.2882830798625946,
0.14931391179561615,
0.014746449887752533,
0.05478404462337494,
-0.4568239748477936,
-0.25448763370513916,
-0.2408495545387268,
0.17448607087135315,
-0.08812730014324188,
0.033067259937524796,
-0.245591938495636,
0.0523466095328331,
-0.07826235890388489,
0.3572179973125458,
-0.3561529517173767,
-0.5247761607170105,
0.13501222431659698,
0.018061116337776184,
0.4147813320159912,
0.5708177089691162,
-0.0001153880002675578,
0.08843380212783813,
0.17518916726112366,
-0.1414048820734024,
-0.4932999014854431,
-0.22929836809635162,
-0.07296933233737946,
-0.11493127048015594,
0.25392529368400574,
-0.2344495952129364,
0.20625081658363342,
-0.3550379276275635,
-0.13567861914634705,
-0.2701839208602905,
0.18568363785743713,
0.5231620073318481,
0.24089644849300385,
-0.08330292254686356,
0.2749316990375519,
0.067841537296772,
0.21703165769577026,
0.16517768800258636,
0.11653096228837967,
0.5183122754096985,
-0.045610278844833374,
0.08198279142379761,
0.13364124298095703,
0.1384005844593048,
-0.2124888002872467,
-0.03147679939866066,
0.5968560576438904,
-0.11905262619256973,
0.08772477507591248,
-0.04308632016181946,
0.08255895972251892,
0.09025569260120392,
0.6775444149971008,
-0.409673273563385,
-0.29934749007225037,
0.010494977235794067,
0.08927799016237259,
-0.20904278755187988,
0.29331234097480774,
-0.003450612537562847,
0.0666918009519577,
0.25882792472839355,
0.3676387667655945,
-0.3984561860561371,
-0.12847557663917542,
0.21803559362888336,
-0.27790722250938416,
0.2585434913635254,
-0.010620604269206524,
-0.009696818888187408,
-0.008990403264760971,
-0.21584342420101166,
0.5138744115829468,
-0.07314623892307281,
0.07722700387239456,
0.16387036442756653,
-0.11871510744094849,
0.2864995300769806,
0.17200690507888794,
-0.3627731502056122,
-0.14518104493618011,
-0.1428729146718979,
-0.000620952807366848,
-0.2531523108482361,
-0.21706147491931915,
0.18504738807678223,
0.2259688824415207,
-0.04517579823732376,
0.14422190189361572,
0.2421547919511795,
0.17417632043361664,
0.17238040268421173,
0.17567691206932068,
0.15309369564056396,
-0.31455424427986145,
-0.2797127664089203,
-0.07411470264196396,
0.0570397675037384,
0.2251526564359665,
-0.08282063156366348,
-0.41316354274749756,
0.12245345115661621,
-0.03723767027258873,
-0.1351868361234665,
0.1063648909330368,
0.23077094554901123,
-0.15064328908920288,
0.3059784471988678,
0.18081039190292358,
0.03208620846271515,
-0.0561554878950119,
0.3300568461418152,
-0.12105187773704529,
0.2784012258052826,
-0.07155194878578186,
-0.12487273663282394,
0.06226378306746483,
-0.021332360804080963,
0.24423831701278687,
-0.009378072805702686,
-0.19627363979816437,
-0.060652878135442734,
-0.044402532279491425,
-0.02063705027103424,
-0.005600236356258392,
0.17170752584934235,
-0.04066945239901543,
0.33206745982170105,
-0.013919688761234283,
-0.24904508888721466,
-0.2244744598865509,
0.25512760877609253,
-0.4341782331466675,
-0.2038404941558838,
-0.310813307762146,
0.24939195811748505,
-0.11758245527744293,
-0.0007130838930606842,
-0.1476217806339264,
-0.36788636445999146,
-0.17696532607078552,
-0.27703210711479187,
-0.1977478563785553,
-0.34166115522384644,
0.1496340036392212,
-0.23709112405776978,
0.27546828985214233,
0.39687395095825195,
-0.6089017391204834,
-0.03408437222242355,
-0.5003616213798523,
0.010249478742480278,
0.03268258273601532,
-0.02532579004764557,
-0.2470165342092514,
0.2396378219127655,
-0.2552063465118408,
-0.04519812762737274,
0.5282572507858276,
-0.6255922317504883,
-0.324076384305954,
-0.04166260361671448,
-0.1666393280029297,
-0.18906165659427643,
-0.045137129724025726,
-0.03509816154837608,
0.21595580875873566,
0.10156098753213882,
0.34537675976753235,
0.3314021825790405,
0.33436456322669983,
-0.022030025720596313,
-0.17913956940174103,
-0.2814503610134125,
0.059632740914821625,
0.23568762838840485,
-0.018470074981451035,
-0.23917195200920105,
0.11810183525085449,
-0.032237038016319275,
0.4003123641014099,
0.020786285400390625,
-0.15341158211231232,
0.5029639601707458,
0.2394540160894394,
0.08240155875682831,
0.047678977251052856,
-0.17202022671699524,
-0.6249172687530518,
-0.04069003835320473,
-0.03183992952108383,
-0.18431246280670166,
-0.505327582359314,
-0.1389666497707367,
-0.29143431782722473,
0.106507308781147,
-0.18736857175827026,
-0.09563905000686646,
0.17525841295719147,
0.23664407432079315,
-0.18291939795017242,
0.19503331184387207,
-0.2687174379825592,
-0.007818354293704033,
0.15463578701019287,
0.18903273344039917,
-0.1548318862915039,
0.2175544649362564,
-0.31576287746429443,
0.04034261405467987,
0.21039026975631714,
0.32848015427589417,
0.18557801842689514,
-0.20184655487537384,
-0.04278618097305298,
0.28091809153556824,
0.15948601067066193,
0.06862635165452957,
0.09620900452136993,
-0.10349814593791962,
0.18017525970935822,
-0.4422140419483185,
0.08399415016174316,
0.14558380842208862,
0.20832960307598114,
-0.02166115865111351,
0.07146437466144562,
-0.05604588985443115,
-0.2511817216873169,
0.14767515659332275,
0.19448751211166382,
0.15575453639030457,
0.28567245602607727,
0.09911054372787476,
0.013406945392489433,
-0.24102437496185303,
0.09661444276571274,
0.37140971422195435,
0.3415938913822174,
0.18534335494041443,
0.1290033459663391,
0.04111788794398308,
0.40307745337486267,
0.11371099948883057,
0.020906291902065277,
0.049892231822013855,
-0.37650588154792786,
0.08985895663499832,
0.2129472941160202,
0.419609397649765,
0.21176952123641968,
0.15518894791603088,
0.014725953340530396,
0.10523483157157898,
0.08532848209142685,
-0.07781475782394409,
0.26806384325027466,
-0.05323269963264465,
0.08607131242752075,
0.24235573410987854,
-0.044316235929727554,
0.006728389300405979,
-0.07056789845228195,
-0.36004090309143066,
-0.005789425224065781,
0.5259449481964111,
-0.33601152896881104,
0.041528381407260895,
-0.569640040397644,
-0.10397787392139435,
-0.44414564967155457,
-0.3171612024307251,
-0.2951538562774658,
-0.18585728108882904,
-0.18193863332271576,
-0.03959145024418831,
-0.18243487179279327,
0.07708463072776794,
-0.10846270620822906,
-0.13133342564105988,
-0.05415772646665573,
-0.4543383717536926,
-0.0014367848634719849,
-0.09542461484670639,
-0.16440510749816895,
0.052689384669065475,
0.4423617124557495,
0.3658410906791687,
0.27298593521118164,
-0.34799689054489136,
0.005974071100354195,
-0.1253732442855835,
-0.031212665140628815,
-0.008239984512329102,
0.3479877710342407,
0.056091584265232086,
0.27634453773498535,
0.1386100798845291,
0.09977151453495026,
-0.37354421615600586,
0.1695050150156021,
0.11594972014427185,
-0.025167789310216904,
-0.1250501275062561,
0.03690934181213379,
-0.13936132192611694,
-0.1630636602640152,
-0.38922616839408875,
-0.43863341212272644,
-0.4829597473144531,
-0.17739541828632355,
0.07507027685642242,
0.3655913472175598,
0.17163942754268646,
0.20897383987903595,
0.2922876179218292,
0.04306630790233612,
0.21220763027668,
0.22460179030895233,
0.011880885809659958,
0.3893257975578308,
-0.2756960093975067,
-0.3148689568042755,
0.16537144780158997,
-0.10916613042354584,
0.17438116669654846,
0.13840904831886292,
-0.42383909225463867,
-0.09599050134420395,
-0.01814163662493229,
0.2265034019947052,
-0.07275836169719696,
0.15906694531440735,
0.20842084288597107,
0.30083179473876953,
0.08430019021034241,
-0.11088274419307709,
-0.2166585624217987,
0.07152154296636581,
-0.026953574270009995,
0.1673475205898285,
-0.02155347540974617,
0.2876620590686798,
-0.20630748569965363,
0.6331831812858582,
0.10363863408565521,
-0.1602020412683487,
0.2856438159942627,
-0.10770488530397415,
0.49822601675987244,
-0.09114985913038254,
-0.3196216821670532,
0.009279200807213783,
0.17611703276634216,
0.06875021010637283,
0.14133253693580627,
-0.12090343981981277,
-0.10155200213193893,
-0.26098427176475525,
0.20330698788166046,
-0.28436410427093506,
-0.21626466512680054,
0.1596456617116928,
-0.30053916573524475,
0.05842360854148865,
0.020792022347450256,
-0.022247903048992157,
-0.13041134178638458,
0.05395574867725372,
0.1825629323720932,
0.34770315885543823,
0.031166329979896545,
0.25210684537887573,
-0.2750769555568695,
-0.10340466350317001,
-0.09675844758749008,
0.16281914710998535,
0.1300278753042221,
0.41383495926856995,
0.053842004388570786,
0.1319560706615448,
0.04090430215001106,
-0.053696610033512115,
0.39453840255737305,
-0.052475444972515106,
-0.18044190108776093,
0.2228674590587616,
0.3700033128261566,
-0.7515665292739868,
-0.05954684317111969,
-0.00046257302165031433,
0.25689589977264404,
0.28420159220695496,
-0.05428914725780487,
-0.4455950856208801,
-0.030076662078499794,
0.3680993914604187,
0.2810713052749634,
-0.06530231982469559,
-0.15425467491149902,
-0.2069275677204132,
-0.4045593738555908,
-0.1675783395767212,
-0.4718332886695862,
0.08909986168146133,
0.30030035972595215,
0.21374760568141937,
0.03326617553830147,
0.0594148114323616,
-0.012200433760881424,
0.01275072991847992,
-0.009922643192112446,
0.5848726630210876,
-0.0876447930932045,
0.14746302366256714,
0.20820128917694092,
0.5807342529296875,
0.5497838258743286,
0.5620353817939758,
-0.4488517940044403,
-0.24214035272598267,
-0.05564310401678085,
-0.2595219910144806,
0.08999380469322205,
0.045556969940662384,
-0.15826717019081116,
-0.04022695869207382,
-0.08982069045305252,
-0.1984967440366745,
0.19907180964946747,
0.21353936195373535,
0.328925222158432,
0.15892167389392853,
-0.01695222593843937,
-0.5565778017044067,
0.13888734579086304,
0.04541127756237984,
-0.014659978449344635,
0.5292743444442749,
0.09554177522659302,
-0.2936505675315857,
0.17226867377758026,
-0.18047228455543518,
0.7495894432067871,
0.2098604440689087,
0.11998073756694794,
0.35997334122657776,
-0.31690990924835205,
0.10035192221403122,
-0.05429333820939064,
-0.0977412760257721,
-0.36463847756385803,
0.030156508088111877,
0.057906925678253174,
-0.30162355303764343,
0.07656398415565491,
-0.07449476420879364,
0.0034738481044769287,
0.18557363748550415,
-0.40582627058029175,
-0.029671449214220047,
-0.175838440656662,
0.20880430936813354,
0.017661530524492264,
0.033993400633335114,
0.03285059705376625,
0.11276859045028687,
-0.07061342895030975,
0.1245613694190979,
-0.2354244887828827,
0.0765458270907402,
-0.3120984733104706,
-0.28525596857070923,
-0.19445636868476868,
-0.0825946182012558,
-0.11677277833223343,
0.3057859539985657,
-0.05761170759797096,
-0.30827561020851135,
-0.005533294752240181,
0.43214860558509827,
-0.02396935224533081,
0.11229851841926575,
-0.1062682718038559,
0.10867446660995483,
-0.43384671211242676,
0.08482324331998825,
0.1828416883945465,
0.02714492380619049,
0.2124510258436203,
-0.19661608338356018,
-0.13843019306659698,
0.07251192629337311,
0.05931845307350159,
-0.12112204730510712,
0.16658127307891846,
0.2439708709716797,
0.2389916032552719,
0.0036658132448792458,
-0.27265384793281555,
-0.0051269978284835815,
-0.026886265724897385,
-0.04448218643665314,
0.17057998478412628,
0.15033257007598877,
-0.006884932518005371,
0.2974034547805786,
-0.29095324873924255,
-0.07765321433544159,
0.014736785553395748,
0.3450012803077698,
-0.01237247884273529,
0.006561093032360077,
0.49853867292404175,
0.010722573846578598,
-0.3269122242927551,
-0.17628219723701477,
0.12411905080080032,
-0.09197854995727539,
-0.22198134660720825,
-0.036558058112859726,
-0.16782082617282867,
-0.10570000112056732,
-0.18863214552402496,
-0.4122649133205414,
0.14839237928390503,
0.11435659229755402,
-0.2438085526227951,
-0.3272925615310669,
-0.06491051614284515,
0.18396174907684326,
-0.12363554537296295,
-0.030613664537668228,
-0.13529272377490997,
0.14128157496452332,
0.08896699547767639,
-0.32071977853775024,
-0.2957530915737152,
0.38387197256088257,
0.04416018724441528,
0.047783784568309784,
-0.04446405917406082,
-0.05548034608364105,
0.022002635523676872,
-0.23741699755191803,
0.1522606760263443,
-0.07373399287462234,
0.023662755265831947,
-0.1967996060848236,
-0.2612542510032654,
0.08677531778812408,
-0.010960731655359268,
-0.14514847099781036,
0.14219118654727936,
-0.4102967381477356,
-0.20546723902225494,
0.055953528732061386,
-0.2494509071111679,
0.1029038056731224,
0.14737170934677124,
0.08997504413127899,
0.09702956676483154,
-0.20363643765449524,
-0.041160471737384796,
0.4532097280025482,
-0.15154868364334106,
0.3274773955345154,
0.03667675703763962,
0.38249874114990234,
-0.07287408411502838,
-0.10585446655750275,
-0.3209514617919922,
-0.042630814015865326,
-0.33216434717178345,
0.08810102939605713,
0.32776975631713867,
-0.13847850263118744,
0.050572145730257034,
0.15107716619968414,
0.28310665488243103,
0.6362085342407227,
-0.40401560068130493,
0.05872230976819992,
0.42122775316238403,
0.21493615210056305,
-0.23011475801467896,
-0.21735356748104095,
0.2856085002422333,
-0.06806813925504684,
0.020758498460054398,
0.013970807194709778,
-0.19279778003692627,
-0.2495023012161255,
0.051306240260601044,
0.14017009735107422,
0.15131880342960358,
0.21440227329730988,
0.24747098982334137,
0.46110042929649353,
-0.062790147960186,
0.142804816365242,
0.1695573329925537,
0.16989801824092865,
0.2019723355770111,
0.7694743275642395,
-0.2693654000759125,
0.04552743211388588,
0.07335393130779266,
-0.15104742348194122,
0.23061123490333557,
-0.44380369782447815,
0.07459712028503418,
0.03732875734567642,
0.17278003692626953,
0.035121217370033264,
0.19786113500595093,
0.3019651472568512,
-0.04612383991479874,
-0.001986320596188307,
0.13388586044311523,
0.04594632238149643,
-0.19270893931388855,
0.18199263513088226,
0.025317903608083725,
-0.14682786166667938,
0.04674098640680313,
0.026898521929979324,
-0.10909475386142731,
-0.2646369934082031,
-0.010542742908000946,
0.16690567135810852,
-0.21510453522205353,
-0.49089133739471436,
0.18352553248405457,
0.04324612021446228,
-0.0286155566573143,
-0.1637028455734253,
0.13650448620319366,
0.29922062158584595,
0.09832092374563217,
-0.11039626598358154,
0.24813544750213623,
0.3080308437347412,
0.5296769738197327,
0.25446563959121704,
-0.17346301674842834,
0.07621346414089203,
-0.09461160004138947,
-0.321832537651062,
-0.11483334004878998,
-0.13874128460884094,
0.18832451105117798,
0.43296298384666443,
0.2295549511909485,
-0.23870913684368134,
-0.16643710434436798,
0.16023476421833038,
0.15410718321800232,
-0.008520256727933884,
0.16185161471366882,
-0.26062101125717163,
-0.16912569105625153,
-0.25697028636932373,
0.15675236284732819,
-0.43953925371170044,
0.01283652801066637,
0.4906741976737976,
0.1295614391565323,
0.13312315940856934,
-0.28577810525894165,
0.05867942422628403,
-0.13340292870998383,
0.4096422493457794,
0.4653957188129425,
0.4635312855243683,
-0.060424186289310455,
-0.17961525917053223,
-0.9071447253227234,
0.268257737159729,
-0.02259490266442299,
-0.1326591670513153,
0.06103063002228737,
0.03619811683893204,
-0.10493610054254532,
0.06605127453804016,
0.39116156101226807,
0.2487116903066635,
0.13934338092803955,
0.09750212728977203,
-0.44417962431907654,
-0.27087491750717163,
-0.09473563730716705,
0.11129151284694672,
-0.08261778950691223,
-0.4625152051448822,
0.28332972526550293,
-0.17230704426765442,
0.04417632520198822,
-0.22653216123580933,
-0.053089577704668045,
-0.03912143036723137,
0.20685763657093048,
0.3561681807041168,
0.06800182908773422,
0.3527803122997284,
0.014647148549556732,
-0.23552660644054413,
-0.31625840067863464,
-0.13401830196380615,
-0.18259532749652863,
0.2041882872581482,
0.15604403614997864,
0.1720164567232132,
-0.3202742040157318,
-0.3478304147720337,
-0.34935638308525085,
0.5035495758056641,
-0.03407909348607063,
0.12424427270889282,
-0.28711172938346863,
0.15728913247585297,
0.01061633974313736,
0.18789957463741302,
0.11061631888151169,
0.041659384965896606,
0.045248374342918396,
0.053252704441547394,
-0.24386803805828094,
-0.3949972689151764,
0.47593197226524353,
0.09748194366693497,
-0.13433951139450073,
-0.02563822641968727,
0.35348016023635864,
0.09666343778371811,
-0.019612396135926247,
-0.3890353739261627,
-0.010366074740886688,
0.34223321080207825,
-0.09281620383262634,
-0.10641425848007202,
0.0976351946592331,
-0.0877896398305893,
0.23050574958324432,
-0.03445496782660484,
0.13931642472743988,
0.09539790451526642,
-0.27102532982826233,
0.04856446012854576,
-0.22038786113262177
] |
https://github.com/huggingface/datasets/issues/5487 | Incorrect filepath for dill module | I'm using spyder, and I am still getting `0.3.6` for `dill`, so unfortunately #288 isn't applicable, I think. However, I found something odd that I believe is a clue:
```
import inspect
import dill
inspect.getfile(dill)
>>> '/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/dill/__init__.py'
```
I checked out the directory, and there is no `dill` subdirectory within '/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/dill`, as there should be. Rather, `_dill.py` is in '/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/dill` itself.
If I run `pip install dill` or `pip install --upgrade dill`, I get the message `Requirement already satisfied: dill in ./opt/anaconda3/lib/python3.9/site-packages (0.3.6)`. If I run `conda upgrade dill`, I get the message `Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.` a couple of times, followed by
```
Solving environment: failed
Solving environment: /
Found conflicts! Looking for incompatible packages.
```
And then terminal proceeds to list conflicts between different packages I have.
This is all very strange to me because I recently uninstalled and reinstalled `anaconda`.
| ### Describe the bug
I installed the `datasets` package and when I try to `import` it, I get the following error:
```
Traceback (most recent call last):
File "/var/folders/jt/zw5g74ln6tqfdzsl8tx378j00000gn/T/ipykernel_3805/3458380017.py", line 1, in <module>
import datasets
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module>
from .arrow_dataset import Dataset
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 66, in <module>
from .arrow_writer import ArrowWriter, OptimizedTypedSequence
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/arrow_writer.py", line 27, in <module>
from .features import Features, Image, Value
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/features/__init__.py", line 17, in <module>
from .audio import Audio
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/features/audio.py", line 12, in <module>
from ..download.streaming_download_manager import xopen
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/download/__init__.py", line 9, in <module>
from .download_manager import DownloadManager, DownloadMode
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/download/download_manager.py", line 36, in <module>
from ..utils.py_utils import NestedDataStructure, map_nested, size_str
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 602, in <module>
class Pickler(dill.Pickler):
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 605, in Pickler
dispatch = dill._dill.MetaCatchingDict(dill.Pickler.dispatch.copy())
AttributeError: module 'dill' has no attribute '_dill'
```
Looking at the github source code for dill, it appears that `datasets` has a bug or is not compatible with the latest `dill`. Specifically, rather than `dill._dill.XXXX` it should be `dill.dill._dill.XXXX`. But given the popularity of `datasets` I feel confused about me being the first person to have this issue, so it makes me wonder if I'm misdiagnosing the issue.
### Steps to reproduce the bug
Install `dill` and `datasets` packages and then `import datasets`
### Expected behavior
I expect `datasets` to import.
### Environment info
- `datasets` version: 2.9.0
- Platform: macOS-10.16-x86_64-i386-64bit
- Python version: 3.9.13
- PyArrow version: 11.0.0
- Pandas version: 1.4.4 | 152 | Incorrect filepath for dill module
### Describe the bug
I installed the `datasets` package and when I try to `import` it, I get the following error:
```
Traceback (most recent call last):
File "/var/folders/jt/zw5g74ln6tqfdzsl8tx378j00000gn/T/ipykernel_3805/3458380017.py", line 1, in <module>
import datasets
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module>
from .arrow_dataset import Dataset
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 66, in <module>
from .arrow_writer import ArrowWriter, OptimizedTypedSequence
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/arrow_writer.py", line 27, in <module>
from .features import Features, Image, Value
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/features/__init__.py", line 17, in <module>
from .audio import Audio
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/features/audio.py", line 12, in <module>
from ..download.streaming_download_manager import xopen
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/download/__init__.py", line 9, in <module>
from .download_manager import DownloadManager, DownloadMode
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/download/download_manager.py", line 36, in <module>
from ..utils.py_utils import NestedDataStructure, map_nested, size_str
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 602, in <module>
class Pickler(dill.Pickler):
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 605, in Pickler
dispatch = dill._dill.MetaCatchingDict(dill.Pickler.dispatch.copy())
AttributeError: module 'dill' has no attribute '_dill'
```
Looking at the github source code for dill, it appears that `datasets` has a bug or is not compatible with the latest `dill`. Specifically, rather than `dill._dill.XXXX` it should be `dill.dill._dill.XXXX`. But given the popularity of `datasets` I feel confused about me being the first person to have this issue, so it makes me wonder if I'm misdiagnosing the issue.
### Steps to reproduce the bug
Install `dill` and `datasets` packages and then `import datasets`
### Expected behavior
I expect `datasets` to import.
### Environment info
- `datasets` version: 2.9.0
- Platform: macOS-10.16-x86_64-i386-64bit
- Python version: 3.9.13
- PyArrow version: 11.0.0
- Pandas version: 1.4.4
I'm using spyder, and I am still getting `0.3.6` for `dill`, so unfortunately #288 isn't applicable, I think. However, I found something odd that I believe is a clue:
```
import inspect
import dill
inspect.getfile(dill)
>>> '/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/dill/__init__.py'
```
I checked out the directory, and there is no `dill` subdirectory within '/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/dill`, as there should be. Rather, `_dill.py` is in '/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/dill` itself.
If I run `pip install dill` or `pip install --upgrade dill`, I get the message `Requirement already satisfied: dill in ./opt/anaconda3/lib/python3.9/site-packages (0.3.6)`. If I run `conda upgrade dill`, I get the message `Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.` a couple of times, followed by
```
Solving environment: failed
Solving environment: /
Found conflicts! Looking for incompatible packages.
```
And then terminal proceeds to list conflicts between different packages I have.
This is all very strange to me because I recently uninstalled and reinstalled `anaconda`.
| [
-0.2769613564014435,
0.15094640851020813,
-0.10528561472892761,
0.3617427945137024,
0.1401957869529724,
0.010012879967689514,
0.4118015766143799,
0.19778048992156982,
-0.27519461512565613,
-0.2218220978975296,
-0.20238515734672546,
0.3167159855365753,
-0.3055160939693451,
-0.1868254691362381,
0.2882830798625946,
0.14931391179561615,
0.014746449887752533,
0.05478404462337494,
-0.4568239748477936,
-0.25448763370513916,
-0.2408495545387268,
0.17448607087135315,
-0.08812730014324188,
0.033067259937524796,
-0.245591938495636,
0.0523466095328331,
-0.07826235890388489,
0.3572179973125458,
-0.3561529517173767,
-0.5247761607170105,
0.13501222431659698,
0.018061116337776184,
0.4147813320159912,
0.5708177089691162,
-0.0001153880002675578,
0.08843380212783813,
0.17518916726112366,
-0.1414048820734024,
-0.4932999014854431,
-0.22929836809635162,
-0.07296933233737946,
-0.11493127048015594,
0.25392529368400574,
-0.2344495952129364,
0.20625081658363342,
-0.3550379276275635,
-0.13567861914634705,
-0.2701839208602905,
0.18568363785743713,
0.5231620073318481,
0.24089644849300385,
-0.08330292254686356,
0.2749316990375519,
0.067841537296772,
0.21703165769577026,
0.16517768800258636,
0.11653096228837967,
0.5183122754096985,
-0.045610278844833374,
0.08198279142379761,
0.13364124298095703,
0.1384005844593048,
-0.2124888002872467,
-0.03147679939866066,
0.5968560576438904,
-0.11905262619256973,
0.08772477507591248,
-0.04308632016181946,
0.08255895972251892,
0.09025569260120392,
0.6775444149971008,
-0.409673273563385,
-0.29934749007225037,
0.010494977235794067,
0.08927799016237259,
-0.20904278755187988,
0.29331234097480774,
-0.003450612537562847,
0.0666918009519577,
0.25882792472839355,
0.3676387667655945,
-0.3984561860561371,
-0.12847557663917542,
0.21803559362888336,
-0.27790722250938416,
0.2585434913635254,
-0.010620604269206524,
-0.009696818888187408,
-0.008990403264760971,
-0.21584342420101166,
0.5138744115829468,
-0.07314623892307281,
0.07722700387239456,
0.16387036442756653,
-0.11871510744094849,
0.2864995300769806,
0.17200690507888794,
-0.3627731502056122,
-0.14518104493618011,
-0.1428729146718979,
-0.000620952807366848,
-0.2531523108482361,
-0.21706147491931915,
0.18504738807678223,
0.2259688824415207,
-0.04517579823732376,
0.14422190189361572,
0.2421547919511795,
0.17417632043361664,
0.17238040268421173,
0.17567691206932068,
0.15309369564056396,
-0.31455424427986145,
-0.2797127664089203,
-0.07411470264196396,
0.0570397675037384,
0.2251526564359665,
-0.08282063156366348,
-0.41316354274749756,
0.12245345115661621,
-0.03723767027258873,
-0.1351868361234665,
0.1063648909330368,
0.23077094554901123,
-0.15064328908920288,
0.3059784471988678,
0.18081039190292358,
0.03208620846271515,
-0.0561554878950119,
0.3300568461418152,
-0.12105187773704529,
0.2784012258052826,
-0.07155194878578186,
-0.12487273663282394,
0.06226378306746483,
-0.021332360804080963,
0.24423831701278687,
-0.009378072805702686,
-0.19627363979816437,
-0.060652878135442734,
-0.044402532279491425,
-0.02063705027103424,
-0.005600236356258392,
0.17170752584934235,
-0.04066945239901543,
0.33206745982170105,
-0.013919688761234283,
-0.24904508888721466,
-0.2244744598865509,
0.25512760877609253,
-0.4341782331466675,
-0.2038404941558838,
-0.310813307762146,
0.24939195811748505,
-0.11758245527744293,
-0.0007130838930606842,
-0.1476217806339264,
-0.36788636445999146,
-0.17696532607078552,
-0.27703210711479187,
-0.1977478563785553,
-0.34166115522384644,
0.1496340036392212,
-0.23709112405776978,
0.27546828985214233,
0.39687395095825195,
-0.6089017391204834,
-0.03408437222242355,
-0.5003616213798523,
0.010249478742480278,
0.03268258273601532,
-0.02532579004764557,
-0.2470165342092514,
0.2396378219127655,
-0.2552063465118408,
-0.04519812762737274,
0.5282572507858276,
-0.6255922317504883,
-0.324076384305954,
-0.04166260361671448,
-0.1666393280029297,
-0.18906165659427643,
-0.045137129724025726,
-0.03509816154837608,
0.21595580875873566,
0.10156098753213882,
0.34537675976753235,
0.3314021825790405,
0.33436456322669983,
-0.022030025720596313,
-0.17913956940174103,
-0.2814503610134125,
0.059632740914821625,
0.23568762838840485,
-0.018470074981451035,
-0.23917195200920105,
0.11810183525085449,
-0.032237038016319275,
0.4003123641014099,
0.020786285400390625,
-0.15341158211231232,
0.5029639601707458,
0.2394540160894394,
0.08240155875682831,
0.047678977251052856,
-0.17202022671699524,
-0.6249172687530518,
-0.04069003835320473,
-0.03183992952108383,
-0.18431246280670166,
-0.505327582359314,
-0.1389666497707367,
-0.29143431782722473,
0.106507308781147,
-0.18736857175827026,
-0.09563905000686646,
0.17525841295719147,
0.23664407432079315,
-0.18291939795017242,
0.19503331184387207,
-0.2687174379825592,
-0.007818354293704033,
0.15463578701019287,
0.18903273344039917,
-0.1548318862915039,
0.2175544649362564,
-0.31576287746429443,
0.04034261405467987,
0.21039026975631714,
0.32848015427589417,
0.18557801842689514,
-0.20184655487537384,
-0.04278618097305298,
0.28091809153556824,
0.15948601067066193,
0.06862635165452957,
0.09620900452136993,
-0.10349814593791962,
0.18017525970935822,
-0.4422140419483185,
0.08399415016174316,
0.14558380842208862,
0.20832960307598114,
-0.02166115865111351,
0.07146437466144562,
-0.05604588985443115,
-0.2511817216873169,
0.14767515659332275,
0.19448751211166382,
0.15575453639030457,
0.28567245602607727,
0.09911054372787476,
0.013406945392489433,
-0.24102437496185303,
0.09661444276571274,
0.37140971422195435,
0.3415938913822174,
0.18534335494041443,
0.1290033459663391,
0.04111788794398308,
0.40307745337486267,
0.11371099948883057,
0.020906291902065277,
0.049892231822013855,
-0.37650588154792786,
0.08985895663499832,
0.2129472941160202,
0.419609397649765,
0.21176952123641968,
0.15518894791603088,
0.014725953340530396,
0.10523483157157898,
0.08532848209142685,
-0.07781475782394409,
0.26806384325027466,
-0.05323269963264465,
0.08607131242752075,
0.24235573410987854,
-0.044316235929727554,
0.006728389300405979,
-0.07056789845228195,
-0.36004090309143066,
-0.005789425224065781,
0.5259449481964111,
-0.33601152896881104,
0.041528381407260895,
-0.569640040397644,
-0.10397787392139435,
-0.44414564967155457,
-0.3171612024307251,
-0.2951538562774658,
-0.18585728108882904,
-0.18193863332271576,
-0.03959145024418831,
-0.18243487179279327,
0.07708463072776794,
-0.10846270620822906,
-0.13133342564105988,
-0.05415772646665573,
-0.4543383717536926,
-0.0014367848634719849,
-0.09542461484670639,
-0.16440510749816895,
0.052689384669065475,
0.4423617124557495,
0.3658410906791687,
0.27298593521118164,
-0.34799689054489136,
0.005974071100354195,
-0.1253732442855835,
-0.031212665140628815,
-0.008239984512329102,
0.3479877710342407,
0.056091584265232086,
0.27634453773498535,
0.1386100798845291,
0.09977151453495026,
-0.37354421615600586,
0.1695050150156021,
0.11594972014427185,
-0.025167789310216904,
-0.1250501275062561,
0.03690934181213379,
-0.13936132192611694,
-0.1630636602640152,
-0.38922616839408875,
-0.43863341212272644,
-0.4829597473144531,
-0.17739541828632355,
0.07507027685642242,
0.3655913472175598,
0.17163942754268646,
0.20897383987903595,
0.2922876179218292,
0.04306630790233612,
0.21220763027668,
0.22460179030895233,
0.011880885809659958,
0.3893257975578308,
-0.2756960093975067,
-0.3148689568042755,
0.16537144780158997,
-0.10916613042354584,
0.17438116669654846,
0.13840904831886292,
-0.42383909225463867,
-0.09599050134420395,
-0.01814163662493229,
0.2265034019947052,
-0.07275836169719696,
0.15906694531440735,
0.20842084288597107,
0.30083179473876953,
0.08430019021034241,
-0.11088274419307709,
-0.2166585624217987,
0.07152154296636581,
-0.026953574270009995,
0.1673475205898285,
-0.02155347540974617,
0.2876620590686798,
-0.20630748569965363,
0.6331831812858582,
0.10363863408565521,
-0.1602020412683487,
0.2856438159942627,
-0.10770488530397415,
0.49822601675987244,
-0.09114985913038254,
-0.3196216821670532,
0.009279200807213783,
0.17611703276634216,
0.06875021010637283,
0.14133253693580627,
-0.12090343981981277,
-0.10155200213193893,
-0.26098427176475525,
0.20330698788166046,
-0.28436410427093506,
-0.21626466512680054,
0.1596456617116928,
-0.30053916573524475,
0.05842360854148865,
0.020792022347450256,
-0.022247903048992157,
-0.13041134178638458,
0.05395574867725372,
0.1825629323720932,
0.34770315885543823,
0.031166329979896545,
0.25210684537887573,
-0.2750769555568695,
-0.10340466350317001,
-0.09675844758749008,
0.16281914710998535,
0.1300278753042221,
0.41383495926856995,
0.053842004388570786,
0.1319560706615448,
0.04090430215001106,
-0.053696610033512115,
0.39453840255737305,
-0.052475444972515106,
-0.18044190108776093,
0.2228674590587616,
0.3700033128261566,
-0.7515665292739868,
-0.05954684317111969,
-0.00046257302165031433,
0.25689589977264404,
0.28420159220695496,
-0.05428914725780487,
-0.4455950856208801,
-0.030076662078499794,
0.3680993914604187,
0.2810713052749634,
-0.06530231982469559,
-0.15425467491149902,
-0.2069275677204132,
-0.4045593738555908,
-0.1675783395767212,
-0.4718332886695862,
0.08909986168146133,
0.30030035972595215,
0.21374760568141937,
0.03326617553830147,
0.0594148114323616,
-0.012200433760881424,
0.01275072991847992,
-0.009922643192112446,
0.5848726630210876,
-0.0876447930932045,
0.14746302366256714,
0.20820128917694092,
0.5807342529296875,
0.5497838258743286,
0.5620353817939758,
-0.4488517940044403,
-0.24214035272598267,
-0.05564310401678085,
-0.2595219910144806,
0.08999380469322205,
0.045556969940662384,
-0.15826717019081116,
-0.04022695869207382,
-0.08982069045305252,
-0.1984967440366745,
0.19907180964946747,
0.21353936195373535,
0.328925222158432,
0.15892167389392853,
-0.01695222593843937,
-0.5565778017044067,
0.13888734579086304,
0.04541127756237984,
-0.014659978449344635,
0.5292743444442749,
0.09554177522659302,
-0.2936505675315857,
0.17226867377758026,
-0.18047228455543518,
0.7495894432067871,
0.2098604440689087,
0.11998073756694794,
0.35997334122657776,
-0.31690990924835205,
0.10035192221403122,
-0.05429333820939064,
-0.0977412760257721,
-0.36463847756385803,
0.030156508088111877,
0.057906925678253174,
-0.30162355303764343,
0.07656398415565491,
-0.07449476420879364,
0.0034738481044769287,
0.18557363748550415,
-0.40582627058029175,
-0.029671449214220047,
-0.175838440656662,
0.20880430936813354,
0.017661530524492264,
0.033993400633335114,
0.03285059705376625,
0.11276859045028687,
-0.07061342895030975,
0.1245613694190979,
-0.2354244887828827,
0.0765458270907402,
-0.3120984733104706,
-0.28525596857070923,
-0.19445636868476868,
-0.0825946182012558,
-0.11677277833223343,
0.3057859539985657,
-0.05761170759797096,
-0.30827561020851135,
-0.005533294752240181,
0.43214860558509827,
-0.02396935224533081,
0.11229851841926575,
-0.1062682718038559,
0.10867446660995483,
-0.43384671211242676,
0.08482324331998825,
0.1828416883945465,
0.02714492380619049,
0.2124510258436203,
-0.19661608338356018,
-0.13843019306659698,
0.07251192629337311,
0.05931845307350159,
-0.12112204730510712,
0.16658127307891846,
0.2439708709716797,
0.2389916032552719,
0.0036658132448792458,
-0.27265384793281555,
-0.0051269978284835815,
-0.026886265724897385,
-0.04448218643665314,
0.17057998478412628,
0.15033257007598877,
-0.006884932518005371,
0.2974034547805786,
-0.29095324873924255,
-0.07765321433544159,
0.014736785553395748,
0.3450012803077698,
-0.01237247884273529,
0.006561093032360077,
0.49853867292404175,
0.010722573846578598,
-0.3269122242927551,
-0.17628219723701477,
0.12411905080080032,
-0.09197854995727539,
-0.22198134660720825,
-0.036558058112859726,
-0.16782082617282867,
-0.10570000112056732,
-0.18863214552402496,
-0.4122649133205414,
0.14839237928390503,
0.11435659229755402,
-0.2438085526227951,
-0.3272925615310669,
-0.06491051614284515,
0.18396174907684326,
-0.12363554537296295,
-0.030613664537668228,
-0.13529272377490997,
0.14128157496452332,
0.08896699547767639,
-0.32071977853775024,
-0.2957530915737152,
0.38387197256088257,
0.04416018724441528,
0.047783784568309784,
-0.04446405917406082,
-0.05548034608364105,
0.022002635523676872,
-0.23741699755191803,
0.1522606760263443,
-0.07373399287462234,
0.023662755265831947,
-0.1967996060848236,
-0.2612542510032654,
0.08677531778812408,
-0.010960731655359268,
-0.14514847099781036,
0.14219118654727936,
-0.4102967381477356,
-0.20546723902225494,
0.055953528732061386,
-0.2494509071111679,
0.1029038056731224,
0.14737170934677124,
0.08997504413127899,
0.09702956676483154,
-0.20363643765449524,
-0.041160471737384796,
0.4532097280025482,
-0.15154868364334106,
0.3274773955345154,
0.03667675703763962,
0.38249874114990234,
-0.07287408411502838,
-0.10585446655750275,
-0.3209514617919922,
-0.042630814015865326,
-0.33216434717178345,
0.08810102939605713,
0.32776975631713867,
-0.13847850263118744,
0.050572145730257034,
0.15107716619968414,
0.28310665488243103,
0.6362085342407227,
-0.40401560068130493,
0.05872230976819992,
0.42122775316238403,
0.21493615210056305,
-0.23011475801467896,
-0.21735356748104095,
0.2856085002422333,
-0.06806813925504684,
0.020758498460054398,
0.013970807194709778,
-0.19279778003692627,
-0.2495023012161255,
0.051306240260601044,
0.14017009735107422,
0.15131880342960358,
0.21440227329730988,
0.24747098982334137,
0.46110042929649353,
-0.062790147960186,
0.142804816365242,
0.1695573329925537,
0.16989801824092865,
0.2019723355770111,
0.7694743275642395,
-0.2693654000759125,
0.04552743211388588,
0.07335393130779266,
-0.15104742348194122,
0.23061123490333557,
-0.44380369782447815,
0.07459712028503418,
0.03732875734567642,
0.17278003692626953,
0.035121217370033264,
0.19786113500595093,
0.3019651472568512,
-0.04612383991479874,
-0.001986320596188307,
0.13388586044311523,
0.04594632238149643,
-0.19270893931388855,
0.18199263513088226,
0.025317903608083725,
-0.14682786166667938,
0.04674098640680313,
0.026898521929979324,
-0.10909475386142731,
-0.2646369934082031,
-0.010542742908000946,
0.16690567135810852,
-0.21510453522205353,
-0.49089133739471436,
0.18352553248405457,
0.04324612021446228,
-0.0286155566573143,
-0.1637028455734253,
0.13650448620319366,
0.29922062158584595,
0.09832092374563217,
-0.11039626598358154,
0.24813544750213623,
0.3080308437347412,
0.5296769738197327,
0.25446563959121704,
-0.17346301674842834,
0.07621346414089203,
-0.09461160004138947,
-0.321832537651062,
-0.11483334004878998,
-0.13874128460884094,
0.18832451105117798,
0.43296298384666443,
0.2295549511909485,
-0.23870913684368134,
-0.16643710434436798,
0.16023476421833038,
0.15410718321800232,
-0.008520256727933884,
0.16185161471366882,
-0.26062101125717163,
-0.16912569105625153,
-0.25697028636932373,
0.15675236284732819,
-0.43953925371170044,
0.01283652801066637,
0.4906741976737976,
0.1295614391565323,
0.13312315940856934,
-0.28577810525894165,
0.05867942422628403,
-0.13340292870998383,
0.4096422493457794,
0.4653957188129425,
0.4635312855243683,
-0.060424186289310455,
-0.17961525917053223,
-0.9071447253227234,
0.268257737159729,
-0.02259490266442299,
-0.1326591670513153,
0.06103063002228737,
0.03619811683893204,
-0.10493610054254532,
0.06605127453804016,
0.39116156101226807,
0.2487116903066635,
0.13934338092803955,
0.09750212728977203,
-0.44417962431907654,
-0.27087491750717163,
-0.09473563730716705,
0.11129151284694672,
-0.08261778950691223,
-0.4625152051448822,
0.28332972526550293,
-0.17230704426765442,
0.04417632520198822,
-0.22653216123580933,
-0.053089577704668045,
-0.03912143036723137,
0.20685763657093048,
0.3561681807041168,
0.06800182908773422,
0.3527803122997284,
0.014647148549556732,
-0.23552660644054413,
-0.31625840067863464,
-0.13401830196380615,
-0.18259532749652863,
0.2041882872581482,
0.15604403614997864,
0.1720164567232132,
-0.3202742040157318,
-0.3478304147720337,
-0.34935638308525085,
0.5035495758056641,
-0.03407909348607063,
0.12424427270889282,
-0.28711172938346863,
0.15728913247585297,
0.01061633974313736,
0.18789957463741302,
0.11061631888151169,
0.041659384965896606,
0.045248374342918396,
0.053252704441547394,
-0.24386803805828094,
-0.3949972689151764,
0.47593197226524353,
0.09748194366693497,
-0.13433951139450073,
-0.02563822641968727,
0.35348016023635864,
0.09666343778371811,
-0.019612396135926247,
-0.3890353739261627,
-0.010366074740886688,
0.34223321080207825,
-0.09281620383262634,
-0.10641425848007202,
0.0976351946592331,
-0.0877896398305893,
0.23050574958324432,
-0.03445496782660484,
0.13931642472743988,
0.09539790451526642,
-0.27102532982826233,
0.04856446012854576,
-0.22038786113262177
] |
https://github.com/huggingface/datasets/issues/5487 | Incorrect filepath for dill module | As I said above, I guess this is not a problem with `datasets`. I think you have different Python environments: one with the new dill version (the one you get while using pip) and other with the old dill version (the one where you get the AttributeError).
You should update `dill` in the Python environment you are using within spyder.
Please note that the `_dill` module is present in the `dill` package since their 2.8.0 version. | ### Describe the bug
I installed the `datasets` package and when I try to `import` it, I get the following error:
```
Traceback (most recent call last):
File "/var/folders/jt/zw5g74ln6tqfdzsl8tx378j00000gn/T/ipykernel_3805/3458380017.py", line 1, in <module>
import datasets
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module>
from .arrow_dataset import Dataset
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 66, in <module>
from .arrow_writer import ArrowWriter, OptimizedTypedSequence
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/arrow_writer.py", line 27, in <module>
from .features import Features, Image, Value
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/features/__init__.py", line 17, in <module>
from .audio import Audio
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/features/audio.py", line 12, in <module>
from ..download.streaming_download_manager import xopen
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/download/__init__.py", line 9, in <module>
from .download_manager import DownloadManager, DownloadMode
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/download/download_manager.py", line 36, in <module>
from ..utils.py_utils import NestedDataStructure, map_nested, size_str
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 602, in <module>
class Pickler(dill.Pickler):
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 605, in Pickler
dispatch = dill._dill.MetaCatchingDict(dill.Pickler.dispatch.copy())
AttributeError: module 'dill' has no attribute '_dill'
```
Looking at the github source code for dill, it appears that `datasets` has a bug or is not compatible with the latest `dill`. Specifically, rather than `dill._dill.XXXX` it should be `dill.dill._dill.XXXX`. But given the popularity of `datasets` I feel confused about me being the first person to have this issue, so it makes me wonder if I'm misdiagnosing the issue.
### Steps to reproduce the bug
Install `dill` and `datasets` packages and then `import datasets`
### Expected behavior
I expect `datasets` to import.
### Environment info
- `datasets` version: 2.9.0
- Platform: macOS-10.16-x86_64-i386-64bit
- Python version: 3.9.13
- PyArrow version: 11.0.0
- Pandas version: 1.4.4 | 76 | Incorrect filepath for dill module
### Describe the bug
I installed the `datasets` package and when I try to `import` it, I get the following error:
```
Traceback (most recent call last):
File "/var/folders/jt/zw5g74ln6tqfdzsl8tx378j00000gn/T/ipykernel_3805/3458380017.py", line 1, in <module>
import datasets
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module>
from .arrow_dataset import Dataset
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 66, in <module>
from .arrow_writer import ArrowWriter, OptimizedTypedSequence
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/arrow_writer.py", line 27, in <module>
from .features import Features, Image, Value
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/features/__init__.py", line 17, in <module>
from .audio import Audio
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/features/audio.py", line 12, in <module>
from ..download.streaming_download_manager import xopen
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/download/__init__.py", line 9, in <module>
from .download_manager import DownloadManager, DownloadMode
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/download/download_manager.py", line 36, in <module>
from ..utils.py_utils import NestedDataStructure, map_nested, size_str
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 602, in <module>
class Pickler(dill.Pickler):
File "/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 605, in Pickler
dispatch = dill._dill.MetaCatchingDict(dill.Pickler.dispatch.copy())
AttributeError: module 'dill' has no attribute '_dill'
```
Looking at the github source code for dill, it appears that `datasets` has a bug or is not compatible with the latest `dill`. Specifically, rather than `dill._dill.XXXX` it should be `dill.dill._dill.XXXX`. But given the popularity of `datasets` I feel confused about me being the first person to have this issue, so it makes me wonder if I'm misdiagnosing the issue.
### Steps to reproduce the bug
Install `dill` and `datasets` packages and then `import datasets`
### Expected behavior
I expect `datasets` to import.
### Environment info
- `datasets` version: 2.9.0
- Platform: macOS-10.16-x86_64-i386-64bit
- Python version: 3.9.13
- PyArrow version: 11.0.0
- Pandas version: 1.4.4
As I said above, I guess this is not a problem with `datasets`. I think you have different Python environments: one with the new dill version (the one you get while using pip) and other with the old dill version (the one where you get the AttributeError).
You should update `dill` in the Python environment you are using within spyder.
Please note that the `_dill` module is present in the `dill` package since their 2.8.0 version. | [
-0.2769613564014435,
0.15094640851020813,
-0.10528561472892761,
0.3617427945137024,
0.1401957869529724,
0.010012879967689514,
0.4118015766143799,
0.19778048992156982,
-0.27519461512565613,
-0.2218220978975296,
-0.20238515734672546,
0.3167159855365753,
-0.3055160939693451,
-0.1868254691362381,
0.2882830798625946,
0.14931391179561615,
0.014746449887752533,
0.05478404462337494,
-0.4568239748477936,
-0.25448763370513916,
-0.2408495545387268,
0.17448607087135315,
-0.08812730014324188,
0.033067259937524796,
-0.245591938495636,
0.0523466095328331,
-0.07826235890388489,
0.3572179973125458,
-0.3561529517173767,
-0.5247761607170105,
0.13501222431659698,
0.018061116337776184,
0.4147813320159912,
0.5708177089691162,
-0.0001153880002675578,
0.08843380212783813,
0.17518916726112366,
-0.1414048820734024,
-0.4932999014854431,
-0.22929836809635162,
-0.07296933233737946,
-0.11493127048015594,
0.25392529368400574,
-0.2344495952129364,
0.20625081658363342,
-0.3550379276275635,
-0.13567861914634705,
-0.2701839208602905,
0.18568363785743713,
0.5231620073318481,
0.24089644849300385,
-0.08330292254686356,
0.2749316990375519,
0.067841537296772,
0.21703165769577026,
0.16517768800258636,
0.11653096228837967,
0.5183122754096985,
-0.045610278844833374,
0.08198279142379761,
0.13364124298095703,
0.1384005844593048,
-0.2124888002872467,
-0.03147679939866066,
0.5968560576438904,
-0.11905262619256973,
0.08772477507591248,
-0.04308632016181946,
0.08255895972251892,
0.09025569260120392,
0.6775444149971008,
-0.409673273563385,
-0.29934749007225037,
0.010494977235794067,
0.08927799016237259,
-0.20904278755187988,
0.29331234097480774,
-0.003450612537562847,
0.0666918009519577,
0.25882792472839355,
0.3676387667655945,
-0.3984561860561371,
-0.12847557663917542,
0.21803559362888336,
-0.27790722250938416,
0.2585434913635254,
-0.010620604269206524,
-0.009696818888187408,
-0.008990403264760971,
-0.21584342420101166,
0.5138744115829468,
-0.07314623892307281,
0.07722700387239456,
0.16387036442756653,
-0.11871510744094849,
0.2864995300769806,
0.17200690507888794,
-0.3627731502056122,
-0.14518104493618011,
-0.1428729146718979,
-0.000620952807366848,
-0.2531523108482361,
-0.21706147491931915,
0.18504738807678223,
0.2259688824415207,
-0.04517579823732376,
0.14422190189361572,
0.2421547919511795,
0.17417632043361664,
0.17238040268421173,
0.17567691206932068,
0.15309369564056396,
-0.31455424427986145,
-0.2797127664089203,
-0.07411470264196396,
0.0570397675037384,
0.2251526564359665,
-0.08282063156366348,
-0.41316354274749756,
0.12245345115661621,
-0.03723767027258873,
-0.1351868361234665,
0.1063648909330368,
0.23077094554901123,
-0.15064328908920288,
0.3059784471988678,
0.18081039190292358,
0.03208620846271515,
-0.0561554878950119,
0.3300568461418152,
-0.12105187773704529,
0.2784012258052826,
-0.07155194878578186,
-0.12487273663282394,
0.06226378306746483,
-0.021332360804080963,
0.24423831701278687,
-0.009378072805702686,
-0.19627363979816437,
-0.060652878135442734,
-0.044402532279491425,
-0.02063705027103424,
-0.005600236356258392,
0.17170752584934235,
-0.04066945239901543,
0.33206745982170105,
-0.013919688761234283,
-0.24904508888721466,
-0.2244744598865509,
0.25512760877609253,
-0.4341782331466675,
-0.2038404941558838,
-0.310813307762146,
0.24939195811748505,
-0.11758245527744293,
-0.0007130838930606842,
-0.1476217806339264,
-0.36788636445999146,
-0.17696532607078552,
-0.27703210711479187,
-0.1977478563785553,
-0.34166115522384644,
0.1496340036392212,
-0.23709112405776978,
0.27546828985214233,
0.39687395095825195,
-0.6089017391204834,
-0.03408437222242355,
-0.5003616213798523,
0.010249478742480278,
0.03268258273601532,
-0.02532579004764557,
-0.2470165342092514,
0.2396378219127655,
-0.2552063465118408,
-0.04519812762737274,
0.5282572507858276,
-0.6255922317504883,
-0.324076384305954,
-0.04166260361671448,
-0.1666393280029297,
-0.18906165659427643,
-0.045137129724025726,
-0.03509816154837608,
0.21595580875873566,
0.10156098753213882,
0.34537675976753235,
0.3314021825790405,
0.33436456322669983,
-0.022030025720596313,
-0.17913956940174103,
-0.2814503610134125,
0.059632740914821625,
0.23568762838840485,
-0.018470074981451035,
-0.23917195200920105,
0.11810183525085449,
-0.032237038016319275,
0.4003123641014099,
0.020786285400390625,
-0.15341158211231232,
0.5029639601707458,
0.2394540160894394,
0.08240155875682831,
0.047678977251052856,
-0.17202022671699524,
-0.6249172687530518,
-0.04069003835320473,
-0.03183992952108383,
-0.18431246280670166,
-0.505327582359314,
-0.1389666497707367,
-0.29143431782722473,
0.106507308781147,
-0.18736857175827026,
-0.09563905000686646,
0.17525841295719147,
0.23664407432079315,
-0.18291939795017242,
0.19503331184387207,
-0.2687174379825592,
-0.007818354293704033,
0.15463578701019287,
0.18903273344039917,
-0.1548318862915039,
0.2175544649362564,
-0.31576287746429443,
0.04034261405467987,
0.21039026975631714,
0.32848015427589417,
0.18557801842689514,
-0.20184655487537384,
-0.04278618097305298,
0.28091809153556824,
0.15948601067066193,
0.06862635165452957,
0.09620900452136993,
-0.10349814593791962,
0.18017525970935822,
-0.4422140419483185,
0.08399415016174316,
0.14558380842208862,
0.20832960307598114,
-0.02166115865111351,
0.07146437466144562,
-0.05604588985443115,
-0.2511817216873169,
0.14767515659332275,
0.19448751211166382,
0.15575453639030457,
0.28567245602607727,
0.09911054372787476,
0.013406945392489433,
-0.24102437496185303,
0.09661444276571274,
0.37140971422195435,
0.3415938913822174,
0.18534335494041443,
0.1290033459663391,
0.04111788794398308,
0.40307745337486267,
0.11371099948883057,
0.020906291902065277,
0.049892231822013855,
-0.37650588154792786,
0.08985895663499832,
0.2129472941160202,
0.419609397649765,
0.21176952123641968,
0.15518894791603088,
0.014725953340530396,
0.10523483157157898,
0.08532848209142685,
-0.07781475782394409,
0.26806384325027466,
-0.05323269963264465,
0.08607131242752075,
0.24235573410987854,
-0.044316235929727554,
0.006728389300405979,
-0.07056789845228195,
-0.36004090309143066,
-0.005789425224065781,
0.5259449481964111,
-0.33601152896881104,
0.041528381407260895,
-0.569640040397644,
-0.10397787392139435,
-0.44414564967155457,
-0.3171612024307251,
-0.2951538562774658,
-0.18585728108882904,
-0.18193863332271576,
-0.03959145024418831,
-0.18243487179279327,
0.07708463072776794,
-0.10846270620822906,
-0.13133342564105988,
-0.05415772646665573,
-0.4543383717536926,
-0.0014367848634719849,
-0.09542461484670639,
-0.16440510749816895,
0.052689384669065475,
0.4423617124557495,
0.3658410906791687,
0.27298593521118164,
-0.34799689054489136,
0.005974071100354195,
-0.1253732442855835,
-0.031212665140628815,
-0.008239984512329102,
0.3479877710342407,
0.056091584265232086,
0.27634453773498535,
0.1386100798845291,
0.09977151453495026,
-0.37354421615600586,
0.1695050150156021,
0.11594972014427185,
-0.025167789310216904,
-0.1250501275062561,
0.03690934181213379,
-0.13936132192611694,
-0.1630636602640152,
-0.38922616839408875,
-0.43863341212272644,
-0.4829597473144531,
-0.17739541828632355,
0.07507027685642242,
0.3655913472175598,
0.17163942754268646,
0.20897383987903595,
0.2922876179218292,
0.04306630790233612,
0.21220763027668,
0.22460179030895233,
0.011880885809659958,
0.3893257975578308,
-0.2756960093975067,
-0.3148689568042755,
0.16537144780158997,
-0.10916613042354584,
0.17438116669654846,
0.13840904831886292,
-0.42383909225463867,
-0.09599050134420395,
-0.01814163662493229,
0.2265034019947052,
-0.07275836169719696,
0.15906694531440735,
0.20842084288597107,
0.30083179473876953,
0.08430019021034241,
-0.11088274419307709,
-0.2166585624217987,
0.07152154296636581,
-0.026953574270009995,
0.1673475205898285,
-0.02155347540974617,
0.2876620590686798,
-0.20630748569965363,
0.6331831812858582,
0.10363863408565521,
-0.1602020412683487,
0.2856438159942627,
-0.10770488530397415,
0.49822601675987244,
-0.09114985913038254,
-0.3196216821670532,
0.009279200807213783,
0.17611703276634216,
0.06875021010637283,
0.14133253693580627,
-0.12090343981981277,
-0.10155200213193893,
-0.26098427176475525,
0.20330698788166046,
-0.28436410427093506,
-0.21626466512680054,
0.1596456617116928,
-0.30053916573524475,
0.05842360854148865,
0.020792022347450256,
-0.022247903048992157,
-0.13041134178638458,
0.05395574867725372,
0.1825629323720932,
0.34770315885543823,
0.031166329979896545,
0.25210684537887573,
-0.2750769555568695,
-0.10340466350317001,
-0.09675844758749008,
0.16281914710998535,
0.1300278753042221,
0.41383495926856995,
0.053842004388570786,
0.1319560706615448,
0.04090430215001106,
-0.053696610033512115,
0.39453840255737305,
-0.052475444972515106,
-0.18044190108776093,
0.2228674590587616,
0.3700033128261566,
-0.7515665292739868,
-0.05954684317111969,
-0.00046257302165031433,
0.25689589977264404,
0.28420159220695496,
-0.05428914725780487,
-0.4455950856208801,
-0.030076662078499794,
0.3680993914604187,
0.2810713052749634,
-0.06530231982469559,
-0.15425467491149902,
-0.2069275677204132,
-0.4045593738555908,
-0.1675783395767212,
-0.4718332886695862,
0.08909986168146133,
0.30030035972595215,
0.21374760568141937,
0.03326617553830147,
0.0594148114323616,
-0.012200433760881424,
0.01275072991847992,
-0.009922643192112446,
0.5848726630210876,
-0.0876447930932045,
0.14746302366256714,
0.20820128917694092,
0.5807342529296875,
0.5497838258743286,
0.5620353817939758,
-0.4488517940044403,
-0.24214035272598267,
-0.05564310401678085,
-0.2595219910144806,
0.08999380469322205,
0.045556969940662384,
-0.15826717019081116,
-0.04022695869207382,
-0.08982069045305252,
-0.1984967440366745,
0.19907180964946747,
0.21353936195373535,
0.328925222158432,
0.15892167389392853,
-0.01695222593843937,
-0.5565778017044067,
0.13888734579086304,
0.04541127756237984,
-0.014659978449344635,
0.5292743444442749,
0.09554177522659302,
-0.2936505675315857,
0.17226867377758026,
-0.18047228455543518,
0.7495894432067871,
0.2098604440689087,
0.11998073756694794,
0.35997334122657776,
-0.31690990924835205,
0.10035192221403122,
-0.05429333820939064,
-0.0977412760257721,
-0.36463847756385803,
0.030156508088111877,
0.057906925678253174,
-0.30162355303764343,
0.07656398415565491,
-0.07449476420879364,
0.0034738481044769287,
0.18557363748550415,
-0.40582627058029175,
-0.029671449214220047,
-0.175838440656662,
0.20880430936813354,
0.017661530524492264,
0.033993400633335114,
0.03285059705376625,
0.11276859045028687,
-0.07061342895030975,
0.1245613694190979,
-0.2354244887828827,
0.0765458270907402,
-0.3120984733104706,
-0.28525596857070923,
-0.19445636868476868,
-0.0825946182012558,
-0.11677277833223343,
0.3057859539985657,
-0.05761170759797096,
-0.30827561020851135,
-0.005533294752240181,
0.43214860558509827,
-0.02396935224533081,
0.11229851841926575,
-0.1062682718038559,
0.10867446660995483,
-0.43384671211242676,
0.08482324331998825,
0.1828416883945465,
0.02714492380619049,
0.2124510258436203,
-0.19661608338356018,
-0.13843019306659698,
0.07251192629337311,
0.05931845307350159,
-0.12112204730510712,
0.16658127307891846,
0.2439708709716797,
0.2389916032552719,
0.0036658132448792458,
-0.27265384793281555,
-0.0051269978284835815,
-0.026886265724897385,
-0.04448218643665314,
0.17057998478412628,
0.15033257007598877,
-0.006884932518005371,
0.2974034547805786,
-0.29095324873924255,
-0.07765321433544159,
0.014736785553395748,
0.3450012803077698,
-0.01237247884273529,
0.006561093032360077,
0.49853867292404175,
0.010722573846578598,
-0.3269122242927551,
-0.17628219723701477,
0.12411905080080032,
-0.09197854995727539,
-0.22198134660720825,
-0.036558058112859726,
-0.16782082617282867,
-0.10570000112056732,
-0.18863214552402496,
-0.4122649133205414,
0.14839237928390503,
0.11435659229755402,
-0.2438085526227951,
-0.3272925615310669,
-0.06491051614284515,
0.18396174907684326,
-0.12363554537296295,
-0.030613664537668228,
-0.13529272377490997,
0.14128157496452332,
0.08896699547767639,
-0.32071977853775024,
-0.2957530915737152,
0.38387197256088257,
0.04416018724441528,
0.047783784568309784,
-0.04446405917406082,
-0.05548034608364105,
0.022002635523676872,
-0.23741699755191803,
0.1522606760263443,
-0.07373399287462234,
0.023662755265831947,
-0.1967996060848236,
-0.2612542510032654,
0.08677531778812408,
-0.010960731655359268,
-0.14514847099781036,
0.14219118654727936,
-0.4102967381477356,
-0.20546723902225494,
0.055953528732061386,
-0.2494509071111679,
0.1029038056731224,
0.14737170934677124,
0.08997504413127899,
0.09702956676483154,
-0.20363643765449524,
-0.041160471737384796,
0.4532097280025482,
-0.15154868364334106,
0.3274773955345154,
0.03667675703763962,
0.38249874114990234,
-0.07287408411502838,
-0.10585446655750275,
-0.3209514617919922,
-0.042630814015865326,
-0.33216434717178345,
0.08810102939605713,
0.32776975631713867,
-0.13847850263118744,
0.050572145730257034,
0.15107716619968414,
0.28310665488243103,
0.6362085342407227,
-0.40401560068130493,
0.05872230976819992,
0.42122775316238403,
0.21493615210056305,
-0.23011475801467896,
-0.21735356748104095,
0.2856085002422333,
-0.06806813925504684,
0.020758498460054398,
0.013970807194709778,
-0.19279778003692627,
-0.2495023012161255,
0.051306240260601044,
0.14017009735107422,
0.15131880342960358,
0.21440227329730988,
0.24747098982334137,
0.46110042929649353,
-0.062790147960186,
0.142804816365242,
0.1695573329925537,
0.16989801824092865,
0.2019723355770111,
0.7694743275642395,
-0.2693654000759125,
0.04552743211388588,
0.07335393130779266,
-0.15104742348194122,
0.23061123490333557,
-0.44380369782447815,
0.07459712028503418,
0.03732875734567642,
0.17278003692626953,
0.035121217370033264,
0.19786113500595093,
0.3019651472568512,
-0.04612383991479874,
-0.001986320596188307,
0.13388586044311523,
0.04594632238149643,
-0.19270893931388855,
0.18199263513088226,
0.025317903608083725,
-0.14682786166667938,
0.04674098640680313,
0.026898521929979324,
-0.10909475386142731,
-0.2646369934082031,
-0.010542742908000946,
0.16690567135810852,
-0.21510453522205353,
-0.49089133739471436,
0.18352553248405457,
0.04324612021446228,
-0.0286155566573143,
-0.1637028455734253,
0.13650448620319366,
0.29922062158584595,
0.09832092374563217,
-0.11039626598358154,
0.24813544750213623,
0.3080308437347412,
0.5296769738197327,
0.25446563959121704,
-0.17346301674842834,
0.07621346414089203,
-0.09461160004138947,
-0.321832537651062,
-0.11483334004878998,
-0.13874128460884094,
0.18832451105117798,
0.43296298384666443,
0.2295549511909485,
-0.23870913684368134,
-0.16643710434436798,
0.16023476421833038,
0.15410718321800232,
-0.008520256727933884,
0.16185161471366882,
-0.26062101125717163,
-0.16912569105625153,
-0.25697028636932373,
0.15675236284732819,
-0.43953925371170044,
0.01283652801066637,
0.4906741976737976,
0.1295614391565323,
0.13312315940856934,
-0.28577810525894165,
0.05867942422628403,
-0.13340292870998383,
0.4096422493457794,
0.4653957188129425,
0.4635312855243683,
-0.060424186289310455,
-0.17961525917053223,
-0.9071447253227234,
0.268257737159729,
-0.02259490266442299,
-0.1326591670513153,
0.06103063002228737,
0.03619811683893204,
-0.10493610054254532,
0.06605127453804016,
0.39116156101226807,
0.2487116903066635,
0.13934338092803955,
0.09750212728977203,
-0.44417962431907654,
-0.27087491750717163,
-0.09473563730716705,
0.11129151284694672,
-0.08261778950691223,
-0.4625152051448822,
0.28332972526550293,
-0.17230704426765442,
0.04417632520198822,
-0.22653216123580933,
-0.053089577704668045,
-0.03912143036723137,
0.20685763657093048,
0.3561681807041168,
0.06800182908773422,
0.3527803122997284,
0.014647148549556732,
-0.23552660644054413,
-0.31625840067863464,
-0.13401830196380615,
-0.18259532749652863,
0.2041882872581482,
0.15604403614997864,
0.1720164567232132,
-0.3202742040157318,
-0.3478304147720337,
-0.34935638308525085,
0.5035495758056641,
-0.03407909348607063,
0.12424427270889282,
-0.28711172938346863,
0.15728913247585297,
0.01061633974313736,
0.18789957463741302,
0.11061631888151169,
0.041659384965896606,
0.045248374342918396,
0.053252704441547394,
-0.24386803805828094,
-0.3949972689151764,
0.47593197226524353,
0.09748194366693497,
-0.13433951139450073,
-0.02563822641968727,
0.35348016023635864,
0.09666343778371811,
-0.019612396135926247,
-0.3890353739261627,
-0.010366074740886688,
0.34223321080207825,
-0.09281620383262634,
-0.10641425848007202,
0.0976351946592331,
-0.0877896398305893,
0.23050574958324432,
-0.03445496782660484,
0.13931642472743988,
0.09539790451526642,
-0.27102532982826233,
0.04856446012854576,
-0.22038786113262177
] |
https://github.com/huggingface/datasets/issues/5486 | Adding `sep` to TextConfig | Hi @omar-araboghli, thanks for your proposal.
Have you tried to use "csv" loader instead of "text"? That already has a `sep` argument. | I have a local a `.txt` file that follows the `CONLL2003` format which I need to load using `load_script`. However, by using `sample_by='line'`, one can only split the dataset into lines without splitting each line into columns. Would it be reasonable to add a `sep` argument in combination with `sample_by='paragraph'` to parse a paragraph into an array for each column ? If so, I am happy to contribute!
## Environment
* `python 3.8.10`
* `datasets 2.9.0`
## Snippet of `train.txt`
```txt
Distribution NN O O
and NN O O
dynamics NN O O
of NN O O
electron NN O B-RP
complexes NN O I-RP
in NN O O
cyanobacterial NN O B-R
membranes NN O I-R
The NN O O
occurrence NN O O
of NN O O
prostaglandin NN O B-R
F2α NN O I-R
in NN O O
Pharbitis NN O B-R
seedlings NN O I-R
grown NN O O
under NN O O
short NN O B-P
days NN O I-P
or NN O I-P
days NN O I-P
```
## Current Behaviour
```python
# defining 4 features ['tokens', 'pos_tags', 'chunk_tags', 'ner_tags'] here would fail with `ValueError: Length of names (4) does not match length of arrays (1)`
dataset = datasets.load_dataset(path='text', features=features, data_files={'train': 'train.txt'}, sample_by='line')
dataset['train']['tokens'][0]
>>> 'Distribution\tNN\tO\tO'
```
## Expected Behaviour / Suggestion
```python
# suppose we defined 4 features ['tokens', 'pos_tags', 'chunk_tags', 'ner_tags']
dataset = datasets.load_dataset(path='text', features=features, data_files={'train': 'train.txt'}, sample_by='paragraph', sep='\t')
dataset['train']['tokens'][0]
>>> ['Distribution', 'and', 'dynamics', ... ]
dataset['train']['ner_tags'][0]
>>> ['O', 'O', 'O', ... ]
``` | 22 | Adding `sep` to TextConfig
I have a local a `.txt` file that follows the `CONLL2003` format which I need to load using `load_script`. However, by using `sample_by='line'`, one can only split the dataset into lines without splitting each line into columns. Would it be reasonable to add a `sep` argument in combination with `sample_by='paragraph'` to parse a paragraph into an array for each column ? If so, I am happy to contribute!
## Environment
* `python 3.8.10`
* `datasets 2.9.0`
## Snippet of `train.txt`
```txt
Distribution NN O O
and NN O O
dynamics NN O O
of NN O O
electron NN O B-RP
complexes NN O I-RP
in NN O O
cyanobacterial NN O B-R
membranes NN O I-R
The NN O O
occurrence NN O O
of NN O O
prostaglandin NN O B-R
F2α NN O I-R
in NN O O
Pharbitis NN O B-R
seedlings NN O I-R
grown NN O O
under NN O O
short NN O B-P
days NN O I-P
or NN O I-P
days NN O I-P
```
## Current Behaviour
```python
# defining 4 features ['tokens', 'pos_tags', 'chunk_tags', 'ner_tags'] here would fail with `ValueError: Length of names (4) does not match length of arrays (1)`
dataset = datasets.load_dataset(path='text', features=features, data_files={'train': 'train.txt'}, sample_by='line')
dataset['train']['tokens'][0]
>>> 'Distribution\tNN\tO\tO'
```
## Expected Behaviour / Suggestion
```python
# suppose we defined 4 features ['tokens', 'pos_tags', 'chunk_tags', 'ner_tags']
dataset = datasets.load_dataset(path='text', features=features, data_files={'train': 'train.txt'}, sample_by='paragraph', sep='\t')
dataset['train']['tokens'][0]
>>> ['Distribution', 'and', 'dynamics', ... ]
dataset['train']['ner_tags'][0]
>>> ['O', 'O', 'O', ... ]
```
Hi @omar-araboghli, thanks for your proposal.
Have you tried to use "csv" loader instead of "text"? That already has a `sep` argument. | [
-0.17985977232456207,
-0.2951112389564514,
-0.13400746881961823,
-0.11365757882595062,
-0.01799459382891655,
0.09609770029783249,
0.6356440782546997,
0.04844085872173309,
-0.06427372992038727,
0.16888821125030518,
0.31319910287857056,
0.3941829204559326,
-0.07302205264568329,
0.6800389885902405,
0.09099232405424118,
-0.015874408185482025,
0.05721883848309517,
0.2524699568748474,
0.19776974618434906,
0.14958734810352325,
-0.28131356835365295,
0.2794163227081299,
-0.26923662424087524,
-0.23567821085453033,
-0.211014986038208,
0.2019423395395279,
0.03916763514280319,
0.1772521585226059,
-0.1346779465675354,
-0.16108132898807526,
0.11064974963665009,
0.007246889173984528,
0.2924581468105316,
-0.04126211255788803,
-0.00012460989819373935,
0.024189308285713196,
-0.07017770409584045,
-0.1733551025390625,
-0.0763649046421051,
0.0047624558210372925,
0.049775660037994385,
-0.050705619156360626,
0.03388594835996628,
-0.2713848054409027,
-0.2636745870113373,
0.2919653356075287,
-0.2698374092578888,
-0.30584752559661865,
0.43091219663619995,
0.40727391839027405,
-0.03719371184706688,
-0.08694957941770554,
-0.3461015224456787,
0.027464624494314194,
0.14553430676460266,
0.5619733333587646,
-0.38702964782714844,
-0.144185408949852,
0.2987707257270813,
-0.0744778960943222,
0.07836601883172989,
0.10950806736946106,
-0.23384153842926025,
0.033980339765548706,
0.5913636088371277,
0.33304455876350403,
-0.1820177137851715,
0.27632594108581543,
-0.14563164114952087,
0.2701496481895447,
0.6053272485733032,
-0.1584007441997528,
-0.16066396236419678,
-0.2656402289867401,
-0.05206548422574997,
-0.36461755633354187,
-0.19956299662590027,
-0.05903194099664688,
-0.3136397898197174,
0.42080360651016235,
-0.11006660014390945,
-0.24951516091823578,
-0.36052343249320984,
-0.04289162904024124,
-0.2538068890571594,
0.40671640634536743,
-0.08019683510065079,
0.01955702155828476,
0.14304091036319733,
-0.04034020006656647,
0.08835086971521378,
-0.051803044974803925,
0.2458006888628006,
0.15371297299861908,
0.035310737788677216,
-0.09953632950782776,
-0.08453711122274399,
-0.6664777994155884,
-0.0949396938085556,
-0.08827118575572968,
0.15110692381858826,
-0.10762137919664383,
0.18428568542003632,
-0.07163535803556442,
0.16625212132930756,
0.18347498774528503,
0.6699848771095276,
0.2934161126613617,
-0.2604093551635742,
-0.33832719922065735,
0.08632735908031464,
-0.10800997167825699,
-0.21357247233390808,
-0.0736454650759697,
-0.17909006774425507,
-0.08592425286769867,
0.02242599055171013,
-0.22113141417503357,
-0.10081294178962708,
0.0069737909361720085,
-0.026547949761152267,
-0.09454172104597092,
-0.009195935912430286,
0.3899202048778534,
0.44138553738594055,
0.30739957094192505,
0.021883275359869003,
0.09353788197040558,
-0.14255166053771973,
-0.0852665901184082,
-0.04018669202923775,
0.0008837375789880753,
-0.04108232632279396,
-0.01697239838540554,
-0.00016473978757858276,
0.05678129941225052,
-0.16550640761852264,
-0.2523215413093567,
-0.03664909303188324,
-0.06335651874542236,
-0.44763246178627014,
-0.0016481736674904823,
0.13468718528747559,
0.0028263889253139496,
-0.02088777720928192,
-0.16910892724990845,
0.025798439979553223,
0.135341614484787,
-0.29988154768943787,
0.2311428189277649,
-0.09817823022603989,
-0.5026571750640869,
-0.060857124626636505,
-0.012026225216686726,
0.05996270477771759,
-0.2605402171611786,
-0.12238498777151108,
0.07777813822031021,
0.6724890470504761,
-0.04007139429450035,
-0.056512780487537384,
-0.2836291193962097,
-0.6320691108703613,
-0.1978224366903305,
0.07071172446012497,
0.26736974716186523,
-0.7107669115066528,
-0.19313795864582062,
-0.1073463037610054,
-0.18941305577754974,
0.32096385955810547,
0.14853979647159576,
-0.35455772280693054,
0.27390632033348083,
-0.027174407616257668,
0.5964360237121582,
0.3897794485092163,
-0.2258395105600357,
0.13774201273918152,
0.6680036783218384,
-0.12587189674377441,
0.018232697620987892,
0.33738550543785095,
-0.011450895108282566,
0.40512651205062866,
0.15885740518569946,
0.38994261622428894,
0.49817895889282227,
0.1410340666770935,
0.05514588952064514,
-0.010478109121322632,
-0.2946632206439972,
0.14238016307353973,
0.39708349108695984,
-0.1871137171983719,
0.17351366579532623,
0.06434871256351471,
-0.1334676593542099,
0.2611483335494995,
-0.3143324851989746,
0.0684163048863411,
0.10500375181436539,
0.27040883898735046,
0.3553173542022705,
0.014864608645439148,
-0.17549285292625427,
-0.3343047797679901,
-0.16919094324111938,
0.7219365835189819,
0.08215213567018509,
0.013618610799312592,
-0.36401575803756714,
-0.020251691341400146,
-0.007707888260483742,
0.09987791627645493,
0.11359724402427673,
-0.11516567319631577,
-0.029671646654605865,
-0.08308009058237076,
-0.37825092673301697,
-0.39241284132003784,
0.4702550172805786,
-0.28482696413993835,
0.1856839507818222,
-0.1918020248413086,
0.006345938891172409,
0.1842440664768219,
-0.14229564368724823,
-0.11480864137411118,
0.3350611627101898,
-0.13626056909561157,
-0.024720732122659683,
0.12907472252845764,
0.06717506051063538,
0.37322288751602173,
-0.0023037344217300415,
-0.17029502987861633,
-0.2536945343017578,
-0.0686979815363884,
0.049627963453531265,
0.02580840326845646,
-0.1775030940771103,
-0.12110180407762527,
-0.12110018730163574,
0.006778433918952942,
0.36212506890296936,
-0.0012094974517822266,
0.5820214152336121,
-0.20426541566848755,
-0.047714777290821075,
0.09961673617362976,
-0.15464352071285248,
-0.07333633303642273,
-0.2980417311191559,
0.09039142727851868,
-0.17872247099876404,
0.3821881115436554,
0.023464372381567955,
-0.1653425395488739,
0.14991740882396698,
-0.12989442050457,
-0.0828319787979126,
-0.15587931871414185,
0.12476147711277008,
-0.007091030478477478,
0.37051641941070557,
-0.031022755429148674,
0.19598381221294403,
0.4036928415298462,
0.2058945894241333,
-0.07623748481273651,
0.21772412955760956,
-0.09384670853614807,
-0.18409666419029236,
0.09932375699281693,
0.12485506385564804,
-0.056891705840826035,
0.13432450592517853,
-0.24308514595031738,
-0.1498066782951355,
-0.10354939848184586,
-0.3211066424846649,
-0.20462624728679657,
-0.012355010956525803,
-0.6230451464653015,
0.2277357131242752,
-0.2444358915090561,
-0.19787052273750305,
-0.4473390579223633,
-0.31306999921798706,
0.13335861265659332,
-0.10470784455537796,
-0.09403710067272186,
-0.15594825148582458,
-0.26466798782348633,
-0.2281898856163025,
-0.1567922681570053,
0.4279435873031616,
0.11601099371910095,
-0.7219922542572021,
0.36980193853378296,
-0.23765091598033905,
0.15788891911506653,
0.01562706008553505,
0.12287478148937225,
0.38942697644233704,
0.006511233747005463,
-0.391356498003006,
-0.0421132817864418,
0.19449813663959503,
0.005649760365486145,
0.2766853868961334,
-0.1821456253528595,
0.1977543830871582,
0.2216225564479828,
0.18536049127578735,
0.3401310443878174,
-0.591325581073761,
0.062190622091293335,
0.22565510869026184,
-0.146096333861351,
0.15122190117835999,
0.3226684331893921,
-0.4612342119216919,
-0.2773144543170929,
-0.4807741940021515,
-0.2867172658443451,
-0.23366837203502655,
0.23502282798290253,
0.061545778065919876,
0.24587716162204742,
0.0872718095779419,
0.1719423532485962,
0.00976045336574316,
-0.1583777815103531,
-0.06745413690805435,
0.02995152771472931,
0.0998365581035614,
0.2312120497226715,
-0.02884860523045063,
0.08223648369312286,
-0.18979093432426453,
0.0677475556731224,
-0.3058362603187561,
0.37598854303359985,
-0.15886357426643372,
-0.055805597454309464,
0.02397754043340683,
-0.07957091927528381,
-0.19957640767097473,
-0.024246132001280785,
0.2326524555683136,
-0.14968018233776093,
0.15147124230861664,
-0.06406567245721817,
-0.3030329644680023,
0.32109013199806213,
0.021114587783813477,
0.07135894894599915,
0.12107895314693451,
0.44749099016189575,
0.045008134096860886,
0.2663707733154297,
0.13775572180747986,
-0.22427593171596527,
0.18884946405887604,
-0.2506052553653717,
0.03674984723329544,
0.11185899376869202,
-0.22346553206443787,
0.02253669872879982,
0.005150899291038513,
-0.40131843090057373,
0.3478272259235382,
0.001569175161421299,
-0.0375775471329689,
-0.19380295276641846,
0.10540048778057098,
-0.01824694685637951,
-0.22346073389053345,
0.21748323738574982,
0.41961318254470825,
0.43803396821022034,
-0.22295621037483215,
0.18419459462165833,
-0.08320973813533783,
0.0724719688296318,
-0.3686247169971466,
0.4178563356399536,
0.11372032761573792,
-0.10942990332841873,
-0.594651997089386,
0.0021551994141191244,
-0.3411756455898285,
0.24794593453407288,
0.40854907035827637,
0.3433898985385895,
-0.10452661663293839,
-0.31742343306541443,
0.03639662265777588,
-0.00048487260937690735,
0.7785459756851196,
-0.18007418513298035,
-0.4344998598098755,
0.1727462112903595,
0.08813351392745972,
-0.28637784719467163,
-0.03985907882452011,
-0.09835705161094666,
-0.16274599730968475,
0.2985432744026184,
0.3697766959667206,
-0.20998089015483856,
-0.06477274745702744,
0.3847200572490692,
0.13483570516109467,
0.02038482204079628,
-0.2624105215072632,
-0.014833800494670868,
0.01647850126028061,
-0.17480112612247467,
0.0762098878622055,
-0.0861518457531929,
0.09907086938619614,
0.26485398411750793,
0.12681704759597778,
0.3726120591163635,
-0.19074738025665283,
0.23763005435466766,
0.14390620589256287,
0.31666994094848633,
-0.29129379987716675,
0.13588711619377136,
-0.11549077928066254,
-0.07387526333332062,
0.44781550765037537,
0.15938545763492584,
-0.14039617776870728,
-0.5787125825881958,
-0.06754874438047409,
-0.3437782824039459,
0.7658831477165222,
0.37543725967407227,
-0.13535185158252716,
0.03495905548334122,
0.13136547803878784,
0.023393776267766953,
0.033801525831222534,
0.17238645255565643,
0.08276980370283127,
-0.06649301946163177,
-0.0952954962849617,
-0.4795153737068176,
0.38067272305488586,
0.024715803563594818,
0.029871352016925812,
-0.20004993677139282,
-0.23419882357120514,
-0.43106627464294434,
0.5632410645484924,
-0.23969334363937378,
1.0304057598114014,
0.020434770733118057,
0.18105705082416534,
-0.130600243806839,
0.06739131361246109,
-0.04645167291164398,
-0.1428793966770172,
0.04328404366970062,
-0.23943227529525757,
0.16078606247901917,
-0.2194538414478302,
-0.23166073858737946,
0.45039787888526917,
0.2482958883047104,
-0.13495974242687225,
0.18369239568710327,
-0.05866440385580063,
0.377628356218338,
-0.20382378995418549,
0.007929656654596329,
-0.15128204226493835,
-0.0845317393541336,
0.12077108770608902,
-0.1485111564397812,
-0.15689003467559814,
-0.16651661694049835,
0.18679961562156677,
-0.07405471056699753,
-0.3147010803222656,
-0.1908467411994934,
-0.2964761257171631,
-0.005421878769993782,
-0.03542764484882355,
-0.2069329470396042,
0.26187577843666077,
-0.46826398372650146,
0.18560372292995453,
-0.08301989734172821,
-0.12837150692939758,
-0.07171986997127533,
-0.1527823954820633,
-0.1844494342803955,
0.12353365123271942,
-0.10299579799175262,
-0.024886423721909523,
-0.14992927014827728,
0.004916878417134285,
0.1700439155101776,
-0.12772245705127716,
-0.07438791543245316,
0.08397901058197021,
-0.8884732723236084,
0.1430927813053131,
0.2412814497947693,
0.39437395334243774,
-0.7780073285102844,
-0.33129480481147766,
0.35694828629493713,
-0.04480189085006714,
-0.022985756397247314,
0.001783996820449829,
-0.05352303385734558,
-0.12194690853357315,
0.3843896687030792,
-0.12881870567798615,
-0.16918635368347168,
-0.037945616990327835,
-0.058104731142520905,
-0.010419290512800217,
0.0783902183175087,
0.13673409819602966,
0.10021498799324036,
-0.2912459373474121,
-0.12575995922088623,
-0.08233216404914856,
-0.0943661704659462,
0.13250848650932312,
-0.05968708172440529,
0.0725068598985672,
-0.2201259434223175,
0.2122526615858078,
0.36642971634864807,
0.10057223588228226,
0.17797353863716125,
-0.2152901291847229,
-0.3300778269767761,
0.11501366645097733,
0.3051799535751343,
-0.024292420595884323,
0.3598501980304718,
0.12805289030075073,
0.773283064365387,
-0.38440173864364624,
-0.22642555832862854,
-0.1375449001789093,
0.05032020062208176,
0.4042077362537384,
0.28434255719184875,
0.4056166708469391,
-0.04467105120420456,
-0.13149282336235046,
-0.17469950020313263,
0.030060356482863426,
0.17632736265659332,
-0.026671811938285828,
-0.1023179143667221,
0.03939220681786537,
0.16212855279445648,
0.0855717658996582,
-0.09320125728845596,
-0.07893569767475128,
0.0373372882604599,
-0.14453956484794617,
-0.29158857464790344,
0.21667291224002838,
0.22680076956748962,
-0.08932526409626007,
0.33826854825019836,
0.19551123678684235,
0.008779563009738922,
-0.17773844301700592,
0.34855130314826965,
-0.1674244999885559,
0.2169819474220276,
0.1396108865737915,
0.3251396417617798,
-0.4214647114276886,
0.2034209966659546,
0.27246564626693726,
0.29096871614456177,
0.34506452083587646,
-0.014922138303518295,
0.006754979491233826,
-0.09191860258579254,
0.033266980201005936,
0.054577477276325226,
0.39960673451423645,
0.514991044998169,
-0.18024060130119324,
0.07975926995277405,
0.24523189663887024,
0.05449429899454117,
0.07417700439691544,
-0.16943992674350739,
0.22366344928741455,
0.2968909740447998,
0.01098322868347168,
0.5714567303657532,
0.2552192211151123,
-0.07474353909492493,
0.273099422454834,
-0.18733733892440796,
0.5366066694259644,
0.6413524150848389,
-0.042755257338285446,
0.7638626098632812,
0.11472584307193756,
-0.03380050137639046,
-0.23411205410957336,
0.10962672531604767,
0.2915811538696289,
0.6126319766044617,
0.04043096676468849,
-0.19877691566944122,
0.14624179899692535,
0.563496470451355,
-0.2058628797531128,
-0.2712840735912323,
0.3166121244430542,
0.357122004032135,
-0.17030629515647888,
0.2541062533855438,
-0.0005864724516868591,
0.5668250918388367,
-0.043566279113292694,
0.152816042304039,
-0.10677501559257507,
0.36049768328666687,
-0.22707313299179077,
-0.21546627581119537,
-0.041893370449543,
0.008182935416698456,
-0.04733746498823166,
0.013991836458444595,
-0.08114990592002869,
-0.2638843059539795,
-0.19623857736587524,
-0.0778585821390152,
0.24098917841911316,
0.15607266128063202,
0.42394766211509705,
-0.25603243708610535,
0.1353285312652588,
-0.41160184144973755,
0.08086615055799484,
-0.2526310086250305,
0.17222468554973602,
0.4004548192024231,
-0.15280559659004211,
0.2483529895544052,
0.27688440680503845,
0.1650974452495575,
-0.33030253648757935,
-0.13654085993766785,
0.040206559002399445,
0.02271229401230812,
-0.07133720815181732,
-0.10938143730163574,
0.49510130286216736,
0.33404526114463806,
-0.012013175524771214,
-0.025259120389819145,
0.06975988298654556,
0.18668393790721893,
-0.004556132480502129,
-0.33734843134880066,
0.13230018317699432,
0.1937340945005417,
-0.40054526925086975,
0.024137135595083237,
0.046554211527109146,
-0.21125471591949463,
0.29179900884628296,
0.1468563973903656,
-0.015097461640834808,
0.20093587040901184,
0.5172879695892334,
-0.024288620799779892,
-0.11469526588916779,
0.035398636013269424,
0.006432760506868362,
0.23909029364585876,
-0.1751279979944229,
-0.250049352645874,
-0.29431989789009094,
-0.1267927885055542,
-0.19618789851665497,
-0.2969474494457245,
0.16803023219108582,
0.07431497424840927,
0.3908384442329407,
0.36108797788619995,
-0.2060346156358719,
0.2719752788543701,
-0.29770123958587646,
0.08061155676841736,
-0.2036973237991333,
0.08662431687116623,
0.3870800733566284,
-0.11843305826187134,
0.14039793610572815,
-0.3931940197944641,
-0.02928481623530388,
0.047875165939331055,
-0.1755976676940918,
0.12845811247825623,
0.029061131179332733,
0.26856347918510437,
0.12936915457248688,
-0.06017281115055084,
-0.347776859998703,
0.5284394025802612,
0.004521746188402176,
0.25472187995910645,
-0.061643537133932114,
-0.010128140449523926,
-0.18525314331054688,
0.22984331846237183,
0.07941330969333649,
0.05085362493991852,
-0.3323402404785156,
0.1682233065366745,
-0.053528767079114914,
0.33544600009918213,
0.13902804255485535,
-0.3629630208015442,
-0.26959457993507385,
0.19389872252941132,
-0.46202483773231506,
-0.08228939771652222,
-0.16081561148166656,
0.25575414299964905,
-0.05981438606977463,
-0.017235418781638145,
-0.017452538013458252,
-0.17049914598464966,
0.15256157517433167,
-0.0023034606128931046,
-0.2598719596862793,
0.07559751719236374,
0.055963970720767975,
0.5768006443977356,
0.007387973368167877,
-0.3561667501926422,
-0.22773152589797974,
0.17635606229305267,
-0.04736309498548508,
0.11588872969150543,
0.3077354431152344,
0.1060984879732132,
-0.21950063109397888,
-0.1590825468301773,
-0.029491499066352844,
0.03969181701540947,
-0.22755850851535797,
-0.5391467213630676,
-0.4670064449310303
] |
https://github.com/huggingface/datasets/issues/5486 | Adding `sep` to TextConfig | Hi @albertvillanova, thanks for the quick response!
Indeed, I have been trying to use `csv` instead of `text`. However I am still not able to define range of rows as one sequence, that is achievable with passing `sample_by='paragraph'` to the `TextConfig`
For instance, the below code
```python
import datasets
dataset = datasets.load_dataset(
path='csv',
data_files={'train': TRAINING_SET_PATH},
sep='\t',
header=None,
column_names=['tokens', 'pos_tags', 'chunk_tags', 'ner_tags']
)
```
leads to
```python
dataset
>>> DatasetDict({
train: Dataset({
features: ['tokens', 'pos_tags', 'chunk_tags', 'ner_tags'],
num_rows: 62543
})
})
dataset['train'][0]
>>> {'tokens': 'Distribution',
'pos_tags': 'NN',
'chunk_tags': 'O',
'ner_tags': 'O'
}
```
Is there a way to deal with multiple csv rows as one dataset instance, where each column is a sequence of those rows ? | I have a local a `.txt` file that follows the `CONLL2003` format which I need to load using `load_script`. However, by using `sample_by='line'`, one can only split the dataset into lines without splitting each line into columns. Would it be reasonable to add a `sep` argument in combination with `sample_by='paragraph'` to parse a paragraph into an array for each column ? If so, I am happy to contribute!
## Environment
* `python 3.8.10`
* `datasets 2.9.0`
## Snippet of `train.txt`
```txt
Distribution NN O O
and NN O O
dynamics NN O O
of NN O O
electron NN O B-RP
complexes NN O I-RP
in NN O O
cyanobacterial NN O B-R
membranes NN O I-R
The NN O O
occurrence NN O O
of NN O O
prostaglandin NN O B-R
F2α NN O I-R
in NN O O
Pharbitis NN O B-R
seedlings NN O I-R
grown NN O O
under NN O O
short NN O B-P
days NN O I-P
or NN O I-P
days NN O I-P
```
## Current Behaviour
```python
# defining 4 features ['tokens', 'pos_tags', 'chunk_tags', 'ner_tags'] here would fail with `ValueError: Length of names (4) does not match length of arrays (1)`
dataset = datasets.load_dataset(path='text', features=features, data_files={'train': 'train.txt'}, sample_by='line')
dataset['train']['tokens'][0]
>>> 'Distribution\tNN\tO\tO'
```
## Expected Behaviour / Suggestion
```python
# suppose we defined 4 features ['tokens', 'pos_tags', 'chunk_tags', 'ner_tags']
dataset = datasets.load_dataset(path='text', features=features, data_files={'train': 'train.txt'}, sample_by='paragraph', sep='\t')
dataset['train']['tokens'][0]
>>> ['Distribution', 'and', 'dynamics', ... ]
dataset['train']['ner_tags'][0]
>>> ['O', 'O', 'O', ... ]
``` | 116 | Adding `sep` to TextConfig
I have a local a `.txt` file that follows the `CONLL2003` format which I need to load using `load_script`. However, by using `sample_by='line'`, one can only split the dataset into lines without splitting each line into columns. Would it be reasonable to add a `sep` argument in combination with `sample_by='paragraph'` to parse a paragraph into an array for each column ? If so, I am happy to contribute!
## Environment
* `python 3.8.10`
* `datasets 2.9.0`
## Snippet of `train.txt`
```txt
Distribution NN O O
and NN O O
dynamics NN O O
of NN O O
electron NN O B-RP
complexes NN O I-RP
in NN O O
cyanobacterial NN O B-R
membranes NN O I-R
The NN O O
occurrence NN O O
of NN O O
prostaglandin NN O B-R
F2α NN O I-R
in NN O O
Pharbitis NN O B-R
seedlings NN O I-R
grown NN O O
under NN O O
short NN O B-P
days NN O I-P
or NN O I-P
days NN O I-P
```
## Current Behaviour
```python
# defining 4 features ['tokens', 'pos_tags', 'chunk_tags', 'ner_tags'] here would fail with `ValueError: Length of names (4) does not match length of arrays (1)`
dataset = datasets.load_dataset(path='text', features=features, data_files={'train': 'train.txt'}, sample_by='line')
dataset['train']['tokens'][0]
>>> 'Distribution\tNN\tO\tO'
```
## Expected Behaviour / Suggestion
```python
# suppose we defined 4 features ['tokens', 'pos_tags', 'chunk_tags', 'ner_tags']
dataset = datasets.load_dataset(path='text', features=features, data_files={'train': 'train.txt'}, sample_by='paragraph', sep='\t')
dataset['train']['tokens'][0]
>>> ['Distribution', 'and', 'dynamics', ... ]
dataset['train']['ner_tags'][0]
>>> ['O', 'O', 'O', ... ]
```
Hi @albertvillanova, thanks for the quick response!
Indeed, I have been trying to use `csv` instead of `text`. However I am still not able to define range of rows as one sequence, that is achievable with passing `sample_by='paragraph'` to the `TextConfig`
For instance, the below code
```python
import datasets
dataset = datasets.load_dataset(
path='csv',
data_files={'train': TRAINING_SET_PATH},
sep='\t',
header=None,
column_names=['tokens', 'pos_tags', 'chunk_tags', 'ner_tags']
)
```
leads to
```python
dataset
>>> DatasetDict({
train: Dataset({
features: ['tokens', 'pos_tags', 'chunk_tags', 'ner_tags'],
num_rows: 62543
})
})
dataset['train'][0]
>>> {'tokens': 'Distribution',
'pos_tags': 'NN',
'chunk_tags': 'O',
'ner_tags': 'O'
}
```
Is there a way to deal with multiple csv rows as one dataset instance, where each column is a sequence of those rows ? | [
-0.17985977232456207,
-0.2951112389564514,
-0.13400746881961823,
-0.11365757882595062,
-0.01799459382891655,
0.09609770029783249,
0.6356440782546997,
0.04844085872173309,
-0.06427372992038727,
0.16888821125030518,
0.31319910287857056,
0.3941829204559326,
-0.07302205264568329,
0.6800389885902405,
0.09099232405424118,
-0.015874408185482025,
0.05721883848309517,
0.2524699568748474,
0.19776974618434906,
0.14958734810352325,
-0.28131356835365295,
0.2794163227081299,
-0.26923662424087524,
-0.23567821085453033,
-0.211014986038208,
0.2019423395395279,
0.03916763514280319,
0.1772521585226059,
-0.1346779465675354,
-0.16108132898807526,
0.11064974963665009,
0.007246889173984528,
0.2924581468105316,
-0.04126211255788803,
-0.00012460989819373935,
0.024189308285713196,
-0.07017770409584045,
-0.1733551025390625,
-0.0763649046421051,
0.0047624558210372925,
0.049775660037994385,
-0.050705619156360626,
0.03388594835996628,
-0.2713848054409027,
-0.2636745870113373,
0.2919653356075287,
-0.2698374092578888,
-0.30584752559661865,
0.43091219663619995,
0.40727391839027405,
-0.03719371184706688,
-0.08694957941770554,
-0.3461015224456787,
0.027464624494314194,
0.14553430676460266,
0.5619733333587646,
-0.38702964782714844,
-0.144185408949852,
0.2987707257270813,
-0.0744778960943222,
0.07836601883172989,
0.10950806736946106,
-0.23384153842926025,
0.033980339765548706,
0.5913636088371277,
0.33304455876350403,
-0.1820177137851715,
0.27632594108581543,
-0.14563164114952087,
0.2701496481895447,
0.6053272485733032,
-0.1584007441997528,
-0.16066396236419678,
-0.2656402289867401,
-0.05206548422574997,
-0.36461755633354187,
-0.19956299662590027,
-0.05903194099664688,
-0.3136397898197174,
0.42080360651016235,
-0.11006660014390945,
-0.24951516091823578,
-0.36052343249320984,
-0.04289162904024124,
-0.2538068890571594,
0.40671640634536743,
-0.08019683510065079,
0.01955702155828476,
0.14304091036319733,
-0.04034020006656647,
0.08835086971521378,
-0.051803044974803925,
0.2458006888628006,
0.15371297299861908,
0.035310737788677216,
-0.09953632950782776,
-0.08453711122274399,
-0.6664777994155884,
-0.0949396938085556,
-0.08827118575572968,
0.15110692381858826,
-0.10762137919664383,
0.18428568542003632,
-0.07163535803556442,
0.16625212132930756,
0.18347498774528503,
0.6699848771095276,
0.2934161126613617,
-0.2604093551635742,
-0.33832719922065735,
0.08632735908031464,
-0.10800997167825699,
-0.21357247233390808,
-0.0736454650759697,
-0.17909006774425507,
-0.08592425286769867,
0.02242599055171013,
-0.22113141417503357,
-0.10081294178962708,
0.0069737909361720085,
-0.026547949761152267,
-0.09454172104597092,
-0.009195935912430286,
0.3899202048778534,
0.44138553738594055,
0.30739957094192505,
0.021883275359869003,
0.09353788197040558,
-0.14255166053771973,
-0.0852665901184082,
-0.04018669202923775,
0.0008837375789880753,
-0.04108232632279396,
-0.01697239838540554,
-0.00016473978757858276,
0.05678129941225052,
-0.16550640761852264,
-0.2523215413093567,
-0.03664909303188324,
-0.06335651874542236,
-0.44763246178627014,
-0.0016481736674904823,
0.13468718528747559,
0.0028263889253139496,
-0.02088777720928192,
-0.16910892724990845,
0.025798439979553223,
0.135341614484787,
-0.29988154768943787,
0.2311428189277649,
-0.09817823022603989,
-0.5026571750640869,
-0.060857124626636505,
-0.012026225216686726,
0.05996270477771759,
-0.2605402171611786,
-0.12238498777151108,
0.07777813822031021,
0.6724890470504761,
-0.04007139429450035,
-0.056512780487537384,
-0.2836291193962097,
-0.6320691108703613,
-0.1978224366903305,
0.07071172446012497,
0.26736974716186523,
-0.7107669115066528,
-0.19313795864582062,
-0.1073463037610054,
-0.18941305577754974,
0.32096385955810547,
0.14853979647159576,
-0.35455772280693054,
0.27390632033348083,
-0.027174407616257668,
0.5964360237121582,
0.3897794485092163,
-0.2258395105600357,
0.13774201273918152,
0.6680036783218384,
-0.12587189674377441,
0.018232697620987892,
0.33738550543785095,
-0.011450895108282566,
0.40512651205062866,
0.15885740518569946,
0.38994261622428894,
0.49817895889282227,
0.1410340666770935,
0.05514588952064514,
-0.010478109121322632,
-0.2946632206439972,
0.14238016307353973,
0.39708349108695984,
-0.1871137171983719,
0.17351366579532623,
0.06434871256351471,
-0.1334676593542099,
0.2611483335494995,
-0.3143324851989746,
0.0684163048863411,
0.10500375181436539,
0.27040883898735046,
0.3553173542022705,
0.014864608645439148,
-0.17549285292625427,
-0.3343047797679901,
-0.16919094324111938,
0.7219365835189819,
0.08215213567018509,
0.013618610799312592,
-0.36401575803756714,
-0.020251691341400146,
-0.007707888260483742,
0.09987791627645493,
0.11359724402427673,
-0.11516567319631577,
-0.029671646654605865,
-0.08308009058237076,
-0.37825092673301697,
-0.39241284132003784,
0.4702550172805786,
-0.28482696413993835,
0.1856839507818222,
-0.1918020248413086,
0.006345938891172409,
0.1842440664768219,
-0.14229564368724823,
-0.11480864137411118,
0.3350611627101898,
-0.13626056909561157,
-0.024720732122659683,
0.12907472252845764,
0.06717506051063538,
0.37322288751602173,
-0.0023037344217300415,
-0.17029502987861633,
-0.2536945343017578,
-0.0686979815363884,
0.049627963453531265,
0.02580840326845646,
-0.1775030940771103,
-0.12110180407762527,
-0.12110018730163574,
0.006778433918952942,
0.36212506890296936,
-0.0012094974517822266,
0.5820214152336121,
-0.20426541566848755,
-0.047714777290821075,
0.09961673617362976,
-0.15464352071285248,
-0.07333633303642273,
-0.2980417311191559,
0.09039142727851868,
-0.17872247099876404,
0.3821881115436554,
0.023464372381567955,
-0.1653425395488739,
0.14991740882396698,
-0.12989442050457,
-0.0828319787979126,
-0.15587931871414185,
0.12476147711277008,
-0.007091030478477478,
0.37051641941070557,
-0.031022755429148674,
0.19598381221294403,
0.4036928415298462,
0.2058945894241333,
-0.07623748481273651,
0.21772412955760956,
-0.09384670853614807,
-0.18409666419029236,
0.09932375699281693,
0.12485506385564804,
-0.056891705840826035,
0.13432450592517853,
-0.24308514595031738,
-0.1498066782951355,
-0.10354939848184586,
-0.3211066424846649,
-0.20462624728679657,
-0.012355010956525803,
-0.6230451464653015,
0.2277357131242752,
-0.2444358915090561,
-0.19787052273750305,
-0.4473390579223633,
-0.31306999921798706,
0.13335861265659332,
-0.10470784455537796,
-0.09403710067272186,
-0.15594825148582458,
-0.26466798782348633,
-0.2281898856163025,
-0.1567922681570053,
0.4279435873031616,
0.11601099371910095,
-0.7219922542572021,
0.36980193853378296,
-0.23765091598033905,
0.15788891911506653,
0.01562706008553505,
0.12287478148937225,
0.38942697644233704,
0.006511233747005463,
-0.391356498003006,
-0.0421132817864418,
0.19449813663959503,
0.005649760365486145,
0.2766853868961334,
-0.1821456253528595,
0.1977543830871582,
0.2216225564479828,
0.18536049127578735,
0.3401310443878174,
-0.591325581073761,
0.062190622091293335,
0.22565510869026184,
-0.146096333861351,
0.15122190117835999,
0.3226684331893921,
-0.4612342119216919,
-0.2773144543170929,
-0.4807741940021515,
-0.2867172658443451,
-0.23366837203502655,
0.23502282798290253,
0.061545778065919876,
0.24587716162204742,
0.0872718095779419,
0.1719423532485962,
0.00976045336574316,
-0.1583777815103531,
-0.06745413690805435,
0.02995152771472931,
0.0998365581035614,
0.2312120497226715,
-0.02884860523045063,
0.08223648369312286,
-0.18979093432426453,
0.0677475556731224,
-0.3058362603187561,
0.37598854303359985,
-0.15886357426643372,
-0.055805597454309464,
0.02397754043340683,
-0.07957091927528381,
-0.19957640767097473,
-0.024246132001280785,
0.2326524555683136,
-0.14968018233776093,
0.15147124230861664,
-0.06406567245721817,
-0.3030329644680023,
0.32109013199806213,
0.021114587783813477,
0.07135894894599915,
0.12107895314693451,
0.44749099016189575,
0.045008134096860886,
0.2663707733154297,
0.13775572180747986,
-0.22427593171596527,
0.18884946405887604,
-0.2506052553653717,
0.03674984723329544,
0.11185899376869202,
-0.22346553206443787,
0.02253669872879982,
0.005150899291038513,
-0.40131843090057373,
0.3478272259235382,
0.001569175161421299,
-0.0375775471329689,
-0.19380295276641846,
0.10540048778057098,
-0.01824694685637951,
-0.22346073389053345,
0.21748323738574982,
0.41961318254470825,
0.43803396821022034,
-0.22295621037483215,
0.18419459462165833,
-0.08320973813533783,
0.0724719688296318,
-0.3686247169971466,
0.4178563356399536,
0.11372032761573792,
-0.10942990332841873,
-0.594651997089386,
0.0021551994141191244,
-0.3411756455898285,
0.24794593453407288,
0.40854907035827637,
0.3433898985385895,
-0.10452661663293839,
-0.31742343306541443,
0.03639662265777588,
-0.00048487260937690735,
0.7785459756851196,
-0.18007418513298035,
-0.4344998598098755,
0.1727462112903595,
0.08813351392745972,
-0.28637784719467163,
-0.03985907882452011,
-0.09835705161094666,
-0.16274599730968475,
0.2985432744026184,
0.3697766959667206,
-0.20998089015483856,
-0.06477274745702744,
0.3847200572490692,
0.13483570516109467,
0.02038482204079628,
-0.2624105215072632,
-0.014833800494670868,
0.01647850126028061,
-0.17480112612247467,
0.0762098878622055,
-0.0861518457531929,
0.09907086938619614,
0.26485398411750793,
0.12681704759597778,
0.3726120591163635,
-0.19074738025665283,
0.23763005435466766,
0.14390620589256287,
0.31666994094848633,
-0.29129379987716675,
0.13588711619377136,
-0.11549077928066254,
-0.07387526333332062,
0.44781550765037537,
0.15938545763492584,
-0.14039617776870728,
-0.5787125825881958,
-0.06754874438047409,
-0.3437782824039459,
0.7658831477165222,
0.37543725967407227,
-0.13535185158252716,
0.03495905548334122,
0.13136547803878784,
0.023393776267766953,
0.033801525831222534,
0.17238645255565643,
0.08276980370283127,
-0.06649301946163177,
-0.0952954962849617,
-0.4795153737068176,
0.38067272305488586,
0.024715803563594818,
0.029871352016925812,
-0.20004993677139282,
-0.23419882357120514,
-0.43106627464294434,
0.5632410645484924,
-0.23969334363937378,
1.0304057598114014,
0.020434770733118057,
0.18105705082416534,
-0.130600243806839,
0.06739131361246109,
-0.04645167291164398,
-0.1428793966770172,
0.04328404366970062,
-0.23943227529525757,
0.16078606247901917,
-0.2194538414478302,
-0.23166073858737946,
0.45039787888526917,
0.2482958883047104,
-0.13495974242687225,
0.18369239568710327,
-0.05866440385580063,
0.377628356218338,
-0.20382378995418549,
0.007929656654596329,
-0.15128204226493835,
-0.0845317393541336,
0.12077108770608902,
-0.1485111564397812,
-0.15689003467559814,
-0.16651661694049835,
0.18679961562156677,
-0.07405471056699753,
-0.3147010803222656,
-0.1908467411994934,
-0.2964761257171631,
-0.005421878769993782,
-0.03542764484882355,
-0.2069329470396042,
0.26187577843666077,
-0.46826398372650146,
0.18560372292995453,
-0.08301989734172821,
-0.12837150692939758,
-0.07171986997127533,
-0.1527823954820633,
-0.1844494342803955,
0.12353365123271942,
-0.10299579799175262,
-0.024886423721909523,
-0.14992927014827728,
0.004916878417134285,
0.1700439155101776,
-0.12772245705127716,
-0.07438791543245316,
0.08397901058197021,
-0.8884732723236084,
0.1430927813053131,
0.2412814497947693,
0.39437395334243774,
-0.7780073285102844,
-0.33129480481147766,
0.35694828629493713,
-0.04480189085006714,
-0.022985756397247314,
0.001783996820449829,
-0.05352303385734558,
-0.12194690853357315,
0.3843896687030792,
-0.12881870567798615,
-0.16918635368347168,
-0.037945616990327835,
-0.058104731142520905,
-0.010419290512800217,
0.0783902183175087,
0.13673409819602966,
0.10021498799324036,
-0.2912459373474121,
-0.12575995922088623,
-0.08233216404914856,
-0.0943661704659462,
0.13250848650932312,
-0.05968708172440529,
0.0725068598985672,
-0.2201259434223175,
0.2122526615858078,
0.36642971634864807,
0.10057223588228226,
0.17797353863716125,
-0.2152901291847229,
-0.3300778269767761,
0.11501366645097733,
0.3051799535751343,
-0.024292420595884323,
0.3598501980304718,
0.12805289030075073,
0.773283064365387,
-0.38440173864364624,
-0.22642555832862854,
-0.1375449001789093,
0.05032020062208176,
0.4042077362537384,
0.28434255719184875,
0.4056166708469391,
-0.04467105120420456,
-0.13149282336235046,
-0.17469950020313263,
0.030060356482863426,
0.17632736265659332,
-0.026671811938285828,
-0.1023179143667221,
0.03939220681786537,
0.16212855279445648,
0.0855717658996582,
-0.09320125728845596,
-0.07893569767475128,
0.0373372882604599,
-0.14453956484794617,
-0.29158857464790344,
0.21667291224002838,
0.22680076956748962,
-0.08932526409626007,
0.33826854825019836,
0.19551123678684235,
0.008779563009738922,
-0.17773844301700592,
0.34855130314826965,
-0.1674244999885559,
0.2169819474220276,
0.1396108865737915,
0.3251396417617798,
-0.4214647114276886,
0.2034209966659546,
0.27246564626693726,
0.29096871614456177,
0.34506452083587646,
-0.014922138303518295,
0.006754979491233826,
-0.09191860258579254,
0.033266980201005936,
0.054577477276325226,
0.39960673451423645,
0.514991044998169,
-0.18024060130119324,
0.07975926995277405,
0.24523189663887024,
0.05449429899454117,
0.07417700439691544,
-0.16943992674350739,
0.22366344928741455,
0.2968909740447998,
0.01098322868347168,
0.5714567303657532,
0.2552192211151123,
-0.07474353909492493,
0.273099422454834,
-0.18733733892440796,
0.5366066694259644,
0.6413524150848389,
-0.042755257338285446,
0.7638626098632812,
0.11472584307193756,
-0.03380050137639046,
-0.23411205410957336,
0.10962672531604767,
0.2915811538696289,
0.6126319766044617,
0.04043096676468849,
-0.19877691566944122,
0.14624179899692535,
0.563496470451355,
-0.2058628797531128,
-0.2712840735912323,
0.3166121244430542,
0.357122004032135,
-0.17030629515647888,
0.2541062533855438,
-0.0005864724516868591,
0.5668250918388367,
-0.043566279113292694,
0.152816042304039,
-0.10677501559257507,
0.36049768328666687,
-0.22707313299179077,
-0.21546627581119537,
-0.041893370449543,
0.008182935416698456,
-0.04733746498823166,
0.013991836458444595,
-0.08114990592002869,
-0.2638843059539795,
-0.19623857736587524,
-0.0778585821390152,
0.24098917841911316,
0.15607266128063202,
0.42394766211509705,
-0.25603243708610535,
0.1353285312652588,
-0.41160184144973755,
0.08086615055799484,
-0.2526310086250305,
0.17222468554973602,
0.4004548192024231,
-0.15280559659004211,
0.2483529895544052,
0.27688440680503845,
0.1650974452495575,
-0.33030253648757935,
-0.13654085993766785,
0.040206559002399445,
0.02271229401230812,
-0.07133720815181732,
-0.10938143730163574,
0.49510130286216736,
0.33404526114463806,
-0.012013175524771214,
-0.025259120389819145,
0.06975988298654556,
0.18668393790721893,
-0.004556132480502129,
-0.33734843134880066,
0.13230018317699432,
0.1937340945005417,
-0.40054526925086975,
0.024137135595083237,
0.046554211527109146,
-0.21125471591949463,
0.29179900884628296,
0.1468563973903656,
-0.015097461640834808,
0.20093587040901184,
0.5172879695892334,
-0.024288620799779892,
-0.11469526588916779,
0.035398636013269424,
0.006432760506868362,
0.23909029364585876,
-0.1751279979944229,
-0.250049352645874,
-0.29431989789009094,
-0.1267927885055542,
-0.19618789851665497,
-0.2969474494457245,
0.16803023219108582,
0.07431497424840927,
0.3908384442329407,
0.36108797788619995,
-0.2060346156358719,
0.2719752788543701,
-0.29770123958587646,
0.08061155676841736,
-0.2036973237991333,
0.08662431687116623,
0.3870800733566284,
-0.11843305826187134,
0.14039793610572815,
-0.3931940197944641,
-0.02928481623530388,
0.047875165939331055,
-0.1755976676940918,
0.12845811247825623,
0.029061131179332733,
0.26856347918510437,
0.12936915457248688,
-0.06017281115055084,
-0.347776859998703,
0.5284394025802612,
0.004521746188402176,
0.25472187995910645,
-0.061643537133932114,
-0.010128140449523926,
-0.18525314331054688,
0.22984331846237183,
0.07941330969333649,
0.05085362493991852,
-0.3323402404785156,
0.1682233065366745,
-0.053528767079114914,
0.33544600009918213,
0.13902804255485535,
-0.3629630208015442,
-0.26959457993507385,
0.19389872252941132,
-0.46202483773231506,
-0.08228939771652222,
-0.16081561148166656,
0.25575414299964905,
-0.05981438606977463,
-0.017235418781638145,
-0.017452538013458252,
-0.17049914598464966,
0.15256157517433167,
-0.0023034606128931046,
-0.2598719596862793,
0.07559751719236374,
0.055963970720767975,
0.5768006443977356,
0.007387973368167877,
-0.3561667501926422,
-0.22773152589797974,
0.17635606229305267,
-0.04736309498548508,
0.11588872969150543,
0.3077354431152344,
0.1060984879732132,
-0.21950063109397888,
-0.1590825468301773,
-0.029491499066352844,
0.03969181701540947,
-0.22755850851535797,
-0.5391467213630676,
-0.4670064449310303
] |
https://github.com/huggingface/datasets/issues/5482 | Reload features from Parquet metadata | I'd be happy to have a look, if nobody else has started working on this yet @lhoestq.
It seems to me that for the `arrow` format features are currently attached as metadata [in `datasets.arrow_writer`](https://github.com/huggingface/datasets/blob/5f810b7011a8a4ab077a1847c024d2d9e267b065/src/datasets/arrow_writer.py#L412) and retrieved from the metadata at `load_dataset` time using [`datasets.features.features.from_arrow_schema`](https://github.com/huggingface/datasets/blob/5f810b7011a8a4ab077a1847c024d2d9e267b065/src/datasets/features/features.py#L1602).
This will need to be replicated for `parquet` via calls to [this api](https://arrow.apache.org/docs/python/generated/pyarrow.parquet.write_metadata.html) from `io.parquet.ParquetWriter` and `io.parquet.ParquetReader` [respectively](https://github.com/huggingface/datasets/blob/5f810b7011a8a4ab077a1847c024d2d9e267b065/src/datasets/io/parquet.py#L104).
Any other important considerations?
| The idea would be to allow this :
```python
ds.to_parquet("my_dataset/ds.parquet")
reloaded = load_dataset("my_dataset")
assert ds.features == reloaded.features
```
And it should also work with Image and Audio types (right now they're reloaded as a dict type)
This can be implemented by storing and reading the feature types in the parquet metadata, as we do for arrow files. | 66 | Reload features from Parquet metadata
The idea would be to allow this :
```python
ds.to_parquet("my_dataset/ds.parquet")
reloaded = load_dataset("my_dataset")
assert ds.features == reloaded.features
```
And it should also work with Image and Audio types (right now they're reloaded as a dict type)
This can be implemented by storing and reading the feature types in the parquet metadata, as we do for arrow files.
I'd be happy to have a look, if nobody else has started working on this yet @lhoestq.
It seems to me that for the `arrow` format features are currently attached as metadata [in `datasets.arrow_writer`](https://github.com/huggingface/datasets/blob/5f810b7011a8a4ab077a1847c024d2d9e267b065/src/datasets/arrow_writer.py#L412) and retrieved from the metadata at `load_dataset` time using [`datasets.features.features.from_arrow_schema`](https://github.com/huggingface/datasets/blob/5f810b7011a8a4ab077a1847c024d2d9e267b065/src/datasets/features/features.py#L1602).
This will need to be replicated for `parquet` via calls to [this api](https://arrow.apache.org/docs/python/generated/pyarrow.parquet.write_metadata.html) from `io.parquet.ParquetWriter` and `io.parquet.ParquetReader` [respectively](https://github.com/huggingface/datasets/blob/5f810b7011a8a4ab077a1847c024d2d9e267b065/src/datasets/io/parquet.py#L104).
Any other important considerations?
| [
-0.08376411348581314,
-0.09851483255624771,
-0.0035651326179504395,
0.1099003255367279,
0.10157612711191177,
-0.2267303764820099,
-0.016706716269254684,
0.22576330602169037,
-0.09258498251438141,
-0.2656981945037842,
-0.06625132262706757,
0.8153367638587952,
-0.20344191789627075,
0.436481773853302,
0.12468180060386658,
-0.16599728167057037,
0.08005169034004211,
0.1385003626346588,
-0.03593868762254715,
0.04752045124769211,
-0.0032949261367321014,
-0.08492094278335571,
0.045850932598114014,
-0.004280425608158112,
-0.039179809391498566,
0.033174823969602585,
-0.19185049831867218,
0.23407265543937683,
-0.2092668116092682,
-0.5963115096092224,
-0.00976487435400486,
0.10984237492084503,
0.01248491182923317,
-0.09390845149755478,
-0.00010785582708194852,
0.0374511256814003,
0.2927797734737396,
-0.21020542085170746,
-0.1635732799768448,
0.004512906074523926,
-0.09007246047258377,
-0.28140193223953247,
0.3255547881126404,
-0.2290765345096588,
-0.15107361972332,
-0.42060133814811707,
-0.07061400264501572,
-0.12341863662004471,
0.25073182582855225,
0.21268318593502045,
0.1808280348777771,
0.22963359951972961,
0.1388501077890396,
0.13127174973487854,
0.39529916644096375,
0.4518890380859375,
-0.08040518313646317,
0.002221483737230301,
0.4999760091304779,
0.09759523719549179,
-0.027950488030910492,
0.30826494097709656,
-0.08558744937181473,
-0.16898654401302338,
0.2508969008922577,
0.08854053914546967,
0.14868852496147156,
0.07817229628562927,
0.08339358866214752,
0.1541767120361328,
0.41115063428878784,
-0.2813909351825714,
-0.39997878670692444,
-0.29666632413864136,
0.05641403794288635,
-0.346335232257843,
0.14098690450191498,
0.2851339876651764,
0.045093197375535965,
0.023471303284168243,
0.15795230865478516,
-0.35928818583488464,
0.004998907446861267,
-0.12106314301490784,
-0.07652708888053894,
0.37426844239234924,
-0.06763621419668198,
-0.048838481307029724,
-0.22059784829616547,
-0.2571478486061096,
-0.016538400202989578,
0.049693651497364044,
-0.23928457498550415,
0.19403792917728424,
0.015789657831192017,
-0.04287690296769142,
-0.1710698902606964,
-0.15062600374221802,
0.13959643244743347,
0.4363173842430115,
0.214803546667099,
0.2778637409210205,
-0.18384696543216705,
0.255697637796402,
0.341476708650589,
-0.4190308153629303,
0.01249770075082779,
-0.025519508868455887,
0.014714315533638,
0.22464999556541443,
-0.06525373458862305,
-0.2143285572528839,
0.07456200569868088,
0.19009408354759216,
0.27181991934776306,
-0.32580795884132385,
0.6267701983451843,
-0.08263759315013885,
0.013684069737792015,
-0.0033418722450733185,
0.10152644664049149,
0.06618692725896835,
0.08087200671434402,
0.20291754603385925,
-0.013525781221687794,
0.33622777462005615,
-0.015192165970802307,
0.3331495523452759,
0.05865675210952759,
-0.2568880319595337,
-0.07742505520582199,
0.06468354165554047,
-0.10017343610525131,
0.005011441186070442,
0.22375507652759552,
0.07560139894485474,
0.12725813686847687,
0.30298346281051636,
0.07207006961107254,
-0.20545168220996857,
0.122616708278656,
0.06613576412200928,
-0.06605566293001175,
-0.020604867488145828,
-0.36047106981277466,
-0.29300543665885925,
0.14555373787879944,
-0.016787026077508926,
-0.38787177205085754,
-0.01721823960542679,
-0.2958073616027832,
-0.07226355373859406,
-0.06624875217676163,
0.24103298783302307,
0.02714575082063675,
-0.19893091917037964,
-0.4239978492259979,
0.36631762981414795,
-0.22148528695106506,
-0.10915221273899078,
-0.0007539168000221252,
0.1531154364347458,
0.06317204236984253,
-0.2468130886554718,
0.09097971767187119,
-0.00767025351524353,
-0.23205561935901642,
-0.11253771185874939,
0.12477099150419235,
0.0027472563087940216,
0.1319417506456375,
-0.023517660796642303,
-0.27195119857788086,
-0.3692910075187683,
-0.12004563212394714,
0.10200946033000946,
0.650495171546936,
-0.03897007182240486,
0.1656157225370407,
-0.16974832117557526,
0.14095766842365265,
0.30710098147392273,
0.3241196572780609,
-0.08898144960403442,
0.43554189801216125,
-0.0010307899210602045,
-0.18620777130126953,
0.44827622175216675,
0.03173762187361717,
0.029120726510882378,
-0.18544495105743408,
-0.226895272731781,
0.15381750464439392,
0.02373133972287178,
-0.053010325878858566,
-0.2135029137134552,
0.26881730556488037,
-0.21243402361869812,
0.048134710639715195,
-0.17138542234897614,
0.05700179934501648,
-0.11558358371257782,
0.24577537178993225,
0.41340363025665283,
-0.04982684180140495,
-0.22302740812301636,
-0.2274247407913208,
0.1476547122001648,
-0.16600506007671356,
-0.03541911393404007,
-0.19813726842403412,
-0.2905607223510742,
-0.195488840341568,
0.22591787576675415,
-0.13341225683689117,
-0.23747524619102478,
0.2555775046348572,
0.370248019695282,
-0.08065278828144073,
0.022130075842142105,
-0.3167437016963959,
0.015784678980708122,
0.061081722378730774,
0.10993164777755737,
-0.029117867350578308,
0.30089667439460754,
0.2960847020149231,
-0.19814004004001617,
0.017582286149263382,
0.10626480728387833,
0.05966261401772499,
0.09055063873529434,
0.1990259885787964,
0.5255711674690247,
0.29502493143081665,
0.4618217349052429,
0.1523057222366333,
0.2556643486022949,
0.11076319962739944,
-0.21120519936084747,
0.21621093153953552,
0.005350416526198387,
0.23675838112831116,
0.09077081829309464,
-0.3086003065109253,
0.5317674875259399,
0.18577106297016144,
0.1822625994682312,
0.05292753130197525,
-0.12789392471313477,
0.25939878821372986,
0.16243751347064972,
-0.3915327191352844,
0.03922563046216965,
-0.3870288133621216,
-0.05223887041211128,
-0.11192843317985535,
0.1426105499267578,
-0.6397795081138611,
0.10768599808216095,
0.331036776304245,
-0.016531601548194885,
0.22463959455490112,
0.03375449776649475,
-0.16100722551345825,
-0.15362274646759033,
0.008683593012392521,
-0.19195576012134552,
0.04177197813987732,
0.2869373857975006,
0.0872376412153244,
-0.06953054666519165,
-0.009494547732174397,
0.11823855340480804,
0.33186250925064087,
0.12312628328800201,
0.09436947107315063,
0.019100066274404526,
0.5161741375923157,
-0.2002498060464859,
-0.44444459676742554,
0.236314058303833,
0.08748991787433624,
-0.21036462485790253,
-0.217904195189476,
0.05183456838130951,
-0.24113191664218903,
0.20840910077095032,
-0.3328288793563843,
0.00022691860795021057,
-0.42847561836242676,
-0.03582547605037689,
0.2031174749135971,
0.26832282543182373,
-0.06500527262687683,
0.1543746143579483,
-0.15758882462978363,
0.16279426217079163,
-0.07316198199987411,
-0.4676513969898224,
-0.14530789852142334,
-0.3103543519973755,
-0.012563332915306091,
0.08345665037631989,
0.2230021357536316,
0.18983526527881622,
0.36293676495552063,
0.25143128633499146,
0.11895567178726196,
-0.46559345722198486,
-0.4274269640445709,
-0.04816794395446777,
0.012788739055395126,
-0.17384186387062073,
0.12011410295963287,
0.013361997902393341,
0.2261994630098343,
-0.24020640552043915,
0.22899916768074036,
-0.15894261002540588,
-0.045185890048742294,
0.2069009393453598,
0.02352466620504856,
0.30656713247299194,
0.043178532272577286,
-0.37204983830451965,
-0.16562755405902863,
-0.38781318068504333,
0.494545578956604,
0.3988914489746094,
0.030219200998544693,
-0.13861095905303955,
0.02873413637280464,
-0.1058119386434555,
-0.0955733135342598,
0.46467217803001404,
-0.14957113564014435,
-0.12173361331224442,
0.12352867424488068,
-0.044901277869939804,
-0.015130173414945602,
-0.03208210691809654,
-0.1435110867023468,
0.17957265675067902,
0.21260343492031097,
-0.13919562101364136,
-0.377843976020813,
-0.05029460787773132,
-0.022496448829770088,
-0.09135448932647705,
0.1679392009973526,
0.2705114185810089,
0.21474644541740417,
-0.14857754111289978,
-0.009853191673755646,
-0.031551651656627655,
0.17381134629249573,
0.22117015719413757,
-0.21218755841255188,
0.06765416264533997,
0.21059122681617737,
0.026295531541109085,
0.4578503966331482,
-0.49253302812576294,
-0.04900522157549858,
0.5002793073654175,
-0.18934404850006104,
0.2810472548007965,
-0.12510794401168823,
0.167396679520607,
-0.18203085660934448,
-0.2274223268032074,
0.04975142329931259,
0.09043091535568237,
-0.12904387712478638,
-0.26628726720809937,
-0.09673170000314713,
0.0808127224445343,
-0.3260519206523895,
-0.30021610856056213,
0.17252801358699799,
-0.17453177273273468,
0.2167825996875763,
-0.12257929146289825,
-0.014165449887514114,
-0.220509335398674,
0.12779465317726135,
0.3867063820362091,
0.05452704057097435,
0.164841890335083,
0.06222234293818474,
-0.2515842318534851,
0.16834653913974762,
0.08745843172073364,
0.09668055176734924,
-0.024484042078256607,
0.13035762310028076,
0.25167590379714966,
-0.5445185899734497,
0.07793537527322769,
-0.3069274127483368,
0.32485055923461914,
0.12458164244890213,
0.11015048623085022,
0.08493998646736145,
-0.07999095320701599,
-0.3339315950870514,
-0.20888327062129974,
-0.19639530777931213,
-0.31915396451950073,
-0.13037027418613434,
0.7161480784416199,
-0.5086154341697693,
-0.047501105815172195,
-0.06124510616064072,
-0.04427209869027138,
-0.05003887414932251,
0.3790125548839569,
-0.1347474604845047,
0.07501232624053955,
-0.4733726382255554,
0.24158626794815063,
0.028343891724944115,
0.19629162549972534,
0.15538282692432404,
0.2012336552143097,
-0.5178196430206299,
0.04325014352798462,
-0.03199617564678192,
0.2668716311454773,
0.4885715842247009,
-0.05534319579601288,
0.0005686692893505096,
-0.19527028501033783,
0.4347265958786011,
0.1136920154094696,
0.6044248342514038,
0.18101096153259277,
-0.46294087171554565,
-0.1751353144645691,
0.18919430673122406,
0.41400647163391113,
0.04571741819381714,
0.06938113272190094,
0.34972384572029114,
-0.3030569851398468,
-0.16187149286270142,
-0.5795472860336304,
0.17794807255268097,
0.17259305715560913,
-0.20463718473911285,
-0.10614902526140213,
-0.45573848485946655,
0.7731817960739136,
-0.04189335182309151,
-0.013939186930656433,
-0.12746182084083557,
0.4714367389678955,
-0.2691459059715271,
0.48486047983169556,
0.41058918833732605,
0.8973142504692078,
-0.10547250509262085,
0.07873376458883286,
0.27549612522125244,
-0.5746204257011414,
0.22911161184310913,
-0.4282330870628357,
-0.08162878453731537,
-0.317749559879303,
0.0670919343829155,
-0.034485530108213425,
-0.23332595825195312,
0.005045484751462936,
0.09646061062812805,
-0.27020180225372314,
0.07329458743333817,
-0.007759489119052887,
0.029286477714776993,
-0.03774907439947128,
0.2689964473247528,
-0.11280178278684616,
-0.2077476531267166,
-0.45663610100746155,
0.12637777626514435,
-0.10192486643791199,
-0.46013620495796204,
-0.02980681136250496,
-0.18128971755504608,
0.15183882415294647,
-0.11907779425382614,
-0.08049344271421432,
0.0537569522857666,
-0.27931469678878784,
0.01245921105146408,
0.11711059510707855,
-0.24027834832668304,
-0.03525898978114128,
-0.1688774824142456,
-0.23459862172603607,
0.13169033825397491,
0.004831438884139061,
0.2123659998178482,
0.29766812920570374,
0.02840707264840603,
-0.12274233251810074,
0.055824995040893555,
0.2438206672668457,
0.13871830701828003,
0.06497175246477127,
0.04543483257293701,
-0.1487320065498352,
-0.22691304981708527,
-0.011595651507377625,
-0.1819118708372116,
0.5211379528045654,
-0.15784956514835358,
-0.0538298636674881,
-0.06611232459545135,
-0.12237653136253357,
-0.10978439450263977,
0.11844635009765625,
-0.024193421006202698,
-0.2698501646518707,
-0.16143718361854553,
0.1667606383562088,
-0.10485850274562836,
-0.047166015952825546,
0.052815813571214676,
-0.045633018016815186,
0.14043475687503815,
0.36442551016807556,
0.035748738795518875,
-0.08718331903219223,
-0.17113760113716125,
-0.07940993458032608,
0.18332459032535553,
-0.1950702965259552,
0.1224391758441925,
0.09645003825426102,
-0.3164186477661133,
0.12650847434997559,
0.05468103289604187,
-0.01887635886669159,
0.022677011787891388,
-0.192238450050354,
-0.30249395966529846,
-0.23614491522312164,
0.402190625667572,
0.04205106198787689,
0.28558245301246643,
0.1635890007019043,
-0.13263162970542908,
-0.35519760847091675,
-0.19665010273456573,
-0.37335994839668274,
0.10667935758829117,
0.2202637493610382,
0.32494792342185974,
0.3742818832397461,
-0.047365881502628326,
-0.03885926306247711,
0.1634373664855957,
0.23390072584152222,
-0.08152846992015839,
0.043982796370983124,
-0.24179914593696594,
-0.02160189114511013,
0.07736174762248993,
-0.03129083290696144,
0.412683367729187,
-0.3073788285255432,
0.018398210406303406,
-0.12037347257137299,
-0.24804675579071045,
0.14363154768943787,
-0.15655732154846191,
-0.27838146686553955,
-0.023656971752643585,
0.431538462638855,
0.013601120561361313,
-0.14940795302391052,
-0.025736283510923386,
-0.08888380229473114,
-0.10852448642253876,
-0.11585621535778046,
0.13746267557144165,
-0.375763475894928,
-0.13074138760566711,
0.1718989610671997,
0.45430007576942444,
0.2778174877166748,
0.12057473510503769,
0.23538395762443542,
0.01808423176407814,
-0.2324170470237732,
0.08999227732419968,
0.4016669690608978,
0.4134300947189331,
0.2133542001247406,
-0.04046688973903656,
0.2327708601951599,
0.3130016028881073,
-0.37229740619659424,
-0.09569315612316132,
0.020331960171461105,
-0.2282695323228836,
0.2556636929512024,
0.25799742341041565,
0.19661220908164978,
0.1626150757074356,
-0.35029882192611694,
0.12643057107925415,
-0.022248096764087677,
-0.08084730058908463,
0.1966603398323059,
0.2962987720966339,
-0.03941141813993454,
-0.22864152491092682,
0.04714297130703926,
0.18590225279331207,
0.32294031977653503,
0.062425646930933,
0.10634586215019226,
0.4337070882320404,
0.4936361312866211,
-0.09727844595909119,
0.2235383689403534,
-0.18646115064620972,
-0.06620912253856659,
0.07184421271085739,
0.587336540222168,
0.3730792999267578,
0.2469502091407776,
0.21903881430625916,
0.5725200176239014,
-0.4723959267139435,
-0.12773840129375458,
0.28008782863616943,
0.09029900282621384,
-0.24615134298801422,
0.1672099530696869,
-0.41890573501586914,
-0.37783053517341614,
0.023730561137199402,
-0.013976041227579117,
0.005169406533241272,
-0.11286751925945282,
0.03269462287425995,
0.30216607451438904,
-0.2464732676744461,
-0.09559603780508041,
-0.010510031133890152,
0.2988811135292053,
-0.27855217456817627,
0.07612890005111694,
0.1437987983226776,
-0.20394626259803772,
0.23186297714710236,
0.1266075223684311,
0.18485185503959656,
0.15449103713035583,
-0.35563570261001587,
0.27490732073783875,
-0.10273292660713196,
0.030123097822070122,
-0.11044830828905106,
-0.132523775100708,
0.0478462278842926,
0.047187454998493195,
0.18344363570213318,
0.2124861627817154,
-0.10584691166877747,
-0.23240865767002106,
-0.19344665110111237,
-0.33766523003578186,
-0.34747666120529175,
0.14906898140907288,
0.5093242526054382,
-0.10363039374351501,
-0.10732030868530273,
0.011588893830776215,
-0.2752464711666107,
-0.6592584848403931,
0.16294609010219574,
0.3575848937034607,
0.09517909586429596,
0.24697697162628174,
0.12421368062496185,
0.13688746094703674,
0.3557555079460144,
0.28111717104911804,
-0.34903645515441895,
0.06653513759374619,
-0.03154197335243225,
-0.5273321866989136,
0.08422771096229553,
0.04509817063808441,
-0.3478188216686249,
0.30374765396118164,
0.3616381585597992,
0.5178750157356262,
0.1579311192035675,
-0.14377738535404205,
0.13680796325206757,
0.07390496134757996,
0.1201404482126236,
-0.19855323433876038,
-0.08302563428878784,
0.17649924755096436,
-0.18914878368377686,
-0.03197917714715004,
-0.2001647651195526,
-0.08822950720787048,
-0.20336250960826874,
0.16039201617240906,
0.12092668563127518,
-0.18900296092033386,
-0.15019583702087402,
-0.1327771097421646,
0.35278433561325073,
-0.018449338153004646,
-0.02554219961166382,
-0.11822161823511124,
-0.11929760128259659,
-0.3940252959728241,
-0.34915822744369507,
-0.30680909752845764,
0.2529454529285431,
-0.27225571870803833,
0.3641103208065033,
-0.0021932674571871758,
-0.0304412804543972,
-0.35488277673721313,
0.04493322968482971,
-0.13798093795776367,
-0.41601014137268066,
-0.2599399983882904,
0.1419980227947235,
0.14184409379959106,
-0.02087756246328354,
-0.253383606672287,
0.24490010738372803,
-0.044315703213214874,
0.03533340245485306,
-0.05909299850463867,
-0.32572659850120544,
0.4996822476387024,
-0.2469589114189148,
-0.513779878616333,
-0.023456942290067673,
0.2589988708496094,
0.13559755682945251,
0.23100636899471283,
-0.5840329527854919,
0.06513675302267075,
0.2177179902791977,
-0.1237921193242073,
0.03296177461743355,
-0.0688726156949997,
0.14751020073890686,
-0.18209204077720642,
-0.3303602933883667,
0.046609967947006226,
0.036969251930713654,
0.23258037865161896,
-0.32881423830986023,
-0.3308597803115845
] |
https://github.com/huggingface/datasets/issues/5482 | Reload features from Parquet metadata | Thanks @MFreidank ! That's correct :)
Reading the metadata to infer the features can be ideally done in the `parquet.py` file in `packaged_builder` when a parquet file is read. You can cast the arrow table to the schema you get from the features.arrow_schema | The idea would be to allow this :
```python
ds.to_parquet("my_dataset/ds.parquet")
reloaded = load_dataset("my_dataset")
assert ds.features == reloaded.features
```
And it should also work with Image and Audio types (right now they're reloaded as a dict type)
This can be implemented by storing and reading the feature types in the parquet metadata, as we do for arrow files. | 43 | Reload features from Parquet metadata
The idea would be to allow this :
```python
ds.to_parquet("my_dataset/ds.parquet")
reloaded = load_dataset("my_dataset")
assert ds.features == reloaded.features
```
And it should also work with Image and Audio types (right now they're reloaded as a dict type)
This can be implemented by storing and reading the feature types in the parquet metadata, as we do for arrow files.
Thanks @MFreidank ! That's correct :)
Reading the metadata to infer the features can be ideally done in the `parquet.py` file in `packaged_builder` when a parquet file is read. You can cast the arrow table to the schema you get from the features.arrow_schema | [
-0.2476496398448944,
-0.16579218208789825,
-0.0633038654923439,
0.21691541373729706,
0.05626900866627693,
-0.1824914813041687,
-0.016658436506986618,
0.2160484790802002,
0.03514346107840538,
-0.06509920954704285,
0.09455104172229767,
0.7727559804916382,
-0.26848629117012024,
0.42340928316116333,
0.02382431924343109,
-0.07224022597074509,
0.014039918780326843,
0.2476237714290619,
-0.05381357669830322,
-0.03323047608137131,
-0.13589099049568176,
-0.08769842982292175,
0.0490933358669281,
0.074229896068573,
-0.024176301434636116,
0.004957946017384529,
-0.09070046991109848,
0.15648142993450165,
-0.24236415326595306,
-0.5758734345436096,
0.03376346826553345,
0.047428641468286514,
-0.047166384756565094,
-0.11047496646642685,
-0.00010429565736558288,
0.018834643065929413,
0.20555421710014343,
-0.24782492220401764,
-0.18251679837703705,
0.06445914506912231,
-0.08545787632465363,
-0.335502028465271,
0.28485429286956787,
-0.28303295373916626,
-0.3234103322029114,
-0.3997126817703247,
-0.07962878048419952,
0.00937458872795105,
0.16095377504825592,
0.31579744815826416,
0.23514516651630402,
0.14763952791690826,
0.17152436077594757,
0.1332933008670807,
0.31076493859291077,
0.14843463897705078,
-0.03896765410900116,
-0.06555920839309692,
0.3490617275238037,
0.15872853994369507,
0.08799578249454498,
0.30786386132240295,
-0.05394444987177849,
-0.0011157840490341187,
0.23370766639709473,
0.055382028222084045,
0.26405075192451477,
-0.0365339070558548,
0.04736039787530899,
0.21126902103424072,
0.2600792944431305,
-0.10766587406396866,
-0.21904292702674866,
-0.3288002014160156,
0.06007968634366989,
-0.28581130504608154,
0.05512503534555435,
0.22805866599082947,
0.015614578500390053,
0.009132269769906998,
0.16475938260555267,
-0.3780384659767151,
0.0313592404127121,
-0.1494336724281311,
-0.2838662564754486,
0.41909268498420715,
-0.03409312292933464,
0.039324067533016205,
-0.21339143812656403,
-0.23472730815410614,
0.10653907805681229,
0.081279456615448,
-0.30662140250205994,
0.11260683834552765,
0.06555713713169098,
-0.07501855492591858,
0.013280928134918213,
-0.07393795996904373,
0.0025915540754795074,
0.33837807178497314,
0.1647355556488037,
0.2935049533843994,
-0.06573987752199173,
0.24251782894134521,
0.28397759795188904,
-0.4557386338710785,
-0.10803443938493729,
0.0880318209528923,
-0.0038316547870635986,
0.29117196798324585,
-0.28197455406188965,
-0.15710985660552979,
0.0024021221324801445,
0.13797937333583832,
0.2972136437892914,
-0.2944997549057007,
0.6276443600654602,
-0.039672911167144775,
-0.06972004473209381,
0.033457234501838684,
0.17825379967689514,
0.11165964603424072,
0.18063931167125702,
0.35452979803085327,
0.029844380915164948,
0.25575751066207886,
-0.01073288731276989,
0.2066633254289627,
0.1135496273636818,
-0.19697390496730804,
-0.12234193086624146,
0.019492262974381447,
-0.02928822487592697,
-0.11603795737028122,
0.12974770367145538,
0.13418450951576233,
0.16023163497447968,
0.13324697315692902,
0.0860709398984909,
-0.27558502554893494,
0.10999950766563416,
-0.06166916713118553,
0.09257660806179047,
-0.01758241280913353,
-0.3845890760421753,
-0.3504338562488556,
0.22070232033729553,
-0.029460620135068893,
-0.398192435503006,
-0.009483665227890015,
-0.41089916229248047,
-0.13446705043315887,
-0.047967515885829926,
0.29008781909942627,
0.017750609666109085,
-0.126263827085495,
-0.31428125500679016,
0.3284360468387604,
-0.17628213763237,
-0.14629840850830078,
0.03506149351596832,
0.03328227251768112,
0.11916732788085938,
-0.21125487983226776,
0.09771879017353058,
-0.11267244815826416,
-0.2362893521785736,
-0.09914630651473999,
0.08397619426250458,
-0.12757322192192078,
0.010513849556446075,
-0.16342540085315704,
-0.28778690099716187,
-0.14406058192253113,
-0.13508541882038116,
-0.021398555487394333,
0.7537900805473328,
0.09485720098018646,
0.059186309576034546,
-0.30717039108276367,
0.12557049095630646,
0.32733988761901855,
0.19595405459403992,
0.04835045710206032,
0.4021603763103485,
0.06997931748628616,
-0.11934122443199158,
0.33129531145095825,
0.05181223899126053,
-0.012095242738723755,
-0.10209521651268005,
-0.178635373711586,
0.23501338064670563,
-0.09649153053760529,
0.09228283166885376,
-0.11639676243066788,
0.1880640834569931,
-0.16895020008087158,
0.07411092519760132,
-0.12150028347969055,
-0.12094845622777939,
-0.15089266002178192,
0.2762211859226227,
0.30285823345184326,
-0.014818677678704262,
-0.3109784722328186,
-0.07727090269327164,
0.25705766677856445,
-0.21117229759693146,
-0.028773203492164612,
-0.22433407604694366,
-0.28165578842163086,
-0.16556742787361145,
0.3120141923427582,
-0.10019868612289429,
-0.16348601877689362,
0.3272453546524048,
0.28868475556373596,
-0.16593888401985168,
-0.1006041020154953,
-0.318705290555954,
-0.04126445949077606,
-0.03518376499414444,
0.06396228820085526,
0.11614906787872314,
0.2566840350627899,
0.24057534337043762,
-0.13585495948791504,
0.053783588111400604,
0.11005811393260956,
0.0781978964805603,
0.05425405502319336,
0.20523402094841003,
0.3905154764652252,
0.3341357409954071,
0.22230878472328186,
0.11797194927930832,
0.13699187338352203,
-0.10217311978340149,
-0.1939113885164261,
0.06990599632263184,
0.03127807751297951,
0.21726617217063904,
0.15270856022834778,
-0.03038521111011505,
0.43710291385650635,
0.3064653277397156,
0.16799843311309814,
0.04616229236125946,
-0.08543365448713303,
0.31566011905670166,
0.13211609423160553,
-0.26799020171165466,
-0.06612507253885269,
-0.5326510667800903,
-0.09217849373817444,
-0.3013348877429962,
0.20919863879680634,
-0.5578060746192932,
0.176656574010849,
0.48095694184303284,
0.10106641054153442,
0.2379283607006073,
-0.05468487739562988,
-0.05744738131761551,
-0.07369720935821533,
0.048658959567546844,
-0.059842973947525024,
0.029947921633720398,
0.2112378478050232,
0.062052689492702484,
-0.09889869391918182,
-0.22936496138572693,
0.22452840209007263,
0.28538188338279724,
0.2109774351119995,
0.054027970880270004,
-0.0225876122713089,
0.37658390402793884,
-0.23427191376686096,
-0.35321831703186035,
0.2394043207168579,
0.007287453860044479,
-0.06845690310001373,
-0.24658061563968658,
0.13194073736667633,
-0.2798963487148285,
0.10566959530115128,
-0.2863878309726715,
0.10076331347227097,
-0.2928451597690582,
-0.03511451929807663,
0.2840958833694458,
0.10759986937046051,
-0.11833055317401886,
0.1203029677271843,
-0.29815059900283813,
0.219447523355484,
-0.08738422393798828,
-0.5301142930984497,
0.010715343058109283,
-0.2986837327480316,
-0.049602024257183075,
0.1278952658176422,
0.1215565949678421,
0.22852934896945953,
0.33445632457733154,
0.1855577975511551,
0.11884644627571106,
-0.41373229026794434,
-0.3728312849998474,
-0.005534660071134567,
-0.01760275289416313,
-0.12855543196201324,
0.19516915082931519,
0.09458226710557938,
0.2986830472946167,
-0.24677816033363342,
0.1979394257068634,
-0.092605821788311,
-0.04173079878091812,
0.18759632110595703,
0.04167720675468445,
0.10936218500137329,
0.10985562205314636,
-0.40652477741241455,
-0.14587554335594177,
-0.37124234437942505,
0.2917416989803314,
0.5668281316757202,
0.1185019314289093,
-0.339315801858902,
0.11424903571605682,
-0.09697321802377701,
-0.022928187623620033,
0.42206084728240967,
-0.17364192008972168,
-0.004225615411996841,
0.013838879764080048,
0.06273007392883301,
0.06088809669017792,
0.04237861558794975,
-0.29276514053344727,
0.27983495593070984,
0.2017982304096222,
-0.14099779725074768,
-0.1838376671075821,
-0.033822737634181976,
-0.010638032108545303,
-0.0284372940659523,
0.06854740530252457,
0.34409767389297485,
0.3353287875652313,
-0.2175978571176529,
0.001577954739332199,
0.0020521897822618484,
0.22287380695343018,
0.28776130080223083,
-0.034014247357845306,
0.039255291223526,
0.20326828956604004,
-0.03423668444156647,
0.4129374623298645,
-0.5008038878440857,
-0.1733662337064743,
0.5282549858093262,
-0.26181647181510925,
0.353660523891449,
-0.14998185634613037,
0.18556848168373108,
-0.30866897106170654,
-0.07848592102527618,
-0.006295252591371536,
0.02166391909122467,
-0.21946009993553162,
-0.29831045866012573,
-0.10193511098623276,
0.1363081932067871,
-0.32431313395500183,
-0.3230783939361572,
0.21646571159362793,
-0.3041439950466156,
0.2185794711112976,
-0.0945991575717926,
-0.014477785676717758,
-0.1516236513853073,
0.07183665782213211,
0.28290438652038574,
-0.09578114748001099,
0.11125660687685013,
-0.015026134438812733,
-0.2322755604982376,
0.07115528732538223,
0.29504141211509705,
0.1618601232767105,
-0.10650916397571564,
0.12228019535541534,
0.2659236192703247,
-0.5812457799911499,
0.0577925480902195,
-0.34584102034568787,
0.09314022213220596,
0.029591690748929977,
0.09356918185949326,
0.050607915967702866,
0.05320648103952408,
-0.19561906158924103,
-0.21498070657253265,
-0.12306980788707733,
-0.2663199305534363,
-0.21990370750427246,
0.5941921472549438,
-0.4196647107601166,
-0.019820241257548332,
0.09503064304590225,
0.0722881481051445,
-0.21115049719810486,
0.5110607147216797,
-0.25960418581962585,
0.11404979974031448,
-0.4018220901489258,
0.28657516837120056,
0.017715366557240486,
0.1262076199054718,
0.13262975215911865,
0.15733473002910614,
-0.5982451438903809,
0.02998775988817215,
-0.1085241287946701,
0.3777613043785095,
0.6071252822875977,
-0.13285207748413086,
-0.006139103323221207,
-0.2432456612586975,
0.4591243267059326,
0.1583407074213028,
0.7093599438667297,
0.05149521306157112,
-0.32043391466140747,
-0.26019275188446045,
0.13532982766628265,
0.39769211411476135,
0.07665305584669113,
-0.08960813283920288,
0.36687174439430237,
-0.4125630855560303,
-0.058416128158569336,
-0.495341420173645,
0.23310722410678864,
0.23761114478111267,
-0.1891939342021942,
-0.05350266024470329,
-0.4553196132183075,
0.588657021522522,
-0.16714492440223694,
-0.10753178596496582,
-0.11466957628726959,
0.4268583059310913,
-0.3289063274860382,
0.6183123588562012,
0.41509395837783813,
0.8631290197372437,
-0.008831053972244263,
0.032378651201725006,
0.15432804822921753,
-0.45762932300567627,
0.07640094310045242,
-0.39005106687545776,
-0.03822368010878563,
-0.25588905811309814,
0.009880728088319302,
-0.11224149167537689,
-0.20090056955814362,
-0.0009099841117858887,
0.1752520352602005,
-0.1933773159980774,
0.15068314969539642,
-0.12717196345329285,
-0.023613285273313522,
-0.12285086512565613,
0.07648556679487228,
0.006204711273312569,
-0.002900645136833191,
-0.35908445715904236,
0.16990825533866882,
-0.01666226238012314,
-0.3439911901950836,
-0.06411450356245041,
-0.010069817304611206,
0.09305022656917572,
-0.23498353362083435,
-0.10974776744842529,
-0.06684382259845734,
-0.12513478100299835,
-0.023762762546539307,
0.19856929779052734,
-0.1331097036600113,
-0.2146245390176773,
-0.11925831437110901,
-0.2731460928916931,
0.21315009891986847,
0.04990819841623306,
0.2620331048965454,
0.36625850200653076,
-0.00592094985768199,
-0.04462429881095886,
0.1549770087003708,
0.26492056250572205,
0.10213723033666611,
-0.026359714567661285,
0.1534690260887146,
-0.1561439484357834,
-0.18477162718772888,
0.027692437171936035,
-0.0263538658618927,
0.4585118293762207,
-0.12654420733451843,
-0.21453160047531128,
-0.0786736011505127,
-0.06433094292879105,
-0.1164410412311554,
0.17585842311382294,
-0.041793227195739746,
-0.30512186884880066,
-0.015044406056404114,
0.2057003527879715,
-0.14564086496829987,
0.024510500952601433,
-0.03731951862573624,
-0.06553874164819717,
0.20758593082427979,
0.30806052684783936,
-0.2539888024330139,
-0.010474525392055511,
-0.22073116898536682,
-0.03343317657709122,
0.1658175140619278,
-0.10638861358165741,
0.04860151559114456,
0.13814949989318848,
-0.4274507164955139,
0.1700822412967682,
0.17993983626365662,
0.05966527760028839,
0.18525606393814087,
-0.2590295374393463,
-0.2885408401489258,
-0.1906069964170456,
0.39579230546951294,
0.029641972854733467,
0.4046517312526703,
-0.034294407814741135,
-0.20290814340114594,
-0.26313236355781555,
-0.09573473036289215,
-0.40344125032424927,
0.08073533326387405,
-0.10974381119012833,
0.35711950063705444,
0.1881982982158661,
0.14298108220100403,
-0.21424156427383423,
0.05033805966377258,
0.2936292588710785,
-0.1239369809627533,
0.016879422590136528,
-0.29840919375419617,
-0.029223833233118057,
0.06657969206571579,
-0.08695640414953232,
0.5849081873893738,
-0.336965948343277,
-0.07945742458105087,
-0.08529917895793915,
-0.14918161928653717,
0.07034119963645935,
-0.22698134183883667,
-0.21504051983356476,
-0.011422342620790005,
0.508102297782898,
-0.0807662233710289,
-0.11768379807472229,
0.02197670377790928,
-0.17200806736946106,
-0.07977817952632904,
-0.12614041566848755,
0.08589242398738861,
-0.38882264494895935,
-0.10127054899930954,
0.266692191362381,
0.4173629581928253,
0.14448314905166626,
0.11299847811460495,
0.257539302110672,
0.17550188302993774,
-0.09279221296310425,
0.026767151430249214,
0.29137876629829407,
0.48240339756011963,
0.15901139378547668,
-0.10211581736803055,
0.26208755373954773,
0.36782461404800415,
-0.500446081161499,
-0.0640178993344307,
-0.056313421577215195,
-0.30054283142089844,
0.3206266760826111,
0.35799792408943176,
0.17224633693695068,
0.1790269911289215,
-0.20796717703342438,
0.07343661785125732,
-0.03095846250653267,
-0.1736755669116974,
0.21087634563446045,
0.25134509801864624,
-0.0656818225979805,
-0.1739380657672882,
0.044511646032333374,
0.14212961494922638,
0.29284629225730896,
0.23370757699012756,
0.10916803777217865,
0.2887363135814667,
0.46223318576812744,
-0.1830335110425949,
0.33933383226394653,
-0.06358583271503448,
0.0015147887170314789,
-0.030119195580482483,
0.5510209798812866,
0.3222914934158325,
0.24496464431285858,
0.03730810806155205,
0.5143336057662964,
-0.49314847588539124,
-0.09335432946681976,
0.20335590839385986,
0.029006021097302437,
-0.19588197767734528,
0.1956549882888794,
-0.4487232565879822,
-0.3641327917575836,
-0.12433226406574249,
0.14611390233039856,
-0.06895166635513306,
-0.2383967936038971,
0.012683678418397903,
0.2244006246328354,
-0.1264810413122177,
-0.07836191356182098,
-0.07678990066051483,
0.22655713558197021,
-0.2792336940765381,
0.10353317856788635,
0.07889474183320999,
-0.08758220076560974,
0.3428545296192169,
-0.002204807475209236,
0.06846241652965546,
0.11903727799654007,
-0.3045286238193512,
0.2087039351463318,
-0.02966022491455078,
-0.02169620245695114,
-0.2803429663181305,
-0.18470661342144012,
0.057708024978637695,
0.12139418721199036,
0.2543755769729614,
0.24145826697349548,
-0.1631467640399933,
-0.15172672271728516,
-0.23337067663669586,
-0.24055349826812744,
-0.3163415789604187,
0.33098289370536804,
0.48439690470695496,
-0.1340998411178589,
-0.2078399807214737,
-0.04475641995668411,
-0.24811634421348572,
-0.661298930644989,
0.1281624734401703,
0.2389080822467804,
0.1405726969242096,
0.21651111543178558,
0.13868066668510437,
0.12191760540008545,
0.40045902132987976,
0.049552954733371735,
-0.15814563632011414,
0.009976936504244804,
-0.057574138045310974,
-0.6320213079452515,
0.07832234352827072,
-0.05410170182585716,
-0.4618487060070038,
0.35820460319519043,
0.3091871738433838,
0.47982481122016907,
0.11173117905855179,
0.029144614934921265,
0.22901248931884766,
0.058047667145729065,
0.1263582557439804,
-0.21436551213264465,
-0.2281462401151657,
0.08838129043579102,
-0.16460347175598145,
-0.009721077978610992,
-0.18853047490119934,
-0.12845049798488617,
-0.2123551219701767,
0.18779036402702332,
0.23444773256778717,
-0.2670067548751831,
-0.08708509802818298,
-0.1129523366689682,
0.3992346227169037,
-0.18697620928287506,
0.10806518793106079,
-0.13197112083435059,
0.08573992550373077,
-0.2509186565876007,
-0.36575978994369507,
-0.32930895686149597,
0.23470190167427063,
-0.1170249730348587,
0.29107123613357544,
0.10566035658121109,
0.11258681118488312,
-0.2969037592411041,
-0.14504963159561157,
0.03801575303077698,
-0.3386698067188263,
-0.2154577672481537,
0.1353176087141037,
0.14748328924179077,
0.02394746243953705,
-0.08885069191455841,
0.14496839046478271,
0.02917369268834591,
-0.04860338568687439,
0.035449281334877014,
-0.3537138104438782,
0.5568912029266357,
0.06668806821107864,
-0.5135018229484558,
-0.027795325964689255,
0.37836337089538574,
0.07233771681785583,
0.16547593474388123,
-0.5227541327476501,
-0.05048187077045441,
0.30390819907188416,
-0.18179678916931152,
0.024537671357393265,
-0.08860450983047485,
0.1656598001718521,
-0.04691346734762192,
-0.32293257117271423,
0.14577272534370422,
-0.07145828753709793,
0.2629930377006531,
-0.4227852523326874,
-0.27921393513679504
] |
https://github.com/huggingface/datasets/issues/5481 | Load a cached dataset as iterable | Hi ! Sure :) you can comment `#self-assign` to assign yourself to this issue.
I can give you some pointers to get started:
`load_dataset` works roughly this way:
1. it instantiate a dataset builder using `load_dataset_builder()`
2. the builder download and prepare the dataset as Arrow files in the cache using `download_and_prepare()`
3. the builder returns a Dataset object with `as_dataset()`
One way to approach this would be to implement `as_iterable_dataset()` in `builder.py`.
And similarly to `as_dataset()`, you can use the `ArrowReader`. It has a `get_file_instructions()` method that can be helpful. It gives you the files to read as list of dictionaries with those keys: `filename`, `skip` and `take`.
The `skip` and `take` arguments are used in case the user wants to load a subset of the dataset, e.g.
```python
load_dataset(..., split="train[:10]")
```
Let me know if you have questions or if I can help :) | The idea would be to allow something like
```python
ds = load_dataset("c4", "en", as_iterable=True)
```
To be used to train models. It would load an IterableDataset from the cached Arrow files.
Cc @stas00
Edit : from the discussions we may load from cache when streaming=True | 146 | Load a cached dataset as iterable
The idea would be to allow something like
```python
ds = load_dataset("c4", "en", as_iterable=True)
```
To be used to train models. It would load an IterableDataset from the cached Arrow files.
Cc @stas00
Edit : from the discussions we may load from cache when streaming=True
Hi ! Sure :) you can comment `#self-assign` to assign yourself to this issue.
I can give you some pointers to get started:
`load_dataset` works roughly this way:
1. it instantiate a dataset builder using `load_dataset_builder()`
2. the builder download and prepare the dataset as Arrow files in the cache using `download_and_prepare()`
3. the builder returns a Dataset object with `as_dataset()`
One way to approach this would be to implement `as_iterable_dataset()` in `builder.py`.
And similarly to `as_dataset()`, you can use the `ArrowReader`. It has a `get_file_instructions()` method that can be helpful. It gives you the files to read as list of dictionaries with those keys: `filename`, `skip` and `take`.
The `skip` and `take` arguments are used in case the user wants to load a subset of the dataset, e.g.
```python
load_dataset(..., split="train[:10]")
```
Let me know if you have questions or if I can help :) | [
-0.4401951730251312,
0.035374611616134644,
-0.08761930465698242,
0.09599576890468597,
0.1853853464126587,
0.2552606165409088,
0.2815189063549042,
0.4225122928619385,
0.1766819953918457,
-0.13068343698978424,
-0.05066940188407898,
0.16501735150814056,
-0.37842506170272827,
0.08378496766090393,
0.06512730568647385,
-0.1622554212808609,
-0.08110245317220688,
0.25629884004592896,
-0.19663342833518982,
0.0741749107837677,
-0.07694701850414276,
-0.1512978971004486,
0.061039507389068604,
-0.08240298926830292,
-0.07408169656991959,
-0.16140787303447723,
0.05617472529411316,
0.10627803206443787,
-0.06173986941576004,
-0.5439608693122864,
0.23492802679538727,
0.24997130036354065,
0.33233442902565,
0.19659584760665894,
-0.00009804491128306836,
0.07854579389095306,
0.03763008862733841,
-0.15626433491706848,
-0.4466244578361511,
0.07111804187297821,
-0.07731947302818298,
-0.023148156702518463,
0.27660003304481506,
-0.2947922348976135,
-0.27039098739624023,
-0.2392568439245224,
0.029254794120788574,
-0.5517253875732422,
0.5843073129653931,
0.22887276113033295,
0.31327784061431885,
0.009263819083571434,
-0.2225106805562973,
0.05454568564891815,
-0.05931008607149124,
-0.2222483605146408,
-0.20155490934848785,
0.24506600201129913,
0.19131436944007874,
0.12299612164497375,
-0.05827317386865616,
0.4072526693344116,
-0.06717486679553986,
0.11624014377593994,
0.3021269142627716,
-0.046595316380262375,
0.18766051530838013,
-0.2196844220161438,
-0.13612505793571472,
0.19473785161972046,
0.41493508219718933,
-0.3372783660888672,
-0.36145755648612976,
-0.4658275544643402,
0.01880209892988205,
-0.5027965307235718,
-0.24108996987342834,
0.16627173125743866,
-0.1603061705827713,
0.24163725972175598,
-0.00597288366407156,
-0.1905282735824585,
-0.1687888503074646,
-0.10677020251750946,
0.21496427059173584,
0.11229406297206879,
0.04525354132056236,
-0.007797673344612122,
0.24351975321769714,
0.0607413724064827,
0.41008883714675903,
0.0359601154923439,
-0.07607047259807587,
0.22995302081108093,
-0.3553098440170288,
-0.03757857531309128,
-0.011671558022499084,
0.038674045354127884,
0.150546133518219,
0.24022096395492554,
0.49449118971824646,
0.2798186242580414,
-0.029135119169950485,
0.09105567634105682,
0.15007294714450836,
0.04932544007897377,
-0.007849149405956268,
0.04761436581611633,
0.01656915992498398,
0.17198175191879272,
-0.2700924277305603,
-0.19545769691467285,
-0.2853397727012634,
-0.16879668831825256,
0.24086596071720123,
0.025766275823116302,
-0.06425030529499054,
0.03960251435637474,
0.008163588121533394,
-0.1781328022480011,
-0.0031429454684257507,
-0.009809698909521103,
0.17123858630657196,
0.39115265011787415,
-0.13859975337982178,
0.2909615933895111,
-0.043634094297885895,
0.10540848225355148,
0.034055233001708984,
-0.1670641452074051,
-0.13848130404949188,
-0.14412325620651245,
-0.19200639426708221,
0.1343420445919037,
0.12146590650081635,
-0.21884754300117493,
0.16910165548324585,
-0.21592850983142853,
0.079676553606987,
0.06745662540197372,
0.4564583897590637,
-0.08610965311527252,
0.36491936445236206,
0.04329587519168854,
-0.1994996815919876,
-0.10144839435815811,
0.21639838814735413,
-0.1847102791070938,
-0.2487439513206482,
-0.03087637573480606,
-0.07097113877534866,
-0.3188798725605011,
0.24621938169002533,
0.2901434302330017,
-0.04022861272096634,
-0.05865386128425598,
-0.19560661911964417,
0.39333927631378174,
0.14406153559684753,
-0.11568209528923035,
0.10637878626585007,
-0.05747804045677185,
-0.002468489110469818,
-0.22882600128650665,
0.2574829161167145,
0.434983491897583,
-0.2547592520713806,
-0.1394725888967514,
-0.03318769112229347,
0.01888906955718994,
-0.10983789712190628,
0.09957250952720642,
-0.3601011037826538,
0.06823968142271042,
-0.13126660883426666,
0.048650920391082764,
0.5224424600601196,
-0.16137365996837616,
-0.27293655276298523,
0.18979717791080475,
0.040112562477588654,
0.29537612199783325,
0.17319351434707642,
0.22985945641994476,
0.09313062578439713,
0.014950767159461975,
-0.008668392896652222,
0.38302141427993774,
-0.11549679934978485,
-0.06259535253047943,
-0.1562781035900116,
-0.19045522809028625,
0.20087553560733795,
0.2712288498878479,
0.08777917921543121,
0.04948269575834274,
-0.0692453607916832,
-0.14364546537399292,
0.39981019496917725,
-0.3557640314102173,
0.14073064923286438,
0.014886602759361267,
0.03990979120135307,
0.0060829296708106995,
0.12000443786382675,
-0.1372239738702774,
-0.317566454410553,
0.31141000986099243,
0.001644577831029892,
-0.264565646648407,
-0.12342275679111481,
-0.2691308259963989,
0.028382711112499237,
0.13383007049560547,
-0.3322184085845947,
-0.17774760723114014,
0.264893114566803,
0.08134735375642776,
0.13473249971866608,
-0.11579872667789459,
-0.4844546616077423,
0.3328758478164673,
-0.24161911010742188,
-0.05859619751572609,
-0.23916132748126984,
-0.007676782086491585,
0.15726768970489502,
0.030794434249401093,
-0.18264906108379364,
0.05574103444814682,
-0.09833230823278427,
-0.07091417163610458,
-0.029438570141792297,
0.3473222553730011,
-0.051697276532649994,
0.10115943849086761,
0.052828624844551086,
0.4132404923439026,
0.09237431734800339,
-0.2093157023191452,
0.0649382472038269,
0.25879204273223877,
0.06907767802476883,
-0.08214211463928223,
0.006079129874706268,
0.46413934230804443,
0.011287566274404526,
0.3178136348724365,
0.2647058367729187,
-0.005220787599682808,
0.3143182694911957,
0.037488412111997604,
-0.3452257513999939,
-0.09296178817749023,
-0.11917664110660553,
-0.1868845522403717,
0.41390863060951233,
-0.09674376249313354,
-0.23335179686546326,
0.2453012764453888,
0.3389051556587219,
0.25430914759635925,
0.021217044442892075,
-0.02845190465450287,
-0.34479960799217224,
-0.06634339690208435,
0.14140000939369202,
0.266353577375412,
0.12193426489830017,
0.2529231011867523,
0.24421244859695435,
0.020277880132198334,
0.02061052806675434,
-0.018446259200572968,
0.21238493919372559,
0.0015816614031791687,
0.24524448812007904,
0.12543007731437683,
0.0027707479894161224,
-0.22157597541809082,
-0.2771322429180145,
-0.14599063992500305,
0.06401500105857849,
-0.06155548244714737,
0.05104072019457817,
0.32151344418525696,
-0.1710553616285324,
-0.06398920714855194,
-0.11183026432991028,
-0.26764315366744995,
0.030092604458332062,
-0.01841093599796295,
0.09429782629013062,
0.25554516911506653,
-0.0959039181470871,
0.1459517776966095,
-0.41851264238357544,
0.3368525505065918,
0.09935544431209564,
-0.21934755146503448,
-0.11471831798553467,
-0.408032089471817,
0.03364688530564308,
0.17458459734916687,
0.2252413034439087,
-0.31986701488494873,
0.3470205068588257,
0.056776560842990875,
-0.048729751259088516,
-0.12759646773338318,
0.04053483158349991,
0.13099823892116547,
0.17937321960926056,
-0.05565520375967026,
-0.005472026765346527,
0.10283598303794861,
0.024670109152793884,
-0.1794312745332718,
0.11919005215167999,
-0.22673620283603668,
0.08419805020093918,
0.033483147621154785,
0.028566818684339523,
0.21936801075935364,
0.0023944079875946045,
-0.23741427063941956,
-0.3652642071247101,
-0.46459004282951355,
0.29760515689849854,
0.28574255108833313,
0.12516248226165771,
0.34935516119003296,
0.18072053790092468,
0.07788843661546707,
0.2107040286064148,
0.07739195227622986,
-0.08228415250778198,
-0.26795485615730286,
0.35101890563964844,
-0.30345648527145386,
-0.13457061350345612,
-0.023251745849847794,
-0.2817844748497009,
0.14993757009506226,
0.2782878875732422,
-0.2957531809806824,
0.08017944544553757,
0.009472023695707321,
0.1218334287405014,
-0.04147868603467941,
-0.24595268070697784,
0.2934020459651947,
0.22920311987400055,
-0.10881379246711731,
-0.17380458116531372,
0.30444568395614624,
0.2408750057220459,
-0.19931739568710327,
0.022391855716705322,
0.07144095748662949,
0.12225467711687088,
0.1247958242893219,
0.8085331916809082,
0.1514957696199417,
-0.06895191967487335,
0.36376065015792847,
0.0016841571778059006,
0.11111985892057419,
-0.1258094608783722,
-0.12848582863807678,
-0.22649504244327545,
-0.27879226207733154,
-0.22049780189990997,
0.23275023698806763,
0.035514142364263535,
-0.39175838232040405,
-0.215048685669899,
0.1987181156873703,
0.08185266703367233,
-0.21986781060695648,
0.3438955247402191,
-0.4185650050640106,
0.24425780773162842,
0.010221436619758606,
0.1506083607673645,
-0.1845647245645523,
-0.01582181826233864,
0.13660523295402527,
-0.11987809836864471,
0.21276411414146423,
-0.02037128619849682,
-0.10082022845745087,
0.0776301696896553,
-0.36365556716918945,
0.17354322969913483,
0.15683656930923462,
0.013498523272573948,
0.30969908833503723,
-0.461792528629303,
0.03656924515962601,
-0.22375167906284332,
0.38604676723480225,
-0.12094680219888687,
-0.1912720650434494,
0.20237606763839722,
-0.06503616273403168,
-0.16270630061626434,
0.07210592925548553,
0.017431382089853287,
0.20360036194324493,
-0.1655103713274002,
0.12079772353172302,
-0.32747846841812134,
-0.13959181308746338,
-0.16007010638713837,
0.24451880156993866,
-0.30239394307136536,
0.12174729257822037,
-0.08991798758506775,
0.1843893826007843,
-0.2284720540046692,
0.024025678634643555,
-0.0009145662188529968,
-0.058255426585674286,
-0.09443336725234985,
-0.08092710375785828,
-0.33077695965766907,
0.16370710730552673,
-0.04625791311264038,
0.23929451406002045,
0.35833728313446045,
-0.02704748325049877,
0.17227816581726074,
0.29383349418640137,
0.2055012285709381,
0.2309955507516861,
0.49028831720352173,
-0.0072859302163124084,
-0.04240155220031738,
-0.24221685528755188,
0.1752830147743225,
0.09921212494373322,
0.27030664682388306,
-0.05350454896688461,
0.1677466630935669,
0.3056694567203522,
-0.0329972580075264,
-0.17720210552215576,
0.0707864761352539,
0.023236524313688278,
-0.08354514092206955,
-0.3089222311973572,
-0.8094672560691833,
0.43547171354293823,
-0.13262295722961426,
-0.06185540184378624,
0.4432050585746765,
-0.3279566168785095,
-0.22128355503082275,
0.3767673373222351,
0.17932985723018646,
0.8079631328582764,
-0.07930707931518555,
0.3330439329147339,
0.13524457812309265,
-0.018019024282693863,
0.07173937559127808,
-0.38320624828338623,
0.14453664422035217,
-0.34618881344795227,
-0.21254625916481018,
-0.0815853625535965,
-0.012640178203582764,
-0.15814891457557678,
0.3361883759498596,
-0.24392682313919067,
0.15001313388347626,
-0.03299066051840782,
-0.0071518197655677795,
0.02940286323428154,
0.005127381533384323,
-0.14439024031162262,
-0.3665495812892914,
-0.4018220901489258,
0.2731715142726898,
0.006506569683551788,
-0.2425508201122284,
-0.1871611475944519,
-0.31866389513015747,
0.36263200640678406,
0.07337024807929993,
0.03500919044017792,
0.13176557421684265,
-0.5173861384391785,
0.12595662474632263,
-0.27097979187965393,
-0.418474018573761,
-0.25012609362602234,
0.2147776335477829,
0.08084375411272049,
-0.10935711860656738,
-0.20811094343662262,
0.20631863176822662,
0.23775550723075867,
-0.0924733355641365,
-0.2324104756116867,
-0.005501460283994675,
0.45625096559524536,
-0.024519409984350204,
0.055035628378391266,
0.25293058156967163,
-0.14562924206256866,
-0.6391698122024536,
0.2988686263561249,
-0.03191877156496048,
0.34372401237487793,
0.05799011513590813,
-0.240457683801651,
0.18704113364219666,
-0.26979973912239075,
-0.21302086114883423,
0.2445269674062729,
0.024434462189674377,
-0.3018031418323517,
-0.000606052577495575,
0.07998855412006378,
-0.04971296712756157,
-0.008065104484558105,
0.17983534932136536,
-0.023181766271591187,
0.06620074063539505,
0.46846893429756165,
0.07157742977142334,
-0.16875770688056946,
-0.3219829201698303,
-0.20016378164291382,
0.26776227355003357,
-0.29844844341278076,
0.17646093666553497,
0.09041838347911835,
-0.027425967156887054,
-0.07423875480890274,
0.014174699783325195,
0.17486363649368286,
0.10860151052474976,
-0.3062158524990082,
-0.13467498123645782,
-0.4477192759513855,
0.0802549421787262,
-0.018460195511579514,
0.2569560706615448,
-0.07391117513179779,
-0.27182501554489136,
-0.09761608392000198,
0.10226555913686752,
-0.4682252109050751,
-0.11194722354412079,
-0.14990472793579102,
0.05115833133459091,
-0.055243104696273804,
-0.01170312985777855,
0.13465040922164917,
0.10394294559955597,
0.20530156791210175,
0.052481479942798615,
-0.3206651210784912,
-0.3962281346321106,
-0.1704852283000946,
0.08708127588033676,
0.07146129757165909,
-0.14916440844535828,
-0.05125107988715172,
-0.1986231952905655,
-0.22108745574951172,
-0.3538764417171478,
0.07403877377510071,
-0.028094623237848282,
-0.030802898108959198,
0.008557935245335102,
0.47244250774383545,
0.048276934772729874,
-0.33100587129592896,
-0.07896886020898819,
0.026508938521146774,
0.06797861307859421,
-0.07094569504261017,
0.06551019847393036,
-0.21116255223751068,
-0.1655072569847107,
0.1624855101108551,
0.14536747336387634,
0.23099909722805023,
0.03691060096025467,
0.38719499111175537,
-0.2413250356912613,
-0.0015654079616069794,
0.10131244361400604,
0.5309202671051025,
0.41757383942604065,
-0.0020343672949820757,
0.19122429192066193,
0.18432000279426575,
0.34190040826797485,
-0.33228403329849243,
-0.09071973711252213,
-0.07688958942890167,
-0.30616533756256104,
0.17886608839035034,
0.19989636540412903,
0.14651206135749817,
0.0011771246790885925,
0.19738039374351501,
0.04958231747150421,
-0.050177257508039474,
-0.31015491485595703,
0.1731393188238144,
0.2655002176761627,
0.21517716348171234,
-0.10973656177520752,
0.13508661091327667,
0.1847865879535675,
0.3715111315250397,
0.25259536504745483,
-0.3912866413593292,
0.1993626207113266,
0.38615819811820984,
-0.21526917815208435,
-0.1627257764339447,
-0.2398238331079483,
-0.10404415428638458,
-0.029742032289505005,
0.06841002404689789,
0.3790379762649536,
0.0720401257276535,
0.25192421674728394,
0.17415277659893036,
-0.23738056421279907,
-0.14729133248329163,
0.06736810505390167,
0.13162744045257568,
-0.2611774206161499,
0.0644632950425148,
-0.17881008982658386,
-0.1937311589717865,
0.00401480495929718,
-0.035670023411512375,
-0.04239239543676376,
0.19453640282154083,
0.12573358416557312,
0.3502635359764099,
-0.29007312655448914,
0.2400902509689331,
0.2172154188156128,
0.39752593636512756,
-0.32746264338493347,
0.10531334578990936,
0.23870961368083954,
0.0651160404086113,
0.03644724190235138,
0.07694276422262192,
0.05738065019249916,
0.22814823687076569,
-0.3099243640899658,
0.35284659266471863,
0.015262969769537449,
-0.11217661947011948,
-0.2861439883708954,
0.0791684240102768,
0.18512357771396637,
-0.15728360414505005,
0.38083207607269287,
0.22695478796958923,
-0.2719179689884186,
0.29522666335105896,
-0.20856259763240814,
0.04662376642227173,
-0.41033270955085754,
-0.02992107719182968,
0.33199986815452576,
-0.15820270776748657,
-0.13680307567119598,
0.05598953366279602,
-0.2693374454975128,
0.016126681119203568,
0.4776304066181183,
-0.3227737545967102,
0.06422078609466553,
-0.06193161755800247,
0.14962711930274963,
-0.0586993582546711,
0.6340994238853455,
-0.01033930853009224,
0.3964231610298157,
-0.2148219347000122,
-0.054265689104795456,
-0.5518858432769775,
-0.04903533309698105,
-0.10852070152759552,
0.10109363496303558,
0.008838491514325142,
0.25206637382507324,
0.22153586149215698,
0.21871300041675568,
0.13274960219860077,
-0.09107217937707901,
0.1125018373131752,
0.41262292861938477,
-0.23063957691192627,
-0.18109184503555298,
0.0717935562133789,
0.3082345724105835,
0.028818819671869278,
-0.5010433793067932,
-0.11700326204299927,
-0.14778241515159607,
0.19416722655296326,
0.2445777803659439,
-0.23158258199691772,
0.21730327606201172,
0.04353415220975876,
0.61098712682724,
-0.14725534617900848,
0.14270511269569397,
-0.10259296745061874,
0.024427281692624092,
-0.28895071148872375,
-0.26001623272895813,
-0.23331424593925476,
-0.12513598799705505,
0.01897634193301201,
0.3287491202354431,
-0.22432880103588104,
-0.24274154007434845,
-0.27679988741874695,
-0.008103498257696629,
0.33164286613464355,
-0.25733041763305664,
-0.23397521674633026,
0.11261560767889023,
-0.07714657485485077,
0.2519116699695587,
-0.07788697630167007,
0.4629198908805847,
-0.12365482747554779,
-0.05361713469028473,
-0.05531170591711998,
-0.1899546980857849,
0.4590936005115509,
-0.3210631310939789,
-0.20063169300556183,
0.22767247259616852,
0.14209191501140594,
0.43394628167152405,
-0.1427989900112152,
-0.3893700838088989,
0.14424675703048706,
0.2531222999095917,
-0.11381646245718002,
-0.24474363029003143,
0.09505023062229156,
0.10578140616416931,
0.10403895378112793,
-0.15671265125274658,
0.41370728611946106,
-0.03944802284240723,
-0.0910857543349266,
-0.3376051187515259,
-0.5245673060417175
] |
https://github.com/huggingface/datasets/issues/5481 | Load a cached dataset as iterable | This use-case is a bit specific, and `load_dataset` already has enough parameters (plus, `streaming=True` also returns an iterable dataset, so we would have to explain the difference), so I think it would be better to add `IterableDataset.from_file` to the API (more flexible and aligned with the goal from https://github.com/huggingface/datasets/issues/3444) instead. | The idea would be to allow something like
```python
ds = load_dataset("c4", "en", as_iterable=True)
```
To be used to train models. It would load an IterableDataset from the cached Arrow files.
Cc @stas00
Edit : from the discussions we may load from cache when streaming=True | 50 | Load a cached dataset as iterable
The idea would be to allow something like
```python
ds = load_dataset("c4", "en", as_iterable=True)
```
To be used to train models. It would load an IterableDataset from the cached Arrow files.
Cc @stas00
Edit : from the discussions we may load from cache when streaming=True
This use-case is a bit specific, and `load_dataset` already has enough parameters (plus, `streaming=True` also returns an iterable dataset, so we would have to explain the difference), so I think it would be better to add `IterableDataset.from_file` to the API (more flexible and aligned with the goal from https://github.com/huggingface/datasets/issues/3444) instead. | [
-0.417756050825119,
-0.17543089389801025,
-0.04263514280319214,
0.06517580896615982,
0.16342905163764954,
0.17753955721855164,
0.2944328188896179,
0.38115009665489197,
0.3552761673927307,
-0.062385037541389465,
-0.04091409593820572,
0.12226374447345734,
-0.30564063787460327,
0.27318528294563293,
0.14387358725070953,
-0.177154079079628,
-0.04520731419324875,
0.2192782461643219,
-0.2261834740638733,
0.0655401349067688,
-0.10008451342582703,
-0.01227923296391964,
0.11188608407974243,
-0.11145582795143127,
-0.06913138926029205,
-0.11046246439218521,
0.11531224846839905,
0.1711300015449524,
-0.018724797293543816,
-0.4539336860179901,
0.2882799208164215,
0.22848165035247803,
0.31177401542663574,
0.08732098340988159,
-0.00010325241601094604,
0.11721384525299072,
0.08991648256778717,
-0.1863250732421875,
-0.3484513759613037,
-0.009398117661476135,
-0.029368074610829353,
-0.010639041662216187,
0.270799845457077,
-0.18215617537498474,
-0.3740386664867401,
-0.1753988415002823,
0.08465829491615295,
-0.5054069757461548,
0.584380030632019,
0.20824570953845978,
0.2805667519569397,
0.20319369435310364,
-0.21769820153713226,
0.01403197180479765,
-0.15071600675582886,
-0.1308542639017105,
-0.22544324398040771,
0.16463708877563477,
0.15721195936203003,
0.08867206424474716,
-0.09405290335416794,
0.4889780580997467,
0.07543190568685532,
0.1330021768808365,
0.2567542493343353,
0.0014790082350373268,
-0.027620673179626465,
-0.06728341430425644,
-0.10914536565542221,
0.21793782711029053,
0.3555888533592224,
-0.2844253182411194,
-0.4489065408706665,
-0.5304744839668274,
-0.08331158012151718,
-0.6333582401275635,
-0.12278645485639572,
0.1277129054069519,
-0.053655583411455154,
0.2728969156742096,
-0.11462384462356567,
-0.109162338078022,
-0.10176810622215271,
-0.10778909921646118,
0.17634399235248566,
-0.007135026156902313,
-0.11992920935153961,
-0.009886607527732849,
0.29587313532829285,
0.05605258420109749,
0.01968536525964737,
0.1635981947183609,
-0.09076738357543945,
0.2121603637933731,
-0.299446165561676,
-0.032773248851299286,
0.08525630086660385,
0.11694364249706268,
0.24547109007835388,
0.4027252793312073,
0.5083863735198975,
0.2997046709060669,
-0.1106308177113533,
0.12785834074020386,
0.1401546746492386,
0.1906929314136505,
0.0234079547226429,
-0.07795335352420807,
0.12198825180530548,
0.27589404582977295,
-0.1802217811346054,
-0.24578389525413513,
-0.054252758622169495,
-0.13613826036453247,
0.19026599824428558,
0.054191704839468,
0.09477657079696655,
-0.06525558978319168,
0.0014919117093086243,
-0.09879763424396515,
0.06528069823980331,
-0.03408851847052574,
0.14544646441936493,
0.42149588465690613,
-0.1036456823348999,
0.27199050784111023,
0.014872666448354721,
0.23166711628437042,
0.043410271406173706,
-0.12341614812612534,
-0.21288177371025085,
-0.1482054740190506,
-0.16817894577980042,
0.28311946988105774,
0.136128768324852,
-0.2634652853012085,
0.3362451493740082,
-0.1968156099319458,
0.03454028069972992,
0.06887290626764297,
0.3881402611732483,
0.018294213339686394,
0.40778648853302,
0.10084478557109833,
-0.10728269815444946,
-0.05677220970392227,
0.28758132457733154,
-0.09831613302230835,
-0.33541616797447205,
-0.1995393931865692,
-0.12772658467292786,
-0.2903696894645691,
0.16170953214168549,
0.23035645484924316,
-0.09909289330244064,
-0.11756446957588196,
-0.37174585461616516,
0.46576085686683655,
0.12589623034000397,
-0.05316481739282608,
0.20969270169734955,
0.05606217309832573,
-0.1863059103488922,
-0.10149945318698883,
0.20877403020858765,
0.4561557173728943,
-0.10481199622154236,
-0.24711798131465912,
0.18356893956661224,
-0.05959630385041237,
-0.18144461512565613,
0.27999958395957947,
-0.3408678472042084,
-0.01270526647567749,
-0.17463621497154236,
0.11653915047645569,
0.4647882580757141,
-0.2008180469274521,
-0.26091131567955017,
0.054363880306482315,
0.029565930366516113,
0.3048643469810486,
0.1803916096687317,
0.10764890909194946,
0.08302915841341019,
0.05762818828225136,
0.027307983487844467,
0.4259013533592224,
-0.0929560661315918,
0.018086319789290428,
-0.1581367701292038,
-0.18577693402767181,
0.07515374571084976,
0.21525834500789642,
-0.021546106785535812,
0.09590674936771393,
-0.07360761612653732,
-0.2401881366968155,
0.4090665280818939,
-0.3164311945438385,
0.08246824890375137,
0.05432406812906265,
0.026787813752889633,
-0.05588884651660919,
0.1140805259346962,
-0.17715772986412048,
-0.5036393404006958,
0.2733778953552246,
0.08105834573507309,
-0.26114413142204285,
-0.06002548336982727,
-0.31876635551452637,
0.02920522913336754,
0.1315743625164032,
-0.2807072401046753,
-0.1639334261417389,
0.18427883088588715,
0.08687778562307358,
0.20246538519859314,
0.021340422332286835,
-0.5606207847595215,
0.28936561942100525,
-0.227341428399086,
0.00022485456429421902,
-0.452016144990921,
0.04342743009328842,
0.27343395352363586,
0.03950651362538338,
-0.18791387975215912,
0.07836110889911652,
-0.09529303759336472,
-0.09012680500745773,
0.02857000008225441,
0.21759438514709473,
-0.11631619185209274,
0.23798952996730804,
0.050513193011283875,
0.4804046154022217,
0.12266651540994644,
-0.08780556917190552,
-0.03525123745203018,
0.18486487865447998,
-0.02156589925289154,
-0.0232246071100235,
-0.05544289946556091,
0.5571709275245667,
0.04689919203519821,
0.24982568621635437,
0.23119781911373138,
-0.09049346297979355,
0.34360596537590027,
-0.024859894067049026,
-0.3811427652835846,
-0.13900214433670044,
0.032007455825805664,
-0.29796409606933594,
0.4121111035346985,
-0.09158909320831299,
-0.28637805581092834,
0.27202990651130676,
0.4460202157497406,
0.18564359843730927,
0.04032692313194275,
0.005578286945819855,
-0.22365802526474,
-0.08402583003044128,
0.22032390534877777,
0.08673474192619324,
0.12916624546051025,
0.24324487149715424,
0.24896258115768433,
0.06102004647254944,
-0.009745226241648197,
-0.05285054072737694,
0.17192767560482025,
-0.05999822914600372,
0.20839667320251465,
0.08186495304107666,
0.11273842304944992,
-0.21487127244472504,
-0.5355773568153381,
-0.10350143909454346,
-0.033757440745830536,
-0.018540585413575172,
-0.055623773485422134,
0.31406763195991516,
-0.21739698946475983,
-0.029737791046500206,
-0.18316005170345306,
-0.2735878527164459,
-0.05715659633278847,
-0.0024114344269037247,
0.06783127784729004,
0.3692663013935089,
-0.1818516105413437,
0.1512182056903839,
-0.4169769287109375,
0.4066678285598755,
0.1144983172416687,
-0.26381364464759827,
-0.23425450921058655,
-0.31166359782218933,
0.1292635202407837,
0.11637315154075623,
0.23426233232021332,
-0.33075574040412903,
0.3781817555427551,
-0.040356189012527466,
-0.08249939233064651,
-0.231782928109169,
-0.05724348872900009,
0.1555940955877304,
0.12202376127243042,
-0.04076003283262253,
0.047285452485084534,
0.1831989735364914,
0.0008364766836166382,
-0.12047546356916428,
0.2149815708398819,
-0.3349612355232239,
-0.06238816678524017,
-0.06592825800180435,
0.02675769105553627,
0.2631371021270752,
-0.0396464467048645,
-0.18913933634757996,
-0.17961521446704865,
-0.41594335436820984,
0.4664332866668701,
0.14459528028964996,
0.08400954306125641,
0.39375030994415283,
0.03720880672335625,
0.08943480253219604,
0.03390767425298691,
0.06962130218744278,
-0.24721522629261017,
-0.3490797281265259,
0.23918035626411438,
-0.280945748090744,
-0.23143179714679718,
-0.08497412502765656,
-0.2434743046760559,
0.11222955584526062,
0.2028520703315735,
-0.3330121636390686,
-0.27721405029296875,
-0.018798531964421272,
0.13829080760478973,
-0.004957921802997589,
-0.1562124490737915,
0.4049348533153534,
0.06724298745393753,
-0.09204407781362534,
-0.12204790115356445,
0.10362859070301056,
0.2994249165058136,
-0.14822843670845032,
-0.07960502058267593,
0.09340587258338928,
0.3228023648262024,
0.06791575253009796,
0.9125200510025024,
0.12137256562709808,
-0.11827422678470612,
0.4953569769859314,
-0.0658545270562172,
0.22568605840206146,
-0.2178904414176941,
-0.18246398866176605,
-0.2187589555978775,
-0.209285706281662,
-0.14055676758289337,
0.2199983149766922,
0.10728870332241058,
-0.23011288046836853,
-0.1629311740398407,
0.18351638317108154,
0.04122210294008255,
-0.2877126634120941,
0.31344956159591675,
-0.1999063789844513,
0.157025545835495,
0.10765735805034637,
0.17430001497268677,
-0.1774493008852005,
0.02289830520749092,
0.22897286713123322,
0.02418668568134308,
0.32114511728286743,
-0.028197437524795532,
-0.25571054220199585,
0.0477399118244648,
-0.6767339706420898,
0.24822871387004852,
0.16444987058639526,
0.013907539658248425,
0.17106613516807556,
-0.49802061915397644,
0.026175305247306824,
-0.24561172723770142,
0.48718756437301636,
-0.038811974227428436,
-0.22887645661830902,
0.04052412882447243,
-0.26780271530151367,
-0.22426369786262512,
0.09246832132339478,
0.12144599854946136,
0.13735760748386383,
-0.06364679336547852,
0.4356876313686371,
-0.3297268748283386,
-0.23167110979557037,
-0.1660703420639038,
0.19821107387542725,
-0.2586386501789093,
0.16267655789852142,
-0.2671333849430084,
-0.00918089970946312,
-0.2353694587945938,
0.14505678415298462,
0.09169463813304901,
-0.0934939756989479,
0.005976276472210884,
-0.04339158535003662,
-0.3669643700122833,
0.08780329674482346,
-0.10037042200565338,
0.299906462430954,
0.3640153110027313,
0.04557853937149048,
0.14987076818943024,
0.272067129611969,
0.2779674232006073,
0.05276384949684143,
0.6303594708442688,
-0.08617083728313446,
-0.22794890403747559,
-0.25005626678466797,
0.2615169584751129,
0.06218123063445091,
0.28462547063827515,
-0.010124997235834599,
0.2558256685733795,
0.3357536196708679,
0.0008628740906715393,
-0.3471853733062744,
0.08153242617845535,
-0.021404126659035683,
0.04252561926841736,
-0.22512683272361755,
-0.607729971408844,
0.5713257789611816,
-0.03186299651861191,
-0.03873320668935776,
0.46736276149749756,
-0.08866046369075775,
-0.2041770964860916,
0.29769861698150635,
0.08920102566480637,
0.7111160755157471,
-0.14276529848575592,
0.37408044934272766,
0.25808244943618774,
0.02078855037689209,
0.21532540023326874,
-0.24963505566120148,
0.15901385247707367,
-0.36621230840682983,
-0.2691401541233063,
-0.09946213662624359,
0.001158684492111206,
-0.13633248209953308,
0.1381542682647705,
-0.08394269645214081,
0.24610978364944458,
0.09550392627716064,
0.1067233681678772,
-0.048539407551288605,
-0.012109983712434769,
-0.2264775186777115,
-0.40693798661231995,
-0.6503487229347229,
0.2115313708782196,
0.03172175586223602,
-0.08059133589267731,
-0.21968033909797668,
-0.23622871935367584,
0.39022454619407654,
-0.10819597542285919,
0.0406268835067749,
0.06527747958898544,
-0.5394477844238281,
0.059295158833265305,
-0.08146561682224274,
-0.4702114462852478,
-0.2571946680545807,
0.19081774353981018,
0.19027799367904663,
-0.20583775639533997,
-0.23666539788246155,
0.184804767370224,
0.06137526407837868,
-0.1047617644071579,
-0.3166992962360382,
-0.08576809614896774,
0.4249606132507324,
-0.059641651809215546,
0.09754013270139694,
0.13694968819618225,
-0.022810393944382668,
-0.6447428464889526,
0.22438156604766846,
0.038410674780607224,
0.1229993924498558,
-0.005471123848110437,
-0.2782938778400421,
0.16465306282043457,
-0.0682438313961029,
-0.26127180457115173,
0.19056333601474762,
0.10724791139364243,
-0.17155523598194122,
-0.1264929473400116,
0.20358623564243317,
-0.12592171132564545,
-0.02856890857219696,
0.3222997188568115,
-0.12391843646764755,
0.007446683943271637,
0.4595889449119568,
0.0737263560295105,
-0.1482565999031067,
-0.27831804752349854,
-0.261112242937088,
0.49681180715560913,
-0.4852184057235718,
0.21734711527824402,
0.14350907504558563,
-0.1222040206193924,
-0.13017165660858154,
0.18274638056755066,
0.11519971489906311,
0.025791887193918228,
-0.08433841168880463,
-0.1572759449481964,
-0.4178440272808075,
0.2840368449687958,
-0.1440443992614746,
0.236249640583992,
0.12164554744958878,
-0.2813326120376587,
-0.19925609230995178,
0.060978882014751434,
-0.4130682945251465,
-0.04711151868104935,
-0.08233468979597092,
-0.00460781529545784,
0.06922544538974762,
-0.089468814432621,
0.391181081533432,
0.06275230646133423,
0.15813609957695007,
0.09718014299869537,
-0.37607529759407043,
-0.36601537466049194,
-0.20313848555088043,
0.10230474174022675,
0.028856847435235977,
-0.05613608658313751,
0.010846001096069813,
-0.06671760976314545,
-0.1797305792570114,
-0.4312976002693176,
0.20074687898159027,
0.042808279395103455,
0.012129675596952438,
-0.012347624637186527,
0.33841848373413086,
0.022429857403039932,
-0.28021717071533203,
-0.12562277913093567,
0.07854127883911133,
-0.02512454241514206,
-0.14224037528038025,
-0.0268666073679924,
-0.39875340461730957,
-0.05531356856226921,
0.19142788648605347,
0.1854763925075531,
0.36136794090270996,
0.06274997442960739,
0.24651706218719482,
-0.2305818647146225,
-0.15175093710422516,
0.19868528842926025,
0.5872186422348022,
0.24948856234550476,
-0.016509581357240677,
0.24287067353725433,
0.23216143250465393,
0.30800920724868774,
-0.34730464220046997,
-0.03973603621125221,
0.05211581662297249,
-0.18240076303482056,
0.1721920520067215,
0.22379940748214722,
0.17575807869434357,
-0.022172018885612488,
0.2577565312385559,
0.040330927819013596,
0.0025948549155145884,
-0.2970990538597107,
0.11210201680660248,
0.057746522128582,
0.16203150153160095,
-0.0828486829996109,
0.24566160142421722,
0.2447466403245926,
0.45432236790657043,
0.13765648007392883,
-0.31157270073890686,
0.2022663950920105,
0.2500697076320648,
-0.08089195191860199,
-0.25898295640945435,
-0.34625500440597534,
-0.16011114418506622,
-0.13209381699562073,
0.0232454314827919,
0.4474601745605469,
0.06409234553575516,
0.4163029193878174,
0.08044721186161041,
-0.29682961106300354,
-0.21818068623542786,
0.13695590198040009,
0.06716722995042801,
-0.35557588934898376,
0.1380482167005539,
-0.0893419086933136,
-0.01801656186580658,
0.09425400197505951,
-0.05683894082903862,
0.02716962620615959,
0.2297690212726593,
0.05260623246431351,
0.34996461868286133,
-0.26328426599502563,
0.05424976348876953,
0.251630961894989,
0.45510777831077576,
-0.1985052078962326,
0.17982113361358643,
0.18923670053482056,
0.028697974979877472,
0.023895353078842163,
0.14740745723247528,
0.03643716126680374,
0.06094233691692352,
-0.12535645067691803,
0.2714717984199524,
-0.05300206318497658,
-0.016926296055316925,
-0.26577430963516235,
0.13111397624015808,
0.18964672088623047,
-0.17591524124145508,
0.3667025566101074,
0.18735942244529724,
-0.23279255628585815,
0.34850290417671204,
-0.3418671190738678,
0.09130793809890747,
-0.4166973829269409,
0.046728089451789856,
0.12294139713048935,
-0.043439678847789764,
-0.22284752130508423,
0.022905848920345306,
-0.2301797866821289,
0.07730387896299362,
0.3104568123817444,
-0.24483928084373474,
0.10717254877090454,
-0.040883615612983704,
0.12235152721405029,
-0.024251632392406464,
0.5023019313812256,
0.17877192795276642,
0.3093148171901703,
-0.18717071413993835,
0.04869455099105835,
-0.5590267777442932,
0.0212898850440979,
-0.07672154903411865,
0.18452110886573792,
0.020487628877162933,
0.2686922252178192,
0.23166120052337646,
0.18522514402866364,
0.1518263816833496,
-0.13082078099250793,
0.20672506093978882,
0.23338176310062408,
-0.2550845146179199,
-0.12449324131011963,
-0.026270605623722076,
0.13455915451049805,
0.1138983815908432,
-0.4840683341026306,
-0.1473170965909958,
-0.12120112776756287,
0.0837484821677208,
0.12722265720367432,
-0.06884444504976273,
-0.07133890688419342,
-0.09273383021354675,
0.5508641004562378,
-0.055358320474624634,
0.06147652491927147,
-0.13958564400672913,
-0.013574731536209583,
-0.407488614320755,
-0.34957408905029297,
-0.29937219619750977,
-0.1029832735657692,
-0.12031130492687225,
0.3756716251373291,
-0.1937808245420456,
-0.2926409840583801,
-0.29776516556739807,
0.16806209087371826,
0.3844425082206726,
-0.2243298590183258,
-0.24665261805057526,
0.2577436566352844,
-0.14924916625022888,
0.12958252429962158,
-0.03754768520593643,
0.5537302494049072,
-0.09655140340328217,
-0.023440081626176834,
0.004389531910419464,
-0.2292472869157791,
0.5903967618942261,
-0.49863284826278687,
-0.1241593062877655,
0.2147810012102127,
0.19239135086536407,
0.5717259049415588,
-0.3485011160373688,
-0.5421503186225891,
0.16440531611442566,
0.11610373109579086,
-0.03366146981716156,
-0.2930827736854553,
0.18092255294322968,
0.07322005927562714,
0.045404378324747086,
-0.20618227124214172,
0.6168491840362549,
0.06315482407808304,
-0.1758006364107132,
-0.16371028125286102,
-0.49662983417510986
] |
https://github.com/huggingface/datasets/issues/5481 | Load a cached dataset as iterable | > This use-case is a bit specific
This allows to use `datasets` for large scale training where map-style datasets are too slow and use too much memory in PyTorch. So I would still consider adding it.
Alternatively we could add this feature one level bellow:
```python
builder = load_dataset_builder(...)
builder.download_and_prepare()
ids = builder.as_iterable_dataset()
``` | The idea would be to allow something like
```python
ds = load_dataset("c4", "en", as_iterable=True)
```
To be used to train models. It would load an IterableDataset from the cached Arrow files.
Cc @stas00
Edit : from the discussions we may load from cache when streaming=True | 54 | Load a cached dataset as iterable
The idea would be to allow something like
```python
ds = load_dataset("c4", "en", as_iterable=True)
```
To be used to train models. It would load an IterableDataset from the cached Arrow files.
Cc @stas00
Edit : from the discussions we may load from cache when streaming=True
> This use-case is a bit specific
This allows to use `datasets` for large scale training where map-style datasets are too slow and use too much memory in PyTorch. So I would still consider adding it.
Alternatively we could add this feature one level bellow:
```python
builder = load_dataset_builder(...)
builder.download_and_prepare()
ids = builder.as_iterable_dataset()
``` | [
-0.4622906744480133,
-0.025394022464752197,
-0.07936936616897583,
0.031785715371370316,
0.12096770107746124,
0.23055285215377808,
0.3271862864494324,
0.4027569890022278,
0.23554116487503052,
-0.07977926731109619,
0.006359554827213287,
0.1989315301179886,
-0.38240280747413635,
0.0920475423336029,
0.13025614619255066,
-0.18051381409168243,
-0.08197586983442307,
0.3195880055427551,
-0.30364885926246643,
0.0708543211221695,
-0.14045539498329163,
-0.16061842441558838,
0.1261916309595108,
-0.14018858969211578,
-0.18996964395046234,
-0.13953113555908203,
0.057294078171253204,
0.08668826520442963,
0.07929489761590958,
-0.6141559481620789,
0.19049310684204102,
0.18909510970115662,
0.2895449697971344,
0.13361512124538422,
-0.0001025051751639694,
0.12473221123218536,
0.07849538326263428,
-0.13050244748592377,
-0.45965221524238586,
0.12126639485359192,
-0.023396655917167664,
-0.07684817910194397,
0.2516918480396271,
-0.3954894244670868,
-0.2369179129600525,
-0.2553652822971344,
0.11992139369249344,
-0.4606071412563324,
0.3558524250984192,
0.26281529664993286,
0.29605832695961,
0.17763157188892365,
-0.23002709448337555,
0.0016621274407953024,
-0.07196115702390671,
-0.26153355836868286,
-0.19316159188747406,
0.20369285345077515,
0.26135316491127014,
0.15755625069141388,
-0.05536080151796341,
0.47414302825927734,
-0.009398790076375008,
0.18915188312530518,
0.282406210899353,
-0.011931958608329296,
0.2020845115184784,
-0.11684195697307587,
-0.15267065167427063,
0.07503186911344528,
0.2696887254714966,
-0.3073806166648865,
-0.3580394387245178,
-0.48639675974845886,
0.05483235791325569,
-0.4604354202747345,
-0.17037487030029297,
0.18183594942092896,
-0.10566894710063934,
0.2026432901620865,
-0.11686438322067261,
-0.16724152863025665,
-0.1564415693283081,
-0.005478627979755402,
0.15333439409732819,
0.11993200331926346,
0.06177531182765961,
0.03719088435173035,
0.20197252929210663,
0.12367676943540573,
0.35706278681755066,
0.0003659650683403015,
-0.01629338040947914,
0.14738628268241882,
-0.2656269669532776,
-0.06500224024057388,
-0.02094382792711258,
-0.06970544904470444,
0.04997424781322479,
0.19621425867080688,
0.45742565393447876,
0.20153039693832397,
0.12211625277996063,
0.10593117028474808,
0.10787265002727509,
0.04305808246135712,
-0.06359731405973434,
0.1926763653755188,
0.015226699411869049,
0.04676182568073273,
-0.262579083442688,
-0.13825228810310364,
-0.1678864061832428,
-0.21169452369213104,
0.415523886680603,
0.05808244273066521,
-0.016922391951084137,
0.13363884389400482,
-0.011416343972086906,
-0.1472780406475067,
-0.15611964464187622,
-0.0035702104214578867,
0.14472976326942444,
0.32569605112075806,
-0.19273024797439575,
0.2395308017730713,
0.029341399669647217,
0.09374523162841797,
0.02017919160425663,
-0.11997971683740616,
-0.15079756081104279,
-0.12058669328689575,
-0.13357309997081757,
0.10872987657785416,
0.180480495095253,
-0.2775138318538666,
0.22735916078090668,
-0.26827120780944824,
0.1883579045534134,
0.08583548665046692,
0.5089764595031738,
0.03988172858953476,
0.5041074752807617,
0.12259435653686523,
-0.19707828760147095,
-0.1774195432662964,
0.15293024480342865,
-0.0444612056016922,
-0.3143312335014343,
0.004486221820116043,
-0.12790286540985107,
-0.3434197008609772,
0.14022453129291534,
0.2590908408164978,
-0.06450170278549194,
-0.11116272211074829,
-0.059674717485904694,
0.2871955633163452,
0.18704405426979065,
-0.11490640044212341,
0.19779466092586517,
-0.10774067044258118,
-0.04454827308654785,
-0.11212895810604095,
0.16317668557167053,
0.36791715025901794,
-0.12583479285240173,
-0.24639970064163208,
0.1809033751487732,
0.07275988161563873,
-0.12406974285840988,
0.16364403069019318,
-0.3988931477069855,
0.05545978248119354,
-0.12084280699491501,
-0.019152957946062088,
0.5941876173019409,
-0.14695873856544495,
-0.3607214093208313,
0.09189537912607193,
0.06845909357070923,
0.2313021868467331,
0.20521855354309082,
0.3080693781375885,
0.15783382952213287,
0.061203036457300186,
0.04946029931306839,
0.407384991645813,
-0.12341414391994476,
-0.003152448683977127,
-0.19445039331912994,
-0.1833249181509018,
0.21355018019676208,
0.3014007806777954,
0.15908589959144592,
0.04611653462052345,
-0.03592858463525772,
-0.20593135058879852,
0.3260062038898468,
-0.382052481174469,
0.07384408265352249,
0.01316761039197445,
-0.016480494290590286,
-0.12023991346359253,
0.11569267511367798,
-0.22713014483451843,
-0.4126490354537964,
0.339825302362442,
-0.04723502695560455,
-0.2882024049758911,
-0.18969221413135529,
-0.2984030246734619,
0.076234370470047,
0.17983783781528473,
-0.32705527544021606,
-0.14963167905807495,
0.2047511488199234,
0.034898340702056885,
0.22265928983688354,
-0.15586291253566742,
-0.4436832666397095,
0.29257917404174805,
-0.2622092664241791,
-0.10808181762695312,
-0.22228388488292694,
0.08274156600236893,
0.15854792296886444,
0.003502391744405031,
-0.25680065155029297,
0.15302333235740662,
-0.12382254749536514,
-0.08336954563856125,
0.006511760875582695,
0.27302637696266174,
-0.10316549986600876,
0.01329096406698227,
0.10308173298835754,
0.455433189868927,
0.1791701763868332,
-0.19715866446495056,
0.05628088489174843,
0.4006577432155609,
-0.04398299753665924,
-0.06877664476633072,
0.054784875363111496,
0.46324265003204346,
0.08521481603384018,
0.26541799306869507,
0.23500074446201324,
-0.011343584395945072,
0.2452271580696106,
0.08045847713947296,
-0.4326998293399811,
-0.10663456469774246,
-0.017345767468214035,
-0.27804961800575256,
0.4228193163871765,
-0.004687516018748283,
-0.26269692182540894,
0.2149839997291565,
0.383755087852478,
0.14906999468803406,
0.05888361483812332,
-0.08616604655981064,
-0.33939114212989807,
-0.041798826307058334,
0.16309252381324768,
0.16403287649154663,
0.1154523640871048,
0.20247937738895416,
0.24726273119449615,
0.03671667352318764,
-0.11206254363059998,
-0.055059388279914856,
0.16590291261672974,
0.027536455541849136,
0.24789223074913025,
0.07694323360919952,
0.08253715932369232,
-0.17382951080799103,
-0.36075708270072937,
-0.09438222646713257,
0.11708403378725052,
-0.07269842177629471,
0.021472115069627762,
0.3457965850830078,
-0.15956716239452362,
-0.08570720255374908,
-0.17587853968143463,
-0.20102794468402863,
0.017789537087082863,
-0.03668482229113579,
0.11812040954828262,
0.3649479150772095,
-0.1355692446231842,
0.22633136808872223,
-0.45564496517181396,
0.383170485496521,
0.10150077939033508,
-0.4010133147239685,
-0.07700428366661072,
-0.4213648736476898,
0.11428716778755188,
0.1191411018371582,
0.17094586789608002,
-0.43186837434768677,
0.41136500239372253,
0.01100938394665718,
-0.019180530682206154,
-0.26914259791374207,
-0.005347132682800293,
0.11281155049800873,
0.30217844247817993,
-0.15906690061092377,
0.047922953963279724,
0.037859201431274414,
0.05555420368909836,
-0.1845947653055191,
0.20387385785579681,
-0.3234502077102661,
0.07301145792007446,
0.06973054260015488,
-0.03795051947236061,
0.12418060004711151,
0.03305820748209953,
-0.21735289692878723,
-0.2992861568927765,
-0.38896194100379944,
0.2887626886367798,
0.2075737565755844,
0.14843222498893738,
0.29324620962142944,
0.17397931218147278,
0.08975581079721451,
0.05006510391831398,
-0.027094101533293724,
-0.1048983633518219,
-0.22487488389015198,
0.37955185770988464,
-0.2989795207977295,
-0.19410043954849243,
-0.11162671446800232,
-0.3840445876121521,
0.12152977287769318,
0.33420753479003906,
-0.3244175314903259,
0.020430929958820343,
-0.01700662635266781,
0.2479625940322876,
-0.03475864231586456,
-0.16935384273529053,
0.3909701406955719,
0.24057511985301971,
-0.08577688783407211,
-0.12689101696014404,
0.3130662143230438,
0.1360515058040619,
-0.0656612291932106,
-0.013811320066452026,
-0.004878882318735123,
0.05343320965766907,
0.1272912323474884,
0.9551768898963928,
0.06549759209156036,
-0.1920531690120697,
0.30452463030815125,
-0.05896686762571335,
0.10362499952316284,
-0.12067653983831406,
-0.23274384438991547,
-0.20471972227096558,
-0.36019477248191833,
-0.23469269275665283,
0.19852031767368317,
-0.02349923923611641,
-0.4740232825279236,
-0.12853354215621948,
0.3169514536857605,
0.10569923371076584,
-0.23931413888931274,
0.3562140464782715,
-0.4075007736682892,
0.2670649290084839,
0.020854845643043518,
0.1515980362892151,
-0.2517912983894348,
0.028984952718019485,
0.16631869971752167,
-0.1731976419687271,
0.24574121832847595,
-0.03819003701210022,
-0.15243373811244965,
-0.025053804740309715,
-0.44000500440597534,
0.18245351314544678,
0.29230114817619324,
0.006580744404345751,
0.30979475378990173,
-0.5092471837997437,
0.06263920664787292,
-0.1890147179365158,
0.40432995557785034,
-0.01316153071820736,
-0.2260546237230301,
0.1965542733669281,
-0.25179123878479004,
-0.23970289528369904,
0.02620069310069084,
0.01796240732073784,
0.22602394223213196,
-0.03611307218670845,
0.27940765023231506,
-0.2060953825712204,
-0.16936320066452026,
-0.03699411451816559,
0.18383990228176117,
-0.2782757878303528,
0.0928175076842308,
-0.19116902351379395,
0.14667260646820068,
-0.24438628554344177,
0.07447908818721771,
0.12116355448961258,
-0.03513798490166664,
0.002556013874709606,
-0.03561263531446457,
-0.3902219235897064,
0.14781475067138672,
-0.1706957370042801,
0.2529810965061188,
0.2875465452671051,
0.04080331325531006,
0.2221604883670807,
0.2745282053947449,
0.2979695498943329,
0.16183152794837952,
0.5452843308448792,
-0.08644932508468628,
-0.19810926914215088,
-0.13879936933517456,
0.21634970605373383,
0.19611474871635437,
0.19709518551826477,
-0.033911678940057755,
0.14693427085876465,
0.2535187602043152,
-0.021756447851657867,
-0.2660982012748718,
0.07328177988529205,
0.03707331418991089,
-0.04109538719058037,
-0.2197510451078415,
-0.6608569622039795,
0.44348499178886414,
-0.07101652026176453,
-0.048735108226537704,
0.5060168504714966,
-0.3877330422401428,
-0.12658023834228516,
0.18981900811195374,
0.20502957701683044,
0.7067139744758606,
-0.15389440953731537,
0.5118755102157593,
0.19102904200553894,
-0.039653170853853226,
0.08678120374679565,
-0.24762460589408875,
0.24358819425106049,
-0.31682807207107544,
-0.22284165024757385,
-0.04544445127248764,
-0.08979959785938263,
-0.10083109885454178,
0.27847176790237427,
-0.13120640814304352,
0.11739523708820343,
0.04523959755897522,
0.052469268441200256,
0.043777354061603546,
0.05023156851530075,
-0.1628725528717041,
-0.3840976357460022,
-0.3585004210472107,
0.23138803243637085,
-0.01329994946718216,
-0.15643468499183655,
-0.27334728837013245,
-0.18025559186935425,
0.4211713969707489,
0.07025189697742462,
0.06836748123168945,
0.11723838001489639,
-0.5932953357696533,
0.1865750104188919,
-0.1993323266506195,
-0.5086110234260559,
-0.2796920835971832,
0.16858693957328796,
-0.00018481165170669556,
-0.1478402018547058,
-0.14142240583896637,
0.19615811109542847,
0.2437034249305725,
-0.1109168753027916,
-0.22001682221889496,
-0.021345816552639008,
0.3735957443714142,
-0.050189852714538574,
0.07570629566907883,
0.24321481585502625,
-0.08936024457216263,
-0.7336304187774658,
0.2336052656173706,
0.06624940037727356,
0.13765835762023926,
0.08991926163434982,
-0.2003292292356491,
0.17150798439979553,
-0.22955091297626495,
-0.21917611360549927,
0.21228748559951782,
0.028357364237308502,
-0.27272745966911316,
-0.05905192345380783,
0.11208397150039673,
-0.19248870015144348,
0.0093667171895504,
0.2310260534286499,
-0.010535024106502533,
0.0669286772608757,
0.45925721526145935,
-0.00837470218539238,
-0.16498038172721863,
-0.30607908964157104,
-0.14619246125221252,
0.2956595718860626,
-0.3422289490699768,
0.20383207499980927,
0.0790228620171547,
-0.10696560889482498,
-0.20206305384635925,
0.06065649166703224,
0.21943019330501556,
0.13721546530723572,
-0.23299221694469452,
-0.0680425763130188,
-0.483138769865036,
0.12655530869960785,
0.07084251940250397,
0.32848483324050903,
0.06884744763374329,
-0.25052937865257263,
-0.19256046414375305,
0.06706532090902328,
-0.42906349897384644,
-0.09359057247638702,
-0.08603093028068542,
0.09050480276346207,
-0.0715412124991417,
-0.05302600562572479,
0.22141164541244507,
0.059414807707071304,
0.1507851630449295,
0.026547204703092575,
-0.2744768559932709,
-0.39008140563964844,
-0.14568878710269928,
0.07295248657464981,
0.09520424902439117,
-0.093604676425457,
-0.025623343884944916,
-0.19339515268802643,
-0.13834866881370544,
-0.34553197026252747,
0.1190444678068161,
0.05182997137308121,
-0.07471305131912231,
0.12794512510299683,
0.4234076738357544,
-0.08233513683080673,
-0.28717589378356934,
-0.06727586686611176,
0.053788136690855026,
0.08675778657197952,
-0.14489580690860748,
0.10513655841350555,
-0.23951496183872223,
-0.08435235172510147,
0.18028873205184937,
0.18062618374824524,
0.1801292896270752,
0.12292888015508652,
0.34703952074050903,
-0.3047335743904114,
-0.005754098296165466,
0.09163884073495865,
0.4444686472415924,
0.33832842111587524,
-0.07073382288217545,
0.17225764691829681,
0.18671870231628418,
0.3192040026187897,
-0.3228672444820404,
-0.1479027420282364,
-0.0358000211417675,
-0.21829791367053986,
0.23883435130119324,
0.16534100472927094,
0.10221520066261292,
0.04140008985996246,
0.2679780125617981,
0.06260626763105392,
-0.12709522247314453,
-0.335646390914917,
0.18206030130386353,
0.26360371708869934,
0.2739524841308594,
-0.12872131168842316,
0.2004626989364624,
0.26212725043296814,
0.3507298231124878,
0.1231929212808609,
-0.2936059534549713,
0.25711023807525635,
0.46662062406539917,
-0.1919705867767334,
-0.13248306512832642,
-0.031696900725364685,
-0.20547296106815338,
-0.22177797555923462,
-0.0038870200514793396,
0.42344650626182556,
0.07955360412597656,
0.20517732203006744,
0.035725679248571396,
-0.34041735529899597,
-0.16089998185634613,
0.03791722655296326,
0.0742444172501564,
-0.2579650580883026,
-0.027648698538541794,
-0.07751145213842392,
-0.05480419099330902,
0.040134575217962265,
-0.03530969098210335,
-0.012281395494937897,
0.273254930973053,
0.16748183965682983,
0.30294710397720337,
-0.2808748185634613,
0.2701569199562073,
0.22722795605659485,
0.49573129415512085,
-0.2995354235172272,
0.06864681094884872,
0.17217901349067688,
0.07018454372882843,
-0.0006127804517745972,
0.18729597330093384,
0.040429599583148956,
0.14618876576423645,
-0.3063342273235321,
0.26917800307273865,
-0.05822974070906639,
-0.07478129863739014,
-0.2936641573905945,
0.04338271915912628,
0.25305575132369995,
-0.26023155450820923,
0.3809696137905121,
0.17989608645439148,
-0.23811301589012146,
0.2860549986362457,
-0.23595218360424042,
-0.0522100068628788,
-0.38747379183769226,
0.08615937829017639,
0.18537837266921997,
-0.24098068475723267,
-0.025791477411985397,
0.08961433172225952,
-0.23417255282402039,
0.024306759238243103,
0.5539703369140625,
-0.34577494859695435,
0.10085760056972504,
-0.006786285899579525,
0.13593238592147827,
-0.06928467750549316,
0.7241185903549194,
0.09237831830978394,
0.4199462831020355,
-0.2376900315284729,
0.09926000237464905,
-0.4465104639530182,
0.04897789657115936,
-0.2178228199481964,
0.14814743399620056,
0.04578334838151932,
0.2641172409057617,
0.1603398621082306,
0.2921113967895508,
0.18806186318397522,
-0.11252178251743317,
0.12705542147159576,
0.36095350980758667,
-0.20548172295093536,
-0.17501327395439148,
0.04789300635457039,
0.23738136887550354,
0.09679847955703735,
-0.5355291366577148,
-0.13925930857658386,
-0.21184062957763672,
0.16531583666801453,
0.1721988469362259,
-0.23002105951309204,
0.15731734037399292,
0.0296152476221323,
0.5709649920463562,
-0.1338036060333252,
0.17419663071632385,
-0.04767746105790138,
0.00831984169781208,
-0.26432785391807556,
-0.35723403096199036,
-0.1929602473974228,
-0.05821054428815842,
-0.0018091537058353424,
0.24372127652168274,
-0.21376606822013855,
-0.3175670802593231,
-0.24276258051395416,
0.06982884556055069,
0.32268911600112915,
-0.27592283487319946,
-0.15043866634368896,
0.1361190229654312,
-0.16502082347869873,
0.2442692667245865,
-0.09246747940778732,
0.5355942845344543,
-0.0921393632888794,
-0.08387000858783722,
-0.007699228823184967,
-0.18329021334648132,
0.4656291604042053,
-0.4165583848953247,
-0.27375689148902893,
0.1409936398267746,
0.1453086882829666,
0.4470057189464569,
-0.0793905109167099,
-0.33868110179901123,
0.10775762051343918,
0.22514717280864716,
-0.10295898467302322,
-0.24326179921627045,
0.09530290961265564,
0.15789055824279785,
0.10056154429912567,
-0.21676278114318848,
0.6603792905807495,
-0.16112807393074036,
-0.07668356597423553,
-0.3422004282474518,
-0.5754399299621582
] |
https://github.com/huggingface/datasets/issues/5481 | Load a cached dataset as iterable | Yes, I see how this can be useful. Still, I think `Dataset.to_iterable` + `IterableDataset.from_file` would be much cleaner in terms of the API design (and more flexible since `load_dataset` can only access the "initial" (unprocessed) version of a dataset).
And since it can be tricky to manually find the "initial" version of a dataset in the cache, maybe `load_dataset` could return an iterable dataset streamed from the cache if `streaming=True` and the cache is up-to-date. | The idea would be to allow something like
```python
ds = load_dataset("c4", "en", as_iterable=True)
```
To be used to train models. It would load an IterableDataset from the cached Arrow files.
Cc @stas00
Edit : from the discussions we may load from cache when streaming=True | 75 | Load a cached dataset as iterable
The idea would be to allow something like
```python
ds = load_dataset("c4", "en", as_iterable=True)
```
To be used to train models. It would load an IterableDataset from the cached Arrow files.
Cc @stas00
Edit : from the discussions we may load from cache when streaming=True
Yes, I see how this can be useful. Still, I think `Dataset.to_iterable` + `IterableDataset.from_file` would be much cleaner in terms of the API design (and more flexible since `load_dataset` can only access the "initial" (unprocessed) version of a dataset).
And since it can be tricky to manually find the "initial" version of a dataset in the cache, maybe `load_dataset` could return an iterable dataset streamed from the cache if `streaming=True` and the cache is up-to-date. | [
-0.45291846990585327,
-0.016842924058437347,
-0.12488701939582825,
-0.06570792198181152,
0.08305391669273376,
0.243190735578537,
0.23844845592975616,
0.4473229944705963,
0.3207477629184723,
-0.10691706836223602,
0.1624637097120285,
0.1538330763578415,
-0.356915682554245,
0.13332749903202057,
0.02965749055147171,
-0.10021200776100159,
-0.049306295812129974,
0.2225310206413269,
-0.18758079409599304,
0.04621202498674393,
-0.16986937820911407,
-0.11751218140125275,
0.1356988549232483,
-0.0644848495721817,
0.04658378288149834,
-0.20734401047229767,
0.13462142646312714,
0.11134248226881027,
0.009395305998623371,
-0.5441734790802002,
0.2159539759159088,
0.15843507647514343,
0.3845715820789337,
0.04503696411848068,
-0.00010087603732245043,
0.11425839364528656,
0.11214910447597504,
-0.12576130032539368,
-0.4040864408016205,
0.0022870004177093506,
-0.08336295187473297,
-0.04408373683691025,
0.2829156816005707,
-0.2790512442588806,
-0.24887695908546448,
-0.2518317401409149,
0.13754796981811523,
-0.650777280330658,
0.5326323509216309,
0.17554238438606262,
0.29387542605400085,
0.014377664774656296,
-0.32480186223983765,
0.03385673463344574,
-0.21732673048973083,
-0.26913660764694214,
-0.20125354826450348,
0.15988759696483612,
0.23990246653556824,
0.0979112982749939,
-0.030936725437641144,
0.40527403354644775,
-0.03159819915890694,
0.08798804879188538,
0.26062238216400146,
-0.06314170360565186,
0.09586404263973236,
-0.15273341536521912,
-0.11270583420991898,
0.11536140739917755,
0.4935629963874817,
-0.2587984800338745,
-0.426425963640213,
-0.4040301740169525,
-0.04272531345486641,
-0.5753588676452637,
-0.19476765394210815,
0.10272423177957535,
-0.006145882420241833,
0.3092232346534729,
0.0012364448048174381,
-0.13591401278972626,
-0.1515897661447525,
-0.09335950016975403,
0.15990899503231049,
0.15213119983673096,
0.03671655058860779,
0.0014014393091201782,
0.18055543303489685,
0.08736192435026169,
0.30733394622802734,
0.10866241157054901,
-0.03610550984740257,
0.2052963525056839,
-0.29281386733055115,
-0.02194860205054283,
0.02376576140522957,
0.06113322079181671,
0.054369837045669556,
0.3894968032836914,
0.5855898857116699,
0.2784275412559509,
-0.049226194620132446,
0.09874212741851807,
0.15297462046146393,
0.05392656847834587,
0.019520021975040436,
0.00407062005251646,
0.04757758229970932,
0.12038025259971619,
-0.22612935304641724,
-0.21115338802337646,
-0.17293094098567963,
-0.13322605192661285,
0.34359052777290344,
0.08723559975624084,
0.009517841041088104,
0.008294288069009781,
-0.014726403169333935,
-0.11665575951337814,
-0.077594093978405,
-0.018843024969100952,
0.1344304382801056,
0.32007673382759094,
-0.07511389255523682,
0.4229821264743805,
-0.03673572093248367,
0.12312875688076019,
0.08953072130680084,
-0.1640840470790863,
-0.15110763907432556,
-0.173897847533226,
-0.17126138508319855,
0.16874539852142334,
0.1094142496585846,
-0.15424342453479767,
0.23499871790409088,
-0.2228558212518692,
-0.006518743932247162,
0.13802506029605865,
0.5486457347869873,
0.031018700450658798,
0.4437667727470398,
0.054587263613939285,
-0.17691129446029663,
-0.03854231536388397,
0.24321649968624115,
-0.10772240161895752,
-0.36562806367874146,
-0.042536661028862,
-0.1472923755645752,
-0.30791962146759033,
0.21506057679653168,
0.2886343002319336,
-0.04001833125948906,
-0.14627628028392792,
-0.23015272617340088,
0.4458373785018921,
0.14210110902786255,
-0.09920383989810944,
0.21483191847801208,
-0.01589515060186386,
-0.07853655517101288,
-0.14734649658203125,
0.10158451646566391,
0.3675535023212433,
-0.21100491285324097,
-0.14748042821884155,
0.011422449722886086,
0.02484671212732792,
-0.15447720885276794,
0.15225531160831451,
-0.36325713992118835,
0.040307652205228806,
-0.11842493712902069,
0.036656901240348816,
0.5397598147392273,
-0.24680283665657043,
-0.26087144017219543,
0.09517083317041397,
0.0905916839838028,
0.2901071310043335,
0.19497010111808777,
0.20073439180850983,
0.03557925298810005,
-0.006598858628422022,
0.019002582877874374,
0.39931720495224,
-0.11521533131599426,
-0.06995297968387604,
-0.2054225355386734,
-0.1811620593070984,
0.18182939291000366,
0.2351146787405014,
0.07475920021533966,
0.11876756697893143,
-0.041668616235256195,
-0.20488175749778748,
0.3716204762458801,
-0.30333271622657776,
0.061154142022132874,
-0.06839193403720856,
-0.005141362547874451,
-0.15438321232795715,
0.11723139882087708,
-0.16565486788749695,
-0.4157264828681946,
0.2667165696620941,
0.03570856153964996,
-0.3439999222755432,
-0.015696130692958832,
-0.286709189414978,
0.0722302496433258,
0.14994005858898163,
-0.2417687326669693,
-0.07668136060237885,
0.24228069186210632,
0.04003171995282173,
0.11738735437393188,
-0.05788614600896835,
-0.522284209728241,
0.2834872007369995,
-0.24267348647117615,
-0.10849989205598831,
-0.3057544529438019,
-0.04571428522467613,
0.25915735960006714,
0.09695373475551605,
-0.23513902723789215,
0.06815836578607559,
-0.12774625420570374,
-0.08858086168766022,
0.019999578595161438,
0.2226724922657013,
-0.04687805473804474,
0.2142879217863083,
0.07935930788516998,
0.5689743161201477,
0.10609768331050873,
-0.031488120555877686,
0.0065942201763391495,
0.27394407987594604,
-0.021435599774122238,
-0.030555441975593567,
0.03955822438001633,
0.4911535978317261,
0.05445530638098717,
0.2746241092681885,
0.23266901075839996,
-0.054502375423908234,
0.3062669634819031,
0.04519912973046303,
-0.4355907738208771,
-0.13444149494171143,
-0.06312797963619232,
-0.19820623099803925,
0.4078647196292877,
-0.09996446967124939,
-0.22725015878677368,
0.3116825222969055,
0.3803001642227173,
0.17167718708515167,
0.016287073493003845,
-0.06152776628732681,
-0.21071013808250427,
-0.09478877484798431,
0.2259799689054489,
0.24477382004261017,
0.11823172867298126,
0.2404041737318039,
0.2395746260881424,
-0.024505628272891045,
-0.0036001671105623245,
-0.009949062950909138,
0.1831594854593277,
0.019733887165784836,
0.2925274968147278,
0.0485880970954895,
0.0629345029592514,
-0.137428879737854,
-0.32154640555381775,
-0.21353860199451447,
0.013806026428937912,
-0.052407406270504,
0.06880448758602142,
0.36698123812675476,
-0.2349398285150528,
-0.011551018804311752,
-0.12674866616725922,
-0.2771013379096985,
0.08062834292650223,
-0.09032122790813446,
0.0890619307756424,
0.2831108272075653,
-0.23190510272979736,
0.10893223434686661,
-0.4814627468585968,
0.3841109871864319,
0.03418312966823578,
-0.26060882210731506,
-0.18580032885074615,
-0.38721948862075806,
0.0934973955154419,
0.15464483201503754,
0.20297910273075104,
-0.4032428562641144,
0.34165623784065247,
0.03071471117436886,
-0.04937327653169632,
-0.13848237693309784,
-0.05695664882659912,
0.07825341820716858,
0.25933903455734253,
-0.09627735614776611,
0.02407221496105194,
0.02302584797143936,
0.0394146591424942,
-0.1829957216978073,
0.07532594352960587,
-0.28131431341171265,
0.06841925531625748,
-0.06965810060501099,
-0.04376648738980293,
0.2059173583984375,
0.022645175457000732,
-0.24456775188446045,
-0.2900790870189667,
-0.46607425808906555,
0.34912508726119995,
0.20556968450546265,
0.10093285143375397,
0.32636240124702454,
0.028054598718881607,
0.021841134876012802,
0.24965187907218933,
-0.03145319223403931,
-0.17665164172649384,
-0.24734388291835785,
0.2723396122455597,
-0.28644371032714844,
-0.14609763026237488,
-0.09025034308433533,
-0.329562246799469,
0.19181154668331146,
0.31191933155059814,
-0.2858732342720032,
-0.10524534434080124,
0.058518342673778534,
0.12798984348773956,
-0.04407147318124771,
-0.35574471950531006,
0.3242461085319519,
0.18915896117687225,
-0.12211210280656815,
-0.11329235881567001,
0.26213395595550537,
0.23381009697914124,
-0.10021937638521194,
-0.10110876709222794,
0.0775032639503479,
0.2223939299583435,
0.08938367664813995,
0.8768138289451599,
0.08194625377655029,
-0.1714051067829132,
0.3430156111717224,
0.06977846473455429,
0.09554256498813629,
-0.17126652598381042,
-0.09337306767702103,
-0.2817617952823639,
-0.2334757149219513,
-0.2725910544395447,
0.1961967647075653,
0.0025345757603645325,
-0.4605713486671448,
-0.13585224747657776,
0.2539255917072296,
0.04264981299638748,
-0.23179037868976593,
0.31093519926071167,
-0.4261847138404846,
0.20567986369132996,
0.12846793234348297,
0.16486433148384094,
-0.21336841583251953,
0.03519855812191963,
0.20537535846233368,
-0.07010701298713684,
0.32380008697509766,
-0.015224936418235302,
-0.205821692943573,
0.04853779450058937,
-0.5611535906791687,
0.2290087342262268,
0.16591088473796844,
0.0463152751326561,
0.2602481245994568,
-0.5400515794754028,
-0.021313615143299103,
-0.21607479453086853,
0.3756600022315979,
-0.16977740824222565,
-0.269936203956604,
0.17200250923633575,
-0.15059685707092285,
-0.15454885363578796,
0.037324171513319016,
0.10617077350616455,
0.2633459270000458,
-0.091218501329422,
0.3176923990249634,
-0.16704709827899933,
-0.10450156778097153,
-0.24023663997650146,
0.1780257523059845,
-0.24500733613967896,
0.1794147491455078,
-0.17698098719120026,
0.10162483900785446,
-0.19345206022262573,
0.06760882586240768,
0.06503427773714066,
-0.12989751994609833,
-0.11694713681936264,
-0.0645420104265213,
-0.3725651204586029,
0.15038534998893738,
-0.06269814074039459,
0.32707247138023376,
0.2838257849216461,
-0.030595440417528152,
0.1861630380153656,
0.2207518219947815,
0.3060222864151001,
0.16942639648914337,
0.5054143667221069,
-0.028188075870275497,
-0.09628462791442871,
-0.12911498546600342,
0.21890699863433838,
0.08417858183383942,
0.2018587440252304,
-0.039393842220306396,
0.22365796566009521,
0.30309781432151794,
-0.03435610234737396,
-0.26759442687034607,
0.03359789028763771,
-0.09067905694246292,
-0.029120411723852158,
-0.3306901156902313,
-0.7192724943161011,
0.5260725021362305,
-0.054181717336177826,
-0.1404954195022583,
0.540961503982544,
-0.3397144675254822,
-0.18461568653583527,
0.4033668041229248,
0.22609809041023254,
0.7207260727882385,
-0.1588834822177887,
0.32498204708099365,
0.14839676022529602,
0.019355744123458862,
0.19343622028827667,
-0.332155704498291,
0.1956193596124649,
-0.32456594705581665,
-0.23968128859996796,
-0.10551197826862335,
0.0018291100859642029,
-0.12571817636489868,
0.29879695177078247,
-0.16468574106693268,
0.23423326015472412,
0.12199057638645172,
0.06546089798212051,
-0.001003938727080822,
0.03601429611444473,
-0.1976330727338791,
-0.3280056416988373,
-0.4900239109992981,
0.23114725947380066,
0.06724970787763596,
-0.19277799129486084,
-0.27710074186325073,
-0.22385625541210175,
0.35599106550216675,
0.02176223322749138,
0.06743323802947998,
0.04155554622411728,
-0.5100396275520325,
0.13518860936164856,
-0.2318924367427826,
-0.491030752658844,
-0.23625627160072327,
0.1977381408214569,
0.10286759585142136,
-0.15701474249362946,
-0.1898070126771927,
0.18011313676834106,
0.2123713195323944,
-0.1044267937541008,
-0.2613699436187744,
-0.0746491402387619,
0.440518856048584,
-0.0769411027431488,
0.08724979311227798,
0.20972254872322083,
-0.08759936690330505,
-0.6823331713676453,
0.18058010935783386,
0.11019755899906158,
0.26429659128189087,
0.08481735736131668,
-0.26298001408576965,
0.2724601626396179,
-0.22193899750709534,
-0.1788397878408432,
0.20664361119270325,
0.025270432233810425,
-0.08174251019954681,
-0.06703927367925644,
0.1190701276063919,
-0.1545000523328781,
-0.024461779743433,
0.18775564432144165,
-0.033591218292713165,
0.04596557468175888,
0.44795680046081543,
-0.1049857810139656,
-0.12096372246742249,
-0.31435006856918335,
-0.27392908930778503,
0.36582067608833313,
-0.3199566602706909,
0.17302680015563965,
0.08721523731946945,
-0.0936858206987381,
-0.07125413417816162,
-0.0003187209367752075,
0.20859046280384064,
0.07002154737710953,
-0.18863865733146667,
-0.16192133724689484,
-0.40518537163734436,
0.23791790008544922,
-0.08968864381313324,
0.22909386456012726,
-0.03294840827584267,
-0.34994515776634216,
-0.2088424116373062,
-0.01209375448524952,
-0.4353318512439728,
-0.12273015826940536,
-0.06074116379022598,
0.020213564857840538,
-0.051899686455726624,
0.004960816353559494,
0.18902021646499634,
0.10310721397399902,
0.16104310750961304,
0.04195407032966614,
-0.308335542678833,
-0.39584875106811523,
-0.1450309157371521,
0.1000220850110054,
0.0581805519759655,
-0.13189658522605896,
0.019763395190238953,
-0.12665700912475586,
-0.16318529844284058,
-0.36911508440971375,
0.04466809704899788,
-0.004073254764080048,
-0.006066083908081055,
0.015543424524366856,
0.44601282477378845,
0.07499140501022339,
-0.3740367293357849,
-0.04685481637716293,
0.055511899292469025,
0.017399489879608154,
-0.15377862751483917,
0.12623803317546844,
-0.23468191921710968,
-0.06185385584831238,
0.18066953122615814,
0.13696201145648956,
0.24248574674129486,
0.13929997384548187,
0.2935488224029541,
-0.16069601476192474,
-0.05797358602285385,
0.18665796518325806,
0.4715534746646881,
0.3099183738231659,
-0.0010849692625924945,
0.1997179538011551,
0.15855297446250916,
0.35551372170448303,
-0.32897812128067017,
0.002952395472675562,
-0.05924313887953758,
-0.16742707788944244,
0.14763997495174408,
0.1968785971403122,
0.24919995665550232,
-0.05713389068841934,
0.3018888235092163,
-0.019822776317596436,
0.00993452500551939,
-0.35174989700317383,
0.2203795313835144,
0.15051205456256866,
0.20454742014408112,
-0.1007084995508194,
0.1287868767976761,
0.16414780914783478,
0.38814592361450195,
0.2062830775976181,
-0.20604148507118225,
0.26711079478263855,
0.4794962406158447,
-0.090346559882164,
-0.28648829460144043,
-0.28227102756500244,
-0.13424378633499146,
-0.08053845167160034,
0.043182555586099625,
0.5068776607513428,
0.1956457495689392,
0.16891643404960632,
0.1804746836423874,
-0.2620397210121155,
-0.1814848631620407,
-0.03208534047007561,
0.1365610659122467,
-0.33259323239326477,
0.08358655124902725,
-0.11848758161067963,
-0.05103669315576553,
0.018522687256336212,
-0.025292832404375076,
0.05663233995437622,
0.1928638368844986,
0.13271711766719818,
0.34030288457870483,
-0.1963922083377838,
0.18317696452140808,
0.18362858891487122,
0.4849275052547455,
-0.28995081782341003,
0.07353395968675613,
0.23197472095489502,
-0.012581020593643188,
0.09338082373142242,
0.06169208884239197,
0.031245330348610878,
0.18069012463092804,
-0.2640829384326935,
0.36156830191612244,
-0.0062707941979169846,
-0.025647597387433052,
-0.33567196130752563,
0.11292605102062225,
0.25820958614349365,
-0.19188910722732544,
0.35739976167678833,
0.21459655463695526,
-0.21638335287570953,
0.4269600212574005,
-0.2621091902256012,
0.05028143525123596,
-0.41890236735343933,
-0.01257498562335968,
0.318972647190094,
-0.1550973355770111,
-0.10986913740634918,
0.18436093628406525,
-0.14001362025737762,
0.08601326495409012,
0.3327156603336334,
-0.3025522232055664,
0.08042415976524353,
-0.003965546377003193,
0.13360151648521423,
-0.061071109026670456,
0.5349720120429993,
0.09752027690410614,
0.3880034387111664,
-0.18568222224712372,
0.0062980204820632935,
-0.498792439699173,
0.020810574293136597,
-0.13360539078712463,
0.23191013932228088,
0.026887184008955956,
0.26513490080833435,
0.2417283058166504,
0.1794901192188263,
0.16019359230995178,
-0.16421236097812653,
0.03954935073852539,
0.3734658658504486,
-0.22483603656291962,
-0.17071308195590973,
0.06127080321311951,
0.15551047027111053,
0.06357080489397049,
-0.561349630355835,
-0.17471782863140106,
-0.13163769245147705,
0.1438160538673401,
0.10509433597326279,
-0.24902591109275818,
0.2075043022632599,
0.08326385915279388,
0.6707653999328613,
-0.025553731247782707,
0.07289042323827744,
-0.11732388287782669,
-0.03254114091396332,
-0.4000013768672943,
-0.3533674478530884,
-0.2904869019985199,
-0.04999193549156189,
-0.0841044932603836,
0.2608773112297058,
-0.18125995993614197,
-0.24368159472942352,
-0.22890399396419525,
0.0922812968492508,
0.3268643617630005,
-0.18907682597637177,
-0.28417056798934937,
0.14449718594551086,
-0.18955495953559875,
0.14404232800006866,
-0.11904240399599075,
0.5127811431884766,
-0.051668934524059296,
-0.0006309393793344498,
0.023448608815670013,
-0.1390155404806137,
0.42002689838409424,
-0.43872886896133423,
-0.10680051147937775,
0.2033364325761795,
0.16417846083641052,
0.45598238706588745,
-0.1284654438495636,
-0.3965611755847931,
0.07598824054002762,
0.25029876828193665,
-0.11074455827474594,
-0.22787214815616608,
0.12664811313152313,
0.12721486389636993,
0.03762492164969444,
-0.23004212975502014,
0.6348249912261963,
-0.07952126115560532,
-0.19493715465068817,
-0.24723757803440094,
-0.5375271439552307
] |
https://github.com/huggingface/datasets/issues/5481 | Load a cached dataset as iterable | > This allows to use datasets for large scale training where map-style datasets are too slow and use too much memory in PyTorch.
I second that. e.g. In my last experiment Oscar-en uses 16GB RSS RAM per process and when using multiple processes the host quickly runs out cpu memory. | The idea would be to allow something like
```python
ds = load_dataset("c4", "en", as_iterable=True)
```
To be used to train models. It would load an IterableDataset from the cached Arrow files.
Cc @stas00
Edit : from the discussions we may load from cache when streaming=True | 50 | Load a cached dataset as iterable
The idea would be to allow something like
```python
ds = load_dataset("c4", "en", as_iterable=True)
```
To be used to train models. It would load an IterableDataset from the cached Arrow files.
Cc @stas00
Edit : from the discussions we may load from cache when streaming=True
> This allows to use datasets for large scale training where map-style datasets are too slow and use too much memory in PyTorch.
I second that. e.g. In my last experiment Oscar-en uses 16GB RSS RAM per process and when using multiple processes the host quickly runs out cpu memory. | [
-0.4272119402885437,
-0.13766340911388397,
-0.08257205784320831,
0.034330710768699646,
0.13773183524608612,
0.2024301290512085,
0.25033000111579895,
0.3894108831882477,
0.3153528869152069,
-0.07966470718383789,
0.030516259372234344,
0.16636428236961365,
-0.4187723994255066,
0.06501611322164536,
0.06767421215772629,
-0.1620205193758011,
-0.08920484036207199,
0.2814355492591858,
-0.37316951155662537,
0.02416316419839859,
-0.12977994978427887,
-0.2342776209115982,
0.14393243193626404,
-0.1691078394651413,
-0.18623358011245728,
-0.12453543394804001,
0.07538000494241714,
0.1552029550075531,
0.12714792788028717,
-0.5417410731315613,
0.10196176171302795,
0.10477201640605927,
0.26478204131126404,
0.09929406642913818,
-0.00010199251119047403,
0.09998129308223724,
0.056974858045578,
-0.17903073132038116,
-0.37355250120162964,
0.10541331768035889,
0.07757493853569031,
-0.010833012871444225,
0.1985890120267868,
-0.4229474663734436,
-0.22016343474388123,
-0.27118009328842163,
0.1542775183916092,
-0.5263562202453613,
0.413122296333313,
0.2668328583240509,
0.3002162277698517,
0.09332314133644104,
-0.38917937874794006,
-0.02480282634496689,
-0.08401545137166977,
-0.28657639026641846,
-0.12889020144939423,
0.19063527882099152,
0.29326456785202026,
0.05630269646644592,
-0.10234663635492325,
0.4912221431732178,
0.0021152272820472717,
0.2224220484495163,
0.3110876679420471,
-0.05677546560764313,
0.19921374320983887,
-0.1069166362285614,
-0.12421941012144089,
0.1155991479754448,
0.2018216848373413,
-0.2031324803829193,
-0.24876222014427185,
-0.3896808624267578,
0.014546846970915794,
-0.43987590074539185,
-0.0836651399731636,
0.18734844028949738,
-0.1612478792667389,
0.22529762983322144,
-0.12946631014347076,
-0.17988355457782745,
-0.15718388557434082,
0.02544180303812027,
0.10521942377090454,
0.11867979168891907,
0.11615365743637085,
0.007973842322826385,
0.21401776373386383,
0.17466548085212708,
0.2638792097568512,
0.08326780796051025,
0.09289208799600601,
0.14185771346092224,
-0.1926625818014145,
-0.03278743848204613,
-0.056207336485385895,
-0.19973406195640564,
0.054493680596351624,
0.10490946471691132,
0.3864941895008087,
0.22309395670890808,
0.13393989205360413,
0.12824642658233643,
0.0582721047103405,
0.05331995710730553,
-0.19036823511123657,
0.09771290421485901,
0.01682087406516075,
0.01787097565829754,
-0.25497862696647644,
-0.10478296130895615,
-0.17175883054733276,
-0.16562899947166443,
0.35420432686805725,
-0.03604530170559883,
-0.04833076894283295,
0.04536322131752968,
-0.01887252926826477,
-0.0003687730059027672,
-0.20715221762657166,
0.01110786758363247,
0.13418519496917725,
0.40660473704338074,
-0.21329136192798615,
0.3049211800098419,
0.05349799245595932,
0.05559081211686134,
0.01026817038655281,
-0.028248146176338196,
-0.1384328007698059,
-0.05589793249964714,
-0.19440653920173645,
0.09816574305295944,
0.1579323559999466,
-0.1046794205904007,
0.2806163728237152,
-0.20874720811843872,
0.21720021963119507,
0.07343495637178421,
0.5317318439483643,
-0.009317834861576557,
0.4631657898426056,
0.10435417294502258,
-0.2585891783237457,
-0.18822498619556427,
0.1601848155260086,
0.07949838042259216,
-0.28289636969566345,
0.038724519312381744,
-0.17293089628219604,
-0.3350738286972046,
0.10583668202161789,
0.2530510127544403,
-0.029834039509296417,
-0.0785658210515976,
-0.02064315229654312,
0.26113271713256836,
0.14319314062595367,
-0.051583439111709595,
0.2432405948638916,
-0.08189798891544342,
-0.1562815010547638,
-0.09693511575460434,
0.21786294877529144,
0.2930835783481598,
-0.1585700511932373,
-0.220864400267601,
0.27590182423591614,
0.16365496814250946,
-0.03133831173181534,
0.3279891610145569,
-0.3771422505378723,
-0.049534909427165985,
-0.052839912474155426,
-0.03825788199901581,
0.4575430154800415,
-0.1613471657037735,
-0.3251568078994751,
0.01432256493717432,
0.0411953330039978,
0.2022206038236618,
0.1689077913761139,
0.30241066217422485,
0.09669617563486099,
0.14037489891052246,
0.11487354338169098,
0.40011096000671387,
-0.13099642097949982,
0.021975865587592125,
-0.27934107184410095,
-0.2116657793521881,
0.16544939577579498,
0.35134854912757874,
0.2736385464668274,
-0.0388985350728035,
-0.06235017627477646,
-0.1620415896177292,
0.2745850086212158,
-0.44964858889579773,
0.10962092876434326,
0.032844096422195435,
-0.036746446043252945,
-0.06313903629779816,
0.09018365293741226,
-0.2591286897659302,
-0.261853963136673,
0.32246139645576477,
-0.12050401419401169,
-0.24480444192886353,
-0.08956387639045715,
-0.21457694470882416,
0.06004989147186279,
0.1139693632721901,
-0.20180301368236542,
-0.07814446091651917,
0.2082063853740692,
0.009577400982379913,
0.163117915391922,
-0.06730727851390839,
-0.3842529356479645,
0.3509596884250641,
-0.2661369740962982,
-0.13387061655521393,
-0.187528595328331,
0.11721062660217285,
0.09852585196495056,
-0.01698996126651764,
-0.27198392152786255,
0.17488235235214233,
-0.1927276849746704,
-0.060158777981996536,
0.019511306658387184,
0.2281031608581543,
-0.0758075937628746,
0.004663579165935516,
0.03869815170764923,
0.4157645106315613,
0.163664773106575,
-0.21074487268924713,
0.09029383957386017,
0.44104626774787903,
0.03309421241283417,
0.0023800507187843323,
-0.025830194354057312,
0.45166271924972534,
0.17519152164459229,
0.17184767127037048,
0.22978998720645905,
-0.015511719509959221,
0.17605406045913696,
0.008268997073173523,
-0.4025872051715851,
-0.08880716562271118,
0.11493027210235596,
-0.2672574520111084,
0.32116514444351196,
0.06237576901912689,
-0.28026098012924194,
0.06180959194898605,
0.41321638226509094,
0.21190820634365082,
0.11205462366342545,
-0.024379558861255646,
-0.29825589060783386,
-0.12885281443595886,
0.22260916233062744,
0.15166130661964417,
0.08496977388858795,
0.22075358033180237,
0.2311408966779709,
0.07289225608110428,
-0.21353095769882202,
-0.022675074636936188,
0.1686221808195114,
0.022763732820749283,
0.34364330768585205,
0.010473866015672684,
0.10034792870283127,
-0.15510745346546173,
-0.32587647438049316,
-0.11638399958610535,
0.09391643851995468,
-0.06588120013475418,
0.061845313757658005,
0.36613404750823975,
-0.25270408391952515,
-0.042802873998880386,
-0.17365437746047974,
-0.09163646399974823,
0.05346329137682915,
0.044324375689029694,
0.18830111622810364,
0.29393360018730164,
-0.21665729582309723,
0.23007231950759888,
-0.4852985441684723,
0.42375290393829346,
0.09500642120838165,
-0.32365870475769043,
-0.0827280730009079,
-0.44310322403907776,
0.12650126218795776,
0.13554176688194275,
0.15158618986606598,
-0.33963972330093384,
0.42255234718322754,
0.08274122327566147,
-0.12465804815292358,
-0.1065172478556633,
-0.032140690833330154,
0.08339720964431763,
0.3062736988067627,
-0.21061109006404877,
-0.07995004951953888,
0.0620950423181057,
-0.13618402183055878,
-0.15825319290161133,
0.20776546001434326,
-0.34984880685806274,
0.08232094347476959,
0.09151782095432281,
-0.000864091154653579,
0.15669898688793182,
0.04915675148367882,
-0.2934485673904419,
-0.3047651946544647,
-0.4170481860637665,
0.2506484091281891,
0.15088987350463867,
0.13420867919921875,
0.29388630390167236,
0.2731006145477295,
0.09844344854354858,
0.04534785822033882,
0.028022149577736855,
-0.15441033244132996,
-0.16345246136188507,
0.36221757531166077,
-0.29114675521850586,
-0.22646890580654144,
-0.15604601800441742,
-0.34376060962677,
0.090819351375103,
0.37465888261795044,
-0.3490552306175232,
-0.10111510753631592,
-0.02768138237297535,
0.12047187983989716,
-0.09608778357505798,
-0.24771954119205475,
0.42363759875297546,
0.21419963240623474,
-0.14806212484836578,
-0.04817947745323181,
0.32123062014579773,
0.19624260067939758,
-0.0631604790687561,
-0.08158170431852341,
-0.034663982689380646,
0.13878005743026733,
0.18940356373786926,
0.8919247984886169,
0.015334881842136383,
-0.12276753783226013,
0.3536931872367859,
-0.005147414281964302,
0.0824013501405716,
-0.11439432948827744,
-0.14417824149131775,
-0.1312982439994812,
-0.3343261480331421,
-0.20836776494979858,
0.24381023645401,
-0.0440463162958622,
-0.522243320941925,
-0.10768748819828033,
0.27711984515190125,
0.17144060134887695,
-0.22728018462657928,
0.44261640310287476,
-0.385261595249176,
0.28069424629211426,
-0.011000447906553745,
0.15892258286476135,
-0.18355128169059753,
-0.014046728610992432,
0.17450691759586334,
-0.25011569261550903,
0.14212185144424438,
-0.0630679652094841,
-0.29139918088912964,
0.019834747537970543,
-0.4708365797996521,
0.20695000886917114,
0.26165440678596497,
0.06595347076654434,
0.21075685322284698,
-0.5146230459213257,
0.07012052834033966,
-0.2323332279920578,
0.2851463854312897,
0.040259793400764465,
-0.24490483105182648,
0.10744041204452515,
-0.20021004974842072,
-0.3047172725200653,
0.030137132853269577,
-0.015382453799247742,
0.1722733974456787,
-0.035098787397146225,
0.252144455909729,
-0.15091843903064728,
-0.11197991669178009,
-0.07164266705513,
0.20307514071464539,
-0.2553670108318329,
0.1246303841471672,
-0.18779277801513672,
0.04174397140741348,
-0.2763480544090271,
0.1729840338230133,
0.15068885684013367,
-0.04996742308139801,
0.05613343417644501,
-0.037065260112285614,
-0.31143414974212646,
0.19923394918441772,
-0.0619359165430069,
0.265202134847641,
0.23894357681274414,
-0.009961253963410854,
0.14264662563800812,
0.19840432703495026,
0.35605308413505554,
0.16531923413276672,
0.5332046151161194,
-0.1317502111196518,
-0.1778131127357483,
-0.15866199135780334,
0.2656356692314148,
0.2699335813522339,
0.23817241191864014,
0.02302292361855507,
0.11311603337526321,
0.34097492694854736,
0.009223736822605133,
-0.31157830357551575,
0.12481580674648285,
0.02384234219789505,
-0.02119402214884758,
-0.1690509021282196,
-0.5930975675582886,
0.3990821838378906,
0.016487345099449158,
-0.05721872299909592,
0.4256517291069031,
-0.3599047064781189,
-0.1499997228384018,
0.3110818862915039,
0.2702350318431854,
0.7837509512901306,
-0.22913898527622223,
0.5360622406005859,
0.20721974968910217,
-0.01076401025056839,
0.021618714556097984,
-0.255161851644516,
0.2401881366968155,
-0.2343071848154068,
-0.19686950743198395,
-0.056690461933612823,
-0.03346741944551468,
-0.12569355964660645,
0.23162032663822174,
-0.13910147547721863,
0.13713812828063965,
0.1344192922115326,
-0.036265503615140915,
0.007975103333592415,
0.016462285071611404,
-0.07820272445678711,
-0.429496169090271,
-0.38678884506225586,
0.23133862018585205,
0.0479428768157959,
-0.2502864599227905,
-0.23736685514450073,
-0.07411568611860275,
0.36407366394996643,
0.026318132877349854,
0.06795544922351837,
0.10450079292058945,
-0.6147512197494507,
0.16840209066867828,
-0.2925901412963867,
-0.5053337216377258,
-0.27305322885513306,
0.1656973958015442,
-0.05602744221687317,
-0.09863975644111633,
-0.12221823632717133,
0.17759519815444946,
0.21242624521255493,
-0.1282813549041748,
-0.2039419263601303,
-0.09223192930221558,
0.4130885601043701,
-0.07388422638177872,
0.028660304844379425,
0.2823146879673004,
-0.04172849282622337,
-0.6864784955978394,
0.21049225330352783,
0.11241056770086288,
0.12047260999679565,
0.14218518137931824,
-0.2628786861896515,
0.1581433266401291,
-0.24744142591953278,
-0.22793546319007874,
0.21136587858200073,
0.03693389892578125,
-0.23561081290245056,
0.010207705199718475,
0.17445918917655945,
-0.24968720972537994,
-0.00351724773645401,
0.20538637042045593,
0.01741129904985428,
0.13132870197296143,
0.42842721939086914,
0.010294169187545776,
-0.1349675953388214,
-0.3181859254837036,
-0.20533642172813416,
0.27447646856307983,
-0.29226118326187134,
0.19125691056251526,
0.1010860726237297,
-0.20639747381210327,
-0.2580057382583618,
-0.04002494737505913,
0.26494351029396057,
0.022911831736564636,
-0.2090855836868286,
-0.025919359177350998,
-0.510604739189148,
0.21703892946243286,
0.14122365415096283,
0.33798444271087646,
0.12254595011472702,
-0.29067888855934143,
-0.22406040132045746,
0.07997351139783859,
-0.4432133436203003,
-0.05437902361154556,
-0.09877768158912659,
0.11202915757894516,
-0.1036725789308548,
-0.14603939652442932,
0.25602543354034424,
0.06334376335144043,
0.1696992665529251,
0.04810827970504761,
-0.2451510727405548,
-0.3971000015735626,
-0.16875296831130981,
0.06519903987646103,
0.06037403270602226,
-0.17079918086528778,
0.0041738636791706085,
-0.2561885118484497,
-0.08156044781208038,
-0.37436404824256897,
0.05859938636422157,
0.15143492817878723,
-0.08938543498516083,
0.12057057023048401,
0.3314334452152252,
-0.13519135117530823,
-0.25307750701904297,
-0.01387261226773262,
0.031951114535331726,
0.0945889949798584,
-0.17690610885620117,
0.1034858375787735,
-0.0887632742524147,
-0.1270601749420166,
0.02219555899500847,
0.1753658652305603,
0.2178897112607956,
0.1236836165189743,
0.20080196857452393,
-0.2249130755662918,
-0.04906514286994934,
0.14195001125335693,
0.438799113035202,
0.29554545879364014,
-0.1005590632557869,
0.15780578553676605,
0.2870689928531647,
0.3501166105270386,
-0.3098858892917633,
-0.11588915437459946,
-0.041916683316230774,
-0.23615826666355133,
0.2928183078765869,
0.2329733967781067,
0.14630354940891266,
0.027736306190490723,
0.2384585738182068,
0.030448324978351593,
-0.20332518219947815,
-0.3485921025276184,
0.13465803861618042,
0.15033936500549316,
0.2796047627925873,
-0.23354028165340424,
0.14057105779647827,
0.24174076318740845,
0.4489171802997589,
0.13740409910678864,
-0.1466016173362732,
0.2983490824699402,
0.41876211762428284,
-0.08243018388748169,
-0.2221297323703766,
-0.060414113104343414,
-0.21076969802379608,
-0.1341629922389984,
-0.08422945439815521,
0.4754042327404022,
0.09008967876434326,
0.22108414769172668,
0.051886748522520065,
-0.35667797923088074,
-0.23219892382621765,
0.04997364431619644,
0.011413676664233208,
-0.2628987729549408,
0.0646645650267601,
-0.1121220663189888,
-0.04973748326301575,
0.10237711668014526,
0.009921424090862274,
0.03949367254972458,
0.3447026014328003,
0.22407570481300354,
0.24324896931648254,
-0.17352454364299774,
0.23364099860191345,
0.2472492754459381,
0.44486403465270996,
-0.30225294828414917,
0.09232963621616364,
0.15136119723320007,
0.0296412892639637,
0.012879854068160057,
0.1953449547290802,
0.07150959968566895,
0.16314034163951874,
-0.3920696973800659,
0.27212437987327576,
-0.051751758903265,
-0.041696298867464066,
-0.33231326937675476,
0.08190479874610901,
0.3422606289386749,
-0.20916447043418884,
0.3526713252067566,
0.1947334259748459,
-0.25718653202056885,
0.3678372800350189,
-0.3304150700569153,
-0.11246466636657715,
-0.3689928948879242,
0.05707350745797157,
0.2951788306236267,
-0.20251217484474182,
-0.06573260575532913,
0.05365106463432312,
-0.28765174746513367,
0.056913331151008606,
0.516157329082489,
-0.36195680499076843,
0.1162065640091896,
0.014783903025090694,
0.13638384640216827,
-0.06920512020587921,
0.723564624786377,
0.0829644575715065,
0.4233146905899048,
-0.18738746643066406,
0.11727820336818695,
-0.43057262897491455,
0.09849104285240173,
-0.3658830225467682,
0.14831767976284027,
-0.036519140005111694,
0.26454198360443115,
0.18848153948783875,
0.2916952967643738,
0.13136522471904755,
-0.17108550667762756,
0.02707553282380104,
0.34886494278907776,
-0.23661771416664124,
-0.04811077192425728,
0.13903504610061646,
0.23343655467033386,
0.1584216058254242,
-0.6080901026725769,
-0.12337896227836609,
-0.2206062376499176,
0.1636686623096466,
0.116361603140831,
-0.19959914684295654,
0.06750810146331787,
0.013881955295801163,
0.6392560601234436,
-0.08546841889619827,
0.21455414593219757,
-0.0968240275979042,
-0.051104214042425156,
-0.2908659875392914,
-0.3329888880252838,
-0.19648395478725433,
-0.12291019409894943,
0.06755039095878601,
0.2815469205379486,
-0.25837501883506775,
-0.3616667091846466,
-0.1890861690044403,
0.15007393062114716,
0.22805331647396088,
-0.3033668100833893,
-0.09125350415706635,
0.08657775819301605,
-0.13077202439308167,
0.23999793827533722,
-0.13132056593894958,
0.5694011449813843,
-0.06708632409572601,
-0.10825060307979584,
-0.036452967673540115,
-0.19777831435203552,
0.4438628852367401,
-0.35566243529319763,
-0.2585093677043915,
0.041125260293483734,
0.12607239186763763,
0.35487356781959534,
-0.0012984685599803925,
-0.3269093334674835,
0.08299494534730911,
0.14789092540740967,
-0.00210004486143589,
-0.3027229607105255,
0.05439164116978645,
0.17712585628032684,
0.03247304633259773,
-0.2371925413608551,
0.726476788520813,
-0.25324177742004395,
-0.14123313128948212,
-0.331537663936615,
-0.5845975875854492
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.