html_url
stringlengths 51
51
| comments
stringlengths 67
24.7k
| title
stringlengths 6
280
| body
stringlengths 51
36.2k
| comment_length
int64 16
1.45k
| text
stringlengths 190
38.3k
| embeddings
sequence |
---|---|---|---|---|---|---|
https://github.com/huggingface/datasets/issues/6193 | Before dynamically loading `.py` scripts with `importlib.import_module`, we also parse their contents to check imports, which is tricky to implement for binary `.pyc` files (requires parsing bytecode), so I don't think this is something we want to support (unless more users request it ofc) as this use case is a bit too specific.
@lhoestq What's your opinion on this? | Dataset loading script method does not work with .pyc file | ### Describe the bug
The huggingface dataset library specifically looks for ‘.py’ file while loading the dataset using loading script approach and it does not work with ‘.pyc’ file.
While deploying in production, it becomes an issue when we are restricted to use only .pyc files. Is there any work around for this ?
### Steps to reproduce the bug
1. Create a dataset loading script to read the custom data.
2. compile the code to make sure that .pyc file is created
3. Delete the loading script and re-run the code. Usually, python should make use of complied .pyc files. However, in this case, the dataset library errors out with the message that it's unable to find the data loader loading script.
### Expected behavior
The code should make use of .pyc file and run without any error.
### Environment info
NA | 59 | Dataset loading script method does not work with .pyc file
### Describe the bug
The huggingface dataset library specifically looks for ‘.py’ file while loading the dataset using loading script approach and it does not work with ‘.pyc’ file.
While deploying in production, it becomes an issue when we are restricted to use only .pyc files. Is there any work around for this ?
### Steps to reproduce the bug
1. Create a dataset loading script to read the custom data.
2. compile the code to make sure that .pyc file is created
3. Delete the loading script and re-run the code. Usually, python should make use of complied .pyc files. However, in this case, the dataset library errors out with the message that it's unable to find the data loader loading script.
### Expected behavior
The code should make use of .pyc file and run without any error.
### Environment info
NA
Before dynamically loading `.py` scripts with `importlib.import_module`, we also parse their contents to check imports, which is tricky to implement for binary `.pyc` files (requires parsing bytecode), so I don't think this is something we want to support (unless more users request it ofc) as this use case is a bit too specific.
@lhoestq What's your opinion on this? | [
0.13531814515590668,
-0.09920451790094376,
0.06262601912021637,
0.16297568380832672,
0.23983454704284668,
-0.05380284786224365,
0.5892165303230286,
0.12035053968429565,
0.27410340309143066,
-0.08429333567619324,
0.09421023726463318,
0.2265389859676361,
-0.1250716894865036,
0.5580391883850098,
0.14726325869560242,
0.24045713245868683,
-0.004993017762899399,
0.131694495677948,
-0.17759451270103455,
0.2482490837574005,
-0.2297261506319046,
0.16811570525169373,
-0.171473428606987,
0.07160631567239761,
-0.13723959028720856,
0.1197512075304985,
-0.046289682388305664,
0.5753955245018005,
0.22076761722564697,
-0.5317046046257019,
0.8046008348464966,
0.057658202946186066,
0.287362277507782,
0.6218387484550476,
-0.00011576824908843264,
0.13231422007083893,
0.3025893270969391,
-0.2372373342514038,
-0.24603430926799774,
-0.23368404805660248,
0.21612077951431274,
-0.1857283115386963,
0.28986799716949463,
-0.2509514391422272,
-0.20993641018867493,
0.07265089452266693,
-0.00013565272092819214,
-0.2653599977493286,
0.4382944107055664,
0.1306169033050537,
0.21043473482131958,
0.44018036127090454,
-0.03602268546819687,
-0.006681479513645172,
-0.15558277070522308,
0.27392128109931946,
-0.036861732602119446,
0.3488225042819977,
0.5365208387374878,
-0.26650723814964294,
-0.030640244483947754,
-0.1404639184474945,
0.034864410758018494,
-0.019901271909475327,
0.5534479022026062,
-0.008726714178919792,
-0.1415952891111374,
-0.39358267188072205,
0.027025584131479263,
0.22355446219444275,
0.5194128155708313,
-0.3484407961368561,
-0.24175935983657837,
-0.3727964758872986,
0.0405326783657074,
-0.09986945986747742,
0.09434264898300171,
0.13760313391685486,
-0.18841445446014404,
0.15507207810878754,
-0.2503937780857086,
-0.23248539865016937,
-0.20736455917358398,
-0.14119280874729156,
0.015776976943016052,
-0.11620181798934937,
-0.1261492371559143,
0.13515515625476837,
0.0029988985043019056,
0.0019020242616534233,
0.021330084651708603,
0.013301845639944077,
-0.007012449204921722,
0.22746124863624573,
-0.050718460232019424,
-0.09781818836927414,
0.005113983526825905,
0.2441578507423401,
0.2961767613887787,
0.010896183550357819,
0.008187863975763321,
0.0023954790085554123,
-0.2313900589942932,
0.1408393681049347,
0.17667634785175323,
0.25842875242233276,
0.0175643227994442,
0.044677481055259705,
0.4817807376384735,
0.3789900243282318,
0.02922162413597107,
0.03529885783791542,
-0.21489137411117554,
-0.2082592397928238,
0.06742353737354279,
-0.18061353266239166,
0.2595573961734772,
-0.3507499098777771,
-0.18516236543655396,
-0.24515360593795776,
0.48979973793029785,
0.13257378339767456,
-0.016639964655041695,
0.43682700395584106,
0.10698063671588898,
0.13816329836845398,
0.015826992690563202,
0.3059307932853699,
-0.0856998935341835,
-0.06183646619319916,
-0.02501511573791504,
-0.0468287467956543,
-0.17981737852096558,
0.14241468906402588,
0.28154194355010986,
-0.23668140172958374,
0.163711816072464,
0.23993736505508423,
0.030550509691238403,
0.002335458993911743,
-0.2840942144393921,
0.10867495834827423,
-0.14620870351791382,
0.12249717116355896,
-0.18880142271518707,
0.1352565884590149,
0.10673150420188904,
-0.2043595016002655,
-0.12623053789138794,
0.088582843542099,
-0.48579075932502747,
-0.2663271427154541,
-0.031326182186603546,
0.12014748156070709,
-0.2974556088447571,
-0.054073501378297806,
-0.3420759439468384,
0.008944381959736347,
0.11254480481147766,
-0.44723278284072876,
-0.057282984256744385,
-0.18429765105247498,
-0.20338499546051025,
-0.37247228622436523,
0.2617681920528412,
0.6333075165748596,
-0.3585861623287201,
-0.08035904169082642,
0.08391843736171722,
-0.16667360067367554,
-0.0006407387554645538,
0.09538938850164413,
-0.22040972113609314,
-0.06694020330905914,
-0.5218492746353149,
-0.35596418380737305,
-0.032367043197155,
-0.4884294271469116,
-0.2872764468193054,
0.38922885060310364,
-0.11585299670696259,
0.4252578616142273,
0.18432754278182983,
0.10096582770347595,
0.05246076360344887,
-0.3423251807689667,
-0.230310320854187,
0.40869012475013733,
-0.1141526848077774,
-0.024242371320724487,
-0.14140671491622925,
-0.38171398639678955,
0.2882601022720337,
0.16646252572536469,
0.028890280053019524,
0.30540329217910767,
0.11428314447402954,
-0.29186293482780457,
0.37667253613471985,
-0.17444182932376862,
-0.05633426457643509,
0.06389476358890533,
0.17725084722042084,
0.03132561594247818,
0.13346578180789948,
-0.10796865820884705,
-0.7472188472747803,
0.43517744541168213,
-0.06334985047578812,
-0.14454439282417297,
-0.162044495344162,
-0.10726486891508102,
-0.23310227692127228,
-0.11089511215686798,
-0.30062779784202576,
-0.21050183475017548,
-0.09609049558639526,
0.04546049237251282,
0.04336673766374588,
0.07863737642765045,
-0.3951253890991211,
0.3493199646472931,
-0.046269580721855164,
0.18798969686031342,
-0.47703224420547485,
0.14537417888641357,
0.1876930445432663,
0.000579390674829483,
0.11246106028556824,
0.33279722929000854,
0.006245282478630543,
-0.3116489350795746,
0.015096604824066162,
0.2356894612312317,
0.11380870640277863,
0.3566838502883911,
-0.0824214518070221,
0.14126458764076233,
0.15046876668930054,
-0.17470654845237732,
-0.006593191064894199,
0.19150280952453613,
0.1888490915298462,
-0.16597215831279755,
-0.009645847603678703,
0.44992199540138245,
-0.31545066833496094,
0.44530633091926575,
0.21759667992591858,
-0.22817102074623108,
0.19941744208335876,
0.017673589289188385,
-0.1827172189950943,
0.03741580247879028,
-0.055689290165901184,
0.05219849571585655,
0.5343288779258728,
0.16846652328968048,
-0.3712040185928345,
-0.05502564087510109,
0.33641013503074646,
0.13045603036880493,
0.01144150085747242,
0.1535644233226776,
-0.1379801332950592,
0.09620033204555511,
0.1146676242351532,
0.08709357678890228,
0.36281269788742065,
0.17882655560970306,
-0.47778651118278503,
0.13028480112552643,
-0.03569001704454422,
-0.24152082204818726,
0.11606662720441818,
-0.0766245573759079,
0.2369147688150406,
-0.04627839848399162,
0.13296224176883698,
0.014417637139558792,
-0.12481893599033356,
0.11483632028102875,
-0.31550872325897217,
-0.20780210196971893,
-0.5545896291732788,
0.280277281999588,
-0.3495672345161438,
-0.16144591569900513,
-0.24262253940105438,
-0.052096057683229446,
-0.23285537958145142,
-0.02308536320924759,
-0.21827591955661774,
0.14671698212623596,
0.04103495925664902,
-0.05376662313938141,
-0.028690654784440994,
0.3924911618232727,
-0.16560879349708557,
-0.4889936149120331,
-0.09443658590316772,
-0.08512182533740997,
-0.25971370935440063,
0.010573241859674454,
0.3553413450717926,
-0.03609871864318848,
0.22458423674106598,
-0.22485391795635223,
-0.15760762989521027,
-0.18209293484687805,
-0.1714029312133789,
0.006313125602900982,
-0.012627723626792431,
0.2817077040672302,
0.12203770875930786,
0.21432453393936157,
0.3085598647594452,
0.17269860208034515,
0.12567085027694702,
-0.2258315086364746,
0.09833817183971405,
0.21807584166526794,
-0.13748204708099365,
-0.028759675100445747,
-0.32742923498153687,
-0.2785487771034241,
-0.41978371143341064,
-0.3484260141849518,
0.2503383755683899,
0.04214838147163391,
0.015307672321796417,
0.3813491761684418,
0.046042993664741516,
0.011638037860393524,
-0.08921068906784058,
0.062453754246234894,
0.08860349655151367,
-0.34070298075675964,
0.4242798089981079,
-0.08513842523097992,
-0.43336454033851624,
0.19456523656845093,
0.07389284670352936,
0.010776396840810776,
-0.06880045682191849,
-0.3078710436820984,
-0.11215056478977203,
-0.05371221899986267,
0.32753127813339233,
0.1493355631828308,
0.2646864950656891,
0.11484389007091522,
-0.105438232421875,
0.1430852711200714,
-0.07558930665254593,
-0.3353125751018524,
0.06452520936727524,
-0.1201687753200531,
0.08777051419019699,
0.4763946235179901,
0.3938530385494232,
-0.22521916031837463,
0.5162655711174011,
0.11710536479949951,
-0.16575774550437927,
0.4191625118255615,
-0.4003492593765259,
0.6038739085197449,
-0.17127539217472076,
-0.3051084578037262,
-0.14879107475280762,
-0.10420749336481094,
0.07727167010307312,
0.2219848781824112,
0.14980144798755646,
0.3037632703781128,
-0.35210978984832764,
-0.029356230050325394,
-0.04407292231917381,
-0.11010818928480148,
-0.03798999264836311,
0.2724458575248718,
0.12380550056695938,
0.05093926936388016,
0.1700509786605835,
0.1702166199684143,
-0.15462639927864075,
0.04707697778940201,
0.4228324592113495,
0.4226120412349701,
0.08797147870063782,
-0.11115658283233643,
-0.004883065819740295,
-0.42815375328063965,
0.24482515454292297,
-0.16278037428855896,
0.21633732318878174,
-0.009650401771068573,
-0.09465228766202927,
-0.11938460171222687,
0.0381631962954998,
0.5651078820228577,
0.34173616766929626,
0.041648466140031815,
-0.05145624279975891,
-0.3555211126804352,
-0.5781850218772888,
-0.047699254006147385,
0.1859441101551056,
0.3455689251422882,
-0.10643166303634644,
0.4127066433429718,
-0.22135594487190247,
0.009670320898294449,
-0.007874312810599804,
0.48270249366760254,
-0.1890491545200348,
-0.3971163332462311,
-0.4120909571647644,
-0.18077069520950317,
-0.3231284022331238,
-0.21672683954238892,
-0.14866705238819122,
-0.047447048127651215,
-0.20994505286216736,
-0.06746996939182281,
0.12781138718128204,
-0.1436619758605957,
0.11521179974079132,
0.1862850785255432,
0.09052014350891113,
-0.18115463852882385,
0.2741595506668091,
0.16255736351013184,
0.16753287613391876,
0.30915939807891846,
0.7080394625663757,
-0.1840398609638214,
-0.4442855715751648,
-0.20508797466754913,
-0.004842635244131088,
0.37619590759277344,
0.3421904444694519,
-0.1816387176513672,
0.14581139385700226,
0.08271816372871399,
-0.019070390611886978,
-0.2823822796344757,
-0.3792201280593872,
0.12385071814060211,
-0.1216781735420227,
-0.4422992169857025,
-0.4335208535194397,
0.39973169565200806,
-0.1592690646648407,
0.07667246460914612,
0.048960357904434204,
0.26913323998451233,
-0.30746015906333923,
0.1496734768152237,
-0.42620527744293213,
0.5524583458900452,
-0.14756222069263458,
0.18178817629814148,
0.4100390672683716,
0.03534813970327377,
0.4928118586540222,
0.25524061918258667,
-0.05542139708995819,
-0.4997403621673584,
-0.09280814230442047,
0.03328024595975876,
-0.17464081943035126,
0.11611316353082657,
-0.033334892243146896,
0.14307540655136108,
0.6809061169624329,
-0.38236144185066223,
0.2377978414297104,
0.07561186701059341,
0.22861813008785248,
-0.13414299488067627,
-0.22429971396923065,
-0.4922250509262085,
0.044261135160923004,
0.018218515440821648,
0.26868563890457153,
-0.038092635571956635,
-0.18414799869060516,
0.04210245609283447,
-0.26285356283187866,
-0.2166331708431244,
0.23951195180416107,
-0.16605925559997559,
-0.12480732053518295,
0.34481117129325867,
-0.06341034173965454,
0.540286660194397,
0.38868600130081177,
0.21991586685180664,
0.01666961796581745,
-0.35132184624671936,
-0.015205539762973785,
-0.031471338123083115,
0.09459894895553589,
-0.04527512937784195,
0.23661252856254578,
0.3321281671524048,
-0.07715007662773132,
0.05580492317676544,
-0.04752087593078613,
-0.08361243456602097,
-0.09276417642831802,
0.009416073560714722,
0.1782672256231308,
0.28789862990379333,
-0.19009509682655334,
-0.4703468680381775,
-0.38021987676620483,
0.3000749349594116,
-0.26787328720092773,
0.07365730404853821,
0.2125895619392395,
0.06522807478904724,
0.13380931317806244,
0.014645896852016449,
-0.25332170724868774,
-0.17487099766731262,
0.07232798635959625,
-0.23292528092861176,
-0.051819466054439545,
0.43830445408821106,
0.3615521192550659,
-0.06352753192186356,
-0.08802041411399841,
0.11705956608057022,
0.4126589298248291,
-0.4386153221130371,
0.2295333445072174,
0.6105498671531677,
0.09639838337898254,
-0.0847829282283783,
0.3128535747528076,
0.1590404361486435,
-0.3777458071708679,
-0.15781964361667633,
-0.5182144641876221,
-0.30870044231414795,
0.21243074536323547,
0.01582878641784191,
-0.09040924906730652,
0.08497001230716705,
-0.15889301896095276,
-0.06952270865440369,
-0.21652215719223022,
-0.2484264373779297,
0.06685761362314224,
0.3213461637496948,
-0.16672679781913757,
0.3349451422691345,
0.349968820810318,
0.003051362931728363,
-0.02747296169400215,
0.08167724311351776,
-0.06627866625785828,
-0.17498986423015594,
-0.14444983005523682,
-0.12870940566062927,
0.18234457075595856,
-0.17018723487854004,
-0.22411170601844788,
0.0198444165289402,
-0.2626537084579468,
-0.2674599289894104,
-0.22620320320129395,
0.26456284523010254,
0.3588547706604004,
-0.047525063157081604,
0.08128106594085693,
0.016300376504659653,
0.0014131497591733932,
-0.338387131690979,
0.4001510441303253,
-0.1405314803123474,
0.3268515169620514,
0.08672910928726196,
0.11016884446144104,
-0.3584836423397064,
0.06831598281860352,
-0.02092871069908142,
0.19885767996311188,
0.16742248833179474,
0.2391887903213501,
0.19018688797950745,
-0.31797221302986145,
0.35522186756134033,
0.2091923952102661,
0.19442297518253326,
0.3425777554512024,
-0.2160121500492096,
0.19893521070480347,
0.14144906401634216,
0.11905637383460999,
-0.33963900804519653,
0.006614431738853455,
0.07680994272232056,
-0.06069335713982582,
-0.1010914072394371,
0.46333032846450806,
0.27986758947372437,
-0.14435501396656036,
0.09945686161518097,
0.004039481282234192,
0.5178050398826599,
0.032307907938957214,
0.23022186756134033,
0.2090877890586853,
0.01460392028093338,
0.061957843601703644,
0.10084006190299988,
0.11572358012199402,
-0.023404546082019806,
0.2693093717098236,
-0.10891550779342651,
0.19831472635269165,
-0.1250910460948944,
0.03338395059108734,
0.09765300154685974,
-0.5610480308532715,
0.07626816630363464,
0.10106505453586578,
0.042887285351753235,
0.08800867199897766,
0.060955509543418884,
0.5493535995483398,
-0.38618072867393494,
0.001048114150762558,
-0.04701859503984451,
0.07302428036928177,
-0.005125965923070908,
0.007961403578519821,
0.3739423155784607,
-0.24076011776924133,
0.045081883668899536,
0.01658988744020462,
-0.30381065607070923,
-0.25433772802352905,
-0.08154168725013733,
0.04409923031926155,
-0.17694053053855896,
-0.2895318269729614,
0.15530060231685638,
0.028224024921655655,
0.21032583713531494,
-0.0038542822003364563,
0.37899309396743774,
0.011755384504795074,
0.13346415758132935,
0.41756996512413025,
-0.043834052979946136,
0.441290944814682,
0.31456834077835083,
0.1922401636838913,
-0.024635257199406624,
-0.293579638004303,
0.10458056628704071,
0.12628531455993652,
0.2531812787055969,
-0.17094910144805908,
0.15719714760780334,
0.05841633677482605,
0.11963991820812225,
-0.037506792694330215,
0.005924642086029053,
0.1401519626379013,
0.09723036736249924,
-0.585903525352478,
0.40501144528388977,
-0.28136271238327026,
-0.13012270629405975,
-0.2596820294857025,
0.416901171207428,
-0.1661132425069809,
-0.0006049796938896179,
0.32532423734664917,
0.2068946212530136,
0.05938219279050827,
-0.07468392699956894,
0.07621440291404724,
-0.02807212993502617,
0.23477157950401306,
0.2917410731315613,
0.2588474154472351,
-0.03008520044386387,
0.0024359524250030518,
-0.7517335414886475,
0.1365584135055542,
0.0890483632683754,
-0.16445067524909973,
0.11402302235364914,
-0.16602492332458496,
0.0015262886881828308,
-0.0965905413031578,
0.23495420813560486,
0.06985575705766678,
0.28126317262649536,
-0.27907535433769226,
0.02152378112077713,
-0.1732902228832245,
-0.3590978980064392,
0.008620643988251686,
-0.11147022247314453,
-0.5033479332923889,
0.0526948943734169,
-0.5180152654647827,
-0.051503799855709076,
-0.04719294235110283,
0.36268940567970276,
0.12410714477300644,
-0.13168767094612122,
0.35629069805145264,
-0.11089431494474411,
0.34555351734161377,
0.0666927620768547,
-0.1855808049440384,
-0.16278544068336487,
-0.19789865612983704,
-0.1978401094675064,
0.3040316700935364,
-0.030075186863541603,
0.07558880746364594,
-0.27149683237075806,
-0.27088576555252075,
-0.46680736541748047,
0.10050234198570251,
-0.04568059369921684,
-0.041373565793037415,
-0.1902816891670227,
0.1478937268257141,
-0.22831979393959045,
0.008693389594554901,
0.16912922263145447,
0.13205572962760925,
-0.22569841146469116,
-0.13776516914367676,
-0.010948479175567627,
-0.13463875651359558,
0.49506130814552307,
-0.32720857858657837,
-0.2530137300491333,
-0.019621841609477997,
0.3964008688926697,
-0.21641704440116882,
-0.2780458629131317,
-0.2792556583881378,
0.14491578936576843,
0.1809602677822113,
0.03975275531411171,
-0.1436225175857544,
0.12181298434734344,
-0.39102834463119507,
0.004270143806934357,
0.06117710471153259,
0.2095884382724762,
0.1362755000591278,
-0.13589806854724884,
0.029711037874221802,
-0.15937231481075287
] |
https://github.com/huggingface/datasets/issues/6193 | > Before dynamically loading .py scripts with importlib.import_module, we also parse their contents to check imports, which is tricky to implement for binary .pyc files (requires parsing bytecode), so I don't think this is something we want to support (unless more users request it ofc) as this use case is a bit too specific.
Yes indeed. Though you can use a .py that imports a package that contains your .pyc code and that you previously installed | Dataset loading script method does not work with .pyc file | ### Describe the bug
The huggingface dataset library specifically looks for ‘.py’ file while loading the dataset using loading script approach and it does not work with ‘.pyc’ file.
While deploying in production, it becomes an issue when we are restricted to use only .pyc files. Is there any work around for this ?
### Steps to reproduce the bug
1. Create a dataset loading script to read the custom data.
2. compile the code to make sure that .pyc file is created
3. Delete the loading script and re-run the code. Usually, python should make use of complied .pyc files. However, in this case, the dataset library errors out with the message that it's unable to find the data loader loading script.
### Expected behavior
The code should make use of .pyc file and run without any error.
### Environment info
NA | 76 | Dataset loading script method does not work with .pyc file
### Describe the bug
The huggingface dataset library specifically looks for ‘.py’ file while loading the dataset using loading script approach and it does not work with ‘.pyc’ file.
While deploying in production, it becomes an issue when we are restricted to use only .pyc files. Is there any work around for this ?
### Steps to reproduce the bug
1. Create a dataset loading script to read the custom data.
2. compile the code to make sure that .pyc file is created
3. Delete the loading script and re-run the code. Usually, python should make use of complied .pyc files. However, in this case, the dataset library errors out with the message that it's unable to find the data loader loading script.
### Expected behavior
The code should make use of .pyc file and run without any error.
### Environment info
NA
> Before dynamically loading .py scripts with importlib.import_module, we also parse their contents to check imports, which is tricky to implement for binary .pyc files (requires parsing bytecode), so I don't think this is something we want to support (unless more users request it ofc) as this use case is a bit too specific.
Yes indeed. Though you can use a .py that imports a package that contains your .pyc code and that you previously installed | [
0.07976479828357697,
-0.07390309870243073,
0.06754831969738007,
0.1540306955575943,
0.24028274416923523,
-0.057877153158187866,
0.5375259518623352,
0.13719815015792847,
0.2799835801124573,
-0.08522695302963257,
0.0898377075791359,
0.2465868443250656,
-0.141922265291214,
0.5773558616638184,
0.17009517550468445,
0.25057145953178406,
-0.015838928520679474,
0.1358347088098526,
-0.18151868879795074,
0.26227372884750366,
-0.2151125967502594,
0.1713026762008667,
-0.15395373106002808,
0.07332973927259445,
-0.1360323429107666,
0.0968848243355751,
-0.052656203508377075,
0.5714668035507202,
0.248020738363266,
-0.5480529069900513,
0.8227468132972717,
0.0811261534690857,
0.291335791349411,
0.6199249029159546,
-0.00011509336036397144,
0.13701799511909485,
0.2844916582107544,
-0.24339765310287476,
-0.27256205677986145,
-0.22796666622161865,
0.22348035871982574,
-0.2039487361907959,
0.2864655554294586,
-0.25654149055480957,
-0.2405705749988556,
0.06714916229248047,
0.00233430415391922,
-0.24809731543064117,
0.45161041617393494,
0.15009020268917084,
0.21545672416687012,
0.4439431428909302,
-0.005114912986755371,
-0.015544457361102104,
-0.1578904390335083,
0.2694436013698578,
-0.02364659681916237,
0.3552296459674835,
0.49821165204048157,
-0.27281320095062256,
-0.016137313097715378,
-0.14512228965759277,
0.022008903324604034,
0.004158489406108856,
0.5563101768493652,
0.0006943307816982269,
-0.15538614988327026,
-0.36199527978897095,
0.018325170502066612,
0.217401921749115,
0.48271024227142334,
-0.36077654361724854,
-0.2375713586807251,
-0.37980130314826965,
0.055267177522182465,
-0.1266167163848877,
0.08446390926837921,
0.1255175769329071,
-0.18552424013614655,
0.14468169212341309,
-0.24875730276107788,
-0.25194644927978516,
-0.19389858841896057,
-0.1298355758190155,
0.06205444037914276,
-0.10565796494483948,
-0.1239752322435379,
0.11896388232707977,
0.025208326056599617,
-0.011885732412338257,
0.036193352192640305,
0.03878774493932724,
-0.036617208272218704,
0.22994199395179749,
-0.038983192294836044,
-0.09121958911418915,
0.001709701493382454,
0.23523518443107605,
0.2957569360733032,
0.02610885351896286,
-0.013586966320872307,
0.0031151259317994118,
-0.22328568994998932,
0.13321520388126373,
0.1498413234949112,
0.242561936378479,
-0.012244239449501038,
0.058554936200380325,
0.4645342230796814,
0.39982470870018005,
0.035683661699295044,
0.004046889021992683,
-0.22010143101215363,
-0.20721761882305145,
0.061014316976070404,
-0.17943766713142395,
0.2859334349632263,
-0.3380013108253479,
-0.17587026953697205,
-0.26838910579681396,
0.5121412873268127,
0.1531834453344345,
-0.03367790952324867,
0.4281159043312073,
0.11934590339660645,
0.1038612350821495,
0.03576737642288208,
0.3156290650367737,
-0.1077856719493866,
-0.06446199864149094,
-0.035928867757320404,
-0.055403199046850204,
-0.14161431789398193,
0.15501539409160614,
0.2871575653553009,
-0.24470140039920807,
0.16813813149929047,
0.21982555091381073,
0.0379132442176342,
-0.0007569193840026855,
-0.2800268530845642,
0.12240496277809143,
-0.16012194752693176,
0.11531350016593933,
-0.17046695947647095,
0.12004392594099045,
0.13645946979522705,
-0.22035318613052368,
-0.14144296944141388,
0.04742113873362541,
-0.46268463134765625,
-0.2688955068588257,
-0.04666518419981003,
0.12058928608894348,
-0.3193909525871277,
-0.06413137912750244,
-0.34266000986099243,
0.006642631255090237,
0.116679847240448,
-0.444774329662323,
-0.059580184519290924,
-0.1891072690486908,
-0.2026214599609375,
-0.3447941839694977,
0.2956300377845764,
0.6406828165054321,
-0.3698279559612274,
-0.1017676591873169,
0.0701388344168663,
-0.16592980921268463,
-0.02034689486026764,
0.05348600074648857,
-0.20517641305923462,
-0.0458722785115242,
-0.5014402866363525,
-0.3728814721107483,
-0.0469391867518425,
-0.4762059450149536,
-0.31148630380630493,
0.3641795217990875,
-0.11834588646888733,
0.4169016480445862,
0.16393780708312988,
0.11651124060153961,
0.07767623662948608,
-0.32386648654937744,
-0.23900993168354034,
0.39739978313446045,
-0.0923001617193222,
-0.00978512316942215,
-0.1256726235151291,
-0.3985230326652527,
0.2725067138671875,
0.15889734029769897,
0.027313243597745895,
0.3149108588695526,
0.10841168463230133,
-0.27756407856941223,
0.3604256808757782,
-0.1786121129989624,
-0.04432789608836174,
0.09109547734260559,
0.1918303370475769,
0.051489442586898804,
0.1124221533536911,
-0.1460607647895813,
-0.736282229423523,
0.44312942028045654,
-0.03333672136068344,
-0.15447185933589935,
-0.1723933219909668,
-0.0980013981461525,
-0.23838946223258972,
-0.11562659591436386,
-0.28627461194992065,
-0.22047901153564453,
-0.0807514563202858,
0.07673102617263794,
0.06929914653301239,
0.07735709100961685,
-0.3898489475250244,
0.3633978068828583,
-0.034861721098423004,
0.1704547256231308,
-0.47167307138442993,
0.14911627769470215,
0.1976035088300705,
-0.022557329386472702,
0.14971095323562622,
0.3276139795780182,
0.02280982956290245,
-0.303866446018219,
0.007272843271493912,
0.26751723885536194,
0.06955274194478989,
0.3371870815753937,
-0.054958220571279526,
0.1236271783709526,
0.12573635578155518,
-0.18182402849197388,
-0.001265007071197033,
0.18857911229133606,
0.18432354927062988,
-0.1431352198123932,
0.0035037435591220856,
0.4555801451206207,
-0.3212374448776245,
0.4447803497314453,
0.21026530861854553,
-0.20219796895980835,
0.23046976327896118,
0.011632174253463745,
-0.17076677083969116,
0.03557872027158737,
-0.07540297508239746,
0.027435973286628723,
0.5256130695343018,
0.12752534449100494,
-0.35922884941101074,
-0.06833617389202118,
0.338784784078598,
0.15726786851882935,
0.028293516486883163,
0.1499321013689041,
-0.16049355268478394,
0.11836740374565125,
0.11312736570835114,
0.10729696601629257,
0.3806907832622528,
0.18921583890914917,
-0.5041297078132629,
0.15960699319839478,
-0.03138638287782669,
-0.2229333072900772,
0.10882376879453659,
-0.09243319183588028,
0.2177974432706833,
-0.07520460337400436,
0.1225222796201706,
-0.004505492746829987,
-0.12390747666358948,
0.12298306822776794,
-0.3209124505519867,
-0.1786617487668991,
-0.554457426071167,
0.2652584910392761,
-0.3506765067577362,
-0.15726646780967712,
-0.24472089111804962,
-0.05331557244062424,
-0.23992760479450226,
-0.015411138534545898,
-0.2343832552433014,
0.17207960784435272,
0.03933493047952652,
-0.029321890324354172,
-0.03771701082587242,
0.36412447690963745,
-0.15874385833740234,
-0.5203026533126831,
-0.10474549233913422,
-0.10319240391254425,
-0.24319502711296082,
0.012280624359846115,
0.33111298084259033,
-0.0018957704305648804,
0.2386128306388855,
-0.22210478782653809,
-0.16518224775791168,
-0.1954261064529419,
-0.12364351749420166,
0.0045936391688883305,
-0.014713435433804989,
0.29150107502937317,
0.11906290054321289,
0.23287896811962128,
0.2894875407218933,
0.16202488541603088,
0.13550740480422974,
-0.23608794808387756,
0.09282512962818146,
0.20196732878684998,
-0.13902893662452698,
-0.030293723568320274,
-0.33744609355926514,
-0.2731623351573944,
-0.4100886881351471,
-0.3503720462322235,
0.2573665678501129,
0.08000506460666656,
0.0031588412821292877,
0.3714407980442047,
0.0648578628897667,
0.029716983437538147,
-0.07871174812316895,
0.043562546372413635,
0.08164840936660767,
-0.33165448904037476,
0.4151620864868164,
-0.09369305521249771,
-0.4119768440723419,
0.2132292538881302,
0.07799932360649109,
0.010898005217313766,
-0.07065220177173615,
-0.3183274269104004,
-0.11398945748806,
-0.06680548191070557,
0.32146772742271423,
0.14345300197601318,
0.2796299159526825,
0.1279999315738678,
-0.0834035724401474,
0.1369694024324417,
-0.07237128168344498,
-0.3416154086589813,
0.061861302703619,
-0.12488475441932678,
0.09447234869003296,
0.455569326877594,
0.3794904351234436,
-0.24517099559307098,
0.532798707485199,
0.12071669101715088,
-0.1791851967573166,
0.39174747467041016,
-0.4265140891075134,
0.6347537636756897,
-0.16963110864162445,
-0.3105354309082031,
-0.15420414507389069,
-0.0994991809129715,
0.10934488475322723,
0.21487881243228912,
0.12256347388029099,
0.3249001204967499,
-0.3475397229194641,
-0.013484157621860504,
-0.0691692978143692,
-0.11524151265621185,
-0.07299897819757462,
0.2736903429031372,
0.13438032567501068,
0.0704471692442894,
0.1575867384672165,
0.13772226870059967,
-0.1670987755060196,
0.0325876846909523,
0.399145245552063,
0.419292688369751,
0.09591302275657654,
-0.13775934278964996,
0.001200016587972641,
-0.42854151129722595,
0.2675090432167053,
-0.18298548460006714,
0.18347209692001343,
-0.004247382283210754,
-0.07710101455450058,
-0.13298174738883972,
0.050705909729003906,
0.5457438230514526,
0.34280282258987427,
0.02948479913175106,
-0.040390145033597946,
-0.3412697911262512,
-0.5718786716461182,
-0.04001488536596298,
0.1834459900856018,
0.3455950915813446,
-0.11487850546836853,
0.4304735064506531,
-0.2124350219964981,
0.023756738752126694,
0.0011888165026903152,
0.4802650511264801,
-0.20752373337745667,
-0.3523804247379303,
-0.42283397912979126,
-0.2294476479291916,
-0.3396790325641632,
-0.19004285335540771,
-0.1583443135023117,
-0.02068377286195755,
-0.19600149989128113,
-0.04655851423740387,
0.09593617916107178,
-0.16520053148269653,
0.09820351004600525,
0.1902349293231964,
0.13322457671165466,
-0.1626047044992447,
0.26618582010269165,
0.1955728530883789,
0.14384320378303528,
0.30510759353637695,
0.708794116973877,
-0.16774651408195496,
-0.46189644932746887,
-0.21696220338344574,
0.011586688458919525,
0.3818371295928955,
0.3230434060096741,
-0.18174481391906738,
0.16803622245788574,
0.111531563103199,
-0.001549210399389267,
-0.27602052688598633,
-0.34998664259910583,
0.09656283259391785,
-0.11482970416545868,
-0.42877528071403503,
-0.44022318720817566,
0.38036227226257324,
-0.15103109180927277,
0.0773196816444397,
0.024824604392051697,
0.2449941337108612,
-0.3146127760410309,
0.13724109530448914,
-0.3991892337799072,
0.5294972062110901,
-0.17866502702236176,
0.17636346817016602,
0.40691372752189636,
0.01809614896774292,
0.5308079123497009,
0.2589763104915619,
-0.03999096155166626,
-0.5045680403709412,
-0.11247013509273529,
0.04251287132501602,
-0.14307650923728943,
0.10455386340618134,
-0.03660247474908829,
0.12135079503059387,
0.6925614476203918,
-0.3712560534477234,
0.24241605401039124,
0.06907626986503601,
0.2187219113111496,
-0.10580944269895554,
-0.24792258441448212,
-0.5051498413085938,
0.05161686986684799,
-0.010162193328142166,
0.26754122972488403,
-0.04259955510497093,
-0.1786310076713562,
0.05325920879840851,
-0.2616519331932068,
-0.2369804084300995,
0.2471972554922104,
-0.1901547610759735,
-0.13740746676921844,
0.33022424578666687,
-0.050813011825084686,
0.509429931640625,
0.38125303387641907,
0.239425927400589,
0.060982845723629,
-0.3522838056087494,
0.010135823860764503,
-0.03889012709259987,
0.0817425549030304,
-0.05834510177373886,
0.24992983043193817,
0.287454217672348,
-0.05902452766895294,
0.04979655146598816,
-0.05840110778808594,
-0.07191877067089081,
-0.10990600287914276,
0.021409884095191956,
0.16693034768104553,
0.27243492007255554,
-0.17892219126224518,
-0.45476171374320984,
-0.36039307713508606,
0.30702465772628784,
-0.2780943214893341,
0.0782560482621193,
0.196319118142128,
0.0640856921672821,
0.10823297500610352,
0.022571993991732597,
-0.25153055787086487,
-0.16798962652683258,
0.09302787482738495,
-0.22772295773029327,
-0.05404571443796158,
0.4772784411907196,
0.36173489689826965,
-0.0365617610514164,
-0.09231992065906525,
0.10038219392299652,
0.3991531729698181,
-0.44536247849464417,
0.23632928729057312,
0.6200928688049316,
0.09233497083187103,
-0.07049555331468582,
0.32107001543045044,
0.145565003156662,
-0.3427118957042694,
-0.16058269143104553,
-0.5094308853149414,
-0.3284801244735718,
0.2020527571439743,
0.027034852653741837,
-0.07621169835329056,
0.10404039919376373,
-0.14202962815761566,
-0.09066018462181091,
-0.20012310147285461,
-0.2523498833179474,
0.06337905675172806,
0.3052499294281006,
-0.17668475210666656,
0.344942182302475,
0.34431061148643494,
0.04012518748641014,
-0.01946566253900528,
0.08976325392723083,
-0.05245409905910492,
-0.1674347221851349,
-0.15055865049362183,
-0.13399454951286316,
0.17558583617210388,
-0.18418607115745544,
-0.2222522795200348,
-0.003920856863260269,
-0.24618522822856903,
-0.27234768867492676,
-0.2484591007232666,
0.25950711965560913,
0.36452174186706543,
-0.061270300298929214,
0.08971863985061646,
-0.0102754607796669,
-0.0022793803364038467,
-0.3247736096382141,
0.3689783811569214,
-0.14999650418758392,
0.2959754168987274,
0.0675828829407692,
0.12472958117723465,
-0.3586885333061218,
0.07747301459312439,
-0.015448760241270065,
0.1998148262500763,
0.17227943241596222,
0.2545180320739746,
0.19918781518936157,
-0.2965644598007202,
0.3054703176021576,
0.19640028476715088,
0.18682017922401428,
0.33074212074279785,
-0.1900004744529724,
0.20716533064842224,
0.14776358008384705,
0.11775922775268555,
-0.3562421500682831,
0.000484514981508255,
0.08935466408729553,
-0.08612051606178284,
-0.09319667518138885,
0.4662015438079834,
0.24671080708503723,
-0.16413961350917816,
0.08215031027793884,
0.002573881298303604,
0.5150901675224304,
0.018002036958932877,
0.24800056219100952,
0.19912615418434143,
0.022789940237998962,
0.027521736919879913,
0.09805416315793991,
0.11138546466827393,
-0.009009961038827896,
0.3040316700935364,
-0.10105022042989731,
0.18475189805030823,
-0.15308284759521484,
0.021733146160840988,
0.06265532225370407,
-0.567744791507721,
0.07588422298431396,
0.09056438505649567,
0.051558010280132294,
0.12175068259239197,
0.04332955926656723,
0.5570570230484009,
-0.38671427965164185,
-0.006097346544265747,
-0.06854266673326492,
0.08163739740848541,
0.014010779559612274,
0.009077280759811401,
0.36691561341285706,
-0.2373267412185669,
0.05806872248649597,
0.012975864112377167,
-0.2731391489505768,
-0.2875044047832489,
-0.07286716997623444,
0.024732649326324463,
-0.16694684326648712,
-0.27457594871520996,
0.1511092483997345,
0.06631028652191162,
0.1847711205482483,
-0.014004789292812347,
0.36039790511131287,
0.026524221524596214,
0.11651463806629181,
0.40017029643058777,
-0.041274480521678925,
0.4470685124397278,
0.29514771699905396,
0.20106671750545502,
0.009033087641000748,
-0.2656249701976776,
0.1015649288892746,
0.1286727339029312,
0.22567756474018097,
-0.15681271255016327,
0.15648256242275238,
0.05777408927679062,
0.1285332590341568,
-0.04145626723766327,
0.013546865433454514,
0.13059215247631073,
0.11540000140666962,
-0.5810888409614563,
0.39296722412109375,
-0.26544028520584106,
-0.13529761135578156,
-0.2704615592956543,
0.41444820165634155,
-0.15550777316093445,
-0.03376246616244316,
0.31915202736854553,
0.20933540165424347,
0.07070267200469971,
-0.06641167402267456,
0.07950529456138611,
-0.04865455627441406,
0.2701778709888458,
0.30573591589927673,
0.24384233355522156,
-0.024618441238999367,
-0.007381230592727661,
-0.7424635291099548,
0.11518019437789917,
0.06359513103961945,
-0.1706334799528122,
0.10553251206874847,
-0.16361631453037262,
0.007300704717636108,
-0.09486135840415955,
0.242460697889328,
0.06191499903798103,
0.27935469150543213,
-0.28087303042411804,
0.019896656274795532,
-0.20441702008247375,
-0.394987016916275,
0.02455214224755764,
-0.07997400313615799,
-0.4918433725833893,
0.010174673981964588,
-0.4996528625488281,
-0.047584325075149536,
-0.022562410682439804,
0.36066165566444397,
0.11181885749101639,
-0.14569847285747528,
0.3717062771320343,
-0.10857095569372177,
0.3644903898239136,
0.06132955849170685,
-0.17667582631111145,
-0.16312463581562042,
-0.1946856826543808,
-0.21162384748458862,
0.3041095733642578,
-0.029401760548353195,
0.11363022029399872,
-0.2868119776248932,
-0.2583020329475403,
-0.4854303300380707,
0.10189199447631836,
-0.02040322870016098,
-0.04796392098069191,
-0.17055504024028778,
0.14497840404510498,
-0.25144124031066895,
0.007704015821218491,
0.17858755588531494,
0.13201597332954407,
-0.23536626994609833,
-0.11110129207372665,
-0.007384836673736572,
-0.11454422771930695,
0.5033309459686279,
-0.3265306353569031,
-0.2587883472442627,
-0.01319420337677002,
0.4078306257724762,
-0.2188212126493454,
-0.28531959652900696,
-0.26871269941329956,
0.16307665407657623,
0.18662714958190918,
0.05034546181559563,
-0.14383703470230103,
0.11824868619441986,
-0.405830055475235,
0.017512135207653046,
0.0653953030705452,
0.22856326401233673,
0.1266915500164032,
-0.149710550904274,
0.03124823421239853,
-0.16655471920967102
] |
https://github.com/huggingface/datasets/issues/6193 | Hi @lhoestq ,
Could you share some example code related to the approach that you are suggesting? | Dataset loading script method does not work with .pyc file | ### Describe the bug
The huggingface dataset library specifically looks for ‘.py’ file while loading the dataset using loading script approach and it does not work with ‘.pyc’ file.
While deploying in production, it becomes an issue when we are restricted to use only .pyc files. Is there any work around for this ?
### Steps to reproduce the bug
1. Create a dataset loading script to read the custom data.
2. compile the code to make sure that .pyc file is created
3. Delete the loading script and re-run the code. Usually, python should make use of complied .pyc files. However, in this case, the dataset library errors out with the message that it's unable to find the data loader loading script.
### Expected behavior
The code should make use of .pyc file and run without any error.
### Environment info
NA | 17 | Dataset loading script method does not work with .pyc file
### Describe the bug
The huggingface dataset library specifically looks for ‘.py’ file while loading the dataset using loading script approach and it does not work with ‘.pyc’ file.
While deploying in production, it becomes an issue when we are restricted to use only .pyc files. Is there any work around for this ?
### Steps to reproduce the bug
1. Create a dataset loading script to read the custom data.
2. compile the code to make sure that .pyc file is created
3. Delete the loading script and re-run the code. Usually, python should make use of complied .pyc files. However, in this case, the dataset library errors out with the message that it's unable to find the data loader loading script.
### Expected behavior
The code should make use of .pyc file and run without any error.
### Environment info
NA
Hi @lhoestq ,
Could you share some example code related to the approach that you are suggesting? | [
0.10208326578140259,
-0.17134933173656464,
0.05191474407911301,
0.20252318680286407,
0.17857559025287628,
-0.06164531037211418,
0.5064952969551086,
0.12081895768642426,
0.2920161485671997,
-0.028900787234306335,
0.08277806639671326,
0.24290403723716736,
-0.10555271059274673,
0.5848366022109985,
0.15545833110809326,
0.18264149129390717,
-0.03065059706568718,
0.15338420867919922,
-0.22432830929756165,
0.2601505517959595,
-0.21709021925926208,
0.17586325109004974,
-0.1495540291070938,
0.08130381256341934,
-0.15073424577713013,
0.07067427784204483,
-0.10247818380594254,
0.6178755760192871,
0.24587678909301758,
-0.5154451131820679,
0.7735986709594727,
0.07096114754676819,
0.3072706460952759,
0.6604013442993164,
-0.00011340389028191566,
0.11278092861175537,
0.3014737069606781,
-0.24248960614204407,
-0.1797570288181305,
-0.19129526615142822,
0.186285600066185,
-0.1797562837600708,
0.252399742603302,
-0.2591216266155243,
-0.31946614384651184,
0.08502374589443207,
-0.027231978252530098,
-0.21120166778564453,
0.5393170118331909,
0.13184106349945068,
0.22169846296310425,
0.4105767607688904,
-0.03332390636205673,
-0.05640514940023422,
-0.1575818955898285,
0.24642115831375122,
-0.0019216910004615784,
0.3267632722854614,
0.4995618760585785,
-0.2594609260559082,
-0.04340041056275368,
-0.08761819452047348,
0.03862254321575165,
-0.03209491819143295,
0.500114917755127,
0.011565867811441422,
-0.18137282133102417,
-0.33375316858291626,
0.03593350946903229,
0.1812777817249298,
0.522493302822113,
-0.34779345989227295,
-0.17198850214481354,
-0.29660487174987793,
0.06478062272071838,
-0.1284399777650833,
0.09107768535614014,
0.1243218258023262,
-0.22060632705688477,
0.1872396469116211,
-0.2754170000553131,
-0.2045934647321701,
-0.24831931293010712,
-0.13042323291301727,
0.05124662071466446,
-0.13563816249370575,
-0.2059786319732666,
0.10092784464359283,
-0.01920420303940773,
-0.02015407755970955,
-0.025406349450349808,
0.019321933388710022,
0.021635903045535088,
0.20728559792041779,
-0.07730306684970856,
-0.10485005378723145,
-0.007812637835741043,
0.27035075426101685,
0.28990381956100464,
0.08242817223072052,
0.032249435782432556,
0.027658328413963318,
-0.1652347892522812,
0.12128716707229614,
0.10677048563957214,
0.23197486996650696,
0.031896818429231644,
-0.006148666143417358,
0.4150293469429016,
0.4310442805290222,
0.0063524916768074036,
-0.013980980962514877,
-0.21501968801021576,
-0.18004606664180756,
0.06104972958564758,
-0.22442656755447388,
0.29140639305114746,
-0.30701982975006104,
-0.19348660111427307,
-0.20791704952716827,
0.5106021761894226,
0.12544141709804535,
0.006352551281452179,
0.5246348977088928,
0.03651505708694458,
-0.0026380084455013275,
0.02301255613565445,
0.25860172510147095,
-0.09865234047174454,
-0.07516650855541229,
-0.0739169716835022,
-0.03661304712295532,
-0.1759314239025116,
0.1345616728067398,
0.2804076671600342,
-0.23882614076137543,
0.23796474933624268,
0.21720558404922485,
0.01631828024983406,
-0.01701539009809494,
-0.28783082962036133,
0.1278853714466095,
-0.14042140543460846,
0.0965089350938797,
-0.16122671961784363,
0.055769048631191254,
0.11377975344657898,
-0.1490669548511505,
-0.10803113132715225,
0.09382069110870361,
-0.4647083282470703,
-0.25387004017829895,
-0.031303487718105316,
0.14394454658031464,
-0.24678698182106018,
-0.0737663060426712,
-0.3255268633365631,
0.024134429171681404,
0.1055298000574112,
-0.4071180522441864,
-0.06747402250766754,
-0.11171261966228485,
-0.21774795651435852,
-0.3636912703514099,
0.32356393337249756,
0.6469115018844604,
-0.3285490572452545,
-0.08536356687545776,
0.07275644689798355,
-0.183817058801651,
0.02854960598051548,
0.10413823276758194,
-0.1482909917831421,
-0.05385429784655571,
-0.5002861618995667,
-0.3003116846084595,
-0.02455919235944748,
-0.4795885980129242,
-0.34817996621131897,
0.40457695722579956,
-0.12135981023311615,
0.4066556990146637,
0.16938015818595886,
0.11047498881816864,
0.054706815630197525,
-0.29186558723449707,
-0.21593588590621948,
0.38353991508483887,
-0.1028624176979065,
-0.013977814465761185,
-0.1382662057876587,
-0.35745394229888916,
0.27496349811553955,
0.21511100232601166,
-0.035309553146362305,
0.29708707332611084,
0.1417660415172577,
-0.36360010504722595,
0.3684578835964203,
-0.15588043630123138,
-0.09240884333848953,
0.1093006432056427,
0.16314201056957245,
0.03885209932923317,
0.1022595763206482,
-0.10727342963218689,
-0.7541967630386353,
0.3912750780582428,
-0.08642923831939697,
-0.18254688382148743,
-0.16783380508422852,
-0.09870751947164536,
-0.3109513223171234,
-0.10192947089672089,
-0.3547721803188324,
-0.2707970142364502,
-0.07084868848323822,
0.0766555592417717,
0.12536315619945526,
0.031598784029483795,
-0.3697853982448578,
0.3619941174983978,
-0.0982871800661087,
0.20351329445838928,
-0.47893834114074707,
0.12732967734336853,
0.1762516051530838,
-0.010376833379268646,
0.16444769501686096,
0.32975950837135315,
0.045593827962875366,
-0.31109485030174255,
0.010694615542888641,
0.3073383867740631,
0.09891064465045929,
0.32174453139305115,
-0.022494425997138023,
0.0835353285074234,
0.12169180810451508,
-0.26087483763694763,
0.04806935787200928,
0.23936733603477478,
0.1869683861732483,
-0.14247703552246094,
-0.09438937902450562,
0.4693792462348938,
-0.33873897790908813,
0.3859950602054596,
0.21351131796836853,
-0.2326234132051468,
0.17728498578071594,
0.0003279745578765869,
-0.19857779145240784,
0.05956294387578964,
-0.04264424741268158,
0.026921521872282028,
0.5928946733474731,
0.12735477089881897,
-0.4107811450958252,
-0.056612081825733185,
0.3487478196620941,
0.124857597053051,
0.0534772090613842,
0.14323581755161285,
-0.1556631177663803,
0.08739897608757019,
0.13838285207748413,
0.04417811334133148,
0.350789874792099,
0.213026225566864,
-0.48967644572257996,
0.16387684643268585,
-0.028392646461725235,
-0.2386847734451294,
0.0861089900135994,
-0.13834857940673828,
0.20526675879955292,
-0.05422573164105415,
0.10469864308834076,
-0.028940754011273384,
-0.1139618307352066,
0.1080922931432724,
-0.3384864330291748,
-0.18726065754890442,
-0.5215297341346741,
0.22787636518478394,
-0.30897751450538635,
-0.1956711709499359,
-0.2905290126800537,
-0.04693832993507385,
-0.2132961004972458,
0.010768182575702667,
-0.23728637397289276,
0.10680682957172394,
0.036049820482730865,
-0.01912558078765869,
0.02045401930809021,
0.4050823748111725,
-0.11656954884529114,
-0.41854849457740784,
-0.0986902117729187,
-0.05869915336370468,
-0.24347200989723206,
0.028697937726974487,
0.27794045209884644,
0.016816135495901108,
0.2821051776409149,
-0.2604437470436096,
-0.11755736172199249,
-0.19648922979831696,
-0.1655341237783432,
0.02997792512178421,
-0.006366852205246687,
0.29749730229377747,
0.11865255236625671,
0.2566510736942291,
0.31351545453071594,
0.18799927830696106,
0.12855172157287598,
-0.24230897426605225,
0.06670289486646652,
0.19978883862495422,
-0.12496105581521988,
-0.0418168380856514,
-0.2784131169319153,
-0.3113284111022949,
-0.39424508810043335,
-0.33179229497909546,
0.2904236316680908,
0.07757404446601868,
0.02815612591803074,
0.32413962483406067,
0.06586012244224548,
0.08182384818792343,
-0.07407161593437195,
0.08460330963134766,
0.0389876663684845,
-0.3871338367462158,
0.37656041979789734,
-0.15597441792488098,
-0.4266792833805084,
0.17534257471561432,
0.07815366238355637,
0.06192371994256973,
-0.13089975714683533,
-0.2818602919578552,
-0.14889788627624512,
-0.09848858416080475,
0.34165245294570923,
0.11670401692390442,
0.2809702455997467,
0.1352715790271759,
-0.14544743299484253,
0.11114591360092163,
-0.10278595983982086,
-0.29844945669174194,
0.09451721608638763,
-0.16158942878246307,
0.0867098942399025,
0.46114659309387207,
0.41509532928466797,
-0.24908171594142914,
0.5581895112991333,
0.1830057054758072,
-0.16057296097278595,
0.3735889196395874,
-0.4213005602359772,
0.5790985822677612,
-0.1688803881406784,
-0.302846759557724,
-0.11574748903512955,
-0.05388063192367554,
0.09840978682041168,
0.26867857575416565,
0.1537192165851593,
0.3587351441383362,
-0.3211061954498291,
-0.08001141995191574,
-0.07801549136638641,
-0.11651845276355743,
-0.08156117051839828,
0.3110789358615875,
0.1433160901069641,
0.02580857276916504,
0.17376641929149628,
0.17333246767520905,
-0.1355993151664734,
0.06260166317224503,
0.4100117087364197,
0.42022082209587097,
0.08657564222812653,
-0.1495113968849182,
0.047237884253263474,
-0.49317264556884766,
0.3186053931713104,
-0.19186653196811676,
0.13764698803424835,
-0.009189091622829437,
-0.09637823700904846,
-0.10372710227966309,
0.024671580642461777,
0.5896776914596558,
0.34933701157569885,
0.06830907613039017,
-0.1335277557373047,
-0.38716375827789307,
-0.5531388521194458,
0.0030466094613075256,
0.14029301702976227,
0.3796200156211853,
-0.14400574564933777,
0.466554194688797,
-0.19409061968326569,
-0.0064730457961559296,
0.04568122699856758,
0.3807694613933563,
-0.19705523550510406,
-0.3954707682132721,
-0.39842700958251953,
-0.23756355047225952,
-0.3269379138946533,
-0.13880914449691772,
-0.14774265885353088,
-0.014239620417356491,
-0.18682096898555756,
-0.05575411766767502,
0.12458136677742004,
-0.10348336398601532,
0.10810686647891998,
0.19653040170669556,
0.0984407514333725,
-0.1862117350101471,
0.24910679459571838,
0.1475931853055954,
0.21720625460147858,
0.27671873569488525,
0.7293121814727783,
-0.19674846529960632,
-0.48367202281951904,
-0.1796220988035202,
-0.015292398631572723,
0.4048221707344055,
0.3323211371898651,
-0.14238956570625305,
0.14602607488632202,
0.13628952205181122,
0.06405764818191528,
-0.3126077353954315,
-0.36366933584213257,
0.09570132941007614,
-0.060912780463695526,
-0.3945182263851166,
-0.41744744777679443,
0.3843889832496643,
-0.16874262690544128,
0.08133901655673981,
0.008352445438504219,
0.2738867998123169,
-0.2904699742794037,
0.14122474193572998,
-0.403015673160553,
0.5792052745819092,
-0.17230211198329926,
0.17496617138385773,
0.44335830211639404,
0.010871663689613342,
0.46770456433296204,
0.2556668221950531,
-0.07339450716972351,
-0.5290084481239319,
-0.13564170897006989,
0.05831070989370346,
-0.12565389275550842,
0.1122247576713562,
-0.009716775268316269,
0.09019668400287628,
0.6675961017608643,
-0.3670617341995239,
0.24429874122142792,
0.04957382380962372,
0.22286318242549896,
-0.08937869966030121,
-0.2171662300825119,
-0.5442560911178589,
0.07383833080530167,
0.02038152515888214,
0.2541801631450653,
-0.07987526804208755,
-0.18238894641399384,
0.053948402404785156,
-0.24117088317871094,
-0.1759343147277832,
0.27897584438323975,
-0.2128397673368454,
-0.16048774123191833,
0.3644905686378479,
-0.07562271505594254,
0.5096141695976257,
0.39300042390823364,
0.2224791944026947,
0.057124361395835876,
-0.3433585464954376,
0.03056180104613304,
-0.07002060860395432,
0.06309153139591217,
-0.11145125329494476,
0.24087321758270264,
0.30343833565711975,
-0.10393828898668289,
0.0177919864654541,
-0.0466930978000164,
-0.04827044904232025,
-0.10186365246772766,
-0.004646480083465576,
0.14454317092895508,
0.21988391876220703,
-0.2486976981163025,
-0.5127264261245728,
-0.37242987751960754,
0.23926854133605957,
-0.26859402656555176,
0.08923105150461197,
0.20495861768722534,
0.021757327020168304,
0.07553376257419586,
0.10058535635471344,
-0.24926434457302094,
-0.16566482186317444,
0.09172728657722473,
-0.26869747042655945,
-0.03182392567396164,
0.46971896290779114,
0.3834105134010315,
-0.04046373814344406,
-0.12348513305187225,
0.07548552006483078,
0.48006388545036316,
-0.40630438923835754,
0.21464115381240845,
0.5720530152320862,
0.10508280992507935,
-0.0635690689086914,
0.3496587872505188,
0.15617558360099792,
-0.3848080635070801,
-0.10701649636030197,
-0.4749382436275482,
-0.30761659145355225,
0.19805733859539032,
0.06411440670490265,
-0.0547427162528038,
0.11674262583255768,
-0.12622222304344177,
-0.08281146734952927,
-0.15765133500099182,
-0.2850940227508545,
0.09809655696153641,
0.27996358275413513,
-0.19822746515274048,
0.3948999047279358,
0.29698583483695984,
0.03506331890821457,
0.054938338696956635,
0.1147666797041893,
-0.03059612400829792,
-0.17344795167446136,
-0.18263913691043854,
-0.12738892436027527,
0.17076611518859863,
-0.19615133106708527,
-0.2165258228778839,
0.012506604194641113,
-0.20445168018341064,
-0.29373958706855774,
-0.22727489471435547,
0.28465697169303894,
0.29276520013809204,
-0.026523444801568985,
0.11021089553833008,
-0.013560967519879341,
-0.03685808181762695,
-0.3865441679954529,
0.36016565561294556,
-0.11587303131818771,
0.27038124203681946,
-0.005917981266975403,
0.09044342488050461,
-0.41436895728111267,
0.02436971664428711,
0.04127426818013191,
0.23653917014598846,
0.26543888449668884,
0.2546895444393158,
0.19471630454063416,
-0.2960895299911499,
0.31324079632759094,
0.186967670917511,
0.22954711318016052,
0.22139357030391693,
-0.20523323118686676,
0.19225111603736877,
0.11148101091384888,
0.1479569524526596,
-0.3742009103298187,
0.04028625041246414,
0.1175980493426323,
-0.12042077630758286,
-0.06242959201335907,
0.45685839653015137,
0.2064560502767563,
-0.048062823712825775,
0.03665114566683769,
-0.03368077427148819,
0.542246401309967,
-0.02155979536473751,
0.15898330509662628,
0.17519241571426392,
-0.005696453154087067,
0.029526643455028534,
0.15044429898262024,
0.12497788667678833,
-0.019641771912574768,
0.32598677277565,
-0.09013858437538147,
0.20164647698402405,
-0.16923867166042328,
0.04447360709309578,
0.10656261444091797,
-0.5569948554039001,
0.06848812103271484,
0.10094515234231949,
0.006087493151426315,
0.1224040538072586,
0.01320626400411129,
0.5768113732337952,
-0.37044382095336914,
0.020938053727149963,
-0.07619693130254745,
0.07844606041908264,
-0.003927009180188179,
0.010821923613548279,
0.3013152778148651,
-0.24518916010856628,
0.03558571636676788,
-0.009429067373275757,
-0.29884517192840576,
-0.23730766773223877,
-0.06164873391389847,
-0.008317708969116211,
-0.15884201228618622,
-0.2529478967189789,
0.10427949577569962,
0.08023357391357422,
0.22795766592025757,
-0.027681387960910797,
0.4023981988430023,
0.021484866738319397,
0.13110661506652832,
0.39834073185920715,
-0.0065074460580945015,
0.4558510184288025,
0.25786158442497253,
0.20589880645275116,
0.010786019265651703,
-0.25620391964912415,
0.046137094497680664,
0.10964301973581314,
0.2541840672492981,
-0.13232193887233734,
0.10232587158679962,
0.06811255216598511,
0.1412981152534485,
-0.05929393693804741,
0.023027557879686356,
0.167624831199646,
0.08689654618501663,
-0.5866596698760986,
0.3108576536178589,
-0.3189108073711395,
-0.1715148240327835,
-0.2887006402015686,
0.3826574683189392,
-0.22190827131271362,
-0.014692388474941254,
0.2724359929561615,
0.1959669440984726,
0.08226259797811508,
-0.06804405152797699,
0.09154750406742096,
-0.08288447558879852,
0.28940606117248535,
0.31792017817497253,
0.28356483578681946,
-0.051253266632556915,
-0.0689162090420723,
-0.7345684170722961,
0.10451668500900269,
0.13519614934921265,
-0.19522619247436523,
0.12211965024471283,
-0.16128087043762207,
-0.006510846316814423,
-0.09459953010082245,
0.2473430186510086,
0.04269571974873543,
0.2806880474090576,
-0.23990559577941895,
-0.02543313428759575,
-0.13523778319358826,
-0.3553389608860016,
0.04378875344991684,
-0.04913404583930969,
-0.47846856713294983,
0.022303888574242592,
-0.410287082195282,
-0.03563675284385681,
-0.04665907099843025,
0.3980117440223694,
0.0918378233909607,
-0.19714997708797455,
0.2944956123828888,
-0.10254687070846558,
0.33016133308410645,
0.009880110621452332,
-0.1846882700920105,
-0.11743734776973724,
-0.13692373037338257,
-0.1995232254266739,
0.32623234391212463,
-0.001691846176981926,
0.15319114923477173,
-0.1819375455379486,
-0.3354353904724121,
-0.4469841718673706,
0.1031915545463562,
0.006528750061988831,
-0.07361511141061783,
-0.1759227216243744,
0.1471709907054901,
-0.2237524390220642,
-0.026460567489266396,
0.19465458393096924,
0.17339710891246796,
-0.2288956344127655,
-0.10889753699302673,
0.00003153085708618164,
-0.13546645641326904,
0.5060428380966187,
-0.33025413751602173,
-0.2444508969783783,
-0.028803272172808647,
0.4072223901748657,
-0.21269692480564117,
-0.2921244502067566,
-0.2770111560821533,
0.1920142024755478,
0.1616179198026657,
0.0314694344997406,
-0.13648486137390137,
0.15550841391086578,
-0.4033946394920349,
0.024101562798023224,
0.07807205617427826,
0.2921745181083679,
0.16904214024543762,
-0.12331584095954895,
-0.0014886856079101562,
-0.20940221846103668
] |
https://github.com/huggingface/datasets/issues/6188 | I think this error means you filter all examples within an (input) batch by deleting its columns. In that case, to avoid the error, you can set the column value to an empty list (`input_batch["col"] = []`) instead. | [Feature Request] Check the length of batch before writing so that empty batch is allowed | ### Use Case
I use `dataset.map(process_fn, batched=True)` to process the dataset, with data **augmentations or filtering**. However, when all examples within a batch is filtered out, i.e. **an empty batch is returned**, the following error will be thrown:
```
ValueError: Schema and number of arrays unequal
```
This is because the empty batch does not comply with the schema of other batches. I think an empty batch should be allowed to facilitate coding (one does not need to assign an empty list manually for all keys.)
A simple fix is to check the length of `batch` before writing:
```
if len(batch):
writer.write_batch(batch)
```
instead of
https://github.com/huggingface/datasets/blob/74d60213dcbd7c99484c62ce1d3dfd90a1df0770/src/datasets/arrow_dataset.py#L3493
| 38 | [Feature Request] Check the length of batch before writing so that empty batch is allowed
### Use Case
I use `dataset.map(process_fn, batched=True)` to process the dataset, with data **augmentations or filtering**. However, when all examples within a batch is filtered out, i.e. **an empty batch is returned**, the following error will be thrown:
```
ValueError: Schema and number of arrays unequal
```
This is because the empty batch does not comply with the schema of other batches. I think an empty batch should be allowed to facilitate coding (one does not need to assign an empty list manually for all keys.)
A simple fix is to check the length of `batch` before writing:
```
if len(batch):
writer.write_batch(batch)
```
instead of
https://github.com/huggingface/datasets/blob/74d60213dcbd7c99484c62ce1d3dfd90a1df0770/src/datasets/arrow_dataset.py#L3493
I think this error means you filter all examples within an (input) batch by deleting its columns. In that case, to avoid the error, you can set the column value to an empty list (`input_batch["col"] = []`) instead. | [
-0.39054322242736816,
-0.11447738856077194,
-0.12671449780464172,
0.06956255435943604,
0.11723816394805908,
-0.039604365825653076,
0.3428269922733307,
0.17094162106513977,
0.3144310414791107,
0.3454689681529999,
0.27377739548683167,
0.036286361515522,
-0.1861603856086731,
0.3792963922023773,
-0.19943314790725708,
0.028409451246261597,
0.046339001506567,
0.2442815601825714,
0.09783781319856644,
0.1592782437801361,
-0.3292884826660156,
-0.09241411089897156,
-0.40040767192840576,
-0.08916457742452621,
0.0109383724629879,
-0.2924945056438446,
0.13225558400154114,
-0.2798365652561188,
-0.2623004913330078,
-0.5025138854980469,
0.057194992899894714,
0.021129675209522247,
-0.11065307259559631,
0.42193758487701416,
-0.00011264019121881574,
0.07867488265037537,
0.36153048276901245,
-0.11059460043907166,
-0.35251814126968384,
-0.049865737557411194,
-0.19619044661521912,
-0.18765173852443695,
0.020854026079177856,
-0.14440180361270905,
0.1358945071697235,
-0.23179462552070618,
-0.16133680939674377,
-0.3499146103858948,
0.279848575592041,
0.01141989603638649,
0.18588407337665558,
0.4228193163871765,
0.15006886422634125,
-0.0170899610966444,
0.2582993507385254,
0.43152785301208496,
-0.17175093293190002,
-0.18591724336147308,
0.3186971843242645,
-0.17477932572364807,
-0.04172194376587868,
0.4778112471103668,
-0.15696680545806885,
0.0876421183347702,
0.2718732953071594,
-0.12652352452278137,
0.3001857101917267,
-0.5573205351829529,
-0.004628535360097885,
0.43427565693855286,
0.4037419855594635,
-0.16806164383888245,
-0.5897400379180908,
-0.5149391889572144,
0.06800483912229538,
-0.34531664848327637,
-0.10379469394683838,
0.275192528963089,
-0.24107924103736877,
0.05371178686618805,
-0.17856481671333313,
0.1808270812034607,
-0.14705058932304382,
-0.1146775335073471,
0.20232422649860382,
0.3490038216114044,
0.13968513906002045,
0.13070473074913025,
0.05307983607053757,
-0.17231035232543945,
0.18167883157730103,
-0.2548098564147949,
-0.4291093647480011,
0.4511967897415161,
-0.23780450224876404,
-0.19767844676971436,
0.057778745889663696,
-0.10680775344371796,
0.45253998041152954,
0.0814928263425827,
0.05257624760270119,
-0.04178939759731293,
0.2706659138202667,
0.20324939489364624,
0.30201566219329834,
0.08860521763563156,
0.47059619426727295,
0.12277311086654663,
-0.08186379075050354,
-0.0796181857585907,
0.15841864049434662,
-0.035995710641145706,
0.0852406919002533,
-0.21992599964141846,
0.11639136075973511,
0.0018704570829868317,
0.16992415487766266,
0.053112685680389404,
-0.1567019522190094,
0.05836494639515877,
-0.11752599477767944,
-0.05523225665092468,
-0.016745075583457947,
0.3523225486278534,
0.13118769228458405,
0.025147102773189545,
-0.11344306170940399,
0.15950466692447662,
-0.12302780151367188,
-0.16071434319019318,
-0.19953776895999908,
-0.28199106454849243,
-0.1585804522037506,
-0.2556525468826294,
0.08772310614585876,
0.11205767095088959,
0.3543342649936676,
0.056479036808013916,
-0.13372980058193207,
0.10781071335077286,
0.4357127547264099,
-0.2861546576023102,
0.472538560628891,
0.49065545201301575,
0.1081799641251564,
-0.017414376139640808,
0.18380002677440643,
0.13926176726818085,
-0.16789108514785767,
0.41173967719078064,
-0.2981656491756439,
-0.3612403869628906,
-0.1702243536710739,
0.18537373840808868,
-0.039754923433065414,
0.2158317267894745,
-0.54529869556427,
0.03729354962706566,
0.16407926380634308,
-0.13344214856624603,
0.2858264148235321,
-0.09833751618862152,
0.11960072070360184,
-0.363632470369339,
0.05051273852586746,
0.5808572769165039,
-0.4533591866493225,
-0.01742466539144516,
0.1638525128364563,
-0.2167052924633026,
-0.04791279137134552,
0.3182992935180664,
-0.2611269950866699,
0.09982795268297195,
-0.20958590507507324,
0.24816632270812988,
0.32106003165245056,
-0.1365363895893097,
0.017438072711229324,
0.2242559790611267,
0.006311520934104919,
-0.034920308738946915,
0.06488627940416336,
0.1130232959985733,
0.5488211512565613,
-0.023783884942531586,
0.04443465173244476,
-0.0020892154425382614,
-0.2323758751153946,
0.007158264517784119,
-0.0917171910405159,
-0.3079746961593628,
0.07890629768371582,
-0.280278742313385,
0.018613863736391068,
-0.07097497582435608,
0.016757439821958542,
-0.4333600103855133,
0.3297176659107208,
-0.20061223208904266,
0.17336875200271606,
0.3714483380317688,
0.52572101354599,
0.0067781321704387665,
-0.07989320158958435,
-0.18827402591705322,
-0.6074391603469849,
0.15798884630203247,
-0.11151590198278427,
-0.09397496283054352,
-0.1294669210910797,
-0.42750880122184753,
0.1344396471977234,
0.2898924946784973,
-0.15356935560703278,
-0.025880888104438782,
0.05313696712255478,
-0.5071308016777039,
0.15585680305957794,
-0.17045967280864716,
-0.14356118440628052,
-0.09543319046497345,
-0.17536981403827667,
0.13870970904827118,
-0.28562530875205994,
0.010844975709915161,
0.11691366881132126,
-0.21768061816692352,
-0.1308707296848297,
0.101735919713974,
0.06376589834690094,
-0.07159683853387833,
0.005662266165018082,
0.3105476200580597,
0.22980090975761414,
-0.09244515001773834,
-0.1704743206501007,
0.2704187035560608,
-0.029206786304712296,
0.1413622945547104,
0.028338739648461342,
-0.0025530997663736343,
0.1873779445886612,
-0.0671750158071518,
-0.405772864818573,
0.4787006974220276,
0.1274210661649704,
0.32444339990615845,
0.14721302688121796,
-0.08277657628059387,
0.19103842973709106,
0.05411117523908615,
-0.2560170590877533,
-0.302876740694046,
0.0033434215001761913,
-0.246055006980896,
0.01448012888431549,
0.16840800642967224,
-0.19938421249389648,
0.03395469859242439,
0.18367934226989746,
0.059556737542152405,
0.13446426391601562,
-0.09494694322347641,
-0.10871283710002899,
0.09208956360816956,
0.254877507686615,
0.054173052310943604,
0.13141804933547974,
0.37802329659461975,
-0.25293171405792236,
-0.2711178660392761,
0.22334590554237366,
-0.08383488655090332,
0.36067482829093933,
0.05298151820898056,
0.36087387800216675,
0.10733465105295181,
0.09135500341653824,
0.007984530180692673,
-0.15978200733661652,
-0.37168943881988525,
-0.0077966563403606415,
0.07717282325029373,
-0.3076814115047455,
-0.12682047486305237,
0.0720086619257927,
-0.14657634496688843,
0.00037093088030815125,
0.1358678638935089,
-0.14917942881584167,
-0.26111745834350586,
0.028261270374059677,
0.21646639704704285,
-0.4855489134788513,
0.09504810720682144,
-0.515986442565918,
-0.02479332685470581,
0.21626660227775574,
-0.37206897139549255,
-0.1328497678041458,
-0.19772645831108093,
0.029694467782974243,
0.049013733863830566,
0.14489419758319855,
0.04305349290370941,
0.48524510860443115,
0.3752686083316803,
-0.17329467833042145,
-0.30522069334983826,
-0.3382859230041504,
0.08738796412944794,
-0.231686070561409,
0.08845242857933044,
0.2321496456861496,
0.5684042572975159,
-0.0323759987950325,
-0.14474815130233765,
0.09544394910335541,
-0.36870792508125305,
-0.41581472754478455,
0.07450839877128601,
0.1961638629436493,
-0.14323852956295013,
-0.46200457215309143,
-0.11081822216510773,
-0.07604269683361053,
-0.42930540442466736,
0.14371448755264282,
-0.03959978371858597,
0.19596679508686066,
0.1500074863433838,
0.26023176312446594,
-0.133795827627182,
-0.1290496289730072,
-0.5193029046058655,
0.1760713905096054,
-0.011257871985435486,
0.22134923934936523,
-0.12720425426959991,
-0.12287064641714096,
0.1585877686738968,
-0.24571384489536285,
-0.07146821916103363,
0.39400720596313477,
-0.10512544959783554,
-0.102615587413311,
-0.07794428616762161,
0.29535922408103943,
-0.02080155536532402,
0.11053046584129333,
0.5135208368301392,
0.25019729137420654,
-0.10412005335092545,
-0.16230443120002747,
-0.049667052924633026,
0.24515599012374878,
-0.1826905906200409,
0.07044881582260132,
-0.09436666965484619,
0.46886980533599854,
-0.08320312201976776,
0.8606113791465759,
0.2074766457080841,
0.034585606306791306,
0.08520965278148651,
-0.14887268841266632,
0.3530440330505371,
-0.12300638109445572,
0.04611171782016754,
-0.05374313145875931,
0.15135706961154938,
-0.1644834578037262,
0.03232814744114876,
-0.13987064361572266,
-0.02555248513817787,
0.2198711484670639,
-0.03927558660507202,
-0.30872103571891785,
-0.11799553036689758,
0.40742412209510803,
-0.3328440189361572,
0.3467060625553131,
-0.08049866557121277,
0.0014018043875694275,
-0.4296967387199402,
-0.21690963208675385,
-0.19227451086044312,
-0.17330139875411987,
0.3373086154460907,
-0.1710452139377594,
-0.492459774017334,
-0.012582618743181229,
-0.480927437543869,
0.40197205543518066,
0.06764665246009827,
0.21071557700634003,
0.1802704632282257,
-0.09066969156265259,
-0.08525851368904114,
0.08707529306411743,
0.9271057844161987,
-0.43016913533210754,
-0.09252974390983582,
-0.0230247899889946,
0.3846755027770996,
-0.5754241943359375,
-0.07943636924028397,
-0.20155711472034454,
0.1681031435728073,
0.10260260105133057,
0.31998154520988464,
-0.37289273738861084,
-0.05839203670620918,
0.09807875752449036,
0.07071627676486969,
-0.14401543140411377,
-0.04696834832429886,
-0.2119053602218628,
-0.17123155295848846,
-0.3610556125640869,
0.18388411402702332,
0.38519930839538574,
0.09237974882125854,
-0.020925195887684822,
-0.2855001389980316,
-0.302340567111969,
0.053651124238967896,
0.19164131581783295,
0.0920494794845581,
0.5679858326911926,
0.029052313417196274,
0.17220208048820496,
-0.2054775506258011,
0.15663981437683105,
0.5945020318031311,
0.3281739056110382,
-0.23685245215892792,
-0.18035449087619781,
0.022686518728733063,
-0.2893274426460266,
0.48194509744644165,
0.3982205092906952,
-0.017228472977876663,
0.47448575496673584,
0.06045965850353241,
0.2208448052406311,
-0.037664253264665604,
-0.2986704111099243,
0.00787942111492157,
-0.031111707910895348,
-0.40840068459510803,
-0.35304784774780273,
0.16971120238304138,
0.18060141801834106,
0.031007006764411926,
0.4780799150466919,
0.1953451931476593,
-0.2537814974784851,
0.6792389154434204,
0.2276652306318283,
0.7792395353317261,
0.06558500230312347,
0.16638289391994476,
0.35521382093429565,
0.08153192698955536,
0.061315540224313736,
0.14232642948627472,
0.23439040780067444,
-0.3372179865837097,
-0.08929681032896042,
0.02333097904920578,
-0.1901869773864746,
0.2868739068508148,
0.43403300642967224,
0.014749206602573395,
0.22521373629570007,
-0.17571264505386353,
0.3924691677093506,
-0.2910423278808594,
0.14377661049365997,
-0.17025983333587646,
-0.13115879893302917,
-0.19463910162448883,
0.1040101870894432,
0.2589873969554901,
-0.1165231466293335,
-0.09089164435863495,
-0.18670113384723663,
0.10027852654457092,
-0.35118353366851807,
-0.23061978816986084,
-0.052795153111219406,
-0.5567758083343506,
0.07322164624929428,
0.19434553384780884,
0.03158929944038391,
0.048624902963638306,
0.07471495866775513,
0.05242595821619034,
0.3174484372138977,
-0.003672199323773384,
0.0243808813393116,
0.3920031189918518,
0.10377632081508636,
-0.09047140926122665,
0.02001422643661499,
0.14475923776626587,
0.047653928399086,
-0.1980476677417755,
0.14401105046272278,
-0.28311800956726074,
-0.24667546153068542,
0.0222197026014328,
0.07545430958271027,
0.018951956182718277,
-0.422467440366745,
-0.37844815850257874,
-0.21305595338344574,
-0.10053180903196335,
0.03406362235546112,
0.06775174289941788,
0.05681847035884857,
-0.13663575053215027,
0.23467054963111877,
-0.16569221019744873,
-0.2531905770301819,
-0.008944314904510975,
0.031433138996362686,
0.18119381368160248,
-0.1452375054359436,
0.5751708745956421,
-0.10491308569908142,
-0.08342786878347397,
-0.3057439625263214,
0.19464001059532166,
0.2721579074859619,
-0.41600310802459717,
0.3983607292175293,
0.18046025931835175,
-0.06456536054611206,
0.157395139336586,
0.41436487436294556,
0.07257163524627686,
0.33502867817878723,
-0.08922424912452698,
-0.12470367550849915,
-0.08625306189060211,
0.36233437061309814,
0.02267010696232319,
0.3674398362636566,
-0.07523847371339798,
0.06665360927581787,
-0.07242739945650101,
-0.06632118672132492,
-0.3620373606681824,
-0.22240492701530457,
-0.10576451569795609,
0.3130505681037903,
0.06706735491752625,
0.27951785922050476,
0.11528094112873077,
-0.3346744179725647,
-0.008018173277378082,
0.17233377695083618,
-0.33994466066360474,
-0.22136783599853516,
0.08785024285316467,
0.14580819010734558,
-0.04083634167909622,
0.09093524515628815,
0.07175444066524506,
-0.16298195719718933,
-0.12298305332660675,
-0.23112285137176514,
0.17342275381088257,
0.07847513258457184,
-0.055843304842710495,
-0.06436285376548767,
0.3457012176513672,
0.34786921739578247,
-0.09342002123594284,
0.2630525827407837,
-0.16902723908424377,
0.010746818035840988,
-0.017478812485933304,
0.15402933955192566,
0.17499397695064545,
0.12524721026420593,
0.283792108297348,
0.03345996141433716,
-0.10656626522541046,
0.05744162201881409,
0.05378115177154541,
-0.3119553327560425,
-0.2117081582546234,
0.12432524561882019,
0.19954846799373627,
0.10325257480144501,
-0.1425982266664505,
-0.0010855123400688171,
0.285165399312973,
0.26537024974823,
-0.38129961490631104,
0.1790166199207306,
0.23855169117450714,
0.1490049511194229,
0.35058262944221497,
0.3632570207118988,
0.26680314540863037,
-0.00817125290632248,
0.011934025213122368,
0.23036816716194153,
0.1279822587966919,
-0.2406909465789795,
0.28883254528045654,
0.5418968796730042,
0.07466943562030792,
-0.15967640280723572,
0.27801454067230225,
0.20446452498435974,
0.3639780282974243,
0.16335785388946533,
0.15314778685569763,
0.5050278902053833,
0.36282801628112793,
0.0049120415933430195,
-0.1445217728614807,
-0.47677597403526306,
0.026876093819737434,
0.0010828971862792969,
-0.03687493875622749,
0.36054718494415283,
0.19172349572181702,
-0.024774018675088882,
0.022619284689426422,
-0.5060205459594727,
-0.04416254535317421,
0.04355083405971527,
-0.37328457832336426,
-0.16776132583618164,
-0.43497371673583984,
-0.11364906281232834,
0.27138185501098633,
-0.21347129344940186,
0.09967447817325592,
-0.19745631515979767,
0.22665739059448242,
-0.08239959180355072,
-0.015304412692785263,
-0.10577341914176941,
0.13388408720493317,
0.33631184697151184,
0.40139225125312805,
-0.1383640468120575,
0.07648158073425293,
0.11832328140735626,
-0.08870089054107666,
0.0786958634853363,
0.5323445796966553,
0.4750736951828003,
0.2907010614871979,
0.043272536247968674,
0.14338186383247375,
0.07643266022205353,
-0.2634059488773346,
-0.2709363102912903,
0.18716368079185486,
0.09403851628303528,
-0.02303207293152809,
0.2317299246788025,
0.13410566747188568,
-0.08922023326158524,
0.08723035454750061,
-0.08183903992176056,
0.019770611077547073,
-0.1002892553806305,
0.19800329208374023,
0.05065342038869858,
-0.3428415358066559,
-0.1830921769142151,
-0.06196014583110809,
-0.09993080794811249,
-0.11497160792350769,
0.5679060220718384,
-0.11562719196081161,
0.15723562240600586,
-0.09659767150878906,
0.10068348050117493,
-0.08381698280572891,
0.37343135476112366,
0.528179407119751,
0.022265318781137466,
-0.25695252418518066,
0.11739921569824219,
-0.6419756412506104,
-0.15781031548976898,
-0.7847806811332703,
0.018450573086738586,
0.1204477846622467,
0.27197277545928955,
0.19690918922424316,
-0.060252733528614044,
0.06365013122558594,
0.03520531952381134,
-0.345985472202301,
0.2848196029663086,
-0.3556280732154846,
-0.09503471851348877,
-0.08382724970579147,
0.038373060524463654,
0.099421426653862,
-0.5292035341262817,
0.07705022394657135,
0.004834011197090149,
0.008479312062263489,
-0.016312338411808014,
0.18744371831417084,
0.2703865170478821,
-0.1767522096633911,
0.24506932497024536,
0.21560253202915192,
-0.05069457367062569,
0.014777906239032745,
-0.03497324138879776,
-0.27875110507011414,
-0.016243960708379745,
-0.311568021774292,
0.12111638486385345,
0.45208701491355896,
0.411916583776474,
-0.24555781483650208,
-0.13597336411476135,
-0.08249200135469437,
0.035780031234025955,
0.10264603793621063,
-0.03274592012166977,
-0.13551826775074005,
0.25262516736984253,
-0.22448310256004333,
0.0712500512599945,
-0.08981519937515259,
0.008299705572426319,
0.024105874821543694,
-0.05012041702866554,
-0.11673341691493988,
-0.3335946202278137,
0.222464457154274,
-0.6015790700912476,
-0.28180885314941406,
-0.16062003374099731,
0.22065672278404236,
0.07522113621234894,
-0.21471330523490906,
-0.49555879831314087,
0.0570586621761322,
0.25756072998046875,
-0.12237919867038727,
0.0002544000744819641,
0.06149882450699806,
-0.21608835458755493,
0.02981904149055481,
-0.1943960189819336,
0.0791223794221878,
0.010132350027561188,
-0.3088873028755188,
-0.10616005957126617,
-0.37098461389541626
] |
https://github.com/huggingface/datasets/issues/6187 | Hi! You can load this dataset with:
```python
data_files = {
"train": "/content/PUBHEALTH/train.tsv",
"validation": "/content/PUBHEALTH/dev.tsv",
"test": "/content/PUBHEALTH/test.tsv",
}
tsv_datasets_reloaded = load_dataset("csv", data_files=data_files, sep="\t")
```
To support your `load_dataset` call, defining aliases for the packaged builders, as suggested in https://github.com/huggingface/datasets/issues/5625, must be implemented. We can consider adding this feature if more people request it.
(Also answered on the Discord [here](https://discord.com/channels/879548962464493619/1145956791134470224/1146071491260186744)) | Couldn't find a dataset script at /content/tsv/tsv.py or any data file in the same directory | ### Describe the bug
```
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
[<ipython-input-48-6a7b3e847019>](https://localhost:8080/#) in <cell line: 7>()
5 }
6
----> 7 csv_datasets_reloaded = load_dataset("tsv", data_files=data_files)
8 csv_datasets_reloaded
2 frames
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1489 raise e1 from None
1490 if isinstance(e1, FileNotFoundError):
-> 1491 raise FileNotFoundError(
1492 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. "
1493 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}"
FileNotFoundError: Couldn't find a dataset script at /content/tsv/tsv.py or any data file in the same directory. Couldn't find 'tsv' on the Hugging Face Hub either: FileNotFoundError: Dataset 'tsv' doesn't exist on the Hub
```
### Steps to reproduce the bug
```
data_files = {
"train": "/content/PUBHEALTH/train.tsv",
"validation": "/content/PUBHEALTH/dev.tsv",
"test": "/content/PUBHEALTH/test.tsv",
}
tsv_datasets_reloaded = load_dataset("tsv", data_files=data_files)
tsv_datasets_reloaded
```
```
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-48-6a7b3e847019> in <cell line: 7>()
5 }
6
----> 7 csv_datasets_reloaded = load_dataset("tsv", data_files=data_files)
8 csv_datasets_reloaded
2 frames
/usr/local/lib/python3.10/dist-packages/datasets/load.py in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1489 raise e1 from None
1490 if isinstance(e1, FileNotFoundError):
-> 1491 raise FileNotFoundError(
1492 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. "
1493 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}"
FileNotFoundError: Couldn't find a dataset script at /content/tsv/tsv.py or any data file in the same directory. Couldn't find 'tsv' on the Hugging Face Hub either: FileNotFoundError: Dataset 'tsv' doesn't exist on the Hub
```
### Expected behavior
load the data, push to hub
### Environment info
jupyter notebook RTX 3090 | 59 | Couldn't find a dataset script at /content/tsv/tsv.py or any data file in the same directory
### Describe the bug
```
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
[<ipython-input-48-6a7b3e847019>](https://localhost:8080/#) in <cell line: 7>()
5 }
6
----> 7 csv_datasets_reloaded = load_dataset("tsv", data_files=data_files)
8 csv_datasets_reloaded
2 frames
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1489 raise e1 from None
1490 if isinstance(e1, FileNotFoundError):
-> 1491 raise FileNotFoundError(
1492 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. "
1493 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}"
FileNotFoundError: Couldn't find a dataset script at /content/tsv/tsv.py or any data file in the same directory. Couldn't find 'tsv' on the Hugging Face Hub either: FileNotFoundError: Dataset 'tsv' doesn't exist on the Hub
```
### Steps to reproduce the bug
```
data_files = {
"train": "/content/PUBHEALTH/train.tsv",
"validation": "/content/PUBHEALTH/dev.tsv",
"test": "/content/PUBHEALTH/test.tsv",
}
tsv_datasets_reloaded = load_dataset("tsv", data_files=data_files)
tsv_datasets_reloaded
```
```
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-48-6a7b3e847019> in <cell line: 7>()
5 }
6
----> 7 csv_datasets_reloaded = load_dataset("tsv", data_files=data_files)
8 csv_datasets_reloaded
2 frames
/usr/local/lib/python3.10/dist-packages/datasets/load.py in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1489 raise e1 from None
1490 if isinstance(e1, FileNotFoundError):
-> 1491 raise FileNotFoundError(
1492 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. "
1493 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}"
FileNotFoundError: Couldn't find a dataset script at /content/tsv/tsv.py or any data file in the same directory. Couldn't find 'tsv' on the Hugging Face Hub either: FileNotFoundError: Dataset 'tsv' doesn't exist on the Hub
```
### Expected behavior
load the data, push to hub
### Environment info
jupyter notebook RTX 3090
Hi! You can load this dataset with:
```python
data_files = {
"train": "/content/PUBHEALTH/train.tsv",
"validation": "/content/PUBHEALTH/dev.tsv",
"test": "/content/PUBHEALTH/test.tsv",
}
tsv_datasets_reloaded = load_dataset("csv", data_files=data_files, sep="\t")
```
To support your `load_dataset` call, defining aliases for the packaged builders, as suggested in https://github.com/huggingface/datasets/issues/5625, must be implemented. We can consider adding this feature if more people request it.
(Also answered on the Discord [here](https://discord.com/channels/879548962464493619/1145956791134470224/1146071491260186744)) | [
-0.32915186882019043,
-0.3512330651283264,
-0.09159648418426514,
0.17967186868190765,
0.4230286478996277,
0.04754011332988739,
0.4763997197151184,
0.493308961391449,
0.18158341944217682,
0.12043030560016632,
0.05047222971916199,
0.2881438434123993,
-0.20857086777687073,
0.1487320363521576,
0.23824450373649597,
0.08736977726221085,
-0.009425528347492218,
0.2668428122997284,
-0.2827720642089844,
-0.033372439444065094,
-0.05926132947206497,
0.1342620849609375,
0.0847998633980751,
-0.05307674780488014,
-0.3550982177257538,
0.04820653796195984,
-0.129983052611351,
0.37275031208992004,
0.04070404917001724,
-0.33891838788986206,
0.12023226171731949,
-0.1468695104122162,
0.10187006741762161,
0.6306528449058533,
-0.00010559716611169279,
0.22559253871440887,
0.10275078564882278,
0.0021051019430160522,
-0.2428981214761734,
-0.3604941964149475,
-0.26118308305740356,
-0.15659692883491516,
-0.030033329501748085,
-0.32907187938690186,
-0.13095782697200775,
0.15424858033657074,
0.09167766571044922,
-0.25783032178878784,
0.4159667491912842,
0.467215359210968,
0.26902124285697937,
0.5936131477355957,
0.007329657673835754,
-0.1503889560699463,
0.4212574064731598,
0.30587634444236755,
-0.15089356899261475,
0.2811799645423889,
-0.014642659574747086,
-0.20134404301643372,
-0.01873389258980751,
0.37853163480758667,
-0.009930238127708435,
-0.08868054300546646,
0.40813249349594116,
0.2267770767211914,
-0.13368502259254456,
-0.24079976975917816,
-0.04331403598189354,
0.1758529245853424,
0.3537876605987549,
-0.4167436957359314,
-0.3636381924152374,
-0.222296804189682,
-0.04640848562121391,
-0.1784721314907074,
0.20598143339157104,
-0.03278859332203865,
0.016562871634960175,
0.14731532335281372,
-0.1845775544643402,
0.034938402473926544,
-0.11911073327064514,
0.09177909046411514,
0.08765746653079987,
-0.1347029209136963,
0.04107431694865227,
-0.018063873052597046,
-0.12983614206314087,
-0.12483371794223785,
0.0036971867084503174,
-0.0023083817213773727,
-0.0166622344404459,
0.15174081921577454,
-0.3296312689781189,
-0.14020757377147675,
0.49479565024375916,
-0.16932544112205505,
-0.029281336814165115,
0.13809631764888763,
0.09042095392942429,
-0.3287489414215088,
-0.1258237212896347,
0.08358821272850037,
0.16301928460597992,
0.14784033596515656,
-0.08398956060409546,
0.24304383993148804,
0.2876383662223816,
0.34676751494407654,
-0.10214217752218246,
-0.05201565846800804,
-0.04644831642508507,
-0.36535418033599854,
0.10345849394798279,
0.18366844952106476,
0.5735890865325928,
0.07917684316635132,
-0.49010518193244934,
0.13283786177635193,
-0.004043444991111755,
0.15817928314208984,
0.1644841879606247,
0.36034053564071655,
-0.016480710357427597,
0.13229958713054657,
0.18746216595172882,
-0.17367996275424957,
-0.17651952803134918,
0.0037826821208000183,
-0.34749913215637207,
0.3516799509525299,
-0.17962218821048737,
0.05519379675388336,
0.15035168826580048,
0.043366774916648865,
0.24539370834827423,
0.07947760820388794,
0.08052060753107071,
-0.010468803346157074,
-0.07752668112516403,
-0.19800952076911926,
0.016221199184656143,
0.37562960386276245,
-0.07747634500265121,
0.017163172364234924,
0.04194837063550949,
0.014432840049266815,
-0.08320054411888123,
0.1670691967010498,
-0.24299339950084686,
-0.2561647295951843,
-0.047222740948200226,
0.27367064356803894,
-0.2940545678138733,
-0.05539881810545921,
0.015183601528406143,
-0.11534569412469864,
0.0153728686273098,
-0.2944405674934387,
0.249600350856781,
-0.15546557307243347,
-0.16695283353328705,
-0.28226983547210693,
0.47297021746635437,
0.8732919692993164,
-0.41503632068634033,
-0.06866836547851562,
0.027532700449228287,
-0.05976981297135353,
-0.0976438820362091,
0.28003790974617004,
-0.038241006433963776,
0.3206736147403717,
-0.46900951862335205,
-0.05878985673189163,
0.17617477476596832,
-0.5984786152839661,
-0.34913817048072815,
0.0796685442328453,
-0.35837721824645996,
0.13312041759490967,
0.23146092891693115,
0.14361098408699036,
-0.07666200399398804,
0.0590655617415905,
0.17566066980361938,
-0.06503847241401672,
-0.07842491567134857,
0.009561918675899506,
-0.22751100361347198,
-0.2025197148323059,
0.1407627910375595,
0.25141069293022156,
0.1325710415840149,
-0.11962485313415527,
0.07234171032905579,
0.004142478108406067,
0.18634316325187683,
-0.13585753738880157,
-0.023495566099882126,
0.28170835971832275,
0.3903823792934418,
0.16031193733215332,
-0.0266013965010643,
-0.38109737634658813,
-0.5233727693557739,
0.2533189356327057,
-0.12148265540599823,
-0.030639078468084335,
-0.1361997425556183,
-0.20182302594184875,
-0.32856684923171997,
-0.2311173975467682,
-0.10318434238433838,
-0.2318466156721115,
0.20840045809745789,
0.23456192016601562,
-0.12574955821037292,
0.03570990264415741,
-0.3651809096336365,
0.36810559034347534,
-0.12549585103988647,
-0.010539371520280838,
-0.4204332232475281,
0.48649096488952637,
-0.1695832908153534,
-0.20309105515480042,
0.01255703717470169,
0.1841949224472046,
0.18622711300849915,
-0.1588272601366043,
-0.0471944734454155,
0.47470274567604065,
0.12258955836296082,
0.3616384267807007,
0.04594546556472778,
-0.17967283725738525,
0.2730472683906555,
-0.06470121443271637,
-0.18725135922431946,
0.10165239870548248,
0.2805717885494232,
0.13899961113929749,
-0.1792454570531845,
0.26627498865127563,
-0.42254361510276794,
-0.0523272380232811,
0.23010961711406708,
-0.018091600388288498,
0.06646426767110825,
-0.17437420785427094,
-0.1266261488199234,
-0.22504554688930511,
0.2685061991214752,
0.30438169836997986,
0.23885023593902588,
0.05470017343759537,
-0.35746219754219055,
0.17996422946453094,
0.519831657409668,
0.03804747760295868,
0.09970639646053314,
0.017004776746034622,
-0.0681932121515274,
0.18846771121025085,
0.09032861143350601,
0.14846856892108917,
0.4849921464920044,
0.2087315022945404,
-0.27419212460517883,
0.11301358789205551,
0.03297775611281395,
-0.22766780853271484,
0.25513410568237305,
-0.06424453854560852,
0.2098631113767624,
0.4210769832134247,
0.0568985715508461,
0.2310982495546341,
-0.3829328417778015,
-0.5447210669517517,
-0.15490365028381348,
0.19527359306812286,
-0.5413994789123535,
-0.021947529166936874,
-0.27903464436531067,
-0.1346852332353592,
-0.1895754635334015,
-0.012247171252965927,
-0.019450929015874863,
-0.08870752900838852,
0.03842664137482643,
0.10088963806629181,
-0.3456227779388428,
0.12416131794452667,
-0.09953147917985916,
0.14267602562904358,
0.10310664027929306,
-0.0717400312423706,
-0.20117397606372833,
-0.1591728925704956,
-0.005204468034207821,
0.08033603429794312,
0.2020660787820816,
-0.0026116929948329926,
0.2563271224498749,
-0.4050523042678833,
-0.05054841190576553,
-0.24730432033538818,
-0.34043505787849426,
-0.012264620512723923,
-0.14116743206977844,
0.24841320514678955,
0.36567339301109314,
0.3644341826438904,
-0.07033975422382355,
-0.2834821045398712,
0.2068306803703308,
-0.11721542477607727,
-0.28708624839782715,
-0.11343011260032654,
-0.05392299219965935,
-0.2352987676858902,
-0.2673211395740509,
-0.6234373450279236,
-0.22987259924411774,
-0.5284397006034851,
0.11309681832790375,
-0.019304469227790833,
0.11594133079051971,
0.4772881269454956,
0.11590895056724548,
0.3206615447998047,
-0.10575036704540253,
0.07211966067552567,
-0.029623089358210564,
-0.27294081449508667,
0.3799634575843811,
-0.22022762894630432,
-0.3622935712337494,
0.11125219613313675,
-0.07739078253507614,
0.05633116886019707,
-0.06430291384458542,
-0.4813874661922455,
-0.2917082607746124,
-0.18330200016498566,
0.21390008926391602,
-0.07880199700593948,
0.0025786645710468292,
0.2370833158493042,
0.06483545899391174,
-0.14530211687088013,
-0.23964188992977142,
-0.14765658974647522,
0.04244382679462433,
0.1658211648464203,
-0.039742160588502884,
-0.08644218742847443,
0.42041638493537903,
-0.10522400587797165,
0.4823181927204132,
0.26308053731918335,
0.005368649959564209,
0.36445125937461853,
-0.36513131856918335,
0.4513067901134491,
-0.26441383361816406,
-0.48367077112197876,
0.01836979016661644,
0.10434667021036148,
-0.09188173711299896,
0.1562727838754654,
-0.1977226883172989,
0.22839254140853882,
-0.253520131111145,
-0.08285493403673172,
-0.2741090953350067,
-0.23003219068050385,
0.03640744835138321,
-0.1883142739534378,
0.08067589998245239,
-0.003384895622730255,
0.01588248461484909,
-0.16840359568595886,
0.07868724316358566,
0.09246038645505905,
0.4140649735927582,
0.3065413534641266,
-0.006476607173681259,
-0.2407820075750351,
-0.006567515432834625,
-0.1234331876039505,
0.01987980678677559,
0.17799057066440582,
0.2612028121948242,
-0.20032347738742828,
-0.18240463733673096,
-0.10674797743558884,
-0.10170867294073105,
0.6749828457832336,
-0.018412012606859207,
0.23883458971977234,
0.049516402184963226,
-0.152878075838089,
-0.4146422743797302,
-0.12347608059644699,
-0.13686305284500122,
0.015721894800662994,
0.07478077709674835,
0.4152333736419678,
-0.11257895082235336,
-0.11578089743852615,
0.3758448362350464,
0.019277729094028473,
-0.018527649343013763,
-0.02745690755546093,
-0.18583513796329498,
-0.11751799285411835,
-0.2250537872314453,
-0.03991840034723282,
0.07646136730909348,
0.05594545975327492,
0.02570594847202301,
-0.20321252942085266,
0.011928902938961983,
-0.2518766224384308,
0.031970251351594925,
0.15387976169586182,
0.4441063404083252,
-0.09132486581802368,
0.40925657749176025,
0.17922097444534302,
0.11140722036361694,
0.37946584820747375,
0.597217857837677,
-0.010520008392632008,
-0.5708421468734741,
-0.05466561019420624,
0.007950913161039352,
0.01605185493826866,
0.39915531873703003,
-0.1562482714653015,
-0.05764346942305565,
-0.08551909774541855,
0.2173449993133545,
-0.12210653722286224,
0.06497710943222046,
0.332794725894928,
0.08214179426431656,
0.020746581256389618,
-0.2169904261827469,
0.10964767634868622,
-0.034852392971515656,
0.10762454569339752,
0.19791343808174133,
0.050403349101543427,
-0.39440667629241943,
0.14411303400993347,
-0.2563247084617615,
0.7496934533119202,
0.42299413681030273,
0.25966325402259827,
0.5537115335464478,
0.02882959693670273,
0.4005078375339508,
-0.07653605937957764,
0.14881525933742523,
-0.3179280757904053,
-0.41534218192100525,
-0.07637546956539154,
-0.08381544798612595,
0.21398156881332397,
-0.05307203531265259,
-0.1621430516242981,
0.2760929763317108,
0.007786363363265991,
0.580194354057312,
-0.16359642148017883,
0.001592285931110382,
-0.006373610347509384,
0.023794423788785934,
-0.22621026635169983,
0.13869501650333405,
-0.008694933727383614,
0.3389121890068054,
-0.0429769903421402,
-0.29088497161865234,
-0.3862791955471039,
-0.1870168149471283,
-0.21846860647201538,
0.1410035789012909,
-0.20376381278038025,
0.2175595611333847,
0.04073541238903999,
-0.2765043079853058,
0.035590022802352905,
0.2327083796262741,
0.10181768238544464,
0.04974815994501114,
-0.31440669298171997,
0.2719469666481018,
-0.0045273639261722565,
0.05471421405673027,
-0.17767347395420074,
-0.045352593064308167,
0.31241148710250854,
-0.09289275109767914,
-0.365328848361969,
-0.021369967609643936,
-0.026838447898626328,
-0.0015330538153648376,
0.1025180071592331,
0.048482783138751984,
-0.043907128274440765,
-0.28276756405830383,
-0.24768371880054474,
-0.010647177696228027,
0.0295439213514328,
-0.2524547576904297,
0.21933934092521667,
-0.1696450561285019,
0.015465915203094482,
0.01009504497051239,
-0.08136764168739319,
-0.195818692445755,
-0.14139580726623535,
0.4951860010623932,
-0.15555527806282043,
0.10859480500221252,
0.4482364058494568,
0.10080260783433914,
-0.1875266134738922,
-0.2986452877521515,
0.30519068241119385,
0.29103022813796997,
-0.481577605009079,
0.27024054527282715,
-0.07305970788002014,
0.2308967113494873,
-0.022494114935398102,
0.0067766401916742325,
0.20104347169399261,
-0.091495081782341,
-0.09273459017276764,
-0.3927389979362488,
-0.3032892346382141,
0.35112684965133667,
0.11366944015026093,
0.38409724831581116,
0.07943356037139893,
0.20433422923088074,
0.046933114528656006,
-0.12775497138500214,
-0.41104432940483093,
-0.020805587992072105,
-0.1998053640127182,
0.08178962022066116,
0.2741363048553467,
-0.11808261275291443,
0.11636652052402496,
-0.18785786628723145,
0.21246030926704407,
0.015797169879078865,
-0.09155258536338806,
-0.32873988151550293,
-0.10986930131912231,
0.09808708727359772,
-0.10834053158760071,
-0.0541008822619915,
-0.061069849878549576,
-0.024858679622411728,
-0.07755503058433533,
-0.175073504447937,
0.24990200996398926,
0.3323262929916382,
-0.03441885858774185,
0.2885492146015167,
-0.047116752713918686,
-0.1374027281999588,
-0.04981086775660515,
0.08632536232471466,
0.00992225669324398,
0.11829521507024765,
0.05958600714802742,
0.24932803213596344,
-0.12352564930915833,
-0.02996235340833664,
-0.1912940889596939,
0.20741471648216248,
-0.031563691794872284,
0.2654118537902832,
0.16964669525623322,
-0.05798257142305374,
-0.09701940417289734,
0.021597284823656082,
0.2289692461490631,
0.33770567178726196,
-0.30860191583633423,
0.012936927378177643,
-0.009331496432423592,
0.30287960171699524,
-0.447358638048172,
0.03455503284931183,
0.2010953724384308,
0.11432758718729019,
0.2146378606557846,
0.11008105427026749,
-0.05789327621459961,
0.01947079598903656,
-0.037865664809942245,
0.32441070675849915,
0.45549535751342773,
-0.12500280141830444,
0.279295951128006,
0.41298508644104004,
-0.04862594231963158,
0.013008158653974533,
-0.039349768310785294,
0.046023108065128326,
0.3233008086681366,
0.6704515218734741,
-0.2821619510650635,
0.12855400145053864,
-0.17353686690330505,
0.031248297542333603,
0.11389883607625961,
-0.2698872685432434,
-0.11921754479408264,
-0.09003487229347229,
-0.225023090839386,
-0.19585075974464417,
0.01307559572160244,
0.25288617610931396,
-0.15108728408813477,
-0.06005233898758888,
-0.13205087184906006,
0.16020245850086212,
-0.27734991908073425,
0.10252267122268677,
-0.21784529089927673,
-0.13856208324432373,
-0.24582180380821228,
-0.03678303211927414,
0.08625912666320801,
0.09984153509140015,
0.22814525663852692,
0.196431964635849,
-0.15552611649036407,
-0.0817301943898201,
0.14566722512245178,
0.18798160552978516,
0.18521513044834137,
-0.16164979338645935,
0.2481597661972046,
0.41121625900268555,
-0.026475004851818085,
-0.039871539920568466,
0.41884854435920715,
0.4504682719707489,
0.36050692200660706,
0.10787011682987213,
0.14227285981178284,
0.1723024547100067,
-0.21612951159477234,
-0.06904986500740051,
0.11337161064147949,
-0.31868767738342285,
0.09971588850021362,
0.1765110343694687,
0.2922947406768799,
-0.2706823945045471,
0.27257320284843445,
0.035293933004140854,
-0.0320512056350708,
-0.3598563075065613,
0.320674866437912,
-0.2532486319541931,
-0.10157275199890137,
-0.2048155516386032,
0.11304962635040283,
-0.365044504404068,
-0.24395883083343506,
0.3919392228126526,
0.16042287647724152,
0.2442110776901245,
-0.07330285012722015,
0.12404985725879669,
-0.04684474319219589,
0.21518033742904663,
0.22198283672332764,
0.028101807460188866,
-0.30662018060684204,
0.10351444780826569,
-0.5335553884506226,
0.0676458328962326,
0.1181250512599945,
-0.1376962810754776,
-0.06860197335481644,
-0.03415640443563461,
-0.31692028045654297,
-0.09331252425909042,
0.5627122521400452,
-0.012531954795122147,
0.002723418176174164,
0.11129489541053772,
-0.26927822828292847,
-0.04374885559082031,
-0.15300434827804565,
-0.07988016307353973,
0.12742628157138824,
-0.430285781621933,
0.13003966212272644,
-0.18829093873500824,
0.0894346609711647,
-0.03158727288246155,
-0.12779712677001953,
0.14626847207546234,
-0.0931580662727356,
0.4251699149608612,
-0.1051061600446701,
0.3911101222038269,
-0.24879813194274902,
-0.0061365291476249695,
-0.2496805638074875,
-0.5139812231063843,
-0.07221106439828873,
0.32840660214424133,
0.189600870013237,
0.3700311481952667,
-0.22463077306747437,
-0.44929012656211853,
-0.2008906602859497,
0.17199230194091797,
0.029576055705547333,
0.09300105273723602,
-0.07027659565210342,
0.07973071932792664,
-0.22016598284244537,
0.11858448386192322,
0.057287540286779404,
0.18503117561340332,
-0.2407171130180359,
0.14727433025836945,
-0.30806490778923035,
-0.6275796294212341,
0.5307307839393616,
-0.2167886197566986,
-0.13282792270183563,
-0.14348120987415314,
0.24926817417144775,
-0.029231805354356766,
0.111605204641819,
-0.3535817563533783,
0.04015779495239258,
0.3322488069534302,
0.10016287863254547,
-0.3096170425415039,
0.30993205308914185,
-0.05707472190260887,
0.04078476130962372,
0.0874154269695282,
0.3517504036426544,
0.13725890219211578,
-0.14401762187480927,
0.2552526295185089,
-0.27919846773147583
] |
https://github.com/huggingface/datasets/issues/6186 | That'd be a great idea! @mariosasko or @lhoestq, would it be possible to fix the code snippet or do you have another suggested way for doing this? | Feature request: add code example of multi-GPU processing | ### Feature request
Would be great to add a code example of how to do multi-GPU processing with 🤗 Datasets in the documentation. cc @stevhliu
Currently the docs has a small [section](https://huggingface.co/docs/datasets/v2.3.2/en/process#map) on this saying "your big GPU call goes here", however it didn't work for me out-of-the-box.
Let's say you have a PyTorch model that can do translation, and you have multiple GPUs. In that case, you'd like to duplicate the model on each GPU, each processing (translating) a chunk of the data in parallel.
Here's how I tried to do that:
```
from datasets import load_dataset
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
from multiprocess import set_start_method
import torch
import os
dataset = load_dataset("mlfoundations/datacomp_small")
tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-distilled-600M")
model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-distilled-600M")
# put model on each available GPU
# also, should I do it like this or use nn.DataParallel?
model.to("cuda:0")
model.to("cuda:1")
set_start_method("spawn")
def translate_captions(batch, rank):
os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())
texts = batch["text"]
inputs = tokenizer(texts, padding=True, truncation=True, return_tensors="pt").to(model.device)
translated_tokens = model.generate(
**inputs, forced_bos_token_id=tokenizer.lang_code_to_id["eng_Latn"], max_length=30
)
translated_texts = tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)
batch["translated_text"] = translated_texts
return batch
updated_dataset = dataset.map(translate_captions, with_rank=True, num_proc=2, batched=True, batch_size=256)
```
I've personally tried running this script on a machine with 2 A100 GPUs.
## Error 1
Running the code snippet above from the terminal (python script.py) resulted in the following error:
```
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 125, in _main
prepare(preparation_data)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 289, in run_path
return _run_module_code(code, init_globals, run_name,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 96, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/niels/python_projects/datacomp/datasets_multi_gpu.py", line 16, in <module>
set_start_method("spawn")
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 247, in set_start_method
raise RuntimeError('context has already been set')
RuntimeError: context has already been set
```
## Error 2
Then, based on [this Stackoverflow answer](https://stackoverflow.com/a/71616344/7762882), I put the `set_start_method("spawn")` section in a try: catch block. This resulted in the following error:
```
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/dataset_dict.py", line 817, in <dictcomp>
k: dataset.map(
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2926, in map
with Pool(nb_of_missing_shards, initargs=initargs, initializer=initializer) as pool:
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 215, in __init__
self._repopulate_pool()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 306, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 329, in _repopulate_pool_static
w.start()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/process.py", line 121, in start
self._popen = self._Popen(self)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 288, in _Popen
return Popen(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 32, in __init__
super().__init__(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_fork.py", line 19, in __init__
self._launch(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 42, in _launch
prep_data = spawn.get_preparation_data(process_obj._name)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 134, in _check_not_importing_main
raise RuntimeError('''
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
```
So then I put the last line under a `if __name__ == '__main__':` block. Then the code snippet seemed to work, but it seemed that it's only leveraging a single GPU (based on monitoring `nvidia-smi`):
```
Mon Aug 28 12:19:24 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.01 Driver Version: 515.65.01 CUDA Version: 11.7 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA A100-SXM... On | 00000000:01:00.0 Off | 0 |
| N/A 55C P0 76W / 275W | 8747MiB / 81920MiB | 0% Default |
| | | Disabled |
+-------------------------------+----------------------+----------------------+
| 1 NVIDIA A100-SXM... On | 00000000:47:00.0 Off | 0 |
| N/A 67C P0 274W / 275W | 59835MiB / 81920MiB | 100% Default |
| | | Disabled |
```
Both GPUs should have equal GPU usage, but I've always noticed that the last GPU has way more usage than the other ones. This made me think that `os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())` might not work inside a Python script, especially if done after importing PyTorch?
### Motivation
Would be great to clarify how to do multi-GPU data processing.
### Your contribution
If my code snippet can be fixed, I can contribute it to the docs :) | 27 | Feature request: add code example of multi-GPU processing
### Feature request
Would be great to add a code example of how to do multi-GPU processing with 🤗 Datasets in the documentation. cc @stevhliu
Currently the docs has a small [section](https://huggingface.co/docs/datasets/v2.3.2/en/process#map) on this saying "your big GPU call goes here", however it didn't work for me out-of-the-box.
Let's say you have a PyTorch model that can do translation, and you have multiple GPUs. In that case, you'd like to duplicate the model on each GPU, each processing (translating) a chunk of the data in parallel.
Here's how I tried to do that:
```
from datasets import load_dataset
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
from multiprocess import set_start_method
import torch
import os
dataset = load_dataset("mlfoundations/datacomp_small")
tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-distilled-600M")
model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-distilled-600M")
# put model on each available GPU
# also, should I do it like this or use nn.DataParallel?
model.to("cuda:0")
model.to("cuda:1")
set_start_method("spawn")
def translate_captions(batch, rank):
os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())
texts = batch["text"]
inputs = tokenizer(texts, padding=True, truncation=True, return_tensors="pt").to(model.device)
translated_tokens = model.generate(
**inputs, forced_bos_token_id=tokenizer.lang_code_to_id["eng_Latn"], max_length=30
)
translated_texts = tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)
batch["translated_text"] = translated_texts
return batch
updated_dataset = dataset.map(translate_captions, with_rank=True, num_proc=2, batched=True, batch_size=256)
```
I've personally tried running this script on a machine with 2 A100 GPUs.
## Error 1
Running the code snippet above from the terminal (python script.py) resulted in the following error:
```
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 125, in _main
prepare(preparation_data)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 289, in run_path
return _run_module_code(code, init_globals, run_name,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 96, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/niels/python_projects/datacomp/datasets_multi_gpu.py", line 16, in <module>
set_start_method("spawn")
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 247, in set_start_method
raise RuntimeError('context has already been set')
RuntimeError: context has already been set
```
## Error 2
Then, based on [this Stackoverflow answer](https://stackoverflow.com/a/71616344/7762882), I put the `set_start_method("spawn")` section in a try: catch block. This resulted in the following error:
```
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/dataset_dict.py", line 817, in <dictcomp>
k: dataset.map(
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2926, in map
with Pool(nb_of_missing_shards, initargs=initargs, initializer=initializer) as pool:
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 215, in __init__
self._repopulate_pool()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 306, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 329, in _repopulate_pool_static
w.start()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/process.py", line 121, in start
self._popen = self._Popen(self)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 288, in _Popen
return Popen(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 32, in __init__
super().__init__(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_fork.py", line 19, in __init__
self._launch(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 42, in _launch
prep_data = spawn.get_preparation_data(process_obj._name)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 134, in _check_not_importing_main
raise RuntimeError('''
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
```
So then I put the last line under a `if __name__ == '__main__':` block. Then the code snippet seemed to work, but it seemed that it's only leveraging a single GPU (based on monitoring `nvidia-smi`):
```
Mon Aug 28 12:19:24 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.01 Driver Version: 515.65.01 CUDA Version: 11.7 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA A100-SXM... On | 00000000:01:00.0 Off | 0 |
| N/A 55C P0 76W / 275W | 8747MiB / 81920MiB | 0% Default |
| | | Disabled |
+-------------------------------+----------------------+----------------------+
| 1 NVIDIA A100-SXM... On | 00000000:47:00.0 Off | 0 |
| N/A 67C P0 274W / 275W | 59835MiB / 81920MiB | 100% Default |
| | | Disabled |
```
Both GPUs should have equal GPU usage, but I've always noticed that the last GPU has way more usage than the other ones. This made me think that `os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())` might not work inside a Python script, especially if done after importing PyTorch?
### Motivation
Would be great to clarify how to do multi-GPU data processing.
### Your contribution
If my code snippet can be fixed, I can contribute it to the docs :)
That'd be a great idea! @mariosasko or @lhoestq, would it be possible to fix the code snippet or do you have another suggested way for doing this? | [
-0.13726481795310974,
-0.43240639567375183,
-0.001979593187570572,
0.09065330773591995,
-0.10275635123252869,
0.048385635018348694,
0.39975813031196594,
0.003309808671474457,
0.1566070318222046,
0.22367125749588013,
0.1868710219860077,
0.23762893676757812,
0.19287052750587463,
0.5128408074378967,
0.522918701171875,
-0.32018184661865234,
0.11813603341579437,
-0.22682499885559082,
0.33320340514183044,
0.1273239254951477,
-0.18765708804130554,
0.3333667814731598,
-0.09929713606834412,
0.215697780251503,
-0.4721122682094574,
-0.2038276344537735,
-0.28530845046043396,
0.03162965551018715,
0.16063891351222992,
-0.22111979126930237,
-0.09847809374332428,
0.298068642616272,
0.0012909993529319763,
0.6303572654724121,
-0.00011646699567791075,
-0.11362777650356293,
0.05465345457196236,
0.016327202320098877,
0.07945813983678818,
-0.177629292011261,
0.22675222158432007,
-0.2504114508628845,
0.10698533803224564,
-0.26256537437438965,
-0.02343132719397545,
-0.028642969205975533,
-0.044210344552993774,
-0.2531892657279968,
0.2555846571922302,
-0.018407993018627167,
0.11944039911031723,
0.16084566712379456,
-0.00857873260974884,
-0.1610921025276184,
-0.3832542598247528,
0.1771220862865448,
0.04658135026693344,
-0.009682543575763702,
0.4095132052898407,
-0.3020716905593872,
-0.12628576159477234,
0.5637154579162598,
-0.02627909556031227,
0.04005734995007515,
-0.1290358304977417,
-0.007826857268810272,
-0.19307777285575867,
-0.3386915326118469,
-0.09387467801570892,
0.13656041026115417,
-0.10574577748775482,
-0.4478246569633484,
-0.44006362557411194,
-0.43075433373451233,
-0.16315262019634247,
-0.47064751386642456,
-0.33834028244018555,
0.20736175775527954,
-0.21800586581230164,
0.06619656085968018,
-0.23226362466812134,
-0.2655092775821686,
0.06610982120037079,
0.022942421957850456,
-0.03881474584341049,
0.22137659788131714,
0.038144513964653015,
0.18081015348434448,
0.2640833854675293,
0.0979112908244133,
-0.12916254997253418,
0.08739263564348221,
0.2578856945037842,
-0.023411016911268234,
-0.6043911576271057,
0.0748874619603157,
0.3175150454044342,
-0.3048141598701477,
0.17235323786735535,
0.11439356207847595,
0.10078545659780502,
0.10357026755809784,
0.06845934689044952,
0.3968272805213928,
-0.18141087889671326,
0.045728348195552826,
-0.23265156149864197,
0.11734238266944885,
0.3198080062866211,
-0.09199150651693344,
0.08039076626300812,
-0.2084348499774933,
-0.07251022011041641,
-0.22268658876419067,
-0.3538980782032013,
0.22539524734020233,
0.2352011501789093,
0.04293382167816162,
-0.032003674656152725,
-0.1665005385875702,
-0.20427000522613525,
-0.0669514611363411,
0.04615724831819534,
0.26968878507614136,
0.22728070616722107,
0.28829044103622437,
0.025303415954113007,
0.17196056246757507,
-0.045768629759550095,
-0.45981329679489136,
-0.22345909476280212,
0.07843558490276337,
-0.27035850286483765,
0.38503459095954895,
0.13989853858947754,
-0.03770642727613449,
0.28386953473091125,
0.21978262066841125,
0.454135537147522,
-0.09292280673980713,
0.5181595683097839,
0.10049033164978027,
0.12257000058889389,
0.14631319046020508,
0.13831278681755066,
0.13250598311424255,
0.47914403676986694,
0.26230233907699585,
-0.20951515436172485,
0.16582340002059937,
-0.22458384931087494,
-0.37102293968200684,
-0.04199288785457611,
0.047635868191719055,
0.1300390064716339,
0.014542641118168831,
-0.2291683703660965,
0.5189156532287598,
0.23879824578762054,
-0.02367641031742096,
0.20874138176441193,
0.014654239639639854,
-0.3141019940376282,
-0.23248054087162018,
0.4379374086856842,
0.5276799201965332,
-0.2623005509376526,
-0.1772947907447815,
0.1776680052280426,
0.10872446745634079,
0.08485651016235352,
0.3919675052165985,
-0.23088431358337402,
0.23045235872268677,
-0.10177546739578247,
0.31368502974510193,
0.03668977692723274,
-0.34959959983825684,
0.154375821352005,
0.41493821144104004,
-0.4368666112422943,
0.02735009789466858,
0.2053980827331543,
0.01394694298505783,
0.10515525937080383,
0.2272937148809433,
0.1648889034986496,
0.37879568338394165,
-0.2669222354888916,
0.18421384692192078,
-0.026782631874084473,
-0.16408276557922363,
0.22497117519378662,
0.07652550935745239,
0.008983400650322437,
-0.07891934365034103,
-0.2709106206893921,
-0.1401703953742981,
0.31071731448173523,
-0.3887564539909363,
-0.08686745166778564,
-0.003976590000092983,
0.42369771003723145,
-0.046889521181583405,
0.134732186794281,
-0.23883652687072754,
-0.07879096269607544,
0.25001955032348633,
-0.05789417773485184,
0.09703810513019562,
0.036940980702638626,
-0.2642768621444702,
0.2818697690963745,
-0.03131144866347313,
-0.23275980353355408,
-0.4970204830169678,
0.0697963535785675,
0.12452025711536407,
-0.02884995937347412,
-0.10219292342662811,
-0.11276303231716156,
0.3690639138221741,
-0.1273595690727234,
-0.01789390668272972,
-0.28777608275413513,
0.20377084612846375,
-0.0831594318151474,
-0.3235185742378235,
-0.1924331933259964,
-0.021928466856479645,
0.18652690947055817,
-0.10716603696346283,
-0.03560876473784447,
0.30218347907066345,
0.29763805866241455,
0.04366501420736313,
0.03703790530562401,
0.31927424669265747,
0.3217100203037262,
0.0003169253468513489,
0.09845403581857681,
0.13694003224372864,
-0.14091072976589203,
-0.10977359861135483,
-0.18560287356376648,
0.46328622102737427,
0.11350454390048981,
0.24202296137809753,
-0.08600223809480667,
0.06320515275001526,
0.10767901688814163,
0.1716879904270172,
-0.1542675495147705,
0.20352287590503693,
0.23374557495117188,
0.13665816187858582,
0.218779057264328,
-0.3072965741157532,
-0.5030412077903748,
0.19718724489212036,
0.31892287731170654,
-0.11530224233865738,
0.13879665732383728,
0.03964545577764511,
-0.004091810435056686,
0.05304737389087677,
0.26514720916748047,
-0.23469361662864685,
0.018823523074388504,
0.16371455788612366,
0.048439908772706985,
0.08198543637990952,
-0.21254703402519226,
-0.08612753450870514,
0.003513820469379425,
0.036425914615392685,
0.08501167595386505,
-0.08011548221111298,
0.12098909914493561,
-0.14708596467971802,
-0.08864250779151917,
-0.29509812593460083,
0.263865202665329,
-0.14647458493709564,
-0.28411632776260376,
0.2300937920808792,
-0.1244259625673294,
-0.12683697044849396,
-0.3070197105407715,
-0.22900371253490448,
-0.26795491576194763,
-0.10462262481451035,
-0.04953736066818237,
0.13317473232746124,
0.059228651225566864,
0.26202845573425293,
0.05757424980401993,
0.4001174867153168,
-0.05412260815501213,
-0.12754014134407043,
0.15420980751514435,
-0.10009711235761642,
0.02882632613182068,
-0.027363119646906853,
0.20304705202579498,
-0.002792973071336746,
0.2650507688522339,
0.27797994017601013,
0.05390234291553497,
-0.2836598753929138,
-0.6495156288146973,
0.10735151171684265,
-0.05230918154120445,
-0.043283797800540924,
0.168809711933136,
-0.22204437851905823,
0.1279846727848053,
-0.12628042697906494,
0.09973480552434921,
-0.2412632405757904,
-0.17246529459953308,
-0.11694647371768951,
0.04209209606051445,
-0.018522538244724274,
-0.34055814146995544,
-0.1257685124874115,
0.03451240807771683,
-0.33644556999206543,
0.7512093782424927,
-0.26782894134521484,
0.18522165715694427,
-0.3420449495315552,
0.21844811737537384,
0.41732317209243774,
-0.07706023752689362,
-0.10423856973648071,
0.12207566946744919,
-0.2222617268562317,
0.04044001176953316,
-0.38753432035446167,
-0.19561229646205902,
-0.15322504937648773,
0.12778699398040771,
0.2567480802536011,
0.022582925856113434,
-0.11081362515687943,
-0.2836706042289734,
-0.08860928565263748,
0.11050793528556824,
0.048427239060401917,
0.2568923830986023,
0.36643534898757935,
-0.11063946038484573,
0.020293205976486206,
0.031001023948192596,
-0.4878546893596649,
0.26738688349723816,
0.14533013105392456,
-0.10296861827373505,
0.0015516206622123718,
0.5334910750389099,
0.33905237913131714,
0.7606999278068542,
0.21592170000076294,
0.007465981878340244,
0.10215451568365097,
-0.0057657817378640175,
-0.0042434558272361755,
0.10331498831510544,
-0.17316995561122894,
-0.03305227309465408,
-0.4584881663322449,
-0.1876434087753296,
0.015719901770353317,
-0.08352261781692505,
-0.09690897911787033,
-0.006443299353122711,
-0.12017791718244553,
-0.2085135281085968,
-0.08613231033086777,
0.10566562414169312,
-0.21639077365398407,
0.30132338404655457,
-0.42527252435684204,
-0.13490456342697144,
-0.2777252197265625,
0.5468804836273193,
0.14954550564289093,
0.10399559885263443,
0.44300156831741333,
-0.029097937047481537,
-0.14628726243972778,
-0.23774603009223938,
-0.2053356021642685,
0.22539299726486206,
-0.08108101785182953,
0.028677653521299362,
-0.09386318922042847,
0.04756540060043335,
-0.16022159159183502,
-0.3425484001636505,
0.9175221920013428,
-0.05383811146020889,
-0.24073535203933716,
0.00021738559007644653,
-0.7767176628112793,
-0.0967627465724945,
0.0002802610397338867,
-0.17745940387248993,
0.08329543471336365,
0.3165305554866791,
0.3290862441062927,
-0.13441196084022522,
-0.08487619459629059,
0.16684913635253906,
-0.11666533350944519,
-0.12171293795108795,
0.053184475749731064,
-0.2602272629737854,
-0.26665198802948,
-0.46504709124565125,
0.28710535168647766,
0.2763529419898987,
-0.17984262108802795,
-0.34102320671081543,
0.08445829153060913,
-0.018273696303367615,
0.05998878926038742,
0.09060539305210114,
0.11562949419021606,
-0.03739555552601814,
0.013924561440944672,
-0.021817386150360107,
0.34926533699035645,
0.10265977680683136,
0.014078659936785698,
0.11376459896564484,
-0.08603110909461975,
-0.48909792304039,
0.2950676679611206,
0.010424274951219559,
0.6215792894363403,
0.2701704502105713,
0.11215329170227051,
0.40111279487609863,
0.2684306502342224,
0.1053607314825058,
-0.1362503468990326,
0.19916892051696777,
0.21539852023124695,
0.24353757500648499,
-0.12264867126941681,
-0.5439552068710327,
0.46222564578056335,
0.3498312532901764,
-0.0706014409661293,
0.6956338286399841,
-0.037806328386068344,
-0.09816247224807739,
-0.03284687548875809,
0.2578716278076172,
0.6009117364883423,
-0.10265389829874039,
0.29417839646339417,
-0.0874977558851242,
-0.492634654045105,
0.4086037278175354,
-0.5855088829994202,
0.15324729681015015,
-0.3028750419616699,
-0.28081363439559937,
-0.019572757184505463,
-0.2748074531555176,
0.2435486912727356,
0.12862132489681244,
-0.36670857667922974,
0.19993901252746582,
0.04349295794963837,
-0.08330457657575607,
0.11621308326721191,
0.4153295159339905,
0.3163139522075653,
-0.5045558214187622,
-0.06624080240726471,
0.04681944474577904,
0.0752277821302414,
0.03474888205528259,
-0.1827327013015747,
-0.19388322532176971,
0.21158930659294128,
-0.11793903261423111,
-0.45810553431510925,
-0.09967547655105591,
-0.5606222748756409,
0.1195961982011795,
-0.22522467374801636,
-0.04953708499670029,
0.28914472460746765,
0.11357800662517548,
0.32963240146636963,
0.07611825317144394,
-0.19609446823596954,
-0.18980371952056885,
-0.048469480127096176,
-0.01310904324054718,
-0.3161090612411499,
-0.48386234045028687,
0.14349395036697388,
-0.06770458072423935,
-0.3479110896587372,
0.19163993000984192,
0.28515103459358215,
-0.06123730167746544,
-0.1872701495885849,
0.12385401129722595,
-0.325794517993927,
0.27604687213897705,
0.03570143133401871,
0.2613053619861603,
0.043633922934532166,
-0.3656446933746338,
0.03794925659894943,
0.27996742725372314,
-0.4606718122959137,
-0.14914073050022125,
-0.2895555794239044,
0.0005127489566802979,
-0.04743792489171028,
0.12466670572757721,
0.06106588989496231,
-0.35553568601608276,
0.00539616122841835,
0.5013360381126404,
0.046341873705387115,
-0.05394354462623596,
-0.1692665070295334,
0.3088708519935608,
-0.16455970704555511,
0.12646351754665375,
-0.30013763904571533,
-0.20930084586143494,
0.065439373254776,
-0.06849654018878937,
-0.04930827394127846,
-0.09942927956581116,
-0.14508076012134552,
0.0263046994805336,
-0.3648007810115814,
0.08772922307252884,
-0.17311403155326843,
0.21729709208011627,
0.13906466960906982,
0.41336095333099365,
0.1406976878643036,
0.4890801012516022,
-0.24726231396198273,
0.20370082557201385,
-0.019625745713710785,
0.05941655859351158,
0.18679526448249817,
0.11418695002794266,
0.034603383392095566,
0.17439121007919312,
-0.11191348731517792,
0.22132134437561035,
0.10593022406101227,
-0.10948453843593597,
-0.20515191555023193,
0.1088176965713501,
0.06157035008072853,
0.10006970167160034,
0.40128087997436523,
0.09312115609645844,
-0.23191124200820923,
-0.18796519935131073,
0.4555113911628723,
0.07979334890842438,
-0.04768458753824234,
0.19658972322940826,
0.08526930212974548,
-0.027219392359256744,
-0.1253235638141632,
-0.09192335605621338,
0.17993953824043274,
-0.18317358195781708,
0.4003690481185913,
0.24932703375816345,
0.07283224910497665,
0.060439951717853546,
-0.04592963308095932,
-0.027615081518888474,
0.3071083724498749,
-0.04781337082386017,
-0.20252485573291779,
-0.05196281522512436,
-0.30233967304229736,
-0.28378042578697205,
0.37536418437957764,
-0.011011844500899315,
0.006591185927391052,
0.25938498973846436,
0.12824416160583496,
0.10668408125638962,
-0.17205020785331726,
0.009691204875707626,
0.20802587270736694,
-0.5298482179641724,
0.36970120668411255,
0.47729846835136414,
0.4435214698314667,
0.6078863739967346,
-0.014679763466119766,
-0.04493133723735809,
0.045707184821367264,
-0.14442098140716553,
0.3065044581890106,
0.012277120724320412,
-0.15027236938476562,
0.21000783145427704,
0.23948028683662415,
0.11469853669404984,
0.21850501000881195,
0.055695828050374985,
0.04671526327729225,
0.491743266582489,
0.0735761895775795,
-0.07577389478683472,
0.46394893527030945,
-0.10315664112567902,
-0.09439939260482788,
-0.3294445276260376,
-0.10423195362091064,
0.04103762283921242,
-0.34252363443374634,
0.22060483694076538,
-0.1431080400943756,
-0.28316864371299744,
-0.1700475513935089,
0.5426687002182007,
-0.1652354747056961,
-0.2160312533378601,
-0.100367471575737,
-0.07325045764446259,
-0.013395056128501892,
-0.11439036577939987,
0.21969474852085114,
-0.21504563093185425,
0.6112523674964905,
-0.10155933350324631,
0.03286806866526604,
0.0357804149389267,
-0.23426973819732666,
0.21196821331977844,
0.21250300109386444,
-0.011693425476551056,
0.004650669172406197,
0.29094818234443665,
-0.33940714597702026,
-0.2513791620731354,
0.26019933819770813,
0.4433901011943817,
0.07676401734352112,
-0.2038024365901947,
0.31794875860214233,
-0.04354413226246834,
0.22492918372154236,
0.056538671255111694,
0.013942830264568329,
0.00512576662003994,
0.09120813757181168,
0.11064764112234116,
0.04012264311313629,
-0.032169125974178314,
-0.11943793296813965,
0.15660136938095093,
0.030711360275745392,
-0.3521858751773834,
0.5341164469718933,
-0.31313902139663696,
-0.07604791224002838,
0.08261220157146454,
0.11361046880483627,
-0.4795506000518799,
0.08186614513397217,
0.6961772441864014,
-0.07884850353002548,
-0.26125895977020264,
-0.018569285050034523,
0.03931156545877457,
0.05087910592556,
0.41207537055015564,
0.13600552082061768,
0.34902194142341614,
-0.37971067428588867,
-0.13116556406021118,
-0.42874985933303833,
0.08600163459777832,
-0.23020508885383606,
0.004055827856063843,
0.04612516984343529,
0.20666763186454773,
0.11755794286727905,
0.041799504309892654,
0.042842090129852295,
-0.21543650329113007,
0.08646251261234283,
0.493436723947525,
-0.39323872327804565,
-0.07431508600711823,
-0.4586561918258667,
0.11608097702264786,
0.26705580949783325,
-0.0228530615568161,
-0.03189676254987717,
0.12276636064052582,
-0.054354023188352585,
-0.23559734225273132,
0.23365938663482666,
0.17777302861213684,
-0.03732554614543915,
0.28508949279785156,
0.08073883503675461,
0.3613443374633789,
0.0030187442898750305,
-0.23002752661705017,
-0.03415326029062271,
0.25322073698043823,
-0.4404388964176178,
0.10954134166240692,
-0.10914701968431473,
0.11539486050605774,
-0.18764635920524597,
-0.598824143409729,
-0.44897517561912537,
0.18354636430740356,
0.28004559874534607,
-0.46360889077186584,
-0.04046037793159485,
0.19633376598358154,
0.11692515760660172,
-0.2343721091747284,
0.49372631311416626,
0.5398153066635132,
-0.1500096619129181,
0.13803306221961975,
-0.2924443483352661,
0.025692477822303772,
0.3646093010902405,
-0.3754533529281616,
-0.21186792850494385,
-0.44899889826774597,
0.3961881399154663,
-0.13880832493305206,
0.13918673992156982,
-0.6909026503562927,
-0.07574541121721268,
0.1821945309638977,
0.05991608276963234,
-0.27545636892318726,
0.47606807947158813,
0.02520240843296051,
-0.2726511061191559,
-0.19228467345237732,
-0.048896290361881256,
0.2035464346408844,
-0.1772707998752594,
0.011682920157909393,
-0.3404439687728882
] |
https://github.com/huggingface/datasets/issues/6186 | Indeed `if __name__ == "__main__"` is important in this case.
Not sure about the imbalanced GPU usage though, but maybe you can try using the `torch.cuda.device` context manager ?
> also, should I do it like this or use nn.DataParallel?
In this case you wouldn't need a multiprocessed map no ? Since nn.DataParallel would take care of parallelism | Feature request: add code example of multi-GPU processing | ### Feature request
Would be great to add a code example of how to do multi-GPU processing with 🤗 Datasets in the documentation. cc @stevhliu
Currently the docs has a small [section](https://huggingface.co/docs/datasets/v2.3.2/en/process#map) on this saying "your big GPU call goes here", however it didn't work for me out-of-the-box.
Let's say you have a PyTorch model that can do translation, and you have multiple GPUs. In that case, you'd like to duplicate the model on each GPU, each processing (translating) a chunk of the data in parallel.
Here's how I tried to do that:
```
from datasets import load_dataset
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
from multiprocess import set_start_method
import torch
import os
dataset = load_dataset("mlfoundations/datacomp_small")
tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-distilled-600M")
model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-distilled-600M")
# put model on each available GPU
# also, should I do it like this or use nn.DataParallel?
model.to("cuda:0")
model.to("cuda:1")
set_start_method("spawn")
def translate_captions(batch, rank):
os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())
texts = batch["text"]
inputs = tokenizer(texts, padding=True, truncation=True, return_tensors="pt").to(model.device)
translated_tokens = model.generate(
**inputs, forced_bos_token_id=tokenizer.lang_code_to_id["eng_Latn"], max_length=30
)
translated_texts = tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)
batch["translated_text"] = translated_texts
return batch
updated_dataset = dataset.map(translate_captions, with_rank=True, num_proc=2, batched=True, batch_size=256)
```
I've personally tried running this script on a machine with 2 A100 GPUs.
## Error 1
Running the code snippet above from the terminal (python script.py) resulted in the following error:
```
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 125, in _main
prepare(preparation_data)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 289, in run_path
return _run_module_code(code, init_globals, run_name,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 96, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/niels/python_projects/datacomp/datasets_multi_gpu.py", line 16, in <module>
set_start_method("spawn")
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 247, in set_start_method
raise RuntimeError('context has already been set')
RuntimeError: context has already been set
```
## Error 2
Then, based on [this Stackoverflow answer](https://stackoverflow.com/a/71616344/7762882), I put the `set_start_method("spawn")` section in a try: catch block. This resulted in the following error:
```
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/dataset_dict.py", line 817, in <dictcomp>
k: dataset.map(
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2926, in map
with Pool(nb_of_missing_shards, initargs=initargs, initializer=initializer) as pool:
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 215, in __init__
self._repopulate_pool()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 306, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 329, in _repopulate_pool_static
w.start()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/process.py", line 121, in start
self._popen = self._Popen(self)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 288, in _Popen
return Popen(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 32, in __init__
super().__init__(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_fork.py", line 19, in __init__
self._launch(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 42, in _launch
prep_data = spawn.get_preparation_data(process_obj._name)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 134, in _check_not_importing_main
raise RuntimeError('''
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
```
So then I put the last line under a `if __name__ == '__main__':` block. Then the code snippet seemed to work, but it seemed that it's only leveraging a single GPU (based on monitoring `nvidia-smi`):
```
Mon Aug 28 12:19:24 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.01 Driver Version: 515.65.01 CUDA Version: 11.7 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA A100-SXM... On | 00000000:01:00.0 Off | 0 |
| N/A 55C P0 76W / 275W | 8747MiB / 81920MiB | 0% Default |
| | | Disabled |
+-------------------------------+----------------------+----------------------+
| 1 NVIDIA A100-SXM... On | 00000000:47:00.0 Off | 0 |
| N/A 67C P0 274W / 275W | 59835MiB / 81920MiB | 100% Default |
| | | Disabled |
```
Both GPUs should have equal GPU usage, but I've always noticed that the last GPU has way more usage than the other ones. This made me think that `os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())` might not work inside a Python script, especially if done after importing PyTorch?
### Motivation
Would be great to clarify how to do multi-GPU data processing.
### Your contribution
If my code snippet can be fixed, I can contribute it to the docs :) | 58 | Feature request: add code example of multi-GPU processing
### Feature request
Would be great to add a code example of how to do multi-GPU processing with 🤗 Datasets in the documentation. cc @stevhliu
Currently the docs has a small [section](https://huggingface.co/docs/datasets/v2.3.2/en/process#map) on this saying "your big GPU call goes here", however it didn't work for me out-of-the-box.
Let's say you have a PyTorch model that can do translation, and you have multiple GPUs. In that case, you'd like to duplicate the model on each GPU, each processing (translating) a chunk of the data in parallel.
Here's how I tried to do that:
```
from datasets import load_dataset
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
from multiprocess import set_start_method
import torch
import os
dataset = load_dataset("mlfoundations/datacomp_small")
tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-distilled-600M")
model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-distilled-600M")
# put model on each available GPU
# also, should I do it like this or use nn.DataParallel?
model.to("cuda:0")
model.to("cuda:1")
set_start_method("spawn")
def translate_captions(batch, rank):
os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())
texts = batch["text"]
inputs = tokenizer(texts, padding=True, truncation=True, return_tensors="pt").to(model.device)
translated_tokens = model.generate(
**inputs, forced_bos_token_id=tokenizer.lang_code_to_id["eng_Latn"], max_length=30
)
translated_texts = tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)
batch["translated_text"] = translated_texts
return batch
updated_dataset = dataset.map(translate_captions, with_rank=True, num_proc=2, batched=True, batch_size=256)
```
I've personally tried running this script on a machine with 2 A100 GPUs.
## Error 1
Running the code snippet above from the terminal (python script.py) resulted in the following error:
```
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 125, in _main
prepare(preparation_data)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 289, in run_path
return _run_module_code(code, init_globals, run_name,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 96, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/niels/python_projects/datacomp/datasets_multi_gpu.py", line 16, in <module>
set_start_method("spawn")
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 247, in set_start_method
raise RuntimeError('context has already been set')
RuntimeError: context has already been set
```
## Error 2
Then, based on [this Stackoverflow answer](https://stackoverflow.com/a/71616344/7762882), I put the `set_start_method("spawn")` section in a try: catch block. This resulted in the following error:
```
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/dataset_dict.py", line 817, in <dictcomp>
k: dataset.map(
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2926, in map
with Pool(nb_of_missing_shards, initargs=initargs, initializer=initializer) as pool:
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 215, in __init__
self._repopulate_pool()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 306, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 329, in _repopulate_pool_static
w.start()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/process.py", line 121, in start
self._popen = self._Popen(self)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 288, in _Popen
return Popen(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 32, in __init__
super().__init__(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_fork.py", line 19, in __init__
self._launch(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 42, in _launch
prep_data = spawn.get_preparation_data(process_obj._name)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 134, in _check_not_importing_main
raise RuntimeError('''
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
```
So then I put the last line under a `if __name__ == '__main__':` block. Then the code snippet seemed to work, but it seemed that it's only leveraging a single GPU (based on monitoring `nvidia-smi`):
```
Mon Aug 28 12:19:24 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.01 Driver Version: 515.65.01 CUDA Version: 11.7 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA A100-SXM... On | 00000000:01:00.0 Off | 0 |
| N/A 55C P0 76W / 275W | 8747MiB / 81920MiB | 0% Default |
| | | Disabled |
+-------------------------------+----------------------+----------------------+
| 1 NVIDIA A100-SXM... On | 00000000:47:00.0 Off | 0 |
| N/A 67C P0 274W / 275W | 59835MiB / 81920MiB | 100% Default |
| | | Disabled |
```
Both GPUs should have equal GPU usage, but I've always noticed that the last GPU has way more usage than the other ones. This made me think that `os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())` might not work inside a Python script, especially if done after importing PyTorch?
### Motivation
Would be great to clarify how to do multi-GPU data processing.
### Your contribution
If my code snippet can be fixed, I can contribute it to the docs :)
Indeed `if __name__ == "__main__"` is important in this case.
Not sure about the imbalanced GPU usage though, but maybe you can try using the `torch.cuda.device` context manager ?
> also, should I do it like this or use nn.DataParallel?
In this case you wouldn't need a multiprocessed map no ? Since nn.DataParallel would take care of parallelism | [
-0.13726481795310974,
-0.43240639567375183,
-0.001979593187570572,
0.09065330773591995,
-0.10275635123252869,
0.048385635018348694,
0.39975813031196594,
0.003309808671474457,
0.1566070318222046,
0.22367125749588013,
0.1868710219860077,
0.23762893676757812,
0.19287052750587463,
0.5128408074378967,
0.522918701171875,
-0.32018184661865234,
0.11813603341579437,
-0.22682499885559082,
0.33320340514183044,
0.1273239254951477,
-0.18765708804130554,
0.3333667814731598,
-0.09929713606834412,
0.215697780251503,
-0.4721122682094574,
-0.2038276344537735,
-0.28530845046043396,
0.03162965551018715,
0.16063891351222992,
-0.22111979126930237,
-0.09847809374332428,
0.298068642616272,
0.0012909993529319763,
0.6303572654724121,
-0.00011646699567791075,
-0.11362777650356293,
0.05465345457196236,
0.016327202320098877,
0.07945813983678818,
-0.177629292011261,
0.22675222158432007,
-0.2504114508628845,
0.10698533803224564,
-0.26256537437438965,
-0.02343132719397545,
-0.028642969205975533,
-0.044210344552993774,
-0.2531892657279968,
0.2555846571922302,
-0.018407993018627167,
0.11944039911031723,
0.16084566712379456,
-0.00857873260974884,
-0.1610921025276184,
-0.3832542598247528,
0.1771220862865448,
0.04658135026693344,
-0.009682543575763702,
0.4095132052898407,
-0.3020716905593872,
-0.12628576159477234,
0.5637154579162598,
-0.02627909556031227,
0.04005734995007515,
-0.1290358304977417,
-0.007826857268810272,
-0.19307777285575867,
-0.3386915326118469,
-0.09387467801570892,
0.13656041026115417,
-0.10574577748775482,
-0.4478246569633484,
-0.44006362557411194,
-0.43075433373451233,
-0.16315262019634247,
-0.47064751386642456,
-0.33834028244018555,
0.20736175775527954,
-0.21800586581230164,
0.06619656085968018,
-0.23226362466812134,
-0.2655092775821686,
0.06610982120037079,
0.022942421957850456,
-0.03881474584341049,
0.22137659788131714,
0.038144513964653015,
0.18081015348434448,
0.2640833854675293,
0.0979112908244133,
-0.12916254997253418,
0.08739263564348221,
0.2578856945037842,
-0.023411016911268234,
-0.6043911576271057,
0.0748874619603157,
0.3175150454044342,
-0.3048141598701477,
0.17235323786735535,
0.11439356207847595,
0.10078545659780502,
0.10357026755809784,
0.06845934689044952,
0.3968272805213928,
-0.18141087889671326,
0.045728348195552826,
-0.23265156149864197,
0.11734238266944885,
0.3198080062866211,
-0.09199150651693344,
0.08039076626300812,
-0.2084348499774933,
-0.07251022011041641,
-0.22268658876419067,
-0.3538980782032013,
0.22539524734020233,
0.2352011501789093,
0.04293382167816162,
-0.032003674656152725,
-0.1665005385875702,
-0.20427000522613525,
-0.0669514611363411,
0.04615724831819534,
0.26968878507614136,
0.22728070616722107,
0.28829044103622437,
0.025303415954113007,
0.17196056246757507,
-0.045768629759550095,
-0.45981329679489136,
-0.22345909476280212,
0.07843558490276337,
-0.27035850286483765,
0.38503459095954895,
0.13989853858947754,
-0.03770642727613449,
0.28386953473091125,
0.21978262066841125,
0.454135537147522,
-0.09292280673980713,
0.5181595683097839,
0.10049033164978027,
0.12257000058889389,
0.14631319046020508,
0.13831278681755066,
0.13250598311424255,
0.47914403676986694,
0.26230233907699585,
-0.20951515436172485,
0.16582340002059937,
-0.22458384931087494,
-0.37102293968200684,
-0.04199288785457611,
0.047635868191719055,
0.1300390064716339,
0.014542641118168831,
-0.2291683703660965,
0.5189156532287598,
0.23879824578762054,
-0.02367641031742096,
0.20874138176441193,
0.014654239639639854,
-0.3141019940376282,
-0.23248054087162018,
0.4379374086856842,
0.5276799201965332,
-0.2623005509376526,
-0.1772947907447815,
0.1776680052280426,
0.10872446745634079,
0.08485651016235352,
0.3919675052165985,
-0.23088431358337402,
0.23045235872268677,
-0.10177546739578247,
0.31368502974510193,
0.03668977692723274,
-0.34959959983825684,
0.154375821352005,
0.41493821144104004,
-0.4368666112422943,
0.02735009789466858,
0.2053980827331543,
0.01394694298505783,
0.10515525937080383,
0.2272937148809433,
0.1648889034986496,
0.37879568338394165,
-0.2669222354888916,
0.18421384692192078,
-0.026782631874084473,
-0.16408276557922363,
0.22497117519378662,
0.07652550935745239,
0.008983400650322437,
-0.07891934365034103,
-0.2709106206893921,
-0.1401703953742981,
0.31071731448173523,
-0.3887564539909363,
-0.08686745166778564,
-0.003976590000092983,
0.42369771003723145,
-0.046889521181583405,
0.134732186794281,
-0.23883652687072754,
-0.07879096269607544,
0.25001955032348633,
-0.05789417773485184,
0.09703810513019562,
0.036940980702638626,
-0.2642768621444702,
0.2818697690963745,
-0.03131144866347313,
-0.23275980353355408,
-0.4970204830169678,
0.0697963535785675,
0.12452025711536407,
-0.02884995937347412,
-0.10219292342662811,
-0.11276303231716156,
0.3690639138221741,
-0.1273595690727234,
-0.01789390668272972,
-0.28777608275413513,
0.20377084612846375,
-0.0831594318151474,
-0.3235185742378235,
-0.1924331933259964,
-0.021928466856479645,
0.18652690947055817,
-0.10716603696346283,
-0.03560876473784447,
0.30218347907066345,
0.29763805866241455,
0.04366501420736313,
0.03703790530562401,
0.31927424669265747,
0.3217100203037262,
0.0003169253468513489,
0.09845403581857681,
0.13694003224372864,
-0.14091072976589203,
-0.10977359861135483,
-0.18560287356376648,
0.46328622102737427,
0.11350454390048981,
0.24202296137809753,
-0.08600223809480667,
0.06320515275001526,
0.10767901688814163,
0.1716879904270172,
-0.1542675495147705,
0.20352287590503693,
0.23374557495117188,
0.13665816187858582,
0.218779057264328,
-0.3072965741157532,
-0.5030412077903748,
0.19718724489212036,
0.31892287731170654,
-0.11530224233865738,
0.13879665732383728,
0.03964545577764511,
-0.004091810435056686,
0.05304737389087677,
0.26514720916748047,
-0.23469361662864685,
0.018823523074388504,
0.16371455788612366,
0.048439908772706985,
0.08198543637990952,
-0.21254703402519226,
-0.08612753450870514,
0.003513820469379425,
0.036425914615392685,
0.08501167595386505,
-0.08011548221111298,
0.12098909914493561,
-0.14708596467971802,
-0.08864250779151917,
-0.29509812593460083,
0.263865202665329,
-0.14647458493709564,
-0.28411632776260376,
0.2300937920808792,
-0.1244259625673294,
-0.12683697044849396,
-0.3070197105407715,
-0.22900371253490448,
-0.26795491576194763,
-0.10462262481451035,
-0.04953736066818237,
0.13317473232746124,
0.059228651225566864,
0.26202845573425293,
0.05757424980401993,
0.4001174867153168,
-0.05412260815501213,
-0.12754014134407043,
0.15420980751514435,
-0.10009711235761642,
0.02882632613182068,
-0.027363119646906853,
0.20304705202579498,
-0.002792973071336746,
0.2650507688522339,
0.27797994017601013,
0.05390234291553497,
-0.2836598753929138,
-0.6495156288146973,
0.10735151171684265,
-0.05230918154120445,
-0.043283797800540924,
0.168809711933136,
-0.22204437851905823,
0.1279846727848053,
-0.12628042697906494,
0.09973480552434921,
-0.2412632405757904,
-0.17246529459953308,
-0.11694647371768951,
0.04209209606051445,
-0.018522538244724274,
-0.34055814146995544,
-0.1257685124874115,
0.03451240807771683,
-0.33644556999206543,
0.7512093782424927,
-0.26782894134521484,
0.18522165715694427,
-0.3420449495315552,
0.21844811737537384,
0.41732317209243774,
-0.07706023752689362,
-0.10423856973648071,
0.12207566946744919,
-0.2222617268562317,
0.04044001176953316,
-0.38753432035446167,
-0.19561229646205902,
-0.15322504937648773,
0.12778699398040771,
0.2567480802536011,
0.022582925856113434,
-0.11081362515687943,
-0.2836706042289734,
-0.08860928565263748,
0.11050793528556824,
0.048427239060401917,
0.2568923830986023,
0.36643534898757935,
-0.11063946038484573,
0.020293205976486206,
0.031001023948192596,
-0.4878546893596649,
0.26738688349723816,
0.14533013105392456,
-0.10296861827373505,
0.0015516206622123718,
0.5334910750389099,
0.33905237913131714,
0.7606999278068542,
0.21592170000076294,
0.007465981878340244,
0.10215451568365097,
-0.0057657817378640175,
-0.0042434558272361755,
0.10331498831510544,
-0.17316995561122894,
-0.03305227309465408,
-0.4584881663322449,
-0.1876434087753296,
0.015719901770353317,
-0.08352261781692505,
-0.09690897911787033,
-0.006443299353122711,
-0.12017791718244553,
-0.2085135281085968,
-0.08613231033086777,
0.10566562414169312,
-0.21639077365398407,
0.30132338404655457,
-0.42527252435684204,
-0.13490456342697144,
-0.2777252197265625,
0.5468804836273193,
0.14954550564289093,
0.10399559885263443,
0.44300156831741333,
-0.029097937047481537,
-0.14628726243972778,
-0.23774603009223938,
-0.2053356021642685,
0.22539299726486206,
-0.08108101785182953,
0.028677653521299362,
-0.09386318922042847,
0.04756540060043335,
-0.16022159159183502,
-0.3425484001636505,
0.9175221920013428,
-0.05383811146020889,
-0.24073535203933716,
0.00021738559007644653,
-0.7767176628112793,
-0.0967627465724945,
0.0002802610397338867,
-0.17745940387248993,
0.08329543471336365,
0.3165305554866791,
0.3290862441062927,
-0.13441196084022522,
-0.08487619459629059,
0.16684913635253906,
-0.11666533350944519,
-0.12171293795108795,
0.053184475749731064,
-0.2602272629737854,
-0.26665198802948,
-0.46504709124565125,
0.28710535168647766,
0.2763529419898987,
-0.17984262108802795,
-0.34102320671081543,
0.08445829153060913,
-0.018273696303367615,
0.05998878926038742,
0.09060539305210114,
0.11562949419021606,
-0.03739555552601814,
0.013924561440944672,
-0.021817386150360107,
0.34926533699035645,
0.10265977680683136,
0.014078659936785698,
0.11376459896564484,
-0.08603110909461975,
-0.48909792304039,
0.2950676679611206,
0.010424274951219559,
0.6215792894363403,
0.2701704502105713,
0.11215329170227051,
0.40111279487609863,
0.2684306502342224,
0.1053607314825058,
-0.1362503468990326,
0.19916892051696777,
0.21539852023124695,
0.24353757500648499,
-0.12264867126941681,
-0.5439552068710327,
0.46222564578056335,
0.3498312532901764,
-0.0706014409661293,
0.6956338286399841,
-0.037806328386068344,
-0.09816247224807739,
-0.03284687548875809,
0.2578716278076172,
0.6009117364883423,
-0.10265389829874039,
0.29417839646339417,
-0.0874977558851242,
-0.492634654045105,
0.4086037278175354,
-0.5855088829994202,
0.15324729681015015,
-0.3028750419616699,
-0.28081363439559937,
-0.019572757184505463,
-0.2748074531555176,
0.2435486912727356,
0.12862132489681244,
-0.36670857667922974,
0.19993901252746582,
0.04349295794963837,
-0.08330457657575607,
0.11621308326721191,
0.4153295159339905,
0.3163139522075653,
-0.5045558214187622,
-0.06624080240726471,
0.04681944474577904,
0.0752277821302414,
0.03474888205528259,
-0.1827327013015747,
-0.19388322532176971,
0.21158930659294128,
-0.11793903261423111,
-0.45810553431510925,
-0.09967547655105591,
-0.5606222748756409,
0.1195961982011795,
-0.22522467374801636,
-0.04953708499670029,
0.28914472460746765,
0.11357800662517548,
0.32963240146636963,
0.07611825317144394,
-0.19609446823596954,
-0.18980371952056885,
-0.048469480127096176,
-0.01310904324054718,
-0.3161090612411499,
-0.48386234045028687,
0.14349395036697388,
-0.06770458072423935,
-0.3479110896587372,
0.19163993000984192,
0.28515103459358215,
-0.06123730167746544,
-0.1872701495885849,
0.12385401129722595,
-0.325794517993927,
0.27604687213897705,
0.03570143133401871,
0.2613053619861603,
0.043633922934532166,
-0.3656446933746338,
0.03794925659894943,
0.27996742725372314,
-0.4606718122959137,
-0.14914073050022125,
-0.2895555794239044,
0.0005127489566802979,
-0.04743792489171028,
0.12466670572757721,
0.06106588989496231,
-0.35553568601608276,
0.00539616122841835,
0.5013360381126404,
0.046341873705387115,
-0.05394354462623596,
-0.1692665070295334,
0.3088708519935608,
-0.16455970704555511,
0.12646351754665375,
-0.30013763904571533,
-0.20930084586143494,
0.065439373254776,
-0.06849654018878937,
-0.04930827394127846,
-0.09942927956581116,
-0.14508076012134552,
0.0263046994805336,
-0.3648007810115814,
0.08772922307252884,
-0.17311403155326843,
0.21729709208011627,
0.13906466960906982,
0.41336095333099365,
0.1406976878643036,
0.4890801012516022,
-0.24726231396198273,
0.20370082557201385,
-0.019625745713710785,
0.05941655859351158,
0.18679526448249817,
0.11418695002794266,
0.034603383392095566,
0.17439121007919312,
-0.11191348731517792,
0.22132134437561035,
0.10593022406101227,
-0.10948453843593597,
-0.20515191555023193,
0.1088176965713501,
0.06157035008072853,
0.10006970167160034,
0.40128087997436523,
0.09312115609645844,
-0.23191124200820923,
-0.18796519935131073,
0.4555113911628723,
0.07979334890842438,
-0.04768458753824234,
0.19658972322940826,
0.08526930212974548,
-0.027219392359256744,
-0.1253235638141632,
-0.09192335605621338,
0.17993953824043274,
-0.18317358195781708,
0.4003690481185913,
0.24932703375816345,
0.07283224910497665,
0.060439951717853546,
-0.04592963308095932,
-0.027615081518888474,
0.3071083724498749,
-0.04781337082386017,
-0.20252485573291779,
-0.05196281522512436,
-0.30233967304229736,
-0.28378042578697205,
0.37536418437957764,
-0.011011844500899315,
0.006591185927391052,
0.25938498973846436,
0.12824416160583496,
0.10668408125638962,
-0.17205020785331726,
0.009691204875707626,
0.20802587270736694,
-0.5298482179641724,
0.36970120668411255,
0.47729846835136414,
0.4435214698314667,
0.6078863739967346,
-0.014679763466119766,
-0.04493133723735809,
0.045707184821367264,
-0.14442098140716553,
0.3065044581890106,
0.012277120724320412,
-0.15027236938476562,
0.21000783145427704,
0.23948028683662415,
0.11469853669404984,
0.21850501000881195,
0.055695828050374985,
0.04671526327729225,
0.491743266582489,
0.0735761895775795,
-0.07577389478683472,
0.46394893527030945,
-0.10315664112567902,
-0.09439939260482788,
-0.3294445276260376,
-0.10423195362091064,
0.04103762283921242,
-0.34252363443374634,
0.22060483694076538,
-0.1431080400943756,
-0.28316864371299744,
-0.1700475513935089,
0.5426687002182007,
-0.1652354747056961,
-0.2160312533378601,
-0.100367471575737,
-0.07325045764446259,
-0.013395056128501892,
-0.11439036577939987,
0.21969474852085114,
-0.21504563093185425,
0.6112523674964905,
-0.10155933350324631,
0.03286806866526604,
0.0357804149389267,
-0.23426973819732666,
0.21196821331977844,
0.21250300109386444,
-0.011693425476551056,
0.004650669172406197,
0.29094818234443665,
-0.33940714597702026,
-0.2513791620731354,
0.26019933819770813,
0.4433901011943817,
0.07676401734352112,
-0.2038024365901947,
0.31794875860214233,
-0.04354413226246834,
0.22492918372154236,
0.056538671255111694,
0.013942830264568329,
0.00512576662003994,
0.09120813757181168,
0.11064764112234116,
0.04012264311313629,
-0.032169125974178314,
-0.11943793296813965,
0.15660136938095093,
0.030711360275745392,
-0.3521858751773834,
0.5341164469718933,
-0.31313902139663696,
-0.07604791224002838,
0.08261220157146454,
0.11361046880483627,
-0.4795506000518799,
0.08186614513397217,
0.6961772441864014,
-0.07884850353002548,
-0.26125895977020264,
-0.018569285050034523,
0.03931156545877457,
0.05087910592556,
0.41207537055015564,
0.13600552082061768,
0.34902194142341614,
-0.37971067428588867,
-0.13116556406021118,
-0.42874985933303833,
0.08600163459777832,
-0.23020508885383606,
0.004055827856063843,
0.04612516984343529,
0.20666763186454773,
0.11755794286727905,
0.041799504309892654,
0.042842090129852295,
-0.21543650329113007,
0.08646251261234283,
0.493436723947525,
-0.39323872327804565,
-0.07431508600711823,
-0.4586561918258667,
0.11608097702264786,
0.26705580949783325,
-0.0228530615568161,
-0.03189676254987717,
0.12276636064052582,
-0.054354023188352585,
-0.23559734225273132,
0.23365938663482666,
0.17777302861213684,
-0.03732554614543915,
0.28508949279785156,
0.08073883503675461,
0.3613443374633789,
0.0030187442898750305,
-0.23002752661705017,
-0.03415326029062271,
0.25322073698043823,
-0.4404388964176178,
0.10954134166240692,
-0.10914701968431473,
0.11539486050605774,
-0.18764635920524597,
-0.598824143409729,
-0.44897517561912537,
0.18354636430740356,
0.28004559874534607,
-0.46360889077186584,
-0.04046037793159485,
0.19633376598358154,
0.11692515760660172,
-0.2343721091747284,
0.49372631311416626,
0.5398153066635132,
-0.1500096619129181,
0.13803306221961975,
-0.2924443483352661,
0.025692477822303772,
0.3646093010902405,
-0.3754533529281616,
-0.21186792850494385,
-0.44899889826774597,
0.3961881399154663,
-0.13880832493305206,
0.13918673992156982,
-0.6909026503562927,
-0.07574541121721268,
0.1821945309638977,
0.05991608276963234,
-0.27545636892318726,
0.47606807947158813,
0.02520240843296051,
-0.2726511061191559,
-0.19228467345237732,
-0.048896290361881256,
0.2035464346408844,
-0.1772707998752594,
0.011682920157909393,
-0.3404439687728882
] |
https://github.com/huggingface/datasets/issues/6186 | I think the issue is that we set `CUDA_VISIBLE_DEVICES` after pytorch is imported ?
We should use `torch.cuda.set_device(...)` instead | Feature request: add code example of multi-GPU processing | ### Feature request
Would be great to add a code example of how to do multi-GPU processing with 🤗 Datasets in the documentation. cc @stevhliu
Currently the docs has a small [section](https://huggingface.co/docs/datasets/v2.3.2/en/process#map) on this saying "your big GPU call goes here", however it didn't work for me out-of-the-box.
Let's say you have a PyTorch model that can do translation, and you have multiple GPUs. In that case, you'd like to duplicate the model on each GPU, each processing (translating) a chunk of the data in parallel.
Here's how I tried to do that:
```
from datasets import load_dataset
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
from multiprocess import set_start_method
import torch
import os
dataset = load_dataset("mlfoundations/datacomp_small")
tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-distilled-600M")
model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-distilled-600M")
# put model on each available GPU
# also, should I do it like this or use nn.DataParallel?
model.to("cuda:0")
model.to("cuda:1")
set_start_method("spawn")
def translate_captions(batch, rank):
os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())
texts = batch["text"]
inputs = tokenizer(texts, padding=True, truncation=True, return_tensors="pt").to(model.device)
translated_tokens = model.generate(
**inputs, forced_bos_token_id=tokenizer.lang_code_to_id["eng_Latn"], max_length=30
)
translated_texts = tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)
batch["translated_text"] = translated_texts
return batch
updated_dataset = dataset.map(translate_captions, with_rank=True, num_proc=2, batched=True, batch_size=256)
```
I've personally tried running this script on a machine with 2 A100 GPUs.
## Error 1
Running the code snippet above from the terminal (python script.py) resulted in the following error:
```
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 125, in _main
prepare(preparation_data)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 289, in run_path
return _run_module_code(code, init_globals, run_name,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 96, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/niels/python_projects/datacomp/datasets_multi_gpu.py", line 16, in <module>
set_start_method("spawn")
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 247, in set_start_method
raise RuntimeError('context has already been set')
RuntimeError: context has already been set
```
## Error 2
Then, based on [this Stackoverflow answer](https://stackoverflow.com/a/71616344/7762882), I put the `set_start_method("spawn")` section in a try: catch block. This resulted in the following error:
```
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/dataset_dict.py", line 817, in <dictcomp>
k: dataset.map(
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2926, in map
with Pool(nb_of_missing_shards, initargs=initargs, initializer=initializer) as pool:
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 215, in __init__
self._repopulate_pool()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 306, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 329, in _repopulate_pool_static
w.start()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/process.py", line 121, in start
self._popen = self._Popen(self)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 288, in _Popen
return Popen(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 32, in __init__
super().__init__(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_fork.py", line 19, in __init__
self._launch(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 42, in _launch
prep_data = spawn.get_preparation_data(process_obj._name)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 134, in _check_not_importing_main
raise RuntimeError('''
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
```
So then I put the last line under a `if __name__ == '__main__':` block. Then the code snippet seemed to work, but it seemed that it's only leveraging a single GPU (based on monitoring `nvidia-smi`):
```
Mon Aug 28 12:19:24 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.01 Driver Version: 515.65.01 CUDA Version: 11.7 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA A100-SXM... On | 00000000:01:00.0 Off | 0 |
| N/A 55C P0 76W / 275W | 8747MiB / 81920MiB | 0% Default |
| | | Disabled |
+-------------------------------+----------------------+----------------------+
| 1 NVIDIA A100-SXM... On | 00000000:47:00.0 Off | 0 |
| N/A 67C P0 274W / 275W | 59835MiB / 81920MiB | 100% Default |
| | | Disabled |
```
Both GPUs should have equal GPU usage, but I've always noticed that the last GPU has way more usage than the other ones. This made me think that `os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())` might not work inside a Python script, especially if done after importing PyTorch?
### Motivation
Would be great to clarify how to do multi-GPU data processing.
### Your contribution
If my code snippet can be fixed, I can contribute it to the docs :) | 19 | Feature request: add code example of multi-GPU processing
### Feature request
Would be great to add a code example of how to do multi-GPU processing with 🤗 Datasets in the documentation. cc @stevhliu
Currently the docs has a small [section](https://huggingface.co/docs/datasets/v2.3.2/en/process#map) on this saying "your big GPU call goes here", however it didn't work for me out-of-the-box.
Let's say you have a PyTorch model that can do translation, and you have multiple GPUs. In that case, you'd like to duplicate the model on each GPU, each processing (translating) a chunk of the data in parallel.
Here's how I tried to do that:
```
from datasets import load_dataset
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
from multiprocess import set_start_method
import torch
import os
dataset = load_dataset("mlfoundations/datacomp_small")
tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-distilled-600M")
model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-distilled-600M")
# put model on each available GPU
# also, should I do it like this or use nn.DataParallel?
model.to("cuda:0")
model.to("cuda:1")
set_start_method("spawn")
def translate_captions(batch, rank):
os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())
texts = batch["text"]
inputs = tokenizer(texts, padding=True, truncation=True, return_tensors="pt").to(model.device)
translated_tokens = model.generate(
**inputs, forced_bos_token_id=tokenizer.lang_code_to_id["eng_Latn"], max_length=30
)
translated_texts = tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)
batch["translated_text"] = translated_texts
return batch
updated_dataset = dataset.map(translate_captions, with_rank=True, num_proc=2, batched=True, batch_size=256)
```
I've personally tried running this script on a machine with 2 A100 GPUs.
## Error 1
Running the code snippet above from the terminal (python script.py) resulted in the following error:
```
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 125, in _main
prepare(preparation_data)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 289, in run_path
return _run_module_code(code, init_globals, run_name,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 96, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/niels/python_projects/datacomp/datasets_multi_gpu.py", line 16, in <module>
set_start_method("spawn")
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 247, in set_start_method
raise RuntimeError('context has already been set')
RuntimeError: context has already been set
```
## Error 2
Then, based on [this Stackoverflow answer](https://stackoverflow.com/a/71616344/7762882), I put the `set_start_method("spawn")` section in a try: catch block. This resulted in the following error:
```
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/dataset_dict.py", line 817, in <dictcomp>
k: dataset.map(
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2926, in map
with Pool(nb_of_missing_shards, initargs=initargs, initializer=initializer) as pool:
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 215, in __init__
self._repopulate_pool()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 306, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 329, in _repopulate_pool_static
w.start()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/process.py", line 121, in start
self._popen = self._Popen(self)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 288, in _Popen
return Popen(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 32, in __init__
super().__init__(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_fork.py", line 19, in __init__
self._launch(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 42, in _launch
prep_data = spawn.get_preparation_data(process_obj._name)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 134, in _check_not_importing_main
raise RuntimeError('''
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
```
So then I put the last line under a `if __name__ == '__main__':` block. Then the code snippet seemed to work, but it seemed that it's only leveraging a single GPU (based on monitoring `nvidia-smi`):
```
Mon Aug 28 12:19:24 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.01 Driver Version: 515.65.01 CUDA Version: 11.7 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA A100-SXM... On | 00000000:01:00.0 Off | 0 |
| N/A 55C P0 76W / 275W | 8747MiB / 81920MiB | 0% Default |
| | | Disabled |
+-------------------------------+----------------------+----------------------+
| 1 NVIDIA A100-SXM... On | 00000000:47:00.0 Off | 0 |
| N/A 67C P0 274W / 275W | 59835MiB / 81920MiB | 100% Default |
| | | Disabled |
```
Both GPUs should have equal GPU usage, but I've always noticed that the last GPU has way more usage than the other ones. This made me think that `os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())` might not work inside a Python script, especially if done after importing PyTorch?
### Motivation
Would be great to clarify how to do multi-GPU data processing.
### Your contribution
If my code snippet can be fixed, I can contribute it to the docs :)
I think the issue is that we set `CUDA_VISIBLE_DEVICES` after pytorch is imported ?
We should use `torch.cuda.set_device(...)` instead | [
-0.13726481795310974,
-0.43240639567375183,
-0.001979593187570572,
0.09065330773591995,
-0.10275635123252869,
0.048385635018348694,
0.39975813031196594,
0.003309808671474457,
0.1566070318222046,
0.22367125749588013,
0.1868710219860077,
0.23762893676757812,
0.19287052750587463,
0.5128408074378967,
0.522918701171875,
-0.32018184661865234,
0.11813603341579437,
-0.22682499885559082,
0.33320340514183044,
0.1273239254951477,
-0.18765708804130554,
0.3333667814731598,
-0.09929713606834412,
0.215697780251503,
-0.4721122682094574,
-0.2038276344537735,
-0.28530845046043396,
0.03162965551018715,
0.16063891351222992,
-0.22111979126930237,
-0.09847809374332428,
0.298068642616272,
0.0012909993529319763,
0.6303572654724121,
-0.00011646699567791075,
-0.11362777650356293,
0.05465345457196236,
0.016327202320098877,
0.07945813983678818,
-0.177629292011261,
0.22675222158432007,
-0.2504114508628845,
0.10698533803224564,
-0.26256537437438965,
-0.02343132719397545,
-0.028642969205975533,
-0.044210344552993774,
-0.2531892657279968,
0.2555846571922302,
-0.018407993018627167,
0.11944039911031723,
0.16084566712379456,
-0.00857873260974884,
-0.1610921025276184,
-0.3832542598247528,
0.1771220862865448,
0.04658135026693344,
-0.009682543575763702,
0.4095132052898407,
-0.3020716905593872,
-0.12628576159477234,
0.5637154579162598,
-0.02627909556031227,
0.04005734995007515,
-0.1290358304977417,
-0.007826857268810272,
-0.19307777285575867,
-0.3386915326118469,
-0.09387467801570892,
0.13656041026115417,
-0.10574577748775482,
-0.4478246569633484,
-0.44006362557411194,
-0.43075433373451233,
-0.16315262019634247,
-0.47064751386642456,
-0.33834028244018555,
0.20736175775527954,
-0.21800586581230164,
0.06619656085968018,
-0.23226362466812134,
-0.2655092775821686,
0.06610982120037079,
0.022942421957850456,
-0.03881474584341049,
0.22137659788131714,
0.038144513964653015,
0.18081015348434448,
0.2640833854675293,
0.0979112908244133,
-0.12916254997253418,
0.08739263564348221,
0.2578856945037842,
-0.023411016911268234,
-0.6043911576271057,
0.0748874619603157,
0.3175150454044342,
-0.3048141598701477,
0.17235323786735535,
0.11439356207847595,
0.10078545659780502,
0.10357026755809784,
0.06845934689044952,
0.3968272805213928,
-0.18141087889671326,
0.045728348195552826,
-0.23265156149864197,
0.11734238266944885,
0.3198080062866211,
-0.09199150651693344,
0.08039076626300812,
-0.2084348499774933,
-0.07251022011041641,
-0.22268658876419067,
-0.3538980782032013,
0.22539524734020233,
0.2352011501789093,
0.04293382167816162,
-0.032003674656152725,
-0.1665005385875702,
-0.20427000522613525,
-0.0669514611363411,
0.04615724831819534,
0.26968878507614136,
0.22728070616722107,
0.28829044103622437,
0.025303415954113007,
0.17196056246757507,
-0.045768629759550095,
-0.45981329679489136,
-0.22345909476280212,
0.07843558490276337,
-0.27035850286483765,
0.38503459095954895,
0.13989853858947754,
-0.03770642727613449,
0.28386953473091125,
0.21978262066841125,
0.454135537147522,
-0.09292280673980713,
0.5181595683097839,
0.10049033164978027,
0.12257000058889389,
0.14631319046020508,
0.13831278681755066,
0.13250598311424255,
0.47914403676986694,
0.26230233907699585,
-0.20951515436172485,
0.16582340002059937,
-0.22458384931087494,
-0.37102293968200684,
-0.04199288785457611,
0.047635868191719055,
0.1300390064716339,
0.014542641118168831,
-0.2291683703660965,
0.5189156532287598,
0.23879824578762054,
-0.02367641031742096,
0.20874138176441193,
0.014654239639639854,
-0.3141019940376282,
-0.23248054087162018,
0.4379374086856842,
0.5276799201965332,
-0.2623005509376526,
-0.1772947907447815,
0.1776680052280426,
0.10872446745634079,
0.08485651016235352,
0.3919675052165985,
-0.23088431358337402,
0.23045235872268677,
-0.10177546739578247,
0.31368502974510193,
0.03668977692723274,
-0.34959959983825684,
0.154375821352005,
0.41493821144104004,
-0.4368666112422943,
0.02735009789466858,
0.2053980827331543,
0.01394694298505783,
0.10515525937080383,
0.2272937148809433,
0.1648889034986496,
0.37879568338394165,
-0.2669222354888916,
0.18421384692192078,
-0.026782631874084473,
-0.16408276557922363,
0.22497117519378662,
0.07652550935745239,
0.008983400650322437,
-0.07891934365034103,
-0.2709106206893921,
-0.1401703953742981,
0.31071731448173523,
-0.3887564539909363,
-0.08686745166778564,
-0.003976590000092983,
0.42369771003723145,
-0.046889521181583405,
0.134732186794281,
-0.23883652687072754,
-0.07879096269607544,
0.25001955032348633,
-0.05789417773485184,
0.09703810513019562,
0.036940980702638626,
-0.2642768621444702,
0.2818697690963745,
-0.03131144866347313,
-0.23275980353355408,
-0.4970204830169678,
0.0697963535785675,
0.12452025711536407,
-0.02884995937347412,
-0.10219292342662811,
-0.11276303231716156,
0.3690639138221741,
-0.1273595690727234,
-0.01789390668272972,
-0.28777608275413513,
0.20377084612846375,
-0.0831594318151474,
-0.3235185742378235,
-0.1924331933259964,
-0.021928466856479645,
0.18652690947055817,
-0.10716603696346283,
-0.03560876473784447,
0.30218347907066345,
0.29763805866241455,
0.04366501420736313,
0.03703790530562401,
0.31927424669265747,
0.3217100203037262,
0.0003169253468513489,
0.09845403581857681,
0.13694003224372864,
-0.14091072976589203,
-0.10977359861135483,
-0.18560287356376648,
0.46328622102737427,
0.11350454390048981,
0.24202296137809753,
-0.08600223809480667,
0.06320515275001526,
0.10767901688814163,
0.1716879904270172,
-0.1542675495147705,
0.20352287590503693,
0.23374557495117188,
0.13665816187858582,
0.218779057264328,
-0.3072965741157532,
-0.5030412077903748,
0.19718724489212036,
0.31892287731170654,
-0.11530224233865738,
0.13879665732383728,
0.03964545577764511,
-0.004091810435056686,
0.05304737389087677,
0.26514720916748047,
-0.23469361662864685,
0.018823523074388504,
0.16371455788612366,
0.048439908772706985,
0.08198543637990952,
-0.21254703402519226,
-0.08612753450870514,
0.003513820469379425,
0.036425914615392685,
0.08501167595386505,
-0.08011548221111298,
0.12098909914493561,
-0.14708596467971802,
-0.08864250779151917,
-0.29509812593460083,
0.263865202665329,
-0.14647458493709564,
-0.28411632776260376,
0.2300937920808792,
-0.1244259625673294,
-0.12683697044849396,
-0.3070197105407715,
-0.22900371253490448,
-0.26795491576194763,
-0.10462262481451035,
-0.04953736066818237,
0.13317473232746124,
0.059228651225566864,
0.26202845573425293,
0.05757424980401993,
0.4001174867153168,
-0.05412260815501213,
-0.12754014134407043,
0.15420980751514435,
-0.10009711235761642,
0.02882632613182068,
-0.027363119646906853,
0.20304705202579498,
-0.002792973071336746,
0.2650507688522339,
0.27797994017601013,
0.05390234291553497,
-0.2836598753929138,
-0.6495156288146973,
0.10735151171684265,
-0.05230918154120445,
-0.043283797800540924,
0.168809711933136,
-0.22204437851905823,
0.1279846727848053,
-0.12628042697906494,
0.09973480552434921,
-0.2412632405757904,
-0.17246529459953308,
-0.11694647371768951,
0.04209209606051445,
-0.018522538244724274,
-0.34055814146995544,
-0.1257685124874115,
0.03451240807771683,
-0.33644556999206543,
0.7512093782424927,
-0.26782894134521484,
0.18522165715694427,
-0.3420449495315552,
0.21844811737537384,
0.41732317209243774,
-0.07706023752689362,
-0.10423856973648071,
0.12207566946744919,
-0.2222617268562317,
0.04044001176953316,
-0.38753432035446167,
-0.19561229646205902,
-0.15322504937648773,
0.12778699398040771,
0.2567480802536011,
0.022582925856113434,
-0.11081362515687943,
-0.2836706042289734,
-0.08860928565263748,
0.11050793528556824,
0.048427239060401917,
0.2568923830986023,
0.36643534898757935,
-0.11063946038484573,
0.020293205976486206,
0.031001023948192596,
-0.4878546893596649,
0.26738688349723816,
0.14533013105392456,
-0.10296861827373505,
0.0015516206622123718,
0.5334910750389099,
0.33905237913131714,
0.7606999278068542,
0.21592170000076294,
0.007465981878340244,
0.10215451568365097,
-0.0057657817378640175,
-0.0042434558272361755,
0.10331498831510544,
-0.17316995561122894,
-0.03305227309465408,
-0.4584881663322449,
-0.1876434087753296,
0.015719901770353317,
-0.08352261781692505,
-0.09690897911787033,
-0.006443299353122711,
-0.12017791718244553,
-0.2085135281085968,
-0.08613231033086777,
0.10566562414169312,
-0.21639077365398407,
0.30132338404655457,
-0.42527252435684204,
-0.13490456342697144,
-0.2777252197265625,
0.5468804836273193,
0.14954550564289093,
0.10399559885263443,
0.44300156831741333,
-0.029097937047481537,
-0.14628726243972778,
-0.23774603009223938,
-0.2053356021642685,
0.22539299726486206,
-0.08108101785182953,
0.028677653521299362,
-0.09386318922042847,
0.04756540060043335,
-0.16022159159183502,
-0.3425484001636505,
0.9175221920013428,
-0.05383811146020889,
-0.24073535203933716,
0.00021738559007644653,
-0.7767176628112793,
-0.0967627465724945,
0.0002802610397338867,
-0.17745940387248993,
0.08329543471336365,
0.3165305554866791,
0.3290862441062927,
-0.13441196084022522,
-0.08487619459629059,
0.16684913635253906,
-0.11666533350944519,
-0.12171293795108795,
0.053184475749731064,
-0.2602272629737854,
-0.26665198802948,
-0.46504709124565125,
0.28710535168647766,
0.2763529419898987,
-0.17984262108802795,
-0.34102320671081543,
0.08445829153060913,
-0.018273696303367615,
0.05998878926038742,
0.09060539305210114,
0.11562949419021606,
-0.03739555552601814,
0.013924561440944672,
-0.021817386150360107,
0.34926533699035645,
0.10265977680683136,
0.014078659936785698,
0.11376459896564484,
-0.08603110909461975,
-0.48909792304039,
0.2950676679611206,
0.010424274951219559,
0.6215792894363403,
0.2701704502105713,
0.11215329170227051,
0.40111279487609863,
0.2684306502342224,
0.1053607314825058,
-0.1362503468990326,
0.19916892051696777,
0.21539852023124695,
0.24353757500648499,
-0.12264867126941681,
-0.5439552068710327,
0.46222564578056335,
0.3498312532901764,
-0.0706014409661293,
0.6956338286399841,
-0.037806328386068344,
-0.09816247224807739,
-0.03284687548875809,
0.2578716278076172,
0.6009117364883423,
-0.10265389829874039,
0.29417839646339417,
-0.0874977558851242,
-0.492634654045105,
0.4086037278175354,
-0.5855088829994202,
0.15324729681015015,
-0.3028750419616699,
-0.28081363439559937,
-0.019572757184505463,
-0.2748074531555176,
0.2435486912727356,
0.12862132489681244,
-0.36670857667922974,
0.19993901252746582,
0.04349295794963837,
-0.08330457657575607,
0.11621308326721191,
0.4153295159339905,
0.3163139522075653,
-0.5045558214187622,
-0.06624080240726471,
0.04681944474577904,
0.0752277821302414,
0.03474888205528259,
-0.1827327013015747,
-0.19388322532176971,
0.21158930659294128,
-0.11793903261423111,
-0.45810553431510925,
-0.09967547655105591,
-0.5606222748756409,
0.1195961982011795,
-0.22522467374801636,
-0.04953708499670029,
0.28914472460746765,
0.11357800662517548,
0.32963240146636963,
0.07611825317144394,
-0.19609446823596954,
-0.18980371952056885,
-0.048469480127096176,
-0.01310904324054718,
-0.3161090612411499,
-0.48386234045028687,
0.14349395036697388,
-0.06770458072423935,
-0.3479110896587372,
0.19163993000984192,
0.28515103459358215,
-0.06123730167746544,
-0.1872701495885849,
0.12385401129722595,
-0.325794517993927,
0.27604687213897705,
0.03570143133401871,
0.2613053619861603,
0.043633922934532166,
-0.3656446933746338,
0.03794925659894943,
0.27996742725372314,
-0.4606718122959137,
-0.14914073050022125,
-0.2895555794239044,
0.0005127489566802979,
-0.04743792489171028,
0.12466670572757721,
0.06106588989496231,
-0.35553568601608276,
0.00539616122841835,
0.5013360381126404,
0.046341873705387115,
-0.05394354462623596,
-0.1692665070295334,
0.3088708519935608,
-0.16455970704555511,
0.12646351754665375,
-0.30013763904571533,
-0.20930084586143494,
0.065439373254776,
-0.06849654018878937,
-0.04930827394127846,
-0.09942927956581116,
-0.14508076012134552,
0.0263046994805336,
-0.3648007810115814,
0.08772922307252884,
-0.17311403155326843,
0.21729709208011627,
0.13906466960906982,
0.41336095333099365,
0.1406976878643036,
0.4890801012516022,
-0.24726231396198273,
0.20370082557201385,
-0.019625745713710785,
0.05941655859351158,
0.18679526448249817,
0.11418695002794266,
0.034603383392095566,
0.17439121007919312,
-0.11191348731517792,
0.22132134437561035,
0.10593022406101227,
-0.10948453843593597,
-0.20515191555023193,
0.1088176965713501,
0.06157035008072853,
0.10006970167160034,
0.40128087997436523,
0.09312115609645844,
-0.23191124200820923,
-0.18796519935131073,
0.4555113911628723,
0.07979334890842438,
-0.04768458753824234,
0.19658972322940826,
0.08526930212974548,
-0.027219392359256744,
-0.1253235638141632,
-0.09192335605621338,
0.17993953824043274,
-0.18317358195781708,
0.4003690481185913,
0.24932703375816345,
0.07283224910497665,
0.060439951717853546,
-0.04592963308095932,
-0.027615081518888474,
0.3071083724498749,
-0.04781337082386017,
-0.20252485573291779,
-0.05196281522512436,
-0.30233967304229736,
-0.28378042578697205,
0.37536418437957764,
-0.011011844500899315,
0.006591185927391052,
0.25938498973846436,
0.12824416160583496,
0.10668408125638962,
-0.17205020785331726,
0.009691204875707626,
0.20802587270736694,
-0.5298482179641724,
0.36970120668411255,
0.47729846835136414,
0.4435214698314667,
0.6078863739967346,
-0.014679763466119766,
-0.04493133723735809,
0.045707184821367264,
-0.14442098140716553,
0.3065044581890106,
0.012277120724320412,
-0.15027236938476562,
0.21000783145427704,
0.23948028683662415,
0.11469853669404984,
0.21850501000881195,
0.055695828050374985,
0.04671526327729225,
0.491743266582489,
0.0735761895775795,
-0.07577389478683472,
0.46394893527030945,
-0.10315664112567902,
-0.09439939260482788,
-0.3294445276260376,
-0.10423195362091064,
0.04103762283921242,
-0.34252363443374634,
0.22060483694076538,
-0.1431080400943756,
-0.28316864371299744,
-0.1700475513935089,
0.5426687002182007,
-0.1652354747056961,
-0.2160312533378601,
-0.100367471575737,
-0.07325045764446259,
-0.013395056128501892,
-0.11439036577939987,
0.21969474852085114,
-0.21504563093185425,
0.6112523674964905,
-0.10155933350324631,
0.03286806866526604,
0.0357804149389267,
-0.23426973819732666,
0.21196821331977844,
0.21250300109386444,
-0.011693425476551056,
0.004650669172406197,
0.29094818234443665,
-0.33940714597702026,
-0.2513791620731354,
0.26019933819770813,
0.4433901011943817,
0.07676401734352112,
-0.2038024365901947,
0.31794875860214233,
-0.04354413226246834,
0.22492918372154236,
0.056538671255111694,
0.013942830264568329,
0.00512576662003994,
0.09120813757181168,
0.11064764112234116,
0.04012264311313629,
-0.032169125974178314,
-0.11943793296813965,
0.15660136938095093,
0.030711360275745392,
-0.3521858751773834,
0.5341164469718933,
-0.31313902139663696,
-0.07604791224002838,
0.08261220157146454,
0.11361046880483627,
-0.4795506000518799,
0.08186614513397217,
0.6961772441864014,
-0.07884850353002548,
-0.26125895977020264,
-0.018569285050034523,
0.03931156545877457,
0.05087910592556,
0.41207537055015564,
0.13600552082061768,
0.34902194142341614,
-0.37971067428588867,
-0.13116556406021118,
-0.42874985933303833,
0.08600163459777832,
-0.23020508885383606,
0.004055827856063843,
0.04612516984343529,
0.20666763186454773,
0.11755794286727905,
0.041799504309892654,
0.042842090129852295,
-0.21543650329113007,
0.08646251261234283,
0.493436723947525,
-0.39323872327804565,
-0.07431508600711823,
-0.4586561918258667,
0.11608097702264786,
0.26705580949783325,
-0.0228530615568161,
-0.03189676254987717,
0.12276636064052582,
-0.054354023188352585,
-0.23559734225273132,
0.23365938663482666,
0.17777302861213684,
-0.03732554614543915,
0.28508949279785156,
0.08073883503675461,
0.3613443374633789,
0.0030187442898750305,
-0.23002752661705017,
-0.03415326029062271,
0.25322073698043823,
-0.4404388964176178,
0.10954134166240692,
-0.10914701968431473,
0.11539486050605774,
-0.18764635920524597,
-0.598824143409729,
-0.44897517561912537,
0.18354636430740356,
0.28004559874534607,
-0.46360889077186584,
-0.04046037793159485,
0.19633376598358154,
0.11692515760660172,
-0.2343721091747284,
0.49372631311416626,
0.5398153066635132,
-0.1500096619129181,
0.13803306221961975,
-0.2924443483352661,
0.025692477822303772,
0.3646093010902405,
-0.3754533529281616,
-0.21186792850494385,
-0.44899889826774597,
0.3961881399154663,
-0.13880832493305206,
0.13918673992156982,
-0.6909026503562927,
-0.07574541121721268,
0.1821945309638977,
0.05991608276963234,
-0.27545636892318726,
0.47606807947158813,
0.02520240843296051,
-0.2726511061191559,
-0.19228467345237732,
-0.048896290361881256,
0.2035464346408844,
-0.1772707998752594,
0.011682920157909393,
-0.3404439687728882
] |
https://github.com/huggingface/datasets/issues/6186 | @lhoestq
> In this case you wouldn't need a multiprocessed map no ?
Yes. But how to load a model to 2 GPU simultaneously without something like accelerate? | Feature request: add code example of multi-GPU processing | ### Feature request
Would be great to add a code example of how to do multi-GPU processing with 🤗 Datasets in the documentation. cc @stevhliu
Currently the docs has a small [section](https://huggingface.co/docs/datasets/v2.3.2/en/process#map) on this saying "your big GPU call goes here", however it didn't work for me out-of-the-box.
Let's say you have a PyTorch model that can do translation, and you have multiple GPUs. In that case, you'd like to duplicate the model on each GPU, each processing (translating) a chunk of the data in parallel.
Here's how I tried to do that:
```
from datasets import load_dataset
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
from multiprocess import set_start_method
import torch
import os
dataset = load_dataset("mlfoundations/datacomp_small")
tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-distilled-600M")
model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-distilled-600M")
# put model on each available GPU
# also, should I do it like this or use nn.DataParallel?
model.to("cuda:0")
model.to("cuda:1")
set_start_method("spawn")
def translate_captions(batch, rank):
os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())
texts = batch["text"]
inputs = tokenizer(texts, padding=True, truncation=True, return_tensors="pt").to(model.device)
translated_tokens = model.generate(
**inputs, forced_bos_token_id=tokenizer.lang_code_to_id["eng_Latn"], max_length=30
)
translated_texts = tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)
batch["translated_text"] = translated_texts
return batch
updated_dataset = dataset.map(translate_captions, with_rank=True, num_proc=2, batched=True, batch_size=256)
```
I've personally tried running this script on a machine with 2 A100 GPUs.
## Error 1
Running the code snippet above from the terminal (python script.py) resulted in the following error:
```
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 125, in _main
prepare(preparation_data)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 289, in run_path
return _run_module_code(code, init_globals, run_name,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 96, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/niels/python_projects/datacomp/datasets_multi_gpu.py", line 16, in <module>
set_start_method("spawn")
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 247, in set_start_method
raise RuntimeError('context has already been set')
RuntimeError: context has already been set
```
## Error 2
Then, based on [this Stackoverflow answer](https://stackoverflow.com/a/71616344/7762882), I put the `set_start_method("spawn")` section in a try: catch block. This resulted in the following error:
```
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/dataset_dict.py", line 817, in <dictcomp>
k: dataset.map(
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2926, in map
with Pool(nb_of_missing_shards, initargs=initargs, initializer=initializer) as pool:
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 215, in __init__
self._repopulate_pool()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 306, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 329, in _repopulate_pool_static
w.start()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/process.py", line 121, in start
self._popen = self._Popen(self)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 288, in _Popen
return Popen(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 32, in __init__
super().__init__(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_fork.py", line 19, in __init__
self._launch(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 42, in _launch
prep_data = spawn.get_preparation_data(process_obj._name)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 134, in _check_not_importing_main
raise RuntimeError('''
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
```
So then I put the last line under a `if __name__ == '__main__':` block. Then the code snippet seemed to work, but it seemed that it's only leveraging a single GPU (based on monitoring `nvidia-smi`):
```
Mon Aug 28 12:19:24 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.01 Driver Version: 515.65.01 CUDA Version: 11.7 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA A100-SXM... On | 00000000:01:00.0 Off | 0 |
| N/A 55C P0 76W / 275W | 8747MiB / 81920MiB | 0% Default |
| | | Disabled |
+-------------------------------+----------------------+----------------------+
| 1 NVIDIA A100-SXM... On | 00000000:47:00.0 Off | 0 |
| N/A 67C P0 274W / 275W | 59835MiB / 81920MiB | 100% Default |
| | | Disabled |
```
Both GPUs should have equal GPU usage, but I've always noticed that the last GPU has way more usage than the other ones. This made me think that `os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())` might not work inside a Python script, especially if done after importing PyTorch?
### Motivation
Would be great to clarify how to do multi-GPU data processing.
### Your contribution
If my code snippet can be fixed, I can contribute it to the docs :) | 28 | Feature request: add code example of multi-GPU processing
### Feature request
Would be great to add a code example of how to do multi-GPU processing with 🤗 Datasets in the documentation. cc @stevhliu
Currently the docs has a small [section](https://huggingface.co/docs/datasets/v2.3.2/en/process#map) on this saying "your big GPU call goes here", however it didn't work for me out-of-the-box.
Let's say you have a PyTorch model that can do translation, and you have multiple GPUs. In that case, you'd like to duplicate the model on each GPU, each processing (translating) a chunk of the data in parallel.
Here's how I tried to do that:
```
from datasets import load_dataset
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
from multiprocess import set_start_method
import torch
import os
dataset = load_dataset("mlfoundations/datacomp_small")
tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-distilled-600M")
model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-distilled-600M")
# put model on each available GPU
# also, should I do it like this or use nn.DataParallel?
model.to("cuda:0")
model.to("cuda:1")
set_start_method("spawn")
def translate_captions(batch, rank):
os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())
texts = batch["text"]
inputs = tokenizer(texts, padding=True, truncation=True, return_tensors="pt").to(model.device)
translated_tokens = model.generate(
**inputs, forced_bos_token_id=tokenizer.lang_code_to_id["eng_Latn"], max_length=30
)
translated_texts = tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)
batch["translated_text"] = translated_texts
return batch
updated_dataset = dataset.map(translate_captions, with_rank=True, num_proc=2, batched=True, batch_size=256)
```
I've personally tried running this script on a machine with 2 A100 GPUs.
## Error 1
Running the code snippet above from the terminal (python script.py) resulted in the following error:
```
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 125, in _main
prepare(preparation_data)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 289, in run_path
return _run_module_code(code, init_globals, run_name,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 96, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/niels/python_projects/datacomp/datasets_multi_gpu.py", line 16, in <module>
set_start_method("spawn")
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 247, in set_start_method
raise RuntimeError('context has already been set')
RuntimeError: context has already been set
```
## Error 2
Then, based on [this Stackoverflow answer](https://stackoverflow.com/a/71616344/7762882), I put the `set_start_method("spawn")` section in a try: catch block. This resulted in the following error:
```
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/dataset_dict.py", line 817, in <dictcomp>
k: dataset.map(
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2926, in map
with Pool(nb_of_missing_shards, initargs=initargs, initializer=initializer) as pool:
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 215, in __init__
self._repopulate_pool()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 306, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 329, in _repopulate_pool_static
w.start()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/process.py", line 121, in start
self._popen = self._Popen(self)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 288, in _Popen
return Popen(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 32, in __init__
super().__init__(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_fork.py", line 19, in __init__
self._launch(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 42, in _launch
prep_data = spawn.get_preparation_data(process_obj._name)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 134, in _check_not_importing_main
raise RuntimeError('''
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
```
So then I put the last line under a `if __name__ == '__main__':` block. Then the code snippet seemed to work, but it seemed that it's only leveraging a single GPU (based on monitoring `nvidia-smi`):
```
Mon Aug 28 12:19:24 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.01 Driver Version: 515.65.01 CUDA Version: 11.7 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA A100-SXM... On | 00000000:01:00.0 Off | 0 |
| N/A 55C P0 76W / 275W | 8747MiB / 81920MiB | 0% Default |
| | | Disabled |
+-------------------------------+----------------------+----------------------+
| 1 NVIDIA A100-SXM... On | 00000000:47:00.0 Off | 0 |
| N/A 67C P0 274W / 275W | 59835MiB / 81920MiB | 100% Default |
| | | Disabled |
```
Both GPUs should have equal GPU usage, but I've always noticed that the last GPU has way more usage than the other ones. This made me think that `os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())` might not work inside a Python script, especially if done after importing PyTorch?
### Motivation
Would be great to clarify how to do multi-GPU data processing.
### Your contribution
If my code snippet can be fixed, I can contribute it to the docs :)
@lhoestq
> In this case you wouldn't need a multiprocessed map no ?
Yes. But how to load a model to 2 GPU simultaneously without something like accelerate? | [
-0.13726481795310974,
-0.43240639567375183,
-0.001979593187570572,
0.09065330773591995,
-0.10275635123252869,
0.048385635018348694,
0.39975813031196594,
0.003309808671474457,
0.1566070318222046,
0.22367125749588013,
0.1868710219860077,
0.23762893676757812,
0.19287052750587463,
0.5128408074378967,
0.522918701171875,
-0.32018184661865234,
0.11813603341579437,
-0.22682499885559082,
0.33320340514183044,
0.1273239254951477,
-0.18765708804130554,
0.3333667814731598,
-0.09929713606834412,
0.215697780251503,
-0.4721122682094574,
-0.2038276344537735,
-0.28530845046043396,
0.03162965551018715,
0.16063891351222992,
-0.22111979126930237,
-0.09847809374332428,
0.298068642616272,
0.0012909993529319763,
0.6303572654724121,
-0.00011646699567791075,
-0.11362777650356293,
0.05465345457196236,
0.016327202320098877,
0.07945813983678818,
-0.177629292011261,
0.22675222158432007,
-0.2504114508628845,
0.10698533803224564,
-0.26256537437438965,
-0.02343132719397545,
-0.028642969205975533,
-0.044210344552993774,
-0.2531892657279968,
0.2555846571922302,
-0.018407993018627167,
0.11944039911031723,
0.16084566712379456,
-0.00857873260974884,
-0.1610921025276184,
-0.3832542598247528,
0.1771220862865448,
0.04658135026693344,
-0.009682543575763702,
0.4095132052898407,
-0.3020716905593872,
-0.12628576159477234,
0.5637154579162598,
-0.02627909556031227,
0.04005734995007515,
-0.1290358304977417,
-0.007826857268810272,
-0.19307777285575867,
-0.3386915326118469,
-0.09387467801570892,
0.13656041026115417,
-0.10574577748775482,
-0.4478246569633484,
-0.44006362557411194,
-0.43075433373451233,
-0.16315262019634247,
-0.47064751386642456,
-0.33834028244018555,
0.20736175775527954,
-0.21800586581230164,
0.06619656085968018,
-0.23226362466812134,
-0.2655092775821686,
0.06610982120037079,
0.022942421957850456,
-0.03881474584341049,
0.22137659788131714,
0.038144513964653015,
0.18081015348434448,
0.2640833854675293,
0.0979112908244133,
-0.12916254997253418,
0.08739263564348221,
0.2578856945037842,
-0.023411016911268234,
-0.6043911576271057,
0.0748874619603157,
0.3175150454044342,
-0.3048141598701477,
0.17235323786735535,
0.11439356207847595,
0.10078545659780502,
0.10357026755809784,
0.06845934689044952,
0.3968272805213928,
-0.18141087889671326,
0.045728348195552826,
-0.23265156149864197,
0.11734238266944885,
0.3198080062866211,
-0.09199150651693344,
0.08039076626300812,
-0.2084348499774933,
-0.07251022011041641,
-0.22268658876419067,
-0.3538980782032013,
0.22539524734020233,
0.2352011501789093,
0.04293382167816162,
-0.032003674656152725,
-0.1665005385875702,
-0.20427000522613525,
-0.0669514611363411,
0.04615724831819534,
0.26968878507614136,
0.22728070616722107,
0.28829044103622437,
0.025303415954113007,
0.17196056246757507,
-0.045768629759550095,
-0.45981329679489136,
-0.22345909476280212,
0.07843558490276337,
-0.27035850286483765,
0.38503459095954895,
0.13989853858947754,
-0.03770642727613449,
0.28386953473091125,
0.21978262066841125,
0.454135537147522,
-0.09292280673980713,
0.5181595683097839,
0.10049033164978027,
0.12257000058889389,
0.14631319046020508,
0.13831278681755066,
0.13250598311424255,
0.47914403676986694,
0.26230233907699585,
-0.20951515436172485,
0.16582340002059937,
-0.22458384931087494,
-0.37102293968200684,
-0.04199288785457611,
0.047635868191719055,
0.1300390064716339,
0.014542641118168831,
-0.2291683703660965,
0.5189156532287598,
0.23879824578762054,
-0.02367641031742096,
0.20874138176441193,
0.014654239639639854,
-0.3141019940376282,
-0.23248054087162018,
0.4379374086856842,
0.5276799201965332,
-0.2623005509376526,
-0.1772947907447815,
0.1776680052280426,
0.10872446745634079,
0.08485651016235352,
0.3919675052165985,
-0.23088431358337402,
0.23045235872268677,
-0.10177546739578247,
0.31368502974510193,
0.03668977692723274,
-0.34959959983825684,
0.154375821352005,
0.41493821144104004,
-0.4368666112422943,
0.02735009789466858,
0.2053980827331543,
0.01394694298505783,
0.10515525937080383,
0.2272937148809433,
0.1648889034986496,
0.37879568338394165,
-0.2669222354888916,
0.18421384692192078,
-0.026782631874084473,
-0.16408276557922363,
0.22497117519378662,
0.07652550935745239,
0.008983400650322437,
-0.07891934365034103,
-0.2709106206893921,
-0.1401703953742981,
0.31071731448173523,
-0.3887564539909363,
-0.08686745166778564,
-0.003976590000092983,
0.42369771003723145,
-0.046889521181583405,
0.134732186794281,
-0.23883652687072754,
-0.07879096269607544,
0.25001955032348633,
-0.05789417773485184,
0.09703810513019562,
0.036940980702638626,
-0.2642768621444702,
0.2818697690963745,
-0.03131144866347313,
-0.23275980353355408,
-0.4970204830169678,
0.0697963535785675,
0.12452025711536407,
-0.02884995937347412,
-0.10219292342662811,
-0.11276303231716156,
0.3690639138221741,
-0.1273595690727234,
-0.01789390668272972,
-0.28777608275413513,
0.20377084612846375,
-0.0831594318151474,
-0.3235185742378235,
-0.1924331933259964,
-0.021928466856479645,
0.18652690947055817,
-0.10716603696346283,
-0.03560876473784447,
0.30218347907066345,
0.29763805866241455,
0.04366501420736313,
0.03703790530562401,
0.31927424669265747,
0.3217100203037262,
0.0003169253468513489,
0.09845403581857681,
0.13694003224372864,
-0.14091072976589203,
-0.10977359861135483,
-0.18560287356376648,
0.46328622102737427,
0.11350454390048981,
0.24202296137809753,
-0.08600223809480667,
0.06320515275001526,
0.10767901688814163,
0.1716879904270172,
-0.1542675495147705,
0.20352287590503693,
0.23374557495117188,
0.13665816187858582,
0.218779057264328,
-0.3072965741157532,
-0.5030412077903748,
0.19718724489212036,
0.31892287731170654,
-0.11530224233865738,
0.13879665732383728,
0.03964545577764511,
-0.004091810435056686,
0.05304737389087677,
0.26514720916748047,
-0.23469361662864685,
0.018823523074388504,
0.16371455788612366,
0.048439908772706985,
0.08198543637990952,
-0.21254703402519226,
-0.08612753450870514,
0.003513820469379425,
0.036425914615392685,
0.08501167595386505,
-0.08011548221111298,
0.12098909914493561,
-0.14708596467971802,
-0.08864250779151917,
-0.29509812593460083,
0.263865202665329,
-0.14647458493709564,
-0.28411632776260376,
0.2300937920808792,
-0.1244259625673294,
-0.12683697044849396,
-0.3070197105407715,
-0.22900371253490448,
-0.26795491576194763,
-0.10462262481451035,
-0.04953736066818237,
0.13317473232746124,
0.059228651225566864,
0.26202845573425293,
0.05757424980401993,
0.4001174867153168,
-0.05412260815501213,
-0.12754014134407043,
0.15420980751514435,
-0.10009711235761642,
0.02882632613182068,
-0.027363119646906853,
0.20304705202579498,
-0.002792973071336746,
0.2650507688522339,
0.27797994017601013,
0.05390234291553497,
-0.2836598753929138,
-0.6495156288146973,
0.10735151171684265,
-0.05230918154120445,
-0.043283797800540924,
0.168809711933136,
-0.22204437851905823,
0.1279846727848053,
-0.12628042697906494,
0.09973480552434921,
-0.2412632405757904,
-0.17246529459953308,
-0.11694647371768951,
0.04209209606051445,
-0.018522538244724274,
-0.34055814146995544,
-0.1257685124874115,
0.03451240807771683,
-0.33644556999206543,
0.7512093782424927,
-0.26782894134521484,
0.18522165715694427,
-0.3420449495315552,
0.21844811737537384,
0.41732317209243774,
-0.07706023752689362,
-0.10423856973648071,
0.12207566946744919,
-0.2222617268562317,
0.04044001176953316,
-0.38753432035446167,
-0.19561229646205902,
-0.15322504937648773,
0.12778699398040771,
0.2567480802536011,
0.022582925856113434,
-0.11081362515687943,
-0.2836706042289734,
-0.08860928565263748,
0.11050793528556824,
0.048427239060401917,
0.2568923830986023,
0.36643534898757935,
-0.11063946038484573,
0.020293205976486206,
0.031001023948192596,
-0.4878546893596649,
0.26738688349723816,
0.14533013105392456,
-0.10296861827373505,
0.0015516206622123718,
0.5334910750389099,
0.33905237913131714,
0.7606999278068542,
0.21592170000076294,
0.007465981878340244,
0.10215451568365097,
-0.0057657817378640175,
-0.0042434558272361755,
0.10331498831510544,
-0.17316995561122894,
-0.03305227309465408,
-0.4584881663322449,
-0.1876434087753296,
0.015719901770353317,
-0.08352261781692505,
-0.09690897911787033,
-0.006443299353122711,
-0.12017791718244553,
-0.2085135281085968,
-0.08613231033086777,
0.10566562414169312,
-0.21639077365398407,
0.30132338404655457,
-0.42527252435684204,
-0.13490456342697144,
-0.2777252197265625,
0.5468804836273193,
0.14954550564289093,
0.10399559885263443,
0.44300156831741333,
-0.029097937047481537,
-0.14628726243972778,
-0.23774603009223938,
-0.2053356021642685,
0.22539299726486206,
-0.08108101785182953,
0.028677653521299362,
-0.09386318922042847,
0.04756540060043335,
-0.16022159159183502,
-0.3425484001636505,
0.9175221920013428,
-0.05383811146020889,
-0.24073535203933716,
0.00021738559007644653,
-0.7767176628112793,
-0.0967627465724945,
0.0002802610397338867,
-0.17745940387248993,
0.08329543471336365,
0.3165305554866791,
0.3290862441062927,
-0.13441196084022522,
-0.08487619459629059,
0.16684913635253906,
-0.11666533350944519,
-0.12171293795108795,
0.053184475749731064,
-0.2602272629737854,
-0.26665198802948,
-0.46504709124565125,
0.28710535168647766,
0.2763529419898987,
-0.17984262108802795,
-0.34102320671081543,
0.08445829153060913,
-0.018273696303367615,
0.05998878926038742,
0.09060539305210114,
0.11562949419021606,
-0.03739555552601814,
0.013924561440944672,
-0.021817386150360107,
0.34926533699035645,
0.10265977680683136,
0.014078659936785698,
0.11376459896564484,
-0.08603110909461975,
-0.48909792304039,
0.2950676679611206,
0.010424274951219559,
0.6215792894363403,
0.2701704502105713,
0.11215329170227051,
0.40111279487609863,
0.2684306502342224,
0.1053607314825058,
-0.1362503468990326,
0.19916892051696777,
0.21539852023124695,
0.24353757500648499,
-0.12264867126941681,
-0.5439552068710327,
0.46222564578056335,
0.3498312532901764,
-0.0706014409661293,
0.6956338286399841,
-0.037806328386068344,
-0.09816247224807739,
-0.03284687548875809,
0.2578716278076172,
0.6009117364883423,
-0.10265389829874039,
0.29417839646339417,
-0.0874977558851242,
-0.492634654045105,
0.4086037278175354,
-0.5855088829994202,
0.15324729681015015,
-0.3028750419616699,
-0.28081363439559937,
-0.019572757184505463,
-0.2748074531555176,
0.2435486912727356,
0.12862132489681244,
-0.36670857667922974,
0.19993901252746582,
0.04349295794963837,
-0.08330457657575607,
0.11621308326721191,
0.4153295159339905,
0.3163139522075653,
-0.5045558214187622,
-0.06624080240726471,
0.04681944474577904,
0.0752277821302414,
0.03474888205528259,
-0.1827327013015747,
-0.19388322532176971,
0.21158930659294128,
-0.11793903261423111,
-0.45810553431510925,
-0.09967547655105591,
-0.5606222748756409,
0.1195961982011795,
-0.22522467374801636,
-0.04953708499670029,
0.28914472460746765,
0.11357800662517548,
0.32963240146636963,
0.07611825317144394,
-0.19609446823596954,
-0.18980371952056885,
-0.048469480127096176,
-0.01310904324054718,
-0.3161090612411499,
-0.48386234045028687,
0.14349395036697388,
-0.06770458072423935,
-0.3479110896587372,
0.19163993000984192,
0.28515103459358215,
-0.06123730167746544,
-0.1872701495885849,
0.12385401129722595,
-0.325794517993927,
0.27604687213897705,
0.03570143133401871,
0.2613053619861603,
0.043633922934532166,
-0.3656446933746338,
0.03794925659894943,
0.27996742725372314,
-0.4606718122959137,
-0.14914073050022125,
-0.2895555794239044,
0.0005127489566802979,
-0.04743792489171028,
0.12466670572757721,
0.06106588989496231,
-0.35553568601608276,
0.00539616122841835,
0.5013360381126404,
0.046341873705387115,
-0.05394354462623596,
-0.1692665070295334,
0.3088708519935608,
-0.16455970704555511,
0.12646351754665375,
-0.30013763904571533,
-0.20930084586143494,
0.065439373254776,
-0.06849654018878937,
-0.04930827394127846,
-0.09942927956581116,
-0.14508076012134552,
0.0263046994805336,
-0.3648007810115814,
0.08772922307252884,
-0.17311403155326843,
0.21729709208011627,
0.13906466960906982,
0.41336095333099365,
0.1406976878643036,
0.4890801012516022,
-0.24726231396198273,
0.20370082557201385,
-0.019625745713710785,
0.05941655859351158,
0.18679526448249817,
0.11418695002794266,
0.034603383392095566,
0.17439121007919312,
-0.11191348731517792,
0.22132134437561035,
0.10593022406101227,
-0.10948453843593597,
-0.20515191555023193,
0.1088176965713501,
0.06157035008072853,
0.10006970167160034,
0.40128087997436523,
0.09312115609645844,
-0.23191124200820923,
-0.18796519935131073,
0.4555113911628723,
0.07979334890842438,
-0.04768458753824234,
0.19658972322940826,
0.08526930212974548,
-0.027219392359256744,
-0.1253235638141632,
-0.09192335605621338,
0.17993953824043274,
-0.18317358195781708,
0.4003690481185913,
0.24932703375816345,
0.07283224910497665,
0.060439951717853546,
-0.04592963308095932,
-0.027615081518888474,
0.3071083724498749,
-0.04781337082386017,
-0.20252485573291779,
-0.05196281522512436,
-0.30233967304229736,
-0.28378042578697205,
0.37536418437957764,
-0.011011844500899315,
0.006591185927391052,
0.25938498973846436,
0.12824416160583496,
0.10668408125638962,
-0.17205020785331726,
0.009691204875707626,
0.20802587270736694,
-0.5298482179641724,
0.36970120668411255,
0.47729846835136414,
0.4435214698314667,
0.6078863739967346,
-0.014679763466119766,
-0.04493133723735809,
0.045707184821367264,
-0.14442098140716553,
0.3065044581890106,
0.012277120724320412,
-0.15027236938476562,
0.21000783145427704,
0.23948028683662415,
0.11469853669404984,
0.21850501000881195,
0.055695828050374985,
0.04671526327729225,
0.491743266582489,
0.0735761895775795,
-0.07577389478683472,
0.46394893527030945,
-0.10315664112567902,
-0.09439939260482788,
-0.3294445276260376,
-0.10423195362091064,
0.04103762283921242,
-0.34252363443374634,
0.22060483694076538,
-0.1431080400943756,
-0.28316864371299744,
-0.1700475513935089,
0.5426687002182007,
-0.1652354747056961,
-0.2160312533378601,
-0.100367471575737,
-0.07325045764446259,
-0.013395056128501892,
-0.11439036577939987,
0.21969474852085114,
-0.21504563093185425,
0.6112523674964905,
-0.10155933350324631,
0.03286806866526604,
0.0357804149389267,
-0.23426973819732666,
0.21196821331977844,
0.21250300109386444,
-0.011693425476551056,
0.004650669172406197,
0.29094818234443665,
-0.33940714597702026,
-0.2513791620731354,
0.26019933819770813,
0.4433901011943817,
0.07676401734352112,
-0.2038024365901947,
0.31794875860214233,
-0.04354413226246834,
0.22492918372154236,
0.056538671255111694,
0.013942830264568329,
0.00512576662003994,
0.09120813757181168,
0.11064764112234116,
0.04012264311313629,
-0.032169125974178314,
-0.11943793296813965,
0.15660136938095093,
0.030711360275745392,
-0.3521858751773834,
0.5341164469718933,
-0.31313902139663696,
-0.07604791224002838,
0.08261220157146454,
0.11361046880483627,
-0.4795506000518799,
0.08186614513397217,
0.6961772441864014,
-0.07884850353002548,
-0.26125895977020264,
-0.018569285050034523,
0.03931156545877457,
0.05087910592556,
0.41207537055015564,
0.13600552082061768,
0.34902194142341614,
-0.37971067428588867,
-0.13116556406021118,
-0.42874985933303833,
0.08600163459777832,
-0.23020508885383606,
0.004055827856063843,
0.04612516984343529,
0.20666763186454773,
0.11755794286727905,
0.041799504309892654,
0.042842090129852295,
-0.21543650329113007,
0.08646251261234283,
0.493436723947525,
-0.39323872327804565,
-0.07431508600711823,
-0.4586561918258667,
0.11608097702264786,
0.26705580949783325,
-0.0228530615568161,
-0.03189676254987717,
0.12276636064052582,
-0.054354023188352585,
-0.23559734225273132,
0.23365938663482666,
0.17777302861213684,
-0.03732554614543915,
0.28508949279785156,
0.08073883503675461,
0.3613443374633789,
0.0030187442898750305,
-0.23002752661705017,
-0.03415326029062271,
0.25322073698043823,
-0.4404388964176178,
0.10954134166240692,
-0.10914701968431473,
0.11539486050605774,
-0.18764635920524597,
-0.598824143409729,
-0.44897517561912537,
0.18354636430740356,
0.28004559874534607,
-0.46360889077186584,
-0.04046037793159485,
0.19633376598358154,
0.11692515760660172,
-0.2343721091747284,
0.49372631311416626,
0.5398153066635132,
-0.1500096619129181,
0.13803306221961975,
-0.2924443483352661,
0.025692477822303772,
0.3646093010902405,
-0.3754533529281616,
-0.21186792850494385,
-0.44899889826774597,
0.3961881399154663,
-0.13880832493305206,
0.13918673992156982,
-0.6909026503562927,
-0.07574541121721268,
0.1821945309638977,
0.05991608276963234,
-0.27545636892318726,
0.47606807947158813,
0.02520240843296051,
-0.2726511061191559,
-0.19228467345237732,
-0.048896290361881256,
0.2035464346408844,
-0.1772707998752594,
0.011682920157909393,
-0.3404439687728882
] |
https://github.com/huggingface/datasets/issues/6186 | > @lhoestq
>
> > In this case you wouldn't need a multiprocessed map no ?
>
> Yes. But how to load a model to 2 GPU simultaneously without something like accelerate?
Take a look at this fix #6550 . Basically, you move the model to each GPU inside of the function to be mapped.
| Feature request: add code example of multi-GPU processing | ### Feature request
Would be great to add a code example of how to do multi-GPU processing with 🤗 Datasets in the documentation. cc @stevhliu
Currently the docs has a small [section](https://huggingface.co/docs/datasets/v2.3.2/en/process#map) on this saying "your big GPU call goes here", however it didn't work for me out-of-the-box.
Let's say you have a PyTorch model that can do translation, and you have multiple GPUs. In that case, you'd like to duplicate the model on each GPU, each processing (translating) a chunk of the data in parallel.
Here's how I tried to do that:
```
from datasets import load_dataset
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
from multiprocess import set_start_method
import torch
import os
dataset = load_dataset("mlfoundations/datacomp_small")
tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-distilled-600M")
model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-distilled-600M")
# put model on each available GPU
# also, should I do it like this or use nn.DataParallel?
model.to("cuda:0")
model.to("cuda:1")
set_start_method("spawn")
def translate_captions(batch, rank):
os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())
texts = batch["text"]
inputs = tokenizer(texts, padding=True, truncation=True, return_tensors="pt").to(model.device)
translated_tokens = model.generate(
**inputs, forced_bos_token_id=tokenizer.lang_code_to_id["eng_Latn"], max_length=30
)
translated_texts = tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)
batch["translated_text"] = translated_texts
return batch
updated_dataset = dataset.map(translate_captions, with_rank=True, num_proc=2, batched=True, batch_size=256)
```
I've personally tried running this script on a machine with 2 A100 GPUs.
## Error 1
Running the code snippet above from the terminal (python script.py) resulted in the following error:
```
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 125, in _main
prepare(preparation_data)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 289, in run_path
return _run_module_code(code, init_globals, run_name,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 96, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/niels/python_projects/datacomp/datasets_multi_gpu.py", line 16, in <module>
set_start_method("spawn")
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 247, in set_start_method
raise RuntimeError('context has already been set')
RuntimeError: context has already been set
```
## Error 2
Then, based on [this Stackoverflow answer](https://stackoverflow.com/a/71616344/7762882), I put the `set_start_method("spawn")` section in a try: catch block. This resulted in the following error:
```
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/dataset_dict.py", line 817, in <dictcomp>
k: dataset.map(
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2926, in map
with Pool(nb_of_missing_shards, initargs=initargs, initializer=initializer) as pool:
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 215, in __init__
self._repopulate_pool()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 306, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 329, in _repopulate_pool_static
w.start()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/process.py", line 121, in start
self._popen = self._Popen(self)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 288, in _Popen
return Popen(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 32, in __init__
super().__init__(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_fork.py", line 19, in __init__
self._launch(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 42, in _launch
prep_data = spawn.get_preparation_data(process_obj._name)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 134, in _check_not_importing_main
raise RuntimeError('''
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
```
So then I put the last line under a `if __name__ == '__main__':` block. Then the code snippet seemed to work, but it seemed that it's only leveraging a single GPU (based on monitoring `nvidia-smi`):
```
Mon Aug 28 12:19:24 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.01 Driver Version: 515.65.01 CUDA Version: 11.7 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA A100-SXM... On | 00000000:01:00.0 Off | 0 |
| N/A 55C P0 76W / 275W | 8747MiB / 81920MiB | 0% Default |
| | | Disabled |
+-------------------------------+----------------------+----------------------+
| 1 NVIDIA A100-SXM... On | 00000000:47:00.0 Off | 0 |
| N/A 67C P0 274W / 275W | 59835MiB / 81920MiB | 100% Default |
| | | Disabled |
```
Both GPUs should have equal GPU usage, but I've always noticed that the last GPU has way more usage than the other ones. This made me think that `os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())` might not work inside a Python script, especially if done after importing PyTorch?
### Motivation
Would be great to clarify how to do multi-GPU data processing.
### Your contribution
If my code snippet can be fixed, I can contribute it to the docs :) | 56 | Feature request: add code example of multi-GPU processing
### Feature request
Would be great to add a code example of how to do multi-GPU processing with 🤗 Datasets in the documentation. cc @stevhliu
Currently the docs has a small [section](https://huggingface.co/docs/datasets/v2.3.2/en/process#map) on this saying "your big GPU call goes here", however it didn't work for me out-of-the-box.
Let's say you have a PyTorch model that can do translation, and you have multiple GPUs. In that case, you'd like to duplicate the model on each GPU, each processing (translating) a chunk of the data in parallel.
Here's how I tried to do that:
```
from datasets import load_dataset
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
from multiprocess import set_start_method
import torch
import os
dataset = load_dataset("mlfoundations/datacomp_small")
tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-distilled-600M")
model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-distilled-600M")
# put model on each available GPU
# also, should I do it like this or use nn.DataParallel?
model.to("cuda:0")
model.to("cuda:1")
set_start_method("spawn")
def translate_captions(batch, rank):
os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())
texts = batch["text"]
inputs = tokenizer(texts, padding=True, truncation=True, return_tensors="pt").to(model.device)
translated_tokens = model.generate(
**inputs, forced_bos_token_id=tokenizer.lang_code_to_id["eng_Latn"], max_length=30
)
translated_texts = tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)
batch["translated_text"] = translated_texts
return batch
updated_dataset = dataset.map(translate_captions, with_rank=True, num_proc=2, batched=True, batch_size=256)
```
I've personally tried running this script on a machine with 2 A100 GPUs.
## Error 1
Running the code snippet above from the terminal (python script.py) resulted in the following error:
```
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 125, in _main
prepare(preparation_data)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 289, in run_path
return _run_module_code(code, init_globals, run_name,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 96, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/niels/python_projects/datacomp/datasets_multi_gpu.py", line 16, in <module>
set_start_method("spawn")
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 247, in set_start_method
raise RuntimeError('context has already been set')
RuntimeError: context has already been set
```
## Error 2
Then, based on [this Stackoverflow answer](https://stackoverflow.com/a/71616344/7762882), I put the `set_start_method("spawn")` section in a try: catch block. This resulted in the following error:
```
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/dataset_dict.py", line 817, in <dictcomp>
k: dataset.map(
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2926, in map
with Pool(nb_of_missing_shards, initargs=initargs, initializer=initializer) as pool:
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 215, in __init__
self._repopulate_pool()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 306, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 329, in _repopulate_pool_static
w.start()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/process.py", line 121, in start
self._popen = self._Popen(self)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 288, in _Popen
return Popen(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 32, in __init__
super().__init__(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_fork.py", line 19, in __init__
self._launch(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 42, in _launch
prep_data = spawn.get_preparation_data(process_obj._name)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 134, in _check_not_importing_main
raise RuntimeError('''
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
```
So then I put the last line under a `if __name__ == '__main__':` block. Then the code snippet seemed to work, but it seemed that it's only leveraging a single GPU (based on monitoring `nvidia-smi`):
```
Mon Aug 28 12:19:24 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.01 Driver Version: 515.65.01 CUDA Version: 11.7 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA A100-SXM... On | 00000000:01:00.0 Off | 0 |
| N/A 55C P0 76W / 275W | 8747MiB / 81920MiB | 0% Default |
| | | Disabled |
+-------------------------------+----------------------+----------------------+
| 1 NVIDIA A100-SXM... On | 00000000:47:00.0 Off | 0 |
| N/A 67C P0 274W / 275W | 59835MiB / 81920MiB | 100% Default |
| | | Disabled |
```
Both GPUs should have equal GPU usage, but I've always noticed that the last GPU has way more usage than the other ones. This made me think that `os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())` might not work inside a Python script, especially if done after importing PyTorch?
### Motivation
Would be great to clarify how to do multi-GPU data processing.
### Your contribution
If my code snippet can be fixed, I can contribute it to the docs :)
> @lhoestq
>
> > In this case you wouldn't need a multiprocessed map no ?
>
> Yes. But how to load a model to 2 GPU simultaneously without something like accelerate?
Take a look at this fix #6550 . Basically, you move the model to each GPU inside of the function to be mapped.
| [
-0.13726481795310974,
-0.43240639567375183,
-0.001979593187570572,
0.09065330773591995,
-0.10275635123252869,
0.048385635018348694,
0.39975813031196594,
0.003309808671474457,
0.1566070318222046,
0.22367125749588013,
0.1868710219860077,
0.23762893676757812,
0.19287052750587463,
0.5128408074378967,
0.522918701171875,
-0.32018184661865234,
0.11813603341579437,
-0.22682499885559082,
0.33320340514183044,
0.1273239254951477,
-0.18765708804130554,
0.3333667814731598,
-0.09929713606834412,
0.215697780251503,
-0.4721122682094574,
-0.2038276344537735,
-0.28530845046043396,
0.03162965551018715,
0.16063891351222992,
-0.22111979126930237,
-0.09847809374332428,
0.298068642616272,
0.0012909993529319763,
0.6303572654724121,
-0.00011646699567791075,
-0.11362777650356293,
0.05465345457196236,
0.016327202320098877,
0.07945813983678818,
-0.177629292011261,
0.22675222158432007,
-0.2504114508628845,
0.10698533803224564,
-0.26256537437438965,
-0.02343132719397545,
-0.028642969205975533,
-0.044210344552993774,
-0.2531892657279968,
0.2555846571922302,
-0.018407993018627167,
0.11944039911031723,
0.16084566712379456,
-0.00857873260974884,
-0.1610921025276184,
-0.3832542598247528,
0.1771220862865448,
0.04658135026693344,
-0.009682543575763702,
0.4095132052898407,
-0.3020716905593872,
-0.12628576159477234,
0.5637154579162598,
-0.02627909556031227,
0.04005734995007515,
-0.1290358304977417,
-0.007826857268810272,
-0.19307777285575867,
-0.3386915326118469,
-0.09387467801570892,
0.13656041026115417,
-0.10574577748775482,
-0.4478246569633484,
-0.44006362557411194,
-0.43075433373451233,
-0.16315262019634247,
-0.47064751386642456,
-0.33834028244018555,
0.20736175775527954,
-0.21800586581230164,
0.06619656085968018,
-0.23226362466812134,
-0.2655092775821686,
0.06610982120037079,
0.022942421957850456,
-0.03881474584341049,
0.22137659788131714,
0.038144513964653015,
0.18081015348434448,
0.2640833854675293,
0.0979112908244133,
-0.12916254997253418,
0.08739263564348221,
0.2578856945037842,
-0.023411016911268234,
-0.6043911576271057,
0.0748874619603157,
0.3175150454044342,
-0.3048141598701477,
0.17235323786735535,
0.11439356207847595,
0.10078545659780502,
0.10357026755809784,
0.06845934689044952,
0.3968272805213928,
-0.18141087889671326,
0.045728348195552826,
-0.23265156149864197,
0.11734238266944885,
0.3198080062866211,
-0.09199150651693344,
0.08039076626300812,
-0.2084348499774933,
-0.07251022011041641,
-0.22268658876419067,
-0.3538980782032013,
0.22539524734020233,
0.2352011501789093,
0.04293382167816162,
-0.032003674656152725,
-0.1665005385875702,
-0.20427000522613525,
-0.0669514611363411,
0.04615724831819534,
0.26968878507614136,
0.22728070616722107,
0.28829044103622437,
0.025303415954113007,
0.17196056246757507,
-0.045768629759550095,
-0.45981329679489136,
-0.22345909476280212,
0.07843558490276337,
-0.27035850286483765,
0.38503459095954895,
0.13989853858947754,
-0.03770642727613449,
0.28386953473091125,
0.21978262066841125,
0.454135537147522,
-0.09292280673980713,
0.5181595683097839,
0.10049033164978027,
0.12257000058889389,
0.14631319046020508,
0.13831278681755066,
0.13250598311424255,
0.47914403676986694,
0.26230233907699585,
-0.20951515436172485,
0.16582340002059937,
-0.22458384931087494,
-0.37102293968200684,
-0.04199288785457611,
0.047635868191719055,
0.1300390064716339,
0.014542641118168831,
-0.2291683703660965,
0.5189156532287598,
0.23879824578762054,
-0.02367641031742096,
0.20874138176441193,
0.014654239639639854,
-0.3141019940376282,
-0.23248054087162018,
0.4379374086856842,
0.5276799201965332,
-0.2623005509376526,
-0.1772947907447815,
0.1776680052280426,
0.10872446745634079,
0.08485651016235352,
0.3919675052165985,
-0.23088431358337402,
0.23045235872268677,
-0.10177546739578247,
0.31368502974510193,
0.03668977692723274,
-0.34959959983825684,
0.154375821352005,
0.41493821144104004,
-0.4368666112422943,
0.02735009789466858,
0.2053980827331543,
0.01394694298505783,
0.10515525937080383,
0.2272937148809433,
0.1648889034986496,
0.37879568338394165,
-0.2669222354888916,
0.18421384692192078,
-0.026782631874084473,
-0.16408276557922363,
0.22497117519378662,
0.07652550935745239,
0.008983400650322437,
-0.07891934365034103,
-0.2709106206893921,
-0.1401703953742981,
0.31071731448173523,
-0.3887564539909363,
-0.08686745166778564,
-0.003976590000092983,
0.42369771003723145,
-0.046889521181583405,
0.134732186794281,
-0.23883652687072754,
-0.07879096269607544,
0.25001955032348633,
-0.05789417773485184,
0.09703810513019562,
0.036940980702638626,
-0.2642768621444702,
0.2818697690963745,
-0.03131144866347313,
-0.23275980353355408,
-0.4970204830169678,
0.0697963535785675,
0.12452025711536407,
-0.02884995937347412,
-0.10219292342662811,
-0.11276303231716156,
0.3690639138221741,
-0.1273595690727234,
-0.01789390668272972,
-0.28777608275413513,
0.20377084612846375,
-0.0831594318151474,
-0.3235185742378235,
-0.1924331933259964,
-0.021928466856479645,
0.18652690947055817,
-0.10716603696346283,
-0.03560876473784447,
0.30218347907066345,
0.29763805866241455,
0.04366501420736313,
0.03703790530562401,
0.31927424669265747,
0.3217100203037262,
0.0003169253468513489,
0.09845403581857681,
0.13694003224372864,
-0.14091072976589203,
-0.10977359861135483,
-0.18560287356376648,
0.46328622102737427,
0.11350454390048981,
0.24202296137809753,
-0.08600223809480667,
0.06320515275001526,
0.10767901688814163,
0.1716879904270172,
-0.1542675495147705,
0.20352287590503693,
0.23374557495117188,
0.13665816187858582,
0.218779057264328,
-0.3072965741157532,
-0.5030412077903748,
0.19718724489212036,
0.31892287731170654,
-0.11530224233865738,
0.13879665732383728,
0.03964545577764511,
-0.004091810435056686,
0.05304737389087677,
0.26514720916748047,
-0.23469361662864685,
0.018823523074388504,
0.16371455788612366,
0.048439908772706985,
0.08198543637990952,
-0.21254703402519226,
-0.08612753450870514,
0.003513820469379425,
0.036425914615392685,
0.08501167595386505,
-0.08011548221111298,
0.12098909914493561,
-0.14708596467971802,
-0.08864250779151917,
-0.29509812593460083,
0.263865202665329,
-0.14647458493709564,
-0.28411632776260376,
0.2300937920808792,
-0.1244259625673294,
-0.12683697044849396,
-0.3070197105407715,
-0.22900371253490448,
-0.26795491576194763,
-0.10462262481451035,
-0.04953736066818237,
0.13317473232746124,
0.059228651225566864,
0.26202845573425293,
0.05757424980401993,
0.4001174867153168,
-0.05412260815501213,
-0.12754014134407043,
0.15420980751514435,
-0.10009711235761642,
0.02882632613182068,
-0.027363119646906853,
0.20304705202579498,
-0.002792973071336746,
0.2650507688522339,
0.27797994017601013,
0.05390234291553497,
-0.2836598753929138,
-0.6495156288146973,
0.10735151171684265,
-0.05230918154120445,
-0.043283797800540924,
0.168809711933136,
-0.22204437851905823,
0.1279846727848053,
-0.12628042697906494,
0.09973480552434921,
-0.2412632405757904,
-0.17246529459953308,
-0.11694647371768951,
0.04209209606051445,
-0.018522538244724274,
-0.34055814146995544,
-0.1257685124874115,
0.03451240807771683,
-0.33644556999206543,
0.7512093782424927,
-0.26782894134521484,
0.18522165715694427,
-0.3420449495315552,
0.21844811737537384,
0.41732317209243774,
-0.07706023752689362,
-0.10423856973648071,
0.12207566946744919,
-0.2222617268562317,
0.04044001176953316,
-0.38753432035446167,
-0.19561229646205902,
-0.15322504937648773,
0.12778699398040771,
0.2567480802536011,
0.022582925856113434,
-0.11081362515687943,
-0.2836706042289734,
-0.08860928565263748,
0.11050793528556824,
0.048427239060401917,
0.2568923830986023,
0.36643534898757935,
-0.11063946038484573,
0.020293205976486206,
0.031001023948192596,
-0.4878546893596649,
0.26738688349723816,
0.14533013105392456,
-0.10296861827373505,
0.0015516206622123718,
0.5334910750389099,
0.33905237913131714,
0.7606999278068542,
0.21592170000076294,
0.007465981878340244,
0.10215451568365097,
-0.0057657817378640175,
-0.0042434558272361755,
0.10331498831510544,
-0.17316995561122894,
-0.03305227309465408,
-0.4584881663322449,
-0.1876434087753296,
0.015719901770353317,
-0.08352261781692505,
-0.09690897911787033,
-0.006443299353122711,
-0.12017791718244553,
-0.2085135281085968,
-0.08613231033086777,
0.10566562414169312,
-0.21639077365398407,
0.30132338404655457,
-0.42527252435684204,
-0.13490456342697144,
-0.2777252197265625,
0.5468804836273193,
0.14954550564289093,
0.10399559885263443,
0.44300156831741333,
-0.029097937047481537,
-0.14628726243972778,
-0.23774603009223938,
-0.2053356021642685,
0.22539299726486206,
-0.08108101785182953,
0.028677653521299362,
-0.09386318922042847,
0.04756540060043335,
-0.16022159159183502,
-0.3425484001636505,
0.9175221920013428,
-0.05383811146020889,
-0.24073535203933716,
0.00021738559007644653,
-0.7767176628112793,
-0.0967627465724945,
0.0002802610397338867,
-0.17745940387248993,
0.08329543471336365,
0.3165305554866791,
0.3290862441062927,
-0.13441196084022522,
-0.08487619459629059,
0.16684913635253906,
-0.11666533350944519,
-0.12171293795108795,
0.053184475749731064,
-0.2602272629737854,
-0.26665198802948,
-0.46504709124565125,
0.28710535168647766,
0.2763529419898987,
-0.17984262108802795,
-0.34102320671081543,
0.08445829153060913,
-0.018273696303367615,
0.05998878926038742,
0.09060539305210114,
0.11562949419021606,
-0.03739555552601814,
0.013924561440944672,
-0.021817386150360107,
0.34926533699035645,
0.10265977680683136,
0.014078659936785698,
0.11376459896564484,
-0.08603110909461975,
-0.48909792304039,
0.2950676679611206,
0.010424274951219559,
0.6215792894363403,
0.2701704502105713,
0.11215329170227051,
0.40111279487609863,
0.2684306502342224,
0.1053607314825058,
-0.1362503468990326,
0.19916892051696777,
0.21539852023124695,
0.24353757500648499,
-0.12264867126941681,
-0.5439552068710327,
0.46222564578056335,
0.3498312532901764,
-0.0706014409661293,
0.6956338286399841,
-0.037806328386068344,
-0.09816247224807739,
-0.03284687548875809,
0.2578716278076172,
0.6009117364883423,
-0.10265389829874039,
0.29417839646339417,
-0.0874977558851242,
-0.492634654045105,
0.4086037278175354,
-0.5855088829994202,
0.15324729681015015,
-0.3028750419616699,
-0.28081363439559937,
-0.019572757184505463,
-0.2748074531555176,
0.2435486912727356,
0.12862132489681244,
-0.36670857667922974,
0.19993901252746582,
0.04349295794963837,
-0.08330457657575607,
0.11621308326721191,
0.4153295159339905,
0.3163139522075653,
-0.5045558214187622,
-0.06624080240726471,
0.04681944474577904,
0.0752277821302414,
0.03474888205528259,
-0.1827327013015747,
-0.19388322532176971,
0.21158930659294128,
-0.11793903261423111,
-0.45810553431510925,
-0.09967547655105591,
-0.5606222748756409,
0.1195961982011795,
-0.22522467374801636,
-0.04953708499670029,
0.28914472460746765,
0.11357800662517548,
0.32963240146636963,
0.07611825317144394,
-0.19609446823596954,
-0.18980371952056885,
-0.048469480127096176,
-0.01310904324054718,
-0.3161090612411499,
-0.48386234045028687,
0.14349395036697388,
-0.06770458072423935,
-0.3479110896587372,
0.19163993000984192,
0.28515103459358215,
-0.06123730167746544,
-0.1872701495885849,
0.12385401129722595,
-0.325794517993927,
0.27604687213897705,
0.03570143133401871,
0.2613053619861603,
0.043633922934532166,
-0.3656446933746338,
0.03794925659894943,
0.27996742725372314,
-0.4606718122959137,
-0.14914073050022125,
-0.2895555794239044,
0.0005127489566802979,
-0.04743792489171028,
0.12466670572757721,
0.06106588989496231,
-0.35553568601608276,
0.00539616122841835,
0.5013360381126404,
0.046341873705387115,
-0.05394354462623596,
-0.1692665070295334,
0.3088708519935608,
-0.16455970704555511,
0.12646351754665375,
-0.30013763904571533,
-0.20930084586143494,
0.065439373254776,
-0.06849654018878937,
-0.04930827394127846,
-0.09942927956581116,
-0.14508076012134552,
0.0263046994805336,
-0.3648007810115814,
0.08772922307252884,
-0.17311403155326843,
0.21729709208011627,
0.13906466960906982,
0.41336095333099365,
0.1406976878643036,
0.4890801012516022,
-0.24726231396198273,
0.20370082557201385,
-0.019625745713710785,
0.05941655859351158,
0.18679526448249817,
0.11418695002794266,
0.034603383392095566,
0.17439121007919312,
-0.11191348731517792,
0.22132134437561035,
0.10593022406101227,
-0.10948453843593597,
-0.20515191555023193,
0.1088176965713501,
0.06157035008072853,
0.10006970167160034,
0.40128087997436523,
0.09312115609645844,
-0.23191124200820923,
-0.18796519935131073,
0.4555113911628723,
0.07979334890842438,
-0.04768458753824234,
0.19658972322940826,
0.08526930212974548,
-0.027219392359256744,
-0.1253235638141632,
-0.09192335605621338,
0.17993953824043274,
-0.18317358195781708,
0.4003690481185913,
0.24932703375816345,
0.07283224910497665,
0.060439951717853546,
-0.04592963308095932,
-0.027615081518888474,
0.3071083724498749,
-0.04781337082386017,
-0.20252485573291779,
-0.05196281522512436,
-0.30233967304229736,
-0.28378042578697205,
0.37536418437957764,
-0.011011844500899315,
0.006591185927391052,
0.25938498973846436,
0.12824416160583496,
0.10668408125638962,
-0.17205020785331726,
0.009691204875707626,
0.20802587270736694,
-0.5298482179641724,
0.36970120668411255,
0.47729846835136414,
0.4435214698314667,
0.6078863739967346,
-0.014679763466119766,
-0.04493133723735809,
0.045707184821367264,
-0.14442098140716553,
0.3065044581890106,
0.012277120724320412,
-0.15027236938476562,
0.21000783145427704,
0.23948028683662415,
0.11469853669404984,
0.21850501000881195,
0.055695828050374985,
0.04671526327729225,
0.491743266582489,
0.0735761895775795,
-0.07577389478683472,
0.46394893527030945,
-0.10315664112567902,
-0.09439939260482788,
-0.3294445276260376,
-0.10423195362091064,
0.04103762283921242,
-0.34252363443374634,
0.22060483694076538,
-0.1431080400943756,
-0.28316864371299744,
-0.1700475513935089,
0.5426687002182007,
-0.1652354747056961,
-0.2160312533378601,
-0.100367471575737,
-0.07325045764446259,
-0.013395056128501892,
-0.11439036577939987,
0.21969474852085114,
-0.21504563093185425,
0.6112523674964905,
-0.10155933350324631,
0.03286806866526604,
0.0357804149389267,
-0.23426973819732666,
0.21196821331977844,
0.21250300109386444,
-0.011693425476551056,
0.004650669172406197,
0.29094818234443665,
-0.33940714597702026,
-0.2513791620731354,
0.26019933819770813,
0.4433901011943817,
0.07676401734352112,
-0.2038024365901947,
0.31794875860214233,
-0.04354413226246834,
0.22492918372154236,
0.056538671255111694,
0.013942830264568329,
0.00512576662003994,
0.09120813757181168,
0.11064764112234116,
0.04012264311313629,
-0.032169125974178314,
-0.11943793296813965,
0.15660136938095093,
0.030711360275745392,
-0.3521858751773834,
0.5341164469718933,
-0.31313902139663696,
-0.07604791224002838,
0.08261220157146454,
0.11361046880483627,
-0.4795506000518799,
0.08186614513397217,
0.6961772441864014,
-0.07884850353002548,
-0.26125895977020264,
-0.018569285050034523,
0.03931156545877457,
0.05087910592556,
0.41207537055015564,
0.13600552082061768,
0.34902194142341614,
-0.37971067428588867,
-0.13116556406021118,
-0.42874985933303833,
0.08600163459777832,
-0.23020508885383606,
0.004055827856063843,
0.04612516984343529,
0.20666763186454773,
0.11755794286727905,
0.041799504309892654,
0.042842090129852295,
-0.21543650329113007,
0.08646251261234283,
0.493436723947525,
-0.39323872327804565,
-0.07431508600711823,
-0.4586561918258667,
0.11608097702264786,
0.26705580949783325,
-0.0228530615568161,
-0.03189676254987717,
0.12276636064052582,
-0.054354023188352585,
-0.23559734225273132,
0.23365938663482666,
0.17777302861213684,
-0.03732554614543915,
0.28508949279785156,
0.08073883503675461,
0.3613443374633789,
0.0030187442898750305,
-0.23002752661705017,
-0.03415326029062271,
0.25322073698043823,
-0.4404388964176178,
0.10954134166240692,
-0.10914701968431473,
0.11539486050605774,
-0.18764635920524597,
-0.598824143409729,
-0.44897517561912537,
0.18354636430740356,
0.28004559874534607,
-0.46360889077186584,
-0.04046037793159485,
0.19633376598358154,
0.11692515760660172,
-0.2343721091747284,
0.49372631311416626,
0.5398153066635132,
-0.1500096619129181,
0.13803306221961975,
-0.2924443483352661,
0.025692477822303772,
0.3646093010902405,
-0.3754533529281616,
-0.21186792850494385,
-0.44899889826774597,
0.3961881399154663,
-0.13880832493305206,
0.13918673992156982,
-0.6909026503562927,
-0.07574541121721268,
0.1821945309638977,
0.05991608276963234,
-0.27545636892318726,
0.47606807947158813,
0.02520240843296051,
-0.2726511061191559,
-0.19228467345237732,
-0.048896290361881256,
0.2035464346408844,
-0.1772707998752594,
0.011682920157909393,
-0.3404439687728882
] |
https://github.com/huggingface/datasets/issues/6186 | In case someone also runs into this issue, I wrote a [blog post](https://forrestbao.github.io/2024/01/30/datasets_map_with_rank_multiple_GPUs.html) with a complete working example by compiling information from several PRs and issues here. Hope it can help. This issue cost me a few hours. I hope my blog post can save you time before the official document gets fixed. | Feature request: add code example of multi-GPU processing | ### Feature request
Would be great to add a code example of how to do multi-GPU processing with 🤗 Datasets in the documentation. cc @stevhliu
Currently the docs has a small [section](https://huggingface.co/docs/datasets/v2.3.2/en/process#map) on this saying "your big GPU call goes here", however it didn't work for me out-of-the-box.
Let's say you have a PyTorch model that can do translation, and you have multiple GPUs. In that case, you'd like to duplicate the model on each GPU, each processing (translating) a chunk of the data in parallel.
Here's how I tried to do that:
```
from datasets import load_dataset
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
from multiprocess import set_start_method
import torch
import os
dataset = load_dataset("mlfoundations/datacomp_small")
tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-distilled-600M")
model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-distilled-600M")
# put model on each available GPU
# also, should I do it like this or use nn.DataParallel?
model.to("cuda:0")
model.to("cuda:1")
set_start_method("spawn")
def translate_captions(batch, rank):
os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())
texts = batch["text"]
inputs = tokenizer(texts, padding=True, truncation=True, return_tensors="pt").to(model.device)
translated_tokens = model.generate(
**inputs, forced_bos_token_id=tokenizer.lang_code_to_id["eng_Latn"], max_length=30
)
translated_texts = tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)
batch["translated_text"] = translated_texts
return batch
updated_dataset = dataset.map(translate_captions, with_rank=True, num_proc=2, batched=True, batch_size=256)
```
I've personally tried running this script on a machine with 2 A100 GPUs.
## Error 1
Running the code snippet above from the terminal (python script.py) resulted in the following error:
```
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 125, in _main
prepare(preparation_data)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 289, in run_path
return _run_module_code(code, init_globals, run_name,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 96, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/niels/python_projects/datacomp/datasets_multi_gpu.py", line 16, in <module>
set_start_method("spawn")
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 247, in set_start_method
raise RuntimeError('context has already been set')
RuntimeError: context has already been set
```
## Error 2
Then, based on [this Stackoverflow answer](https://stackoverflow.com/a/71616344/7762882), I put the `set_start_method("spawn")` section in a try: catch block. This resulted in the following error:
```
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/dataset_dict.py", line 817, in <dictcomp>
k: dataset.map(
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2926, in map
with Pool(nb_of_missing_shards, initargs=initargs, initializer=initializer) as pool:
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 215, in __init__
self._repopulate_pool()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 306, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 329, in _repopulate_pool_static
w.start()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/process.py", line 121, in start
self._popen = self._Popen(self)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 288, in _Popen
return Popen(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 32, in __init__
super().__init__(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_fork.py", line 19, in __init__
self._launch(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 42, in _launch
prep_data = spawn.get_preparation_data(process_obj._name)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 134, in _check_not_importing_main
raise RuntimeError('''
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
```
So then I put the last line under a `if __name__ == '__main__':` block. Then the code snippet seemed to work, but it seemed that it's only leveraging a single GPU (based on monitoring `nvidia-smi`):
```
Mon Aug 28 12:19:24 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.01 Driver Version: 515.65.01 CUDA Version: 11.7 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA A100-SXM... On | 00000000:01:00.0 Off | 0 |
| N/A 55C P0 76W / 275W | 8747MiB / 81920MiB | 0% Default |
| | | Disabled |
+-------------------------------+----------------------+----------------------+
| 1 NVIDIA A100-SXM... On | 00000000:47:00.0 Off | 0 |
| N/A 67C P0 274W / 275W | 59835MiB / 81920MiB | 100% Default |
| | | Disabled |
```
Both GPUs should have equal GPU usage, but I've always noticed that the last GPU has way more usage than the other ones. This made me think that `os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())` might not work inside a Python script, especially if done after importing PyTorch?
### Motivation
Would be great to clarify how to do multi-GPU data processing.
### Your contribution
If my code snippet can be fixed, I can contribute it to the docs :) | 53 | Feature request: add code example of multi-GPU processing
### Feature request
Would be great to add a code example of how to do multi-GPU processing with 🤗 Datasets in the documentation. cc @stevhliu
Currently the docs has a small [section](https://huggingface.co/docs/datasets/v2.3.2/en/process#map) on this saying "your big GPU call goes here", however it didn't work for me out-of-the-box.
Let's say you have a PyTorch model that can do translation, and you have multiple GPUs. In that case, you'd like to duplicate the model on each GPU, each processing (translating) a chunk of the data in parallel.
Here's how I tried to do that:
```
from datasets import load_dataset
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
from multiprocess import set_start_method
import torch
import os
dataset = load_dataset("mlfoundations/datacomp_small")
tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-distilled-600M")
model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-distilled-600M")
# put model on each available GPU
# also, should I do it like this or use nn.DataParallel?
model.to("cuda:0")
model.to("cuda:1")
set_start_method("spawn")
def translate_captions(batch, rank):
os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())
texts = batch["text"]
inputs = tokenizer(texts, padding=True, truncation=True, return_tensors="pt").to(model.device)
translated_tokens = model.generate(
**inputs, forced_bos_token_id=tokenizer.lang_code_to_id["eng_Latn"], max_length=30
)
translated_texts = tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)
batch["translated_text"] = translated_texts
return batch
updated_dataset = dataset.map(translate_captions, with_rank=True, num_proc=2, batched=True, batch_size=256)
```
I've personally tried running this script on a machine with 2 A100 GPUs.
## Error 1
Running the code snippet above from the terminal (python script.py) resulted in the following error:
```
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 125, in _main
prepare(preparation_data)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 289, in run_path
return _run_module_code(code, init_globals, run_name,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 96, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/niels/python_projects/datacomp/datasets_multi_gpu.py", line 16, in <module>
set_start_method("spawn")
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 247, in set_start_method
raise RuntimeError('context has already been set')
RuntimeError: context has already been set
```
## Error 2
Then, based on [this Stackoverflow answer](https://stackoverflow.com/a/71616344/7762882), I put the `set_start_method("spawn")` section in a try: catch block. This resulted in the following error:
```
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/dataset_dict.py", line 817, in <dictcomp>
k: dataset.map(
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2926, in map
with Pool(nb_of_missing_shards, initargs=initargs, initializer=initializer) as pool:
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 215, in __init__
self._repopulate_pool()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 306, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 329, in _repopulate_pool_static
w.start()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/process.py", line 121, in start
self._popen = self._Popen(self)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 288, in _Popen
return Popen(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 32, in __init__
super().__init__(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_fork.py", line 19, in __init__
self._launch(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 42, in _launch
prep_data = spawn.get_preparation_data(process_obj._name)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 134, in _check_not_importing_main
raise RuntimeError('''
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
```
So then I put the last line under a `if __name__ == '__main__':` block. Then the code snippet seemed to work, but it seemed that it's only leveraging a single GPU (based on monitoring `nvidia-smi`):
```
Mon Aug 28 12:19:24 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.01 Driver Version: 515.65.01 CUDA Version: 11.7 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA A100-SXM... On | 00000000:01:00.0 Off | 0 |
| N/A 55C P0 76W / 275W | 8747MiB / 81920MiB | 0% Default |
| | | Disabled |
+-------------------------------+----------------------+----------------------+
| 1 NVIDIA A100-SXM... On | 00000000:47:00.0 Off | 0 |
| N/A 67C P0 274W / 275W | 59835MiB / 81920MiB | 100% Default |
| | | Disabled |
```
Both GPUs should have equal GPU usage, but I've always noticed that the last GPU has way more usage than the other ones. This made me think that `os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())` might not work inside a Python script, especially if done after importing PyTorch?
### Motivation
Would be great to clarify how to do multi-GPU data processing.
### Your contribution
If my code snippet can be fixed, I can contribute it to the docs :)
In case someone also runs into this issue, I wrote a [blog post](https://forrestbao.github.io/2024/01/30/datasets_map_with_rank_multiple_GPUs.html) with a complete working example by compiling information from several PRs and issues here. Hope it can help. This issue cost me a few hours. I hope my blog post can save you time before the official document gets fixed. | [
-0.13726481795310974,
-0.43240639567375183,
-0.001979593187570572,
0.09065330773591995,
-0.10275635123252869,
0.048385635018348694,
0.39975813031196594,
0.003309808671474457,
0.1566070318222046,
0.22367125749588013,
0.1868710219860077,
0.23762893676757812,
0.19287052750587463,
0.5128408074378967,
0.522918701171875,
-0.32018184661865234,
0.11813603341579437,
-0.22682499885559082,
0.33320340514183044,
0.1273239254951477,
-0.18765708804130554,
0.3333667814731598,
-0.09929713606834412,
0.215697780251503,
-0.4721122682094574,
-0.2038276344537735,
-0.28530845046043396,
0.03162965551018715,
0.16063891351222992,
-0.22111979126930237,
-0.09847809374332428,
0.298068642616272,
0.0012909993529319763,
0.6303572654724121,
-0.00011646699567791075,
-0.11362777650356293,
0.05465345457196236,
0.016327202320098877,
0.07945813983678818,
-0.177629292011261,
0.22675222158432007,
-0.2504114508628845,
0.10698533803224564,
-0.26256537437438965,
-0.02343132719397545,
-0.028642969205975533,
-0.044210344552993774,
-0.2531892657279968,
0.2555846571922302,
-0.018407993018627167,
0.11944039911031723,
0.16084566712379456,
-0.00857873260974884,
-0.1610921025276184,
-0.3832542598247528,
0.1771220862865448,
0.04658135026693344,
-0.009682543575763702,
0.4095132052898407,
-0.3020716905593872,
-0.12628576159477234,
0.5637154579162598,
-0.02627909556031227,
0.04005734995007515,
-0.1290358304977417,
-0.007826857268810272,
-0.19307777285575867,
-0.3386915326118469,
-0.09387467801570892,
0.13656041026115417,
-0.10574577748775482,
-0.4478246569633484,
-0.44006362557411194,
-0.43075433373451233,
-0.16315262019634247,
-0.47064751386642456,
-0.33834028244018555,
0.20736175775527954,
-0.21800586581230164,
0.06619656085968018,
-0.23226362466812134,
-0.2655092775821686,
0.06610982120037079,
0.022942421957850456,
-0.03881474584341049,
0.22137659788131714,
0.038144513964653015,
0.18081015348434448,
0.2640833854675293,
0.0979112908244133,
-0.12916254997253418,
0.08739263564348221,
0.2578856945037842,
-0.023411016911268234,
-0.6043911576271057,
0.0748874619603157,
0.3175150454044342,
-0.3048141598701477,
0.17235323786735535,
0.11439356207847595,
0.10078545659780502,
0.10357026755809784,
0.06845934689044952,
0.3968272805213928,
-0.18141087889671326,
0.045728348195552826,
-0.23265156149864197,
0.11734238266944885,
0.3198080062866211,
-0.09199150651693344,
0.08039076626300812,
-0.2084348499774933,
-0.07251022011041641,
-0.22268658876419067,
-0.3538980782032013,
0.22539524734020233,
0.2352011501789093,
0.04293382167816162,
-0.032003674656152725,
-0.1665005385875702,
-0.20427000522613525,
-0.0669514611363411,
0.04615724831819534,
0.26968878507614136,
0.22728070616722107,
0.28829044103622437,
0.025303415954113007,
0.17196056246757507,
-0.045768629759550095,
-0.45981329679489136,
-0.22345909476280212,
0.07843558490276337,
-0.27035850286483765,
0.38503459095954895,
0.13989853858947754,
-0.03770642727613449,
0.28386953473091125,
0.21978262066841125,
0.454135537147522,
-0.09292280673980713,
0.5181595683097839,
0.10049033164978027,
0.12257000058889389,
0.14631319046020508,
0.13831278681755066,
0.13250598311424255,
0.47914403676986694,
0.26230233907699585,
-0.20951515436172485,
0.16582340002059937,
-0.22458384931087494,
-0.37102293968200684,
-0.04199288785457611,
0.047635868191719055,
0.1300390064716339,
0.014542641118168831,
-0.2291683703660965,
0.5189156532287598,
0.23879824578762054,
-0.02367641031742096,
0.20874138176441193,
0.014654239639639854,
-0.3141019940376282,
-0.23248054087162018,
0.4379374086856842,
0.5276799201965332,
-0.2623005509376526,
-0.1772947907447815,
0.1776680052280426,
0.10872446745634079,
0.08485651016235352,
0.3919675052165985,
-0.23088431358337402,
0.23045235872268677,
-0.10177546739578247,
0.31368502974510193,
0.03668977692723274,
-0.34959959983825684,
0.154375821352005,
0.41493821144104004,
-0.4368666112422943,
0.02735009789466858,
0.2053980827331543,
0.01394694298505783,
0.10515525937080383,
0.2272937148809433,
0.1648889034986496,
0.37879568338394165,
-0.2669222354888916,
0.18421384692192078,
-0.026782631874084473,
-0.16408276557922363,
0.22497117519378662,
0.07652550935745239,
0.008983400650322437,
-0.07891934365034103,
-0.2709106206893921,
-0.1401703953742981,
0.31071731448173523,
-0.3887564539909363,
-0.08686745166778564,
-0.003976590000092983,
0.42369771003723145,
-0.046889521181583405,
0.134732186794281,
-0.23883652687072754,
-0.07879096269607544,
0.25001955032348633,
-0.05789417773485184,
0.09703810513019562,
0.036940980702638626,
-0.2642768621444702,
0.2818697690963745,
-0.03131144866347313,
-0.23275980353355408,
-0.4970204830169678,
0.0697963535785675,
0.12452025711536407,
-0.02884995937347412,
-0.10219292342662811,
-0.11276303231716156,
0.3690639138221741,
-0.1273595690727234,
-0.01789390668272972,
-0.28777608275413513,
0.20377084612846375,
-0.0831594318151474,
-0.3235185742378235,
-0.1924331933259964,
-0.021928466856479645,
0.18652690947055817,
-0.10716603696346283,
-0.03560876473784447,
0.30218347907066345,
0.29763805866241455,
0.04366501420736313,
0.03703790530562401,
0.31927424669265747,
0.3217100203037262,
0.0003169253468513489,
0.09845403581857681,
0.13694003224372864,
-0.14091072976589203,
-0.10977359861135483,
-0.18560287356376648,
0.46328622102737427,
0.11350454390048981,
0.24202296137809753,
-0.08600223809480667,
0.06320515275001526,
0.10767901688814163,
0.1716879904270172,
-0.1542675495147705,
0.20352287590503693,
0.23374557495117188,
0.13665816187858582,
0.218779057264328,
-0.3072965741157532,
-0.5030412077903748,
0.19718724489212036,
0.31892287731170654,
-0.11530224233865738,
0.13879665732383728,
0.03964545577764511,
-0.004091810435056686,
0.05304737389087677,
0.26514720916748047,
-0.23469361662864685,
0.018823523074388504,
0.16371455788612366,
0.048439908772706985,
0.08198543637990952,
-0.21254703402519226,
-0.08612753450870514,
0.003513820469379425,
0.036425914615392685,
0.08501167595386505,
-0.08011548221111298,
0.12098909914493561,
-0.14708596467971802,
-0.08864250779151917,
-0.29509812593460083,
0.263865202665329,
-0.14647458493709564,
-0.28411632776260376,
0.2300937920808792,
-0.1244259625673294,
-0.12683697044849396,
-0.3070197105407715,
-0.22900371253490448,
-0.26795491576194763,
-0.10462262481451035,
-0.04953736066818237,
0.13317473232746124,
0.059228651225566864,
0.26202845573425293,
0.05757424980401993,
0.4001174867153168,
-0.05412260815501213,
-0.12754014134407043,
0.15420980751514435,
-0.10009711235761642,
0.02882632613182068,
-0.027363119646906853,
0.20304705202579498,
-0.002792973071336746,
0.2650507688522339,
0.27797994017601013,
0.05390234291553497,
-0.2836598753929138,
-0.6495156288146973,
0.10735151171684265,
-0.05230918154120445,
-0.043283797800540924,
0.168809711933136,
-0.22204437851905823,
0.1279846727848053,
-0.12628042697906494,
0.09973480552434921,
-0.2412632405757904,
-0.17246529459953308,
-0.11694647371768951,
0.04209209606051445,
-0.018522538244724274,
-0.34055814146995544,
-0.1257685124874115,
0.03451240807771683,
-0.33644556999206543,
0.7512093782424927,
-0.26782894134521484,
0.18522165715694427,
-0.3420449495315552,
0.21844811737537384,
0.41732317209243774,
-0.07706023752689362,
-0.10423856973648071,
0.12207566946744919,
-0.2222617268562317,
0.04044001176953316,
-0.38753432035446167,
-0.19561229646205902,
-0.15322504937648773,
0.12778699398040771,
0.2567480802536011,
0.022582925856113434,
-0.11081362515687943,
-0.2836706042289734,
-0.08860928565263748,
0.11050793528556824,
0.048427239060401917,
0.2568923830986023,
0.36643534898757935,
-0.11063946038484573,
0.020293205976486206,
0.031001023948192596,
-0.4878546893596649,
0.26738688349723816,
0.14533013105392456,
-0.10296861827373505,
0.0015516206622123718,
0.5334910750389099,
0.33905237913131714,
0.7606999278068542,
0.21592170000076294,
0.007465981878340244,
0.10215451568365097,
-0.0057657817378640175,
-0.0042434558272361755,
0.10331498831510544,
-0.17316995561122894,
-0.03305227309465408,
-0.4584881663322449,
-0.1876434087753296,
0.015719901770353317,
-0.08352261781692505,
-0.09690897911787033,
-0.006443299353122711,
-0.12017791718244553,
-0.2085135281085968,
-0.08613231033086777,
0.10566562414169312,
-0.21639077365398407,
0.30132338404655457,
-0.42527252435684204,
-0.13490456342697144,
-0.2777252197265625,
0.5468804836273193,
0.14954550564289093,
0.10399559885263443,
0.44300156831741333,
-0.029097937047481537,
-0.14628726243972778,
-0.23774603009223938,
-0.2053356021642685,
0.22539299726486206,
-0.08108101785182953,
0.028677653521299362,
-0.09386318922042847,
0.04756540060043335,
-0.16022159159183502,
-0.3425484001636505,
0.9175221920013428,
-0.05383811146020889,
-0.24073535203933716,
0.00021738559007644653,
-0.7767176628112793,
-0.0967627465724945,
0.0002802610397338867,
-0.17745940387248993,
0.08329543471336365,
0.3165305554866791,
0.3290862441062927,
-0.13441196084022522,
-0.08487619459629059,
0.16684913635253906,
-0.11666533350944519,
-0.12171293795108795,
0.053184475749731064,
-0.2602272629737854,
-0.26665198802948,
-0.46504709124565125,
0.28710535168647766,
0.2763529419898987,
-0.17984262108802795,
-0.34102320671081543,
0.08445829153060913,
-0.018273696303367615,
0.05998878926038742,
0.09060539305210114,
0.11562949419021606,
-0.03739555552601814,
0.013924561440944672,
-0.021817386150360107,
0.34926533699035645,
0.10265977680683136,
0.014078659936785698,
0.11376459896564484,
-0.08603110909461975,
-0.48909792304039,
0.2950676679611206,
0.010424274951219559,
0.6215792894363403,
0.2701704502105713,
0.11215329170227051,
0.40111279487609863,
0.2684306502342224,
0.1053607314825058,
-0.1362503468990326,
0.19916892051696777,
0.21539852023124695,
0.24353757500648499,
-0.12264867126941681,
-0.5439552068710327,
0.46222564578056335,
0.3498312532901764,
-0.0706014409661293,
0.6956338286399841,
-0.037806328386068344,
-0.09816247224807739,
-0.03284687548875809,
0.2578716278076172,
0.6009117364883423,
-0.10265389829874039,
0.29417839646339417,
-0.0874977558851242,
-0.492634654045105,
0.4086037278175354,
-0.5855088829994202,
0.15324729681015015,
-0.3028750419616699,
-0.28081363439559937,
-0.019572757184505463,
-0.2748074531555176,
0.2435486912727356,
0.12862132489681244,
-0.36670857667922974,
0.19993901252746582,
0.04349295794963837,
-0.08330457657575607,
0.11621308326721191,
0.4153295159339905,
0.3163139522075653,
-0.5045558214187622,
-0.06624080240726471,
0.04681944474577904,
0.0752277821302414,
0.03474888205528259,
-0.1827327013015747,
-0.19388322532176971,
0.21158930659294128,
-0.11793903261423111,
-0.45810553431510925,
-0.09967547655105591,
-0.5606222748756409,
0.1195961982011795,
-0.22522467374801636,
-0.04953708499670029,
0.28914472460746765,
0.11357800662517548,
0.32963240146636963,
0.07611825317144394,
-0.19609446823596954,
-0.18980371952056885,
-0.048469480127096176,
-0.01310904324054718,
-0.3161090612411499,
-0.48386234045028687,
0.14349395036697388,
-0.06770458072423935,
-0.3479110896587372,
0.19163993000984192,
0.28515103459358215,
-0.06123730167746544,
-0.1872701495885849,
0.12385401129722595,
-0.325794517993927,
0.27604687213897705,
0.03570143133401871,
0.2613053619861603,
0.043633922934532166,
-0.3656446933746338,
0.03794925659894943,
0.27996742725372314,
-0.4606718122959137,
-0.14914073050022125,
-0.2895555794239044,
0.0005127489566802979,
-0.04743792489171028,
0.12466670572757721,
0.06106588989496231,
-0.35553568601608276,
0.00539616122841835,
0.5013360381126404,
0.046341873705387115,
-0.05394354462623596,
-0.1692665070295334,
0.3088708519935608,
-0.16455970704555511,
0.12646351754665375,
-0.30013763904571533,
-0.20930084586143494,
0.065439373254776,
-0.06849654018878937,
-0.04930827394127846,
-0.09942927956581116,
-0.14508076012134552,
0.0263046994805336,
-0.3648007810115814,
0.08772922307252884,
-0.17311403155326843,
0.21729709208011627,
0.13906466960906982,
0.41336095333099365,
0.1406976878643036,
0.4890801012516022,
-0.24726231396198273,
0.20370082557201385,
-0.019625745713710785,
0.05941655859351158,
0.18679526448249817,
0.11418695002794266,
0.034603383392095566,
0.17439121007919312,
-0.11191348731517792,
0.22132134437561035,
0.10593022406101227,
-0.10948453843593597,
-0.20515191555023193,
0.1088176965713501,
0.06157035008072853,
0.10006970167160034,
0.40128087997436523,
0.09312115609645844,
-0.23191124200820923,
-0.18796519935131073,
0.4555113911628723,
0.07979334890842438,
-0.04768458753824234,
0.19658972322940826,
0.08526930212974548,
-0.027219392359256744,
-0.1253235638141632,
-0.09192335605621338,
0.17993953824043274,
-0.18317358195781708,
0.4003690481185913,
0.24932703375816345,
0.07283224910497665,
0.060439951717853546,
-0.04592963308095932,
-0.027615081518888474,
0.3071083724498749,
-0.04781337082386017,
-0.20252485573291779,
-0.05196281522512436,
-0.30233967304229736,
-0.28378042578697205,
0.37536418437957764,
-0.011011844500899315,
0.006591185927391052,
0.25938498973846436,
0.12824416160583496,
0.10668408125638962,
-0.17205020785331726,
0.009691204875707626,
0.20802587270736694,
-0.5298482179641724,
0.36970120668411255,
0.47729846835136414,
0.4435214698314667,
0.6078863739967346,
-0.014679763466119766,
-0.04493133723735809,
0.045707184821367264,
-0.14442098140716553,
0.3065044581890106,
0.012277120724320412,
-0.15027236938476562,
0.21000783145427704,
0.23948028683662415,
0.11469853669404984,
0.21850501000881195,
0.055695828050374985,
0.04671526327729225,
0.491743266582489,
0.0735761895775795,
-0.07577389478683472,
0.46394893527030945,
-0.10315664112567902,
-0.09439939260482788,
-0.3294445276260376,
-0.10423195362091064,
0.04103762283921242,
-0.34252363443374634,
0.22060483694076538,
-0.1431080400943756,
-0.28316864371299744,
-0.1700475513935089,
0.5426687002182007,
-0.1652354747056961,
-0.2160312533378601,
-0.100367471575737,
-0.07325045764446259,
-0.013395056128501892,
-0.11439036577939987,
0.21969474852085114,
-0.21504563093185425,
0.6112523674964905,
-0.10155933350324631,
0.03286806866526604,
0.0357804149389267,
-0.23426973819732666,
0.21196821331977844,
0.21250300109386444,
-0.011693425476551056,
0.004650669172406197,
0.29094818234443665,
-0.33940714597702026,
-0.2513791620731354,
0.26019933819770813,
0.4433901011943817,
0.07676401734352112,
-0.2038024365901947,
0.31794875860214233,
-0.04354413226246834,
0.22492918372154236,
0.056538671255111694,
0.013942830264568329,
0.00512576662003994,
0.09120813757181168,
0.11064764112234116,
0.04012264311313629,
-0.032169125974178314,
-0.11943793296813965,
0.15660136938095093,
0.030711360275745392,
-0.3521858751773834,
0.5341164469718933,
-0.31313902139663696,
-0.07604791224002838,
0.08261220157146454,
0.11361046880483627,
-0.4795506000518799,
0.08186614513397217,
0.6961772441864014,
-0.07884850353002548,
-0.26125895977020264,
-0.018569285050034523,
0.03931156545877457,
0.05087910592556,
0.41207537055015564,
0.13600552082061768,
0.34902194142341614,
-0.37971067428588867,
-0.13116556406021118,
-0.42874985933303833,
0.08600163459777832,
-0.23020508885383606,
0.004055827856063843,
0.04612516984343529,
0.20666763186454773,
0.11755794286727905,
0.041799504309892654,
0.042842090129852295,
-0.21543650329113007,
0.08646251261234283,
0.493436723947525,
-0.39323872327804565,
-0.07431508600711823,
-0.4586561918258667,
0.11608097702264786,
0.26705580949783325,
-0.0228530615568161,
-0.03189676254987717,
0.12276636064052582,
-0.054354023188352585,
-0.23559734225273132,
0.23365938663482666,
0.17777302861213684,
-0.03732554614543915,
0.28508949279785156,
0.08073883503675461,
0.3613443374633789,
0.0030187442898750305,
-0.23002752661705017,
-0.03415326029062271,
0.25322073698043823,
-0.4404388964176178,
0.10954134166240692,
-0.10914701968431473,
0.11539486050605774,
-0.18764635920524597,
-0.598824143409729,
-0.44897517561912537,
0.18354636430740356,
0.28004559874534607,
-0.46360889077186584,
-0.04046037793159485,
0.19633376598358154,
0.11692515760660172,
-0.2343721091747284,
0.49372631311416626,
0.5398153066635132,
-0.1500096619129181,
0.13803306221961975,
-0.2924443483352661,
0.025692477822303772,
0.3646093010902405,
-0.3754533529281616,
-0.21186792850494385,
-0.44899889826774597,
0.3961881399154663,
-0.13880832493305206,
0.13918673992156982,
-0.6909026503562927,
-0.07574541121721268,
0.1821945309638977,
0.05991608276963234,
-0.27545636892318726,
0.47606807947158813,
0.02520240843296051,
-0.2726511061191559,
-0.19228467345237732,
-0.048896290361881256,
0.2035464346408844,
-0.1772707998752594,
0.011682920157909393,
-0.3404439687728882
] |
https://github.com/huggingface/datasets/issues/6185 | You can cast the `input_image` column to the `Image` type to fix the issue:
```python
ds.cast_column("input_image", datasets.Image())
``` | Error in saving the PIL image into *.arrow files using datasets.arrow_writer | ### Describe the bug
I am using the ArrowWriter from datasets.arrow_writer to save a json-style file as arrow files. Within the dictionary, it contains a feature called "image" which is a list of PIL.Image objects.
I am saving the json using the following script:
```
def save_to_arrow(path,temp):
with ArrowWriter(path=path,writer_batch_size=20) as writer:
writer.write_batch(temp)
writer.finalize()
```
However, when I attempt to restore the dataset and use the ```Dataset.from_file(path)``` function to load the arrow file, there seems to be an issue with the PIL.Image object in the dataset. The list of PIL.Images appears as follows rather than a normal PIL.Image object:
![1693051705440](https://github.com/huggingface/datasets/assets/14247682/03b204c2-d0fa-4d19-beff-6f4d7b83c848)
### Steps to reproduce the bug
1. Storing the data json into arrow files:
```
def save_to_arrow(path,temp):
with ArrowWriter(path=path,writer_batch_size=20) as writer:
writer.write_batch(temp)
writer.finalize()
save_to_arrow( path, json_file )
```
2. try to load the arrow file into the Dataset object using the ```Dataset.from_file(path)```
### Expected behavior
Except to saving the contained "image" feature as a list PIL.Image objects as the arrow file. And I can restore the dataset from the file.
### Environment info
- `datasets` version: 2.12.0
- Platform: Linux-5.4.0-150-generic-x86_64-with-glibc2.17
- Python version: 3.8.17
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.4.4 | 18 | Error in saving the PIL image into *.arrow files using datasets.arrow_writer
### Describe the bug
I am using the ArrowWriter from datasets.arrow_writer to save a json-style file as arrow files. Within the dictionary, it contains a feature called "image" which is a list of PIL.Image objects.
I am saving the json using the following script:
```
def save_to_arrow(path,temp):
with ArrowWriter(path=path,writer_batch_size=20) as writer:
writer.write_batch(temp)
writer.finalize()
```
However, when I attempt to restore the dataset and use the ```Dataset.from_file(path)``` function to load the arrow file, there seems to be an issue with the PIL.Image object in the dataset. The list of PIL.Images appears as follows rather than a normal PIL.Image object:
![1693051705440](https://github.com/huggingface/datasets/assets/14247682/03b204c2-d0fa-4d19-beff-6f4d7b83c848)
### Steps to reproduce the bug
1. Storing the data json into arrow files:
```
def save_to_arrow(path,temp):
with ArrowWriter(path=path,writer_batch_size=20) as writer:
writer.write_batch(temp)
writer.finalize()
save_to_arrow( path, json_file )
```
2. try to load the arrow file into the Dataset object using the ```Dataset.from_file(path)```
### Expected behavior
Except to saving the contained "image" feature as a list PIL.Image objects as the arrow file. And I can restore the dataset from the file.
### Environment info
- `datasets` version: 2.12.0
- Platform: Linux-5.4.0-150-generic-x86_64-with-glibc2.17
- Python version: 3.8.17
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.4.4
You can cast the `input_image` column to the `Image` type to fix the issue:
```python
ds.cast_column("input_image", datasets.Image())
``` | [
-0.19886647164821625,
0.19410349428653717,
0.05354221165180206,
0.4502630829811096,
0.2469896376132965,
0.06560923904180527,
0.23730714619159698,
0.09777480363845825,
-0.014207031577825546,
-0.1852148175239563,
0.04238203167915344,
0.4313201904296875,
-0.16450275480747223,
0.04493481665849686,
-0.04109659790992737,
-0.3775148093700409,
0.03904465585947037,
0.11026357859373093,
-0.014667440205812454,
-0.03029295802116394,
-0.19105684757232666,
0.25560083985328674,
0.04861098527908325,
0.4281964898109436,
-0.31161102652549744,
-0.1931503862142563,
0.09536353498697281,
0.14434927701950073,
-0.09577253460884094,
-0.3419822156429291,
0.09609203785657883,
-0.1162184402346611,
0.21086516976356506,
0.14973902702331543,
-0.00012088218500139192,
0.00013422220945358276,
0.4456981122493744,
-0.13031986355781555,
-0.12865625321865082,
-0.37951791286468506,
-0.35549986362457275,
-0.12638965249061584,
0.2908811867237091,
-0.32673218846321106,
0.35055118799209595,
-0.5473971366882324,
0.2428228110074997,
-0.0952363833785057,
0.3394007682800293,
0.2425728440284729,
0.17220538854599,
0.26363831758499146,
0.31228578090667725,
0.11668276786804199,
0.2721624970436096,
0.38348379731178284,
-0.177362859249115,
0.031060904264450073,
-0.2500874400138855,
0.0659065917134285,
0.15023097395896912,
0.2287578284740448,
-0.06975734978914261,
-0.23419272899627686,
0.295762300491333,
0.22893615067005157,
-0.23477120697498322,
-0.15056729316711426,
0.0862913578748703,
-0.041798193007707596,
0.43954673409461975,
-0.533639669418335,
-0.49785351753234863,
-0.17461644113063812,
0.08751950412988663,
-0.13549219071865082,
0.15621939301490784,
0.24828127026557922,
-0.012868940830230713,
-0.07604897767305374,
0.09734112024307251,
-0.16442880034446716,
-0.18661445379257202,
0.0038637425750494003,
0.14276303350925446,
-0.4148961007595062,
-0.13191118836402893,
0.23106366395950317,
0.03594394028186798,
-0.030419323593378067,
0.28980541229248047,
-0.350892573595047,
0.011755499988794327,
-0.021451961249113083,
-0.12348993122577667,
0.2566485106945038,
-0.10270971059799194,
-0.03173842281103134,
0.003713451325893402,
0.02600938454270363,
0.2551078796386719,
-0.11670967936515808,
-0.3032120168209076,
0.14035825431346893,
0.5703938603401184,
0.17096683382987976,
0.35651326179504395,
0.28978559374809265,
0.12287825345993042,
0.19787654280662537,
-0.09011776745319366,
-0.33396559953689575,
-0.005441248416900635,
-0.07070596516132355,
0.5060526728630066,
-0.14169898629188538,
0.4516618847846985,
-0.1268422156572342,
-0.3237934708595276,
0.1527886688709259,
-0.21400010585784912,
-0.05912518501281738,
-0.004893513396382332,
0.34209874272346497,
0.12583301961421967,
0.28076162934303284,
0.3319467306137085,
0.2858995199203491,
0.06688250601291656,
0.255089670419693,
-0.12871608138084412,
-0.03374228626489639,
-0.016096994280815125,
-0.02154591679573059,
-0.15273991227149963,
-0.2812679409980774,
0.2975410521030426,
-0.12380146980285645,
0.08850313723087311,
-0.1714588701725006,
0.12994787096977234,
-0.09083135426044464,
0.08911530673503876,
0.26278865337371826,
0.008846677839756012,
0.21875348687171936,
0.020180637016892433,
-0.23149918019771576,
-0.052712760865688324,
0.33342114090919495,
-0.24051924049854279,
-0.08540112525224686,
-0.14894966781139374,
0.005180263891816139,
-0.09600593894720078,
0.1001511812210083,
-0.6687943339347839,
-0.30867800116539,
0.17596814036369324,
0.05177990347146988,
0.09456850588321686,
-0.46794867515563965,
-0.046068739145994186,
-0.37265074253082275,
0.025302253663539886,
0.40041518211364746,
-0.2267591953277588,
0.06520257890224457,
-0.3011188209056854,
-0.3807049095630646,
0.0795539915561676,
0.39589953422546387,
-0.08106833696365356,
0.32547473907470703,
-0.24743488430976868,
0.31514862179756165,
0.18944841623306274,
-0.1570398062467575,
-0.34150612354278564,
0.05195334926247597,
0.15705230832099915,
0.23918657004833221,
-0.1755191683769226,
0.15940482914447784,
0.11576869338750839,
-0.17889048159122467,
-0.185167133808136,
0.04227769002318382,
-0.02268025279045105,
0.02471049129962921,
-0.16002240777015686,
-0.1376768797636032,
0.028153833001852036,
-0.11377286165952682,
-0.13238491117954254,
0.08553482592105865,
0.17170986533164978,
-0.013824712485074997,
0.21623969078063965,
-0.1621546447277069,
0.3111855983734131,
0.39808639883995056,
0.24728268384933472,
0.11038324236869812,
0.2415558099746704,
0.05997341126203537,
-0.5855589509010315,
-0.041948117315769196,
-0.26804858446121216,
-0.3280201852321625,
-0.5243335962295532,
0.05018496513366699,
-0.14108110964298248,
0.4717860519886017,
-0.34722840785980225,
-0.010055877268314362,
0.008816249668598175,
0.046278998255729675,
-0.23178395628929138,
0.12252095341682434,
-0.0704367533326149,
0.29458218812942505,
-0.18264935910701752,
0.15624575316905975,
-0.48534277081489563,
0.3938005566596985,
-0.02757621370255947,
-0.22093936800956726,
0.032784149050712585,
0.09658275544643402,
0.05254737287759781,
-0.06897550821304321,
-0.08249703049659729,
0.43629685044288635,
0.24272437393665314,
0.35680723190307617,
-0.13122673332691193,
-0.09135975688695908,
0.17776672542095184,
-0.6378239393234253,
0.08888866752386093,
0.21648235619068146,
0.44562000036239624,
-0.00415966659784317,
-0.16794675588607788,
0.40160486102104187,
-0.2381693422794342,
0.23994748294353485,
0.037736810743808746,
0.15589050948619843,
0.09491091966629028,
0.08308590948581696,
-0.20319141447544098,
-0.21786391735076904,
0.07088872045278549,
0.1376543939113617,
0.0047243088483810425,
-0.017856668680906296,
-0.5081270337104797,
0.028433991596102715,
0.2547372579574585,
0.13173061609268188,
0.12265464663505554,
0.21493199467658997,
-0.23771490156650543,
0.04558552801609039,
0.1457962691783905,
0.3843807578086853,
0.3625662922859192,
-0.0039894841611385345,
-0.2807963490486145,
-0.006219906732439995,
-0.01274348609149456,
0.017667364329099655,
0.333579421043396,
0.017199374735355377,
0.28735026717185974,
0.13750669360160828,
0.23446740210056305,
0.02481338381767273,
-0.36691415309906006,
-0.027481205761432648,
-0.16171827912330627,
0.12781955301761627,
-0.30046772956848145,
0.1351979374885559,
-0.21950554847717285,
-0.15261897444725037,
-0.24765785038471222,
0.11051417142152786,
-0.16828753054141998,
-0.19916921854019165,
-0.19569982588291168,
0.1864650547504425,
-0.13758307695388794,
0.003526877611875534,
-0.07209518551826477,
-0.09382957220077515,
0.10300860553979874,
-0.1880628764629364,
-0.30268213152885437,
-0.10046319663524628,
-0.11311468482017517,
-0.053989093750715256,
0.22421050071716309,
0.15503878891468048,
0.2848605215549469,
0.10622593760490417,
0.07285576313734055,
-0.6465103626251221,
-0.11704926937818527,
0.06732163578271866,
-0.1530156135559082,
0.29012244939804077,
0.29968777298927307,
0.047881245613098145,
-0.13643285632133484,
-0.10735342651605606,
0.2545666992664337,
-0.1108224019408226,
-0.36929434537887573,
0.1942092627286911,
0.13649429380893707,
-0.1740274727344513,
0.0738569051027298,
0.07076512277126312,
0.017920611426234245,
-0.2001916617155075,
0.6163845062255859,
0.22257772088050842,
0.20008204877376556,
0.064610555768013,
0.20039114356040955,
0.1854563057422638,
-0.06409457325935364,
-0.12596723437309265,
-0.031080886721611023,
0.05376414954662323,
0.45049795508384705,
-0.1536005735397339,
-0.5796552896499634,
0.07718983292579651,
0.038672491908073425,
0.06725530326366425,
0.07033123075962067,
-0.3429715037345886,
-0.319355845451355,
-0.16233514249324799,
0.1886957883834839,
0.04151751846075058,
0.20255427062511444,
0.12126831710338593,
0.23535235226154327,
0.08216780424118042,
-0.3204180598258972,
-0.5161584615707397,
0.21570366621017456,
0.042629919946193695,
0.30219119787216187,
0.13255806267261505,
0.2700948715209961,
-0.2279532551765442,
0.47516918182373047,
0.39358121156692505,
-0.0011091283522546291,
0.4189082086086273,
-0.08999370038509369,
0.2763783633708954,
-0.24715065956115723,
-0.2994902729988098,
-0.1293414831161499,
-0.18837226927280426,
-0.021614920347929,
-0.23830226063728333,
-0.02371356636285782,
0.10306399315595627,
0.13033872842788696,
0.1768389642238617,
-0.3510522246360779,
-0.24364161491394043,
0.08895077556371689,
-0.04346521943807602,
0.17524166405200958,
0.13054727017879486,
-0.1639525294303894,
-0.06885810941457748,
-0.03959783911705017,
0.10563334822654724,
0.22499684989452362,
0.2583129405975342,
-0.07120485603809357,
-0.44766104221343994,
-0.42123663425445557,
-0.6673489212989807,
0.18841543793678284,
0.13430337607860565,
0.3858177661895752,
0.185190349817276,
0.10256735235452652,
0.14305058121681213,
-0.020307915285229683,
0.647686779499054,
-0.0947561264038086,
-0.228348508477211,
0.06985478848218918,
-0.038827426731586456,
-0.5254215002059937,
0.07673966139554977,
-0.050949323922395706,
0.21333637833595276,
-0.3116114139556885,
0.3577524423599243,
-0.1785251498222351,
-0.030403245240449905,
-0.14426647126674652,
0.17973142862319946,
-0.27232837677001953,
-0.06714067608118057,
-0.1903848499059677,
-0.326986163854599,
-0.36228102445602417,
-0.32786524295806885,
0.05370711535215378,
0.17102015018463135,
0.07059174031019211,
0.10508307069540024,
-0.20818494260311127,
0.011299394071102142,
-0.19200760126113892,
-0.15905344486236572,
0.6564186811447144,
-0.2655862271785736,
0.10212506353855133,
0.19462697207927704,
0.13568823039531708,
0.46513739228248596,
0.5179929137229919,
-0.16343580186367035,
-0.17463073134422302,
-0.052681341767311096,
-0.12531210482120514,
0.23789428174495697,
0.024127505719661713,
-0.29181164503097534,
-0.06328099966049194,
-0.03819449990987778,
-0.06421297788619995,
0.015966612845659256,
-0.1825818121433258,
0.29308754205703735,
-0.024886058643460274,
0.01895497739315033,
-0.27048757672309875,
0.5384381413459778,
0.2917284667491913,
0.02287951111793518,
0.41765540838241577,
0.08262108266353607,
-0.31992170214653015,
0.5393431186676025,
0.3982696533203125,
0.7010486125946045,
-0.25048354268074036,
0.3773145079612732,
0.1251925826072693,
-0.39655131101608276,
0.5520774722099304,
0.28990843892097473,
0.03709813952445984,
-0.5276669859886169,
0.012776609510183334,
-0.009897451847791672,
-0.1335640251636505,
0.07047945261001587,
-0.06405360251665115,
-0.17961247265338898,
-0.026219159364700317,
-0.13012784719467163,
-0.3677864074707031,
-0.09953424334526062,
0.13099338114261627,
-0.21833118796348572,
-0.31486397981643677,
-0.2712777554988861,
0.016842901706695557,
0.09084442257881165,
-0.02089875191450119,
-0.09548555314540863,
-0.2096688151359558,
-0.2821580171585083,
-0.14142023026943207,
-0.3949672281742096,
0.17834320664405823,
-0.5240207314491272,
0.10804780572652817,
0.21031562983989716,
-0.3479039669036865,
0.04180571436882019,
0.4049926996231079,
0.02452688291668892,
-0.34405216574668884,
-0.06908806413412094,
0.04522939398884773,
0.09353505074977875,
0.0998372882604599,
-0.05551353842020035,
-0.135076642036438,
0.23795729875564575,
-0.03573370724916458,
0.24503633379936218,
-0.3010677993297577,
-0.24324223399162292,
-0.28783494234085083,
0.10416747629642487,
0.24043811857700348,
0.14823463559150696,
-0.13484938442707062,
-0.29769811034202576,
-0.03016093000769615,
-0.18049412965774536,
-0.24174834787845612,
0.03241315111517906,
0.30990707874298096,
0.10212463140487671,
0.21143610775470734,
-0.14053216576576233,
-0.1514832079410553,
0.2314443141222,
0.33073481917381287,
0.05101943016052246,
0.05997167527675629,
0.6766313910484314,
0.08653384447097778,
-0.05451865494251251,
-0.15468168258666992,
0.15858647227287292,
0.21476155519485474,
-0.5686489343643188,
0.5450083017349243,
-0.34795358777046204,
-0.006035014986991882,
-0.20570732653141022,
0.20794788002967834,
0.065676249563694,
-0.14863766729831696,
-0.05422379821538925,
-0.5371609926223755,
-0.3617558479309082,
0.256878137588501,
-0.046138349920511246,
0.1474107801914215,
-0.22527384757995605,
0.02353357896208763,
0.12629666924476624,
-0.24167272448539734,
-0.1716158092021942,
0.15853118896484375,
-0.01417231559753418,
0.2216612696647644,
0.3791041374206543,
0.139023095369339,
0.254256933927536,
-0.16950929164886475,
0.03364120423793793,
0.23979762196540833,
-0.033845268189907074,
-0.09070803225040436,
-0.29371169209480286,
0.18023346364498138,
0.14781060814857483,
-0.3532090485095978,
-0.15005464851856232,
-0.1909283995628357,
-0.07295271009206772,
-0.1739291548728943,
-0.13008154928684235,
0.1647733598947525,
-0.17601580917835236,
-0.01201687753200531,
-0.03784141317009926,
0.057716600596904755,
-0.111056387424469,
0.11778591573238373,
-0.09437765181064606,
0.23109619319438934,
0.10599622130393982,
0.34566715359687805,
-0.06425944715738297,
-0.04847445338964462,
-0.10217616707086563,
-0.008598800748586655,
-0.2513335347175598,
0.3815939724445343,
0.3844836950302124,
-0.3558158874511719,
-0.2973552942276001,
-0.00837896391749382,
0.5732990503311157,
0.394734650850296,
-0.33802443742752075,
0.021927565336227417,
0.04086343199014664,
0.038836605846881866,
-0.10218295454978943,
-0.13336947560310364,
0.2552892565727234,
0.0325937382876873,
-0.18940618634223938,
0.09582012891769409,
0.04111890494823456,
0.01364368200302124,
-0.31067511439323425,
0.013665065169334412,
0.06385737657546997,
-0.21079882979393005,
0.231254443526268,
0.32514888048171997,
0.1715480536222458,
0.30662965774536133,
0.4171593487262726,
0.2612249255180359,
0.3702695667743683,
0.502177357673645,
0.2262563556432724,
0.20029957592487335,
0.2761334478855133,
0.19180253148078918,
0.19773468375205994,
-0.4658011496067047,
0.08446162939071655,
0.008090078830718994,
0.005356963723897934,
0.2694610059261322,
0.1548938751220703,
0.4976408779621124,
0.009918741881847382,
-0.05484866350889206,
0.11010471731424332,
0.26632899045944214,
-0.189361572265625,
-0.20324566960334778,
-0.2460964024066925,
-0.13554073870182037,
-0.07621106505393982,
-0.011256508529186249,
-0.17007514834403992,
-0.15873852372169495,
0.2951768934726715,
0.1013832539319992,
-0.09863752126693726,
-0.3934929072856903,
-0.03644518554210663,
0.18253928422927856,
0.1475854218006134,
-0.27579981088638306,
0.094297394156456,
-0.04741892218589783,
-0.15328317880630493,
-0.041273366659879684,
0.5615392923355103,
0.3182929456233978,
0.34303244948387146,
0.32472100853919983,
0.13921187818050385,
0.044883325695991516,
-0.1103021502494812,
-0.006561167538166046,
0.10384255647659302,
0.1536186933517456,
0.012731630355119705,
0.31879979372024536,
0.0423424169421196,
0.03593632951378822,
-0.07110307365655899,
0.29744112491607666,
0.16637389361858368,
0.09068263322114944,
0.22023510932922363,
-0.29171350598335266,
-0.3810022473335266,
-0.14721596240997314,
0.03716043755412102,
-0.022640377283096313,
-0.15670564770698547,
0.5765636563301086,
-0.2368643581867218,
0.21507865190505981,
-0.20773804187774658,
0.02489730715751648,
-0.09692738950252533,
0.3141772449016571,
0.7304109334945679,
-0.03338891267776489,
-0.08494441956281662,
0.006575554609298706,
-0.5312994122505188,
0.038776323199272156,
0.0009941100142896175,
0.1538134217262268,
0.35255083441734314,
0.3391481339931488,
-0.21814295649528503,
0.05337336286902428,
0.4633532762527466,
0.20571213960647583,
-0.02766047790646553,
0.257446825504303,
-0.10566210001707077,
-0.26896169781684875,
0.44971439242362976,
-0.07577970623970032,
0.016021639108657837,
-0.4009975790977478,
0.20663559436798096,
-0.12271484732627869,
0.03527630865573883,
-0.2602328062057495,
-0.17524607479572296,
-0.27308374643325806,
-0.1418175846338272,
0.6344649195671082,
0.34144988656044006,
-0.0974908098578453,
-0.11529585719108582,
-0.3103308081626892,
-0.1002277284860611,
-0.17869743704795837,
-0.1998312771320343,
0.12703770399093628,
0.11775475740432739,
0.5777359008789062,
-0.19763755798339844,
0.09698216617107391,
-0.3888412415981293,
-0.020879458636045456,
-0.06576351076364517,
-0.082912877202034,
-0.43070492148399353,
0.31986522674560547,
-0.3775472342967987,
-0.05180427059531212,
0.08217381685972214,
0.3061353862285614,
-0.08572150021791458,
0.13233855366706848,
-0.3800603151321411,
-0.24018201231956482,
0.32350417971611023,
-0.5526667833328247,
-0.19320553541183472,
0.5335196256637573,
0.043620601296424866,
0.01040119118988514,
-0.3006734848022461,
-0.490156352519989,
-0.039726026356220245,
0.31376463174819946,
-0.17484170198440552,
-0.2503221929073334,
-0.08070532977581024,
-0.09497319906949997,
0.1019212156534195,
0.016870275139808655,
0.6180668473243713,
0.19531875848770142,
-0.14660122990608215,
0.38149160146713257,
-0.2601037621498108
] |
https://github.com/huggingface/datasets/issues/6184 | This issue is a duplicate of https://github.com/huggingface/datasets/issues/3297. This is a limitation of `dill`, a package we use for caching (non-`__main__` module objects are serialized by reference). You can find more info about it here: https://github.com/uqfoundation/dill/issues/424.
In your case, moving
```
data = datasets.load_dataset('json', data_files=['/tmp/test.json'], split='train')
data = data.map(transform)
```
to `test.py` and setting `transform.__module__ = None` at the end of `dataset.py` should fix the issue. | Map cache does not detect function changes in another module | ```python
# dataset.py
import os
import datasets
if not os.path.exists('/tmp/test.json'):
with open('/tmp/test.json', 'w') as file:
file.write('[{"text": "hello"}]')
def transform(example):
text = example['text']
# text += ' world'
return {'text': text}
data = datasets.load_dataset('json', data_files=['/tmp/test.json'], split='train')
data = data.map(transform)
```
```python
# test.py
import dataset
print(next(iter(dataset.data)))
```
Initialize cache
```
python3 test.py
# {'text': 'hello'}
```
Edit dataset.py and uncomment the commented line, run again
```
python3 test.py
# {'text': 'hello'}
# expected: {'text': 'hello world'}
```
Clear cache and run again
```
rm -rf ~/.cache/huggingface/datasets/*
python3 test.py
# {'text': 'hello world'}
```
If instead the two files are combined, then changes to the function are detected correctly. But it's expected when working on any realistic codebase that things will be modularized into separate files. | 65 | Map cache does not detect function changes in another module
```python
# dataset.py
import os
import datasets
if not os.path.exists('/tmp/test.json'):
with open('/tmp/test.json', 'w') as file:
file.write('[{"text": "hello"}]')
def transform(example):
text = example['text']
# text += ' world'
return {'text': text}
data = datasets.load_dataset('json', data_files=['/tmp/test.json'], split='train')
data = data.map(transform)
```
```python
# test.py
import dataset
print(next(iter(dataset.data)))
```
Initialize cache
```
python3 test.py
# {'text': 'hello'}
```
Edit dataset.py and uncomment the commented line, run again
```
python3 test.py
# {'text': 'hello'}
# expected: {'text': 'hello world'}
```
Clear cache and run again
```
rm -rf ~/.cache/huggingface/datasets/*
python3 test.py
# {'text': 'hello world'}
```
If instead the two files are combined, then changes to the function are detected correctly. But it's expected when working on any realistic codebase that things will be modularized into separate files.
This issue is a duplicate of https://github.com/huggingface/datasets/issues/3297. This is a limitation of `dill`, a package we use for caching (non-`__main__` module objects are serialized by reference). You can find more info about it here: https://github.com/uqfoundation/dill/issues/424.
In your case, moving
```
data = datasets.load_dataset('json', data_files=['/tmp/test.json'], split='train')
data = data.map(transform)
```
to `test.py` and setting `transform.__module__ = None` at the end of `dataset.py` should fix the issue. | [
0.0022165104746818542,
-0.06392253190279007,
-0.010190296918153763,
0.14868000149726868,
0.18692547082901,
-0.03552545607089996,
0.34139183163642883,
0.4110347628593445,
0.2190169394016266,
0.06012767180800438,
-0.2603941857814789,
0.38653305172920227,
0.03615827485918999,
-0.28218042850494385,
0.089989572763443,
0.2259172648191452,
0.07523520290851593,
-0.011714138090610504,
-0.39452359080314636,
0.0632796362042427,
-0.18086671829223633,
0.2587323784828186,
-0.19733209908008575,
-0.17104503512382507,
-0.19887635111808777,
0.16861799359321594,
-0.050401609390974045,
0.03948505222797394,
0.024165784940123558,
-0.17967408895492554,
0.15770453214645386,
0.11320941150188446,
-0.2656169533729553,
0.6544387340545654,
-0.00010733980889199302,
0.15205873548984528,
0.11303485929965973,
-0.13905607163906097,
-0.26593124866485596,
-0.2518409788608551,
0.16023661196231842,
-0.12605389952659607,
0.06649943441152573,
-0.3626922070980072,
-0.16799511015415192,
0.16608822345733643,
-0.12409372627735138,
-0.6323739290237427,
0.4977177679538727,
0.12748581171035767,
0.24750033020973206,
0.18532051146030426,
0.065675750374794,
0.19791318476200104,
0.30966660380363464,
0.10234665125608444,
-0.01792318746447563,
0.2849808931350708,
0.056942056864500046,
0.06063695251941681,
-0.18887761235237122,
0.4638614058494568,
-0.18901002407073975,
0.06346438825130463,
0.3367040753364563,
0.12108099460601807,
-0.17880813777446747,
-0.13667601346969604,
0.07281279563903809,
-0.12465441226959229,
0.14555904269218445,
-0.7188978791236877,
-0.5339226722717285,
-0.33543622493743896,
-0.27340167760849,
-0.2124846875667572,
0.3204774856567383,
-0.27005282044410706,
0.09632323682308197,
0.13270960748195648,
-0.24243468046188354,
-0.1731351613998413,
0.2993074953556061,
0.022778766229748726,
-0.04906861111521721,
-0.0181092731654644,
-0.23890626430511475,
0.06139777600765228,
0.10918152332305908,
-0.05894562602043152,
-0.05132630094885826,
-0.002637794241309166,
0.08073461055755615,
0.1853560507297516,
-0.16415874660015106,
-0.0734277069568634,
0.15546491742134094,
-0.1657525897026062,
-0.004690729081630707,
-0.046882957220077515,
0.03970802575349808,
0.09381803870201111,
-0.0478544645011425,
0.13954776525497437,
-0.0681392177939415,
0.5950815677642822,
-0.017521966248750687,
0.20402982831001282,
0.14515681564807892,
0.020208608359098434,
-0.4722776412963867,
-0.04540257900953293,
0.2866400182247162,
-0.12929099798202515,
0.2706371545791626,
0.15554583072662354,
0.2311042845249176,
0.05732125788927078,
0.12605500221252441,
-0.25530901551246643,
-0.12169523537158966,
-0.24329662322998047,
0.08946779370307922,
0.38113081455230713,
0.003092300146818161,
0.19450077414512634,
0.20015299320220947,
0.19879665970802307,
-0.21301321685314178,
0.1075502336025238,
-0.33470624685287476,
-0.008634494617581367,
-0.23025982081890106,
0.3827568590641022,
0.2187206894159317,
0.003437228500843048,
0.19716671109199524,
-0.02840070053935051,
0.12432731688022614,
-0.11789307743310928,
0.11526431143283844,
-0.058275219053030014,
0.44585439562797546,
0.06209225580096245,
-0.2098996639251709,
0.3190521001815796,
0.402233362197876,
-0.16409337520599365,
-0.2531278133392334,
-0.1511630117893219,
-0.40657007694244385,
-0.15090638399124146,
0.2027430236339569,
0.16132879257202148,
-0.2784775495529175,
0.16438241302967072,
-0.11421968042850494,
0.0255383662879467,
0.373273104429245,
-0.5958346724510193,
0.149794802069664,
-0.01939363405108452,
-0.3583294749259949,
-0.3865640163421631,
0.28269171714782715,
0.5594461560249329,
0.0602470338344574,
-0.21304330229759216,
0.06621754169464111,
0.23441630601882935,
-0.042411599308252335,
0.2639964818954468,
-0.19947335124015808,
-0.07656801491975784,
-0.2316778153181076,
0.1343136578798294,
0.37692558765411377,
-0.5283073782920837,
-0.6581430435180664,
0.15803170204162598,
-0.23421311378479004,
0.26609089970588684,
0.1161842942237854,
-0.2166975885629654,
0.04864008352160454,
-0.2967328727245331,
0.19208687543869019,
0.10285164415836334,
0.26605844497680664,
0.13198135793209076,
-0.30370163917541504,
-0.14022114872932434,
0.15965427458286285,
-0.24626512825489044,
-0.22070108354091644,
0.17741623520851135,
-0.07966475188732147,
-0.09382103383541107,
0.2736036777496338,
0.0034426506608724594,
0.3798576891422272,
0.34600305557250977,
0.116890087723732,
0.11164109408855438,
0.09469150751829147,
-0.11156485974788666,
-0.3747357428073883,
0.16707058250904083,
-0.14185374975204468,
-0.17831048369407654,
-0.3622671365737915,
-0.127836212515831,
-0.005110137164592743,
-0.10343461483716965,
-0.06425546109676361,
-0.3878474831581116,
0.21399886906147003,
0.21723249554634094,
0.30415958166122437,
0.0680692195892334,
-0.28036487102508545,
0.34445297718048096,
0.30465126037597656,
-0.011680152267217636,
-0.4693097174167633,
-0.03759611397981644,
-0.02353592962026596,
-0.1280653029680252,
-0.17569439113140106,
0.12440374493598938,
0.11293813586235046,
-0.19323822855949402,
-0.3064683973789215,
0.3112379014492035,
0.056687675416469574,
0.32375407218933105,
-0.010473118163645267,
0.029596194624900818,
0.061579808592796326,
0.09855546057224274,
0.2344934493303299,
0.06627123057842255,
-0.004050686955451965,
0.024627462029457092,
-0.09519302845001221,
0.26144587993621826,
-0.073259636759758,
0.13292497396469116,
-0.06159712001681328,
-0.22492556273937225,
0.07277794927358627,
-0.04105731472373009,
-0.10418393462896347,
-0.46951910853385925,
-0.1712256819009781,
-0.08449389040470123,
0.5274527668952942,
0.24341227114200592,
0.2470058649778366,
0.24136051535606384,
0.8131784200668335,
0.16589096188545227,
0.2678906321525574,
0.05404205620288849,
-0.28544485569000244,
-0.25493061542510986,
-0.04870498180389404,
0.10259979963302612,
0.533880352973938,
0.11010908335447311,
0.3235964775085449,
0.16804927587509155,
0.26825910806655884,
0.01963776722550392,
-0.014923766255378723,
-0.1343364119529724,
0.14950069785118103,
-0.04871228337287903,
0.24561378359794617,
0.07904036343097687,
-0.06729193776845932,
0.03747934103012085,
0.015156395733356476,
-0.04230400174856186,
-0.150356724858284,
0.1962868571281433,
-0.31359946727752686,
0.20102494955062866,
-0.2707661986351013,
-0.28578615188598633,
-0.1774917095899582,
-0.21717968583106995,
-0.08828900754451752,
0.27942273020744324,
-0.03867202252149582,
0.18975475430488586,
0.2246946096420288,
-0.17147493362426758,
-0.002475552260875702,
-0.5197955369949341,
-0.23828455805778503,
-0.15775133669376373,
-0.11498221755027771,
-0.024932673200964928,
0.16419070959091187,
-0.15766584873199463,
-0.07191124558448792,
-0.19518768787384033,
-0.06765522062778473,
-0.0995083749294281,
-0.30661314725875854,
0.062169481068849564,
-0.19075189530849457,
0.030917959287762642,
-0.0034489482641220093,
-0.046514369547367096,
-0.024742286652326584,
-0.12561628222465515,
0.4127737879753113,
-0.4915171265602112,
-0.3278992772102356,
-0.038335420191287994,
0.1592460423707962,
0.16510221362113953,
-0.2368324100971222,
-0.3519479036331177,
-0.022083010524511337,
-0.5186094641685486,
0.35111889243125916,
-0.20265215635299683,
-0.02388150990009308,
0.1898130476474762,
0.11695021390914917,
0.0466628223657608,
-0.08937679976224899,
0.2843155860900879,
-0.32845866680145264,
-0.30654799938201904,
0.25308743119239807,
-0.2804657816886902,
-0.11782844364643097,
-0.019994735717773438,
-0.03051929920911789,
0.22846972942352295,
0.15413326025009155,
-0.2939092516899109,
-0.3274536430835724,
-0.14832837879657745,
0.10752976685762405,
0.014240703545510769,
0.16794201731681824,
0.447659432888031,
0.13288868963718414,
-0.1116715520620346,
-0.3086194396018982,
-0.5197350978851318,
-0.03623345121741295,
0.1402423083782196,
0.1736045628786087,
0.015740863978862762,
0.32238754630088806,
0.026203610002994537,
0.6470316052436829,
0.33288323879241943,
0.024737747386097908,
0.28425121307373047,
0.03745602071285248,
0.2603147625923157,
-0.237977534532547,
-0.4004840850830078,
0.043482109904289246,
-0.2606962025165558,
-0.07707586884498596,
0.08936022222042084,
-0.054452769458293915,
-0.22913070023059845,
-0.2040916234254837,
-0.1556277722120285,
-0.4467274844646454,
-0.4688204824924469,
0.20869719982147217,
-0.09230580180883408,
0.1290941834449768,
0.18940110504627228,
0.07048369199037552,
-0.4902699887752533,
0.10533653199672699,
0.25086891651153564,
0.04227280616760254,
0.32857847213745117,
0.11785735189914703,
-0.17414593696594238,
-0.038217149674892426,
-0.26363199949264526,
0.27899765968322754,
0.1223638504743576,
0.06182271987199783,
-0.027035459876060486,
-0.4939090311527252,
-0.1841496229171753,
-0.01654195226728916,
0.7159232497215271,
-0.25510111451148987,
-0.09982110559940338,
0.16257306933403015,
-0.25138866901397705,
-0.43868061900138855,
0.11677606403827667,
0.1911657750606537,
0.20008710026741028,
0.2736610174179077,
0.49878939986228943,
-0.3016933798789978,
-0.1663215011358261,
-0.1797724962234497,
0.21613264083862305,
0.0669199526309967,
-0.12025254219770432,
-0.37403494119644165,
-0.15157462656497955,
-0.5080682039260864,
-0.24241040647029877,
-0.0632615014910698,
-0.16432037949562073,
0.08632561564445496,
0.06097026169300079,
0.0670977383852005,
-0.03377201408147812,
-0.10444526374340057,
0.20394152402877808,
0.4092350900173187,
0.09348271787166595,
0.058298319578170776,
0.3687664866447449,
0.26072046160697937,
-0.14068663120269775,
0.5885735154151917,
-0.2117287814617157,
-0.13370494544506073,
0.0438561886548996,
0.23084646463394165,
-0.10899189114570618,
0.25099533796310425,
0.007559165358543396,
0.20993828773498535,
0.14526817202568054,
0.12751270830631256,
-0.11320361495018005,
-0.09562887251377106,
0.26571425795555115,
0.10852855443954468,
-0.09460853040218353,
-0.5653770565986633,
0.3350435495376587,
0.21355609595775604,
-0.04845169931650162,
0.2231040596961975,
-0.2534366846084595,
-0.2131672203540802,
0.31088516116142273,
-0.10396593809127808,
0.8465755581855774,
-0.06739519536495209,
0.19947251677513123,
0.1540614813566208,
-0.1638782024383545,
0.35727936029434204,
-0.24624082446098328,
0.24951955676078796,
-0.09132613986730576,
-0.0600869357585907,
0.09290285408496857,
-0.06815993040800095,
-0.12107595801353455,
-0.06770987063646317,
-0.5148903131484985,
0.03961138799786568,
0.022914841771125793,
0.2961256802082062,
-0.14722320437431335,
0.0031089186668395996,
-0.09000214189291,
-0.17290529608726501,
-0.38745272159576416,
0.24083298444747925,
0.09255647659301758,
0.3396061956882477,
0.19082488119602203,
-0.2772630453109741,
-0.4541451930999756,
0.003915503621101379,
0.21506449580192566,
0.08108054846525192,
-0.31052330136299133,
0.1663205921649933,
0.08049426972866058,
-0.15428753197193146,
-0.07009115815162659,
0.2590945065021515,
0.31046581268310547,
0.04577839374542236,
-0.07960023730993271,
0.009188001975417137,
0.059580691158771515,
0.31071722507476807,
-0.09895126521587372,
-0.20252034068107605,
0.25849878787994385,
0.06861905008554459,
-0.13886678218841553,
0.09172628819942474,
-0.03572513535618782,
-0.3905777633190155,
-0.08018483966588974,
0.3485478162765503,
-0.2184896022081375,
-0.2762417495250702,
0.03604825586080551,
0.17346110939979553,
-0.0355321504175663,
-0.16681763529777527,
0.17302349209785461,
0.04828168451786041,
-0.17408739030361176,
0.24937321245670319,
-0.3815898001194,
-0.34370869398117065,
-0.12426211684942245,
0.5460872650146484,
0.051744986325502396,
0.013523980975151062,
0.33213770389556885,
-0.05618758127093315,
-0.05037428438663483,
-0.07217233628034592,
-0.23993068933486938,
0.07101723551750183,
-0.30605095624923706,
0.19413873553276062,
-0.07036396116018295,
-0.11465902626514435,
0.09398993849754333,
-0.08289574831724167,
0.021391501650214195,
0.23227182030677795,
-0.21012312173843384,
-0.17464417219161987,
-0.46143674850463867,
0.2548661530017853,
0.011898336000740528,
0.07818859815597534,
0.16438275575637817,
0.10479260981082916,
-0.010282576084136963,
0.4569125175476074,
-0.389209508895874,
0.14165133237838745,
-0.055957429111003876,
0.033864255994558334,
0.1472356915473938,
-0.2302841693162918,
0.2499173879623413,
-0.03516186773777008,
0.13471783697605133,
0.24510891735553741,
-0.418256014585495,
-0.26522862911224365,
-0.030141830444335938,
0.06166019290685654,
-0.09360217303037643,
0.19256094098091125,
-0.16877926886081696,
0.037023596465587616,
0.2776099443435669,
-0.54751056432724,
0.18780381977558136,
0.2375791370868683,
0.048551976680755615,
0.11457350105047226,
-0.0110524483025074,
-0.16727131605148315,
0.17966313660144806,
-0.01096920296549797,
-0.03431267663836479,
-0.12048367410898209,
-0.11375501751899719,
0.14276762306690216,
-0.08412833511829376,
0.14255259931087494,
0.08265367150306702,
-0.05086427554488182,
0.05480001121759415,
0.06053975969552994,
0.25500407814979553,
-0.17152930796146393,
-0.05189100652933121,
0.17006823420524597,
0.26795095205307007,
0.2086530178785324,
-0.06840944290161133,
0.0037963390350341797,
-0.06077668070793152,
0.18552859127521515,
-0.05701063573360443,
-0.04226350039243698,
0.45735660195350647,
-0.1914394199848175,
0.25228700041770935,
0.32195818424224854,
0.06066104769706726,
0.20432747900485992,
0.38124579191207886,
0.19515113532543182,
0.31932368874549866,
-0.2469044029712677,
-0.010498635470867157,
0.0163433700799942,
0.01465434581041336,
0.14469590783119202,
0.45963090658187866,
0.21046751737594604,
0.29376065731048584,
0.28709372878074646,
0.16925036907196045,
0.31449782848358154,
-0.2278233766555786,
0.024997051805257797,
0.11106004565954208,
-0.17123831808567047,
0.17356158792972565,
0.1356089562177658,
0.050943776965141296,
0.2919808030128479,
-0.13670246303081512,
0.22263672947883606,
-0.28270530700683594,
-0.10483317822217941,
0.20455734431743622,
0.3142915964126587,
-0.13338348269462585,
-0.11126261949539185,
0.3515501618385315,
-0.10412988066673279,
-0.027028411626815796,
-0.16145965456962585,
0.008901942521333694,
-0.0455220490694046,
0.566819965839386,
0.0698850229382515,
0.0049903057515621185,
-0.1067793145775795,
-0.24456915259361267,
-0.1576036512851715,
0.3382178843021393,
-0.13200542330741882,
0.20160634815692902,
0.07017435133457184,
-0.18441709876060486,
-0.07797394692897797,
0.31670451164245605,
0.31709155440330505,
0.2799583375453949,
-0.0632719099521637,
0.2760978937149048,
0.16324931383132935,
-0.15053440630435944,
-0.29986342787742615,
0.23637841641902924,
-0.03690723329782486,
-0.27046501636505127,
0.09961549937725067,
0.2472977340221405,
-0.2422216236591339,
-0.09855332225561142,
-0.2615371346473694,
0.2676306664943695,
-0.10842432081699371,
0.20491597056388855,
-0.3088047504425049,
0.03792627900838852,
-0.2503354847431183,
-0.15467411279678345,
-0.481593519449234,
-0.040104128420352936,
0.2490345984697342,
-0.1728813648223877,
0.16493657231330872,
-0.25128811597824097,
0.11757904291152954,
0.3194098174571991,
0.2391047179698944,
0.3010372221469879,
0.04112495481967926,
-0.12202078104019165,
-0.07570578902959824,
-0.5671635866165161,
0.326524943113327,
-0.022096186876296997,
0.23817917704582214,
-0.22706162929534912,
0.19544978439807892,
0.09022976458072662,
0.05687003210186958,
0.14608359336853027,
-0.18026480078697205,
0.01133260503411293,
0.13134923577308655,
-0.323002427816391,
-0.18690580129623413,
-0.18634921312332153,
0.021025342866778374,
0.4002154469490051,
-0.25635409355163574,
0.09645941853523254,
-0.031475313007831573,
0.16899430751800537,
-0.2950729727745056,
0.14378857612609863,
0.07510055601596832,
0.06282539665699005,
0.510287344455719,
0.2998047471046448,
0.10056491196155548,
-0.10658527910709381,
-0.2059411257505417,
-0.23759382963180542,
-0.0969795286655426,
-0.20944003760814667,
-0.020490363240242004,
-0.10962281376123428,
0.36373886466026306,
-0.32174918055534363,
-0.3531966209411621,
-0.3198736608028412,
0.2796984016895294,
0.20971712470054626,
-0.1223662793636322,
0.02630847692489624,
0.004251152276992798,
-0.0012792274355888367,
0.12589921057224274,
0.1942451298236847,
0.548178493976593,
-0.003715669736266136,
0.44560396671295166,
-0.3711000680923462,
-0.09208311885595322,
0.5785045027732849,
-0.3505421280860901,
-0.28922906517982483,
0.18050888180732727,
0.06732127070426941,
-0.19901809096336365,
-0.36293768882751465,
-0.49190694093704224,
0.0739167183637619,
0.22452253103256226,
0.1375897079706192,
-0.235054150223732,
0.21824592351913452,
-0.10549065470695496,
0.08135753870010376,
-0.16345539689064026,
0.3717404901981354,
0.13961061835289001,
-0.008574314415454865,
0.10150350630283356,
-0.011399023234844208
] |
https://github.com/huggingface/datasets/issues/6184 | I understand this may be a limitation of an upstream tool, but for a user for datasets this is very annoying, as when you have dozens of different datasets with different preprocessing functions you can't really move them all into the same file. It may be worth seeing if there is a way to specialize the dependency (eg. subclass it) and enforce behaviors that makes sense for your product.
I was able to work around this for now by setting `__module__ = None`. If such workarounds are required for now it may be better to document it somewhere than a single obscure issue from a long time ago.
As this is a duplicate issue I'm closing it.
I have another issue with the cache https://github.com/huggingface/datasets/issues/6179 can you take a look? | Map cache does not detect function changes in another module | ```python
# dataset.py
import os
import datasets
if not os.path.exists('/tmp/test.json'):
with open('/tmp/test.json', 'w') as file:
file.write('[{"text": "hello"}]')
def transform(example):
text = example['text']
# text += ' world'
return {'text': text}
data = datasets.load_dataset('json', data_files=['/tmp/test.json'], split='train')
data = data.map(transform)
```
```python
# test.py
import dataset
print(next(iter(dataset.data)))
```
Initialize cache
```
python3 test.py
# {'text': 'hello'}
```
Edit dataset.py and uncomment the commented line, run again
```
python3 test.py
# {'text': 'hello'}
# expected: {'text': 'hello world'}
```
Clear cache and run again
```
rm -rf ~/.cache/huggingface/datasets/*
python3 test.py
# {'text': 'hello world'}
```
If instead the two files are combined, then changes to the function are detected correctly. But it's expected when working on any realistic codebase that things will be modularized into separate files. | 130 | Map cache does not detect function changes in another module
```python
# dataset.py
import os
import datasets
if not os.path.exists('/tmp/test.json'):
with open('/tmp/test.json', 'w') as file:
file.write('[{"text": "hello"}]')
def transform(example):
text = example['text']
# text += ' world'
return {'text': text}
data = datasets.load_dataset('json', data_files=['/tmp/test.json'], split='train')
data = data.map(transform)
```
```python
# test.py
import dataset
print(next(iter(dataset.data)))
```
Initialize cache
```
python3 test.py
# {'text': 'hello'}
```
Edit dataset.py and uncomment the commented line, run again
```
python3 test.py
# {'text': 'hello'}
# expected: {'text': 'hello world'}
```
Clear cache and run again
```
rm -rf ~/.cache/huggingface/datasets/*
python3 test.py
# {'text': 'hello world'}
```
If instead the two files are combined, then changes to the function are detected correctly. But it's expected when working on any realistic codebase that things will be modularized into separate files.
I understand this may be a limitation of an upstream tool, but for a user for datasets this is very annoying, as when you have dozens of different datasets with different preprocessing functions you can't really move them all into the same file. It may be worth seeing if there is a way to specialize the dependency (eg. subclass it) and enforce behaviors that makes sense for your product.
I was able to work around this for now by setting `__module__ = None`. If such workarounds are required for now it may be better to document it somewhere than a single obscure issue from a long time ago.
As this is a duplicate issue I'm closing it.
I have another issue with the cache https://github.com/huggingface/datasets/issues/6179 can you take a look? | [
-0.05461974814534187,
0.08799296617507935,
-0.10253699123859406,
0.09561468660831451,
0.23779329657554626,
-0.07245713472366333,
0.30146026611328125,
0.36234450340270996,
0.31089890003204346,
-0.09996545314788818,
-0.01867002807557583,
0.3402145504951477,
0.06084798276424408,
-0.12410904467105865,
0.030805151909589767,
0.33176201581954956,
0.10557860136032104,
0.013779815286397934,
-0.5336185097694397,
0.06263655424118042,
-0.08038193732500076,
0.21347834169864655,
-0.14104361832141876,
-0.2240416258573532,
-0.07093262672424316,
0.08123951405286789,
0.0960952416062355,
-0.08806487172842026,
-0.0827285647392273,
-0.14985187351703644,
0.4472760856151581,
0.2729349136352539,
-0.27419960498809814,
0.5939151644706726,
-0.0001102119786082767,
0.15528130531311035,
0.22797606885433197,
-0.11509118974208832,
-0.1563279926776886,
-0.23023751378059387,
-0.2317863404750824,
-0.22631055116653442,
0.034725576639175415,
-0.2796997129917145,
-0.0403912179172039,
0.15820711851119995,
-0.1453823745250702,
-0.6731675863265991,
0.5741512179374695,
0.09745452553033829,
0.23130837082862854,
0.09619440138339996,
0.11412498354911804,
0.2818458676338196,
0.2968807816505432,
0.13689130544662476,
-0.14433342218399048,
0.21971604228019714,
0.13758687674999237,
-0.004643753170967102,
-0.1815178394317627,
0.507009744644165,
-0.20265810191631317,
0.11853843927383423,
0.3680157959461212,
-0.021204061806201935,
0.010470514185726643,
-0.340766578912735,
0.07566593587398529,
-0.08376727998256683,
0.28686395287513733,
-0.600515604019165,
-0.4478456377983093,
-0.4881097674369812,
-0.27005550265312195,
-0.15888264775276184,
0.3537006676197052,
-0.20050674676895142,
0.07488110661506653,
0.1555129736661911,
-0.29363906383514404,
-0.17847087979316711,
0.2068304568529129,
0.06081957370042801,
0.08547399938106537,
0.07120398432016373,
-0.26572751998901367,
0.05458880588412285,
0.1817893534898758,
-0.048395976424217224,
0.08735807240009308,
-0.04670016095042229,
-0.002188012469559908,
0.11092860996723175,
-0.2625083923339844,
-0.08808121830224991,
0.09894303977489471,
-0.07555681467056274,
-0.018346350640058517,
0.022332768887281418,
-0.11953911185264587,
0.25267112255096436,
-0.12270951271057129,
0.15895655751228333,
-0.012811052612960339,
0.5571771264076233,
0.008165325969457626,
0.2889573872089386,
0.2318921983242035,
0.0516633540391922,
-0.5014457702636719,
0.017297087237238884,
0.3047025203704834,
-0.18279427289962769,
0.27257391810417175,
0.16482502222061157,
0.2574780583381653,
-0.010102145373821259,
0.12436731904745102,
-0.3123973608016968,
-0.009113490581512451,
-0.17716416716575623,
0.1767745316028595,
0.28509682416915894,
-0.029134131968021393,
0.40784981846809387,
0.14460539817810059,
0.21746189892292023,
-0.16791218519210815,
0.034735120832920074,
-0.24126313626766205,
-0.007719650864601135,
-0.2909505367279053,
0.373566210269928,
0.20623748004436493,
0.0775957852602005,
0.12735515832901,
0.04892491176724434,
0.09794186055660248,
-0.11580684036016464,
0.29639625549316406,
-0.06372668594121933,
0.3379657566547394,
0.13779470324516296,
-0.23180237412452698,
0.3589659035205841,
0.26705390214920044,
-0.08300862461328506,
-0.2243189811706543,
-0.2101646512746811,
-0.504281759262085,
-0.22493407130241394,
0.37480130791664124,
0.15061849355697632,
-0.39121729135513306,
0.1673838049173355,
-0.16563528776168823,
0.0812717154622078,
0.34802019596099854,
-0.4320893883705139,
0.16857494413852692,
-0.026909321546554565,
-0.40470466017723083,
-0.4147725999355316,
0.22468556463718414,
0.5357562303543091,
0.0497165322303772,
-0.14694541692733765,
-0.07066672295331955,
0.18415379524230957,
-0.04793331027030945,
0.12159919738769531,
-0.17705123126506805,
0.005116773769259453,
-0.15763366222381592,
-0.05824387073516846,
0.6098167896270752,
-0.6512132883071899,
-0.7452207803726196,
0.2802584171295166,
-0.07374615967273712,
0.17615008354187012,
0.19501253962516785,
-0.14711253345012665,
0.020855043083429337,
-0.30760934948921204,
-0.02001246064901352,
0.2908826470375061,
0.0482695996761322,
0.07384059578180313,
-0.18761712312698364,
-0.13882529735565186,
-0.011950378306210041,
-0.06698771566152573,
-0.054338645190000534,
0.05417289957404137,
-0.13867595791816711,
-0.23604044318199158,
0.11019182205200195,
-0.03859924152493477,
0.38379231095314026,
0.37298935651779175,
0.09354760497808456,
0.21887700259685516,
0.16034741699695587,
-0.07271954417228699,
-0.3429853320121765,
0.27941855788230896,
-0.07905730605125427,
-0.3012049198150635,
-0.43812257051467896,
-0.07390579581260681,
0.026979804039001465,
-0.15766781568527222,
-0.24614709615707397,
-0.3840867877006531,
0.2205030769109726,
0.1092851310968399,
0.1718817502260208,
-0.013246729969978333,
-0.2225516438484192,
0.5706769824028015,
0.4135962128639221,
0.05424832925200462,
-0.4536656141281128,
-0.1212659403681755,
0.05585046112537384,
-0.08671384304761887,
-0.08444169163703918,
0.11410297453403473,
0.18301737308502197,
-0.19264717400074005,
-0.3103478252887726,
0.2606281042098999,
0.0674225240945816,
0.38891130685806274,
0.04006744548678398,
0.25303488969802856,
0.008129773661494255,
0.02028638869524002,
0.13592864573001862,
0.0020794272422790527,
-0.00877465307712555,
-0.04426547884941101,
0.021866239607334137,
0.18652477860450745,
-0.08018684387207031,
0.23122695088386536,
-0.06771274656057358,
-0.1784410923719406,
0.13689681887626648,
-0.08956106007099152,
-0.1448768824338913,
-0.48935478925704956,
-0.2777535915374756,
-0.2921614646911621,
0.6219122409820557,
0.15707966685295105,
0.46061599254608154,
0.2751765549182892,
0.6171849966049194,
0.26553982496261597,
0.29476839303970337,
0.003071062732487917,
-0.33927062153816223,
-0.1557128131389618,
-0.020981064066290855,
0.3031356930732727,
0.6520788073539734,
0.13878421485424042,
0.31247392296791077,
0.022602396085858345,
0.29761093854904175,
0.09077897667884827,
-0.004949986934661865,
-0.07434353977441788,
0.17920415103435516,
-0.10894402861595154,
0.2632174789905548,
0.0382915660738945,
-0.021268509328365326,
0.15798455476760864,
0.08607343584299088,
-0.1429150253534317,
-0.12476594746112823,
0.30132147669792175,
-0.4425266683101654,
0.04922226816415787,
-0.21425050497055054,
-0.24117423593997955,
-0.1108500137925148,
-0.2177894413471222,
-0.10453532636165619,
0.3128982484340668,
0.010258220136165619,
0.23456931114196777,
0.19208788871765137,
-0.1443425416946411,
-0.10544749349355698,
-0.47989457845687866,
-0.11880870908498764,
-0.23031139373779297,
-0.12242381274700165,
-0.012023314833641052,
0.27071717381477356,
-0.1527012288570404,
0.20319166779518127,
-0.12945511937141418,
-0.11867731809616089,
-0.23895636200904846,
-0.41970717906951904,
0.13215743005275726,
-0.18982720375061035,
-0.0034685060381889343,
0.05828716978430748,
-0.1952650547027588,
0.06556697934865952,
-0.06864304840564728,
0.2843324840068817,
-0.4945595860481262,
-0.19804257154464722,
-0.05016418546438217,
-0.03352271020412445,
0.08805760741233826,
-0.21133792400360107,
-0.3165039122104645,
-0.07290110737085342,
-0.464660108089447,
0.30294331908226013,
-0.22851306200027466,
-0.10257294774055481,
0.2000105381011963,
0.038029059767723083,
-0.1969578117132187,
-0.03266239911317825,
0.22971788048744202,
-0.3133631646633148,
-0.30024805665016174,
0.24167872965335846,
-0.1601765751838684,
-0.06603522598743439,
0.1522548496723175,
-0.03702087327837944,
0.2480601817369461,
0.3661658465862274,
-0.26724475622177124,
-0.228420227766037,
-0.10674607753753662,
0.07550625503063202,
0.06770859658718109,
0.17314906418323517,
0.49907445907592773,
0.13378851115703583,
-0.023706983774900436,
-0.4359191358089447,
-0.44277751445770264,
-0.0675494521856308,
0.04511325806379318,
0.25490880012512207,
0.0625772774219513,
0.3566921055316925,
0.08352261781692505,
0.6483986973762512,
0.18907544016838074,
-0.07143948972225189,
0.16484323143959045,
0.08757060766220093,
0.2749437093734741,
-0.0620313324034214,
-0.38785213232040405,
-0.12545549869537354,
-0.28715401887893677,
-0.004544563591480255,
0.01980099454522133,
0.08697761595249176,
-0.2719988524913788,
-0.29328835010528564,
-0.017205163836479187,
-0.46816787123680115,
-0.42726677656173706,
0.23030178248882294,
-0.2296859622001648,
0.20204661786556244,
0.1311212182044983,
-0.04492814093828201,
-0.5083230137825012,
0.003704424947500229,
0.24977460503578186,
0.03585277870297432,
0.21706140041351318,
0.12060524523258209,
-0.017815768718719482,
-0.01857876405119896,
-0.20975442230701447,
0.24150016903877258,
0.04058057442307472,
0.13643509149551392,
-0.04938257858157158,
-0.35468652844429016,
-0.26340699195861816,
-0.0076207369565963745,
0.5635567307472229,
-0.5284047722816467,
-0.0983206182718277,
0.13551275432109833,
-0.19083936512470245,
-0.3174259066581726,
-0.08412294089794159,
0.14848363399505615,
0.344577431678772,
0.3299430012702942,
0.22485065460205078,
-0.25413691997528076,
-0.1978665590286255,
-0.16679984331130981,
0.15022194385528564,
0.02874196320772171,
-0.15462885797023773,
-0.33227020502090454,
-0.041921403259038925,
-0.389349102973938,
-0.259746789932251,
0.0034021660685539246,
-0.4235190749168396,
0.07985623925924301,
-0.03917042911052704,
0.07558538019657135,
-0.02932623401284218,
-0.11708775907754898,
0.15504759550094604,
0.2510488033294678,
-0.02226865664124489,
0.18371592462062836,
0.30509987473487854,
0.05508419871330261,
-0.1072934940457344,
0.6069468855857849,
-0.08766902983188629,
-0.2462775707244873,
-0.014765230007469654,
0.2300592064857483,
-0.10559176653623581,
0.19946971535682678,
-0.14277565479278564,
0.13999633491039276,
0.03368087112903595,
0.04020737111568451,
-0.039667122066020966,
0.04215549677610397,
0.3270593285560608,
0.15064683556556702,
-0.21657322347164154,
-0.5896106958389282,
0.41984832286834717,
0.28817304968833923,
-0.20770421624183655,
0.38366401195526123,
-0.4240402281284332,
-0.2832294702529907,
0.2587812542915344,
-0.15726619958877563,
0.7480576038360596,
-0.0013933349400758743,
-0.00641997717320919,
0.025885097682476044,
-0.1385670304298401,
0.5494295358657837,
-0.3984549641609192,
0.24420806765556335,
0.0076891109347343445,
-0.06617120653390884,
-0.030842207372188568,
-0.19712474942207336,
-0.04970244690775871,
0.07556891441345215,
-0.4153662919998169,
0.2749106287956238,
0.33924558758735657,
0.4632299244403839,
-0.05656079202890396,
-0.03368285298347473,
0.03386123478412628,
-0.2468957006931305,
-0.3134597837924957,
0.23798777163028717,
0.045985303819179535,
0.3250582814216614,
0.11543422937393188,
-0.36974674463272095,
-0.2721010744571686,
-0.021543942391872406,
-0.0024295449256896973,
0.08606728911399841,
-0.30072450637817383,
0.24836239218711853,
0.025166671723127365,
-0.05507366359233856,
0.04591716080904007,
0.09653360396623611,
0.44961485266685486,
-0.11180068552494049,
-0.1322563737630844,
0.1904713213443756,
0.2475343942642212,
0.27547523379325867,
-0.20508413016796112,
-0.18542861938476562,
0.1479586660861969,
-0.031115900725126266,
-0.10287055373191833,
-0.09872366487979889,
-0.11339478194713593,
-0.3885582387447357,
-0.04005242884159088,
0.293322890996933,
-0.0572919063270092,
-0.09577731788158417,
0.035049036145210266,
0.29217982292175293,
0.019049473106861115,
-0.05371416360139847,
0.1552475094795227,
-0.0029106102883815765,
-0.06429685652256012,
0.3982311189174652,
-0.4435383975505829,
-0.29479312896728516,
-0.04957444593310356,
0.4088328182697296,
0.06456956267356873,
-0.043955571949481964,
0.10831567645072937,
-0.1654452681541443,
-0.034464336931705475,
-0.10380059480667114,
-0.371903657913208,
-0.030283614993095398,
-0.16458311676979065,
0.02473677322268486,
-0.04743007570505142,
-0.22615107893943787,
0.2656324505805969,
-0.31289681792259216,
0.06554442644119263,
0.17853865027427673,
-0.17023026943206787,
-0.2872008979320526,
-0.4548134207725525,
0.24303287267684937,
-0.18026025593280792,
0.0113522969186306,
-0.010640352964401245,
-0.0816701278090477,
0.040380775928497314,
0.48405590653419495,
-0.3300451338291168,
0.06373226642608643,
0.022197693586349487,
-0.002039828337728977,
0.18986456096172333,
-0.03653479740023613,
0.1640687882900238,
-0.12471334636211395,
0.04070508852601051,
0.15828649699687958,
-0.5326868891716003,
-0.2242056429386139,
0.06221447139978409,
0.11247265338897705,
-0.14563606679439545,
0.2627771198749542,
-0.10730236768722534,
-0.03321970999240875,
0.2048831582069397,
-0.39292097091674805,
0.2783057987689972,
0.18141323328018188,
-0.0003945324569940567,
-0.012183476239442825,
0.0029281526803970337,
-0.046693865209817886,
-0.025470510125160217,
-0.04580911621451378,
-0.11301267892122269,
-0.12343472242355347,
0.042094383388757706,
0.1792672574520111,
0.038509223610162735,
0.10450641065835953,
0.0418679378926754,
-0.10065330564975739,
0.0656023919582367,
0.05203541740775108,
0.34168681502342224,
-0.14796744287014008,
0.01919505000114441,
0.2449016571044922,
0.07778575271368027,
0.29960575699806213,
-0.0726846382021904,
0.11695007979869843,
-0.14627990126609802,
0.1903315782546997,
-0.1229860782623291,
-0.10048338770866394,
0.4171922504901886,
-0.11228848993778229,
0.1834152638912201,
0.25643259286880493,
0.35362040996551514,
0.1498968005180359,
0.4546935558319092,
0.30843544006347656,
0.4230772852897644,
-0.306993305683136,
0.10617566108703613,
0.03719073161482811,
0.02817346900701523,
0.09210123121738434,
0.429837703704834,
0.17037057876586914,
0.2588582932949066,
0.31447842717170715,
0.21127162873744965,
0.42057526111602783,
-0.031172629445791245,
-0.08163702487945557,
0.07922433316707611,
-0.24783417582511902,
0.05864855647087097,
0.13187158107757568,
0.0802597627043724,
0.2708178758621216,
0.029715076088905334,
0.09015963226556778,
-0.18555808067321777,
-0.21231907606124878,
0.1381860375404358,
0.23583973944187164,
0.023990273475646973,
-0.04646703600883484,
0.2479865700006485,
-0.0629461333155632,
-0.07296416163444519,
-0.25484395027160645,
0.06907626986503601,
-0.01560090109705925,
0.6718023419380188,
0.12193935364484787,
-0.06866678595542908,
-0.0620468407869339,
-0.3130749762058258,
-0.030146928504109383,
0.40828996896743774,
-0.10369175672531128,
0.19222934544086456,
0.02263016253709793,
-0.2737542986869812,
-0.06490464508533478,
0.22813409566879272,
0.38898950815200806,
0.25707727670669556,
-0.1776951253414154,
0.21175390481948853,
0.1701636016368866,
-0.16332104802131653,
-0.2732691168785095,
0.27300870418548584,
-0.11394236981868744,
-0.2440347671508789,
-0.07363131642341614,
0.2088257074356079,
-0.138151153922081,
0.0460909865796566,
-0.2923261821269989,
0.21497228741645813,
-0.15220512449741364,
0.1767052412033081,
-0.11541981995105743,
0.10323460400104523,
-0.15982797741889954,
-0.010911751538515091,
-0.36359697580337524,
-0.079306960105896,
0.4644451439380646,
-0.15474876761436462,
0.15197445452213287,
-0.1640421748161316,
0.10970237106084824,
0.2876007854938507,
0.3236360251903534,
0.1383771300315857,
-0.09417250752449036,
-0.06805410981178284,
-0.11723693460226059,
-0.6218258142471313,
0.19904732704162598,
-0.2777641713619232,
0.11997976899147034,
-0.18825799226760864,
0.08816689997911453,
0.19657830893993378,
0.16552957892417908,
0.18479099869728088,
-0.1402522325515747,
0.16534410417079926,
0.03889695554971695,
-0.4253424406051636,
-0.2145286649465561,
-0.11396315693855286,
0.011859143152832985,
0.39089706540107727,
-0.38062751293182373,
0.0480109266936779,
0.15254169702529907,
0.1369543969631195,
-0.09823580086231232,
0.026973798871040344,
0.24112313985824585,
0.05476084351539612,
0.5971410274505615,
0.23830962181091309,
0.2660864591598511,
-0.05200310796499252,
-0.17301267385482788,
-0.2507938742637634,
-0.16076110303401947,
-0.13120615482330322,
0.07253754138946533,
-0.13769520819187164,
0.2729488015174866,
-0.4178253412246704,
-0.2214624583721161,
-0.35188189148902893,
0.14707031846046448,
0.17713548243045807,
-0.1923740804195404,
-0.09280321002006531,
0.02936432510614395,
0.02942071110010147,
0.3220313787460327,
0.05310060456395149,
0.4545939266681671,
-0.0932246670126915,
0.27189671993255615,
-0.3867034316062927,
-0.18258370459079742,
0.4638253450393677,
-0.31703269481658936,
-0.35346055030822754,
0.06881684064865112,
0.1400068998336792,
-0.12077967822551727,
-0.16337764263153076,
-0.45746761560440063,
0.11579009890556335,
0.18824055790901184,
0.06401537358760834,
-0.2068777233362198,
0.1905023157596588,
-0.12374687194824219,
0.16936393082141876,
-0.11647583544254303,
0.43088704347610474,
0.09645237028598785,
-0.01685475930571556,
0.024697549641132355,
-0.03215843811631203
] |
https://github.com/huggingface/datasets/issues/6183 | This was fixed in https://github.com/huggingface/datasets/pull/6155, which will be included in the next release (or you can install `datasets` from source to use it immediately). | Load dataset with non-existent file | ### Describe the bug
When load a dataset from datasets and pass a wrong path to json with the data, error message does not contain something abount "wrong path" or "file do not exist" -
```SchemaInferenceError: Please pass `features` or at least one example when writing data```
### Steps to reproduce the bug
```python
from datasets import load_dataset
load_dataset('json', data_files='/home/alexey/unreal_file.json')
```
### Expected behavior
Raise os FileNotFound error or custom error with informative message
### Environment info
```
# packages in environment at /home/alexey/.conda/envs/alex_LoRA:
#
# Name Version Build Channel
_libgcc_mutex 0.1 main
_openmp_mutex 5.1 1_gnu
accelerate 0.21.0 pypi_0 pypi
aiohttp 3.8.5 pypi_0 pypi
aiosignal 1.3.1 pypi_0 pypi
antlr4-python3-runtime 4.9.3 pypi_0 pypi
appdirs 1.4.4 pypi_0 pypi
asttokens 2.0.5 pyhd3eb1b0_0
async-timeout 4.0.3 pypi_0 pypi
attrs 23.1.0 pypi_0 pypi
backcall 0.2.0 pyhd3eb1b0_0
bitsandbytes 0.41.1 pypi_0 pypi
bzip2 1.0.8 h7b6447c_0
ca-certificates 2023.05.30 h06a4308_0
certifi 2023.7.22 pypi_0 pypi
charset-normalizer 3.2.0 pypi_0 pypi
click 8.1.6 pypi_0 pypi
cmake 3.27.2 pypi_0 pypi
comm 0.1.2 py310h06a4308_0
contourpy 1.1.0 pypi_0 pypi
cycler 0.11.0 pypi_0 pypi
datasets 2.14.4 pypi_0 pypi
debugpy 1.6.7 py310h6a678d5_0
decorator 5.1.1 pyhd3eb1b0_0
dill 0.3.7 pypi_0 pypi
docker-pycreds 0.4.0 pypi_0 pypi
executing 0.8.3 pyhd3eb1b0_0
filelock 3.12.2 pypi_0 pypi
fire 0.5.0 pypi_0 pypi
fonttools 4.42.0 pypi_0 pypi
frozenlist 1.4.0 pypi_0 pypi
fsspec 2023.6.0 pypi_0 pypi
gitdb 4.0.10 pypi_0 pypi
gitpython 3.1.32 pypi_0 pypi
huggingface-hub 0.16.4 pypi_0 pypi
idna 3.4 pypi_0 pypi
ipykernel 6.25.0 py310h2f386ee_0
ipython 8.12.2 py310h06a4308_0
ipython-genutils 0.2.0 pypi_0 pypi
ipywidgets 8.0.4 py310h06a4308_0
jedi 0.18.1 py310h06a4308_1
jinja2 3.1.2 pypi_0 pypi
jsonschema 4.19.0 pypi_0 pypi
jsonschema-specifications 2023.7.1 pypi_0 pypi
jupyter_client 8.1.0 py310h06a4308_0
jupyter_core 5.3.0 py310h06a4308_0
jupyterlab_widgets 3.0.5 py310h06a4308_0
kiwisolver 1.4.4 pypi_0 pypi
ld_impl_linux-64 2.38 h1181459_1
libffi 3.3 he6710b0_2
libgcc-ng 11.2.0 h1234567_1
libgomp 11.2.0 h1234567_1
libsodium 1.0.18 h7b6447c_0
libstdcxx-ng 11.2.0 h1234567_1
libuuid 1.41.5 h5eee18b_0
lightning-utilities 0.9.0 pypi_0 pypi
lit 16.0.6 pypi_0 pypi
markupsafe 2.1.3 pypi_0 pypi
matplotlib 3.7.2 pypi_0 pypi
matplotlib-inline 0.1.6 py310h06a4308_0
mpmath 1.3.0 pypi_0 pypi
multidict 6.0.4 pypi_0 pypi
multiprocess 0.70.15 pypi_0 pypi
nbformat 4.2.0 pypi_0 pypi
ncurses 6.4 h6a678d5_0
nest-asyncio 1.5.6 py310h06a4308_0
networkx 3.1 pypi_0 pypi
numpy 1.25.2 pypi_0 pypi
nvidia-cublas-cu11 11.10.3.66 pypi_0 pypi
nvidia-cuda-cupti-cu11 11.7.101 pypi_0 pypi
nvidia-cuda-nvrtc-cu11 11.7.99 pypi_0 pypi
nvidia-cuda-runtime-cu11 11.7.99 pypi_0 pypi
nvidia-cudnn-cu11 8.5.0.96 pypi_0 pypi
nvidia-cufft-cu11 10.9.0.58 pypi_0 pypi
nvidia-curand-cu11 10.2.10.91 pypi_0 pypi
nvidia-cusolver-cu11 11.4.0.1 pypi_0 pypi
nvidia-cusparse-cu11 11.7.4.91 pypi_0 pypi
nvidia-nccl-cu11 2.14.3 pypi_0 pypi
nvidia-nvtx-cu11 11.7.91 pypi_0 pypi
omegaconf 2.3.0 pypi_0 pypi
openssl 1.1.1v h7f8727e_0
packaging 23.0 py310h06a4308_0
pandas 2.0.3 pypi_0 pypi
parso 0.8.3 pyhd3eb1b0_0
pathtools 0.1.2 pypi_0 pypi
peft 0.4.0 pypi_0 pypi
pexpect 4.8.0 pyhd3eb1b0_3
pickleshare 0.7.5 pyhd3eb1b0_1003
pillow 10.0.0 pypi_0 pypi
pip 23.2.1 py310h06a4308_0
platformdirs 2.5.2 py310h06a4308_0
plotly 5.16.1 pypi_0 pypi
prompt-toolkit 3.0.36 py310h06a4308_0
protobuf 4.24.0 pypi_0 pypi
psutil 5.9.0 py310h5eee18b_0
ptyprocess 0.7.0 pyhd3eb1b0_2
pure_eval 0.2.2 pyhd3eb1b0_0
pyarrow 12.0.1 pypi_0 pypi
pygments 2.15.1 py310h06a4308_1
pyparsing 3.0.9 pypi_0 pypi
python 3.10.0 h12debd9_5
python-dateutil 2.8.2 pyhd3eb1b0_0
pytorch-lightning 2.0.6 pypi_0 pypi
pytz 2023.3 pypi_0 pypi
pyyaml 6.0.1 pypi_0 pypi
pyzmq 25.1.0 py310h6a678d5_0
readline 8.2 h5eee18b_0
referencing 0.30.2 pypi_0 pypi
regex 2023.8.8 pypi_0 pypi
requests 2.31.0 pypi_0 pypi
rpds-py 0.9.2 pypi_0 pypi
safetensors 0.3.2 pypi_0 pypi
scipy 1.11.1 pypi_0 pypi
sentencepiece 0.1.99 pypi_0 pypi
sentry-sdk 1.29.2 pypi_0 pypi
setproctitle 1.3.2 pypi_0 pypi
setuptools 68.0.0 py310h06a4308_0
six 1.16.0 pyhd3eb1b0_1
smmap 5.0.0 pypi_0 pypi
sqlite 3.41.2 h5eee18b_0
stack_data 0.2.0 pyhd3eb1b0_0
sympy 1.12 pypi_0 pypi
tenacity 8.2.3 pypi_0 pypi
termcolor 2.3.0 pypi_0 pypi
tk 8.6.12 h1ccaba5_0
tokenizers 0.13.3 pypi_0 pypi
torch 2.0.1 pypi_0 pypi
torchmetrics 1.0.3 pypi_0 pypi
tornado 6.3.2 py310h5eee18b_0
tqdm 4.66.1 pypi_0 pypi
traitlets 5.7.1 py310h06a4308_0
transformers 4.31.0 pypi_0 pypi
triton 2.0.0 pypi_0 pypi
typing-extensions 4.7.1 pypi_0 pypi
tzdata 2023.3 pypi_0 pypi
urllib3 2.0.4 pypi_0 pypi
wandb 0.15.8 pypi_0 pypi
wcwidth 0.2.5 pyhd3eb1b0_0
wheel 0.38.4 py310h06a4308_0
widgetsnbextension 4.0.5 py310h06a4308_0
xxhash 3.3.0 pypi_0 pypi
xz 5.4.2 h5eee18b_0
yarl 1.9.2 pypi_0 pypi
zeromq 4.3.4 h2531618_0
zlib 1.2.13 h5eee18b_0
active environment : None
user config file : /home/alexey/.condarc
populated config files :
conda version : 23.1.0
conda-build version : 3.22.0
python version : 3.9.13.final.0
virtual packages : __archspec=1=x86_64
__cuda=12.0=0
__glibc=2.35=0
__linux=5.19.0=0
__unix=0=0
base environment : /opt/anaconda/anaconda3 (read only)
conda av data dir : /opt/anaconda/anaconda3/etc/conda
conda av metadata url : None
channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /opt/anaconda/anaconda3/pkgs
/home/alexey/.conda/pkgs
envs directories : /home/alexey/.conda/envs
/opt/anaconda/anaconda3/envs
platform : linux-64
user-agent : conda/23.1.0 requests/2.31.0 CPython/3.9.13 Linux/5.19.0-46-generic ubuntu/22.04.2 glibc/2.35
UID:GID : 1009:1009
netrc file : /home/alexey/.netrc
offline mode : False
``` | 24 | Load dataset with non-existent file
### Describe the bug
When load a dataset from datasets and pass a wrong path to json with the data, error message does not contain something abount "wrong path" or "file do not exist" -
```SchemaInferenceError: Please pass `features` or at least one example when writing data```
### Steps to reproduce the bug
```python
from datasets import load_dataset
load_dataset('json', data_files='/home/alexey/unreal_file.json')
```
### Expected behavior
Raise os FileNotFound error or custom error with informative message
### Environment info
```
# packages in environment at /home/alexey/.conda/envs/alex_LoRA:
#
# Name Version Build Channel
_libgcc_mutex 0.1 main
_openmp_mutex 5.1 1_gnu
accelerate 0.21.0 pypi_0 pypi
aiohttp 3.8.5 pypi_0 pypi
aiosignal 1.3.1 pypi_0 pypi
antlr4-python3-runtime 4.9.3 pypi_0 pypi
appdirs 1.4.4 pypi_0 pypi
asttokens 2.0.5 pyhd3eb1b0_0
async-timeout 4.0.3 pypi_0 pypi
attrs 23.1.0 pypi_0 pypi
backcall 0.2.0 pyhd3eb1b0_0
bitsandbytes 0.41.1 pypi_0 pypi
bzip2 1.0.8 h7b6447c_0
ca-certificates 2023.05.30 h06a4308_0
certifi 2023.7.22 pypi_0 pypi
charset-normalizer 3.2.0 pypi_0 pypi
click 8.1.6 pypi_0 pypi
cmake 3.27.2 pypi_0 pypi
comm 0.1.2 py310h06a4308_0
contourpy 1.1.0 pypi_0 pypi
cycler 0.11.0 pypi_0 pypi
datasets 2.14.4 pypi_0 pypi
debugpy 1.6.7 py310h6a678d5_0
decorator 5.1.1 pyhd3eb1b0_0
dill 0.3.7 pypi_0 pypi
docker-pycreds 0.4.0 pypi_0 pypi
executing 0.8.3 pyhd3eb1b0_0
filelock 3.12.2 pypi_0 pypi
fire 0.5.0 pypi_0 pypi
fonttools 4.42.0 pypi_0 pypi
frozenlist 1.4.0 pypi_0 pypi
fsspec 2023.6.0 pypi_0 pypi
gitdb 4.0.10 pypi_0 pypi
gitpython 3.1.32 pypi_0 pypi
huggingface-hub 0.16.4 pypi_0 pypi
idna 3.4 pypi_0 pypi
ipykernel 6.25.0 py310h2f386ee_0
ipython 8.12.2 py310h06a4308_0
ipython-genutils 0.2.0 pypi_0 pypi
ipywidgets 8.0.4 py310h06a4308_0
jedi 0.18.1 py310h06a4308_1
jinja2 3.1.2 pypi_0 pypi
jsonschema 4.19.0 pypi_0 pypi
jsonschema-specifications 2023.7.1 pypi_0 pypi
jupyter_client 8.1.0 py310h06a4308_0
jupyter_core 5.3.0 py310h06a4308_0
jupyterlab_widgets 3.0.5 py310h06a4308_0
kiwisolver 1.4.4 pypi_0 pypi
ld_impl_linux-64 2.38 h1181459_1
libffi 3.3 he6710b0_2
libgcc-ng 11.2.0 h1234567_1
libgomp 11.2.0 h1234567_1
libsodium 1.0.18 h7b6447c_0
libstdcxx-ng 11.2.0 h1234567_1
libuuid 1.41.5 h5eee18b_0
lightning-utilities 0.9.0 pypi_0 pypi
lit 16.0.6 pypi_0 pypi
markupsafe 2.1.3 pypi_0 pypi
matplotlib 3.7.2 pypi_0 pypi
matplotlib-inline 0.1.6 py310h06a4308_0
mpmath 1.3.0 pypi_0 pypi
multidict 6.0.4 pypi_0 pypi
multiprocess 0.70.15 pypi_0 pypi
nbformat 4.2.0 pypi_0 pypi
ncurses 6.4 h6a678d5_0
nest-asyncio 1.5.6 py310h06a4308_0
networkx 3.1 pypi_0 pypi
numpy 1.25.2 pypi_0 pypi
nvidia-cublas-cu11 11.10.3.66 pypi_0 pypi
nvidia-cuda-cupti-cu11 11.7.101 pypi_0 pypi
nvidia-cuda-nvrtc-cu11 11.7.99 pypi_0 pypi
nvidia-cuda-runtime-cu11 11.7.99 pypi_0 pypi
nvidia-cudnn-cu11 8.5.0.96 pypi_0 pypi
nvidia-cufft-cu11 10.9.0.58 pypi_0 pypi
nvidia-curand-cu11 10.2.10.91 pypi_0 pypi
nvidia-cusolver-cu11 11.4.0.1 pypi_0 pypi
nvidia-cusparse-cu11 11.7.4.91 pypi_0 pypi
nvidia-nccl-cu11 2.14.3 pypi_0 pypi
nvidia-nvtx-cu11 11.7.91 pypi_0 pypi
omegaconf 2.3.0 pypi_0 pypi
openssl 1.1.1v h7f8727e_0
packaging 23.0 py310h06a4308_0
pandas 2.0.3 pypi_0 pypi
parso 0.8.3 pyhd3eb1b0_0
pathtools 0.1.2 pypi_0 pypi
peft 0.4.0 pypi_0 pypi
pexpect 4.8.0 pyhd3eb1b0_3
pickleshare 0.7.5 pyhd3eb1b0_1003
pillow 10.0.0 pypi_0 pypi
pip 23.2.1 py310h06a4308_0
platformdirs 2.5.2 py310h06a4308_0
plotly 5.16.1 pypi_0 pypi
prompt-toolkit 3.0.36 py310h06a4308_0
protobuf 4.24.0 pypi_0 pypi
psutil 5.9.0 py310h5eee18b_0
ptyprocess 0.7.0 pyhd3eb1b0_2
pure_eval 0.2.2 pyhd3eb1b0_0
pyarrow 12.0.1 pypi_0 pypi
pygments 2.15.1 py310h06a4308_1
pyparsing 3.0.9 pypi_0 pypi
python 3.10.0 h12debd9_5
python-dateutil 2.8.2 pyhd3eb1b0_0
pytorch-lightning 2.0.6 pypi_0 pypi
pytz 2023.3 pypi_0 pypi
pyyaml 6.0.1 pypi_0 pypi
pyzmq 25.1.0 py310h6a678d5_0
readline 8.2 h5eee18b_0
referencing 0.30.2 pypi_0 pypi
regex 2023.8.8 pypi_0 pypi
requests 2.31.0 pypi_0 pypi
rpds-py 0.9.2 pypi_0 pypi
safetensors 0.3.2 pypi_0 pypi
scipy 1.11.1 pypi_0 pypi
sentencepiece 0.1.99 pypi_0 pypi
sentry-sdk 1.29.2 pypi_0 pypi
setproctitle 1.3.2 pypi_0 pypi
setuptools 68.0.0 py310h06a4308_0
six 1.16.0 pyhd3eb1b0_1
smmap 5.0.0 pypi_0 pypi
sqlite 3.41.2 h5eee18b_0
stack_data 0.2.0 pyhd3eb1b0_0
sympy 1.12 pypi_0 pypi
tenacity 8.2.3 pypi_0 pypi
termcolor 2.3.0 pypi_0 pypi
tk 8.6.12 h1ccaba5_0
tokenizers 0.13.3 pypi_0 pypi
torch 2.0.1 pypi_0 pypi
torchmetrics 1.0.3 pypi_0 pypi
tornado 6.3.2 py310h5eee18b_0
tqdm 4.66.1 pypi_0 pypi
traitlets 5.7.1 py310h06a4308_0
transformers 4.31.0 pypi_0 pypi
triton 2.0.0 pypi_0 pypi
typing-extensions 4.7.1 pypi_0 pypi
tzdata 2023.3 pypi_0 pypi
urllib3 2.0.4 pypi_0 pypi
wandb 0.15.8 pypi_0 pypi
wcwidth 0.2.5 pyhd3eb1b0_0
wheel 0.38.4 py310h06a4308_0
widgetsnbextension 4.0.5 py310h06a4308_0
xxhash 3.3.0 pypi_0 pypi
xz 5.4.2 h5eee18b_0
yarl 1.9.2 pypi_0 pypi
zeromq 4.3.4 h2531618_0
zlib 1.2.13 h5eee18b_0
active environment : None
user config file : /home/alexey/.condarc
populated config files :
conda version : 23.1.0
conda-build version : 3.22.0
python version : 3.9.13.final.0
virtual packages : __archspec=1=x86_64
__cuda=12.0=0
__glibc=2.35=0
__linux=5.19.0=0
__unix=0=0
base environment : /opt/anaconda/anaconda3 (read only)
conda av data dir : /opt/anaconda/anaconda3/etc/conda
conda av metadata url : None
channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /opt/anaconda/anaconda3/pkgs
/home/alexey/.conda/pkgs
envs directories : /home/alexey/.conda/envs
/opt/anaconda/anaconda3/envs
platform : linux-64
user-agent : conda/23.1.0 requests/2.31.0 CPython/3.9.13 Linux/5.19.0-46-generic ubuntu/22.04.2 glibc/2.35
UID:GID : 1009:1009
netrc file : /home/alexey/.netrc
offline mode : False
```
This was fixed in https://github.com/huggingface/datasets/pull/6155, which will be included in the next release (or you can install `datasets` from source to use it immediately). | [
-0.06370417773723602,
-0.07461162656545639,
-0.047087933868169785,
0.40176621079444885,
0.15048280358314514,
-0.04745347052812576,
0.26163727045059204,
0.3800365924835205,
0.13985149562358856,
0.016334250569343567,
0.2836117744445801,
0.49351298809051514,
-0.12176764756441116,
0.15939360857009888,
0.0025265514850616455,
-0.07881078124046326,
0.1175447329878807,
0.17332570254802704,
0.049041301012039185,
-0.1018083393573761,
-0.4949391782283783,
0.17782847583293915,
-0.0874524712562561,
0.1134050190448761,
-0.3656230866909027,
-0.16953906416893005,
-0.07268485426902771,
0.5808646082878113,
-0.1350623071193695,
-0.3182954788208008,
0.06710763275623322,
-0.38354840874671936,
-0.032859016209840775,
0.5409777760505676,
-0.00010980406659655273,
0.14651155471801758,
0.31241869926452637,
-0.19743187725543976,
-0.3123548626899719,
-0.34668058156967163,
-0.5216385722160339,
-0.16159923374652863,
-0.007104530930519104,
-0.47921961545944214,
-0.03247539699077606,
-0.04903823137283325,
-0.15052689611911774,
-0.19031104445457458,
0.5407060384750366,
0.5204944610595703,
0.2298383116722107,
0.10569538176059723,
0.045052751898765564,
-0.05907190963625908,
0.3131709694862366,
0.37296363711357117,
-0.00544961541891098,
0.1463957130908966,
0.02785562351346016,
0.12507402896881104,
0.12384200841188431,
0.18491467833518982,
-0.3089147210121155,
-0.14680607616901398,
0.2713684141635895,
-0.1768622100353241,
0.03272663429379463,
-0.05569292604923248,
0.014257173985242844,
0.22920706868171692,
0.6100342273712158,
-0.3861687481403351,
-0.40455377101898193,
-0.1251503974199295,
-0.13196556270122528,
-0.16275501251220703,
0.3982117772102356,
0.3168599605560303,
-0.256296306848526,
0.3005988895893097,
0.05373933166265488,
-0.13291382789611816,
-0.13858088850975037,
0.05090471729636192,
0.15823274850845337,
0.19920626282691956,
-0.00999956764280796,
0.05491616576910019,
-0.26227837800979614,
-0.1325352042913437,
0.0637134313583374,
-0.3775968849658966,
-0.10459702461957932,
0.22050459682941437,
-0.2730506658554077,
-0.2540052533149719,
-0.05640489608049393,
-0.2983405590057373,
0.21816128492355347,
0.02386496216058731,
0.06714503467082977,
-0.18002386391162872,
-0.23302733898162842,
0.22249476611614227,
0.25358453392982483,
0.04436091333627701,
-0.10715045034885406,
0.18576867878437042,
0.005209159571677446,
0.07335630059242249,
0.0027012303471565247,
-0.05768420547246933,
-0.11622467637062073,
-0.11715366691350937,
-0.04338028281927109,
0.05101194977760315,
0.5142855644226074,
-0.18372565507888794,
-0.6342796087265015,
0.13139431178569794,
-0.38964465260505676,
0.10381805896759033,
-0.009231001138687134,
0.518180787563324,
-0.13123789429664612,
-0.05498654395341873,
0.34485873579978943,
0.048540160059928894,
-0.13819032907485962,
-0.0652708038687706,
-0.12820017337799072,
0.2904731035232544,
-0.21160586178302765,
0.07231695204973221,
-0.05536806955933571,
0.3501245975494385,
0.5206044912338257,
0.13041800260543823,
-0.22952216863632202,
-0.22520828247070312,
0.19137954711914062,
-0.11477439105510712,
-0.14625653624534607,
0.13810321688652039,
-0.010914400219917297,
0.11204221844673157,
0.09844618290662766,
-0.11877046525478363,
-0.08739021420478821,
0.2695087194442749,
-0.5613441467285156,
-0.3173907995223999,
-0.21387900412082672,
0.2552996277809143,
-0.11624365299940109,
0.07074610888957977,
-0.21507860720157623,
-0.1989670991897583,
-0.05458914488554001,
-0.25361165404319763,
0.1201123520731926,
0.1440168023109436,
-0.08794739097356796,
-0.3014763593673706,
0.23046691715717316,
0.6014931201934814,
-0.23627063632011414,
-0.057666271924972534,
0.3104560971260071,
-0.04007560759782791,
0.046822644770145416,
0.24216169118881226,
-0.2176099419593811,
0.3532860577106476,
-0.43474042415618896,
0.04550410807132721,
0.48237454891204834,
-0.3682769536972046,
-0.2683470845222473,
0.3395869731903076,
-0.2830975651741028,
0.14206194877624512,
0.3336012363433838,
0.09265556186437607,
-0.14731594920158386,
-0.01628464087843895,
0.325759619474411,
0.11082935333251953,
0.1422683596611023,
0.14349748194217682,
-0.4614279270172119,
-0.35041356086730957,
-0.02935713529586792,
0.16882561147212982,
-0.023755893111228943,
0.126087486743927,
0.34017160534858704,
0.12503254413604736,
0.5286374092102051,
-0.20718833804130554,
-0.2758103013038635,
0.592939019203186,
0.4263986647129059,
0.04519742727279663,
-0.011201035231351852,
-0.15890386700630188,
-0.4110688269138336,
-0.003958277404308319,
-0.044107720255851746,
-0.13266029953956604,
-0.20619727671146393,
-0.30397897958755493,
-0.23607687652111053,
0.0215914249420166,
-0.2777523398399353,
-0.1529097855091095,
0.19442975521087646,
0.044132061302661896,
-0.09081380069255829,
0.04218783974647522,
-0.20003721117973328,
0.3354281783103943,
-0.26376625895500183,
0.07355314493179321,
-0.22642746567726135,
0.44611355662345886,
-0.13073202967643738,
-0.1793540120124817,
0.07511359453201294,
0.19267278909683228,
0.26031020283699036,
-0.06921231746673584,
-0.21494245529174805,
0.39762169122695923,
0.19395337998867035,
0.023800920695066452,
-0.03815833851695061,
0.06504423916339874,
0.1892474889755249,
-0.1198691874742508,
-0.034375131130218506,
0.28658196330070496,
0.25749900937080383,
0.07393539696931839,
-0.3821898400783539,
0.33895188570022583,
-0.07138930261135101,
-0.015682268887758255,
0.17984037101268768,
-0.14136357605457306,
0.24827274680137634,
-0.176543191075325,
-0.04934012144804001,
-0.0033088847994804382,
0.21663765609264374,
0.41005316376686096,
0.06445033848285675,
0.1420876681804657,
-0.28678199648857117,
-0.27010050415992737,
0.560518741607666,
-0.1265038102865219,
0.19869206845760345,
0.02119063213467598,
-0.10431553423404694,
0.04683902859687805,
0.13448451459407806,
0.20707088708877563,
0.4901237189769745,
0.24899493157863617,
-0.33330684900283813,
0.16264593601226807,
0.1359851360321045,
-0.133870929479599,
0.2961167097091675,
-0.026944704353809357,
0.24132642149925232,
0.2822816073894501,
-0.09388852119445801,
-0.00005759671330451965,
-0.21227802336215973,
-0.5281851291656494,
-0.006517719477415085,
0.20071561634540558,
-0.5068346858024597,
-0.07835966348648071,
-0.13193359971046448,
-0.05732479691505432,
-0.26645225286483765,
0.15110167860984802,
-0.030948825180530548,
0.05680245906114578,
-0.11303494870662689,
0.14966219663619995,
-0.17854535579681396,
0.033879220485687256,
-0.4002402126789093,
0.054090432822704315,
0.15202000737190247,
-0.24870344996452332,
-0.14827384054660797,
-0.05029232054948807,
-0.04681239277124405,
0.005729466676712036,
0.13293975591659546,
0.24887029826641083,
0.18162937462329865,
-0.3294293284416199,
-0.05979945510625839,
-0.29934102296829224,
-0.07099223136901855,
0.15267831087112427,
0.2771051526069641,
0.23693211376667023,
0.3213019371032715,
0.21528354287147522,
0.1822866052389145,
-0.31777265667915344,
0.230484738945961,
0.19801676273345947,
-0.28084343671798706,
0.015840865671634674,
0.06763775646686554,
-0.06876309216022491,
-0.08643630892038345,
-0.5711344480514526,
-0.10905448347330093,
-0.44684165716171265,
0.20936799049377441,
0.011675715446472168,
0.29210683703422546,
0.26600712537765503,
0.2054951936006546,
0.2759476602077484,
-0.017203964293003082,
0.17792227864265442,
0.01960814744234085,
-0.4038035571575165,
0.13677823543548584,
-0.05604863911867142,
-0.1542998105287552,
0.13717953860759735,
-0.19122682511806488,
0.16876161098480225,
0.061087753623723984,
-0.4646395444869995,
-0.27971065044403076,
0.0049559585750103,
0.34738990664482117,
-0.26481103897094727,
-0.12190034985542297,
0.3573189675807953,
0.21582578122615814,
-0.05250781029462814,
-0.29849231243133545,
-0.13616174459457397,
0.12908531725406647,
-0.04910704120993614,
0.13871844112873077,
0.09150316566228867,
0.6992576122283936,
-0.14841902256011963,
0.33231812715530396,
0.23977097868919373,
0.0751994401216507,
0.3955916464328766,
-0.1396445631980896,
0.33271491527557373,
-0.16563422977924347,
-0.09767943620681763,
-0.1005447655916214,
0.29274410009384155,
-0.35825979709625244,
0.1420898586511612,
-0.04469353333115578,
0.11207706481218338,
-0.027861937880516052,
-0.34282535314559937,
-0.3680798411369324,
-0.14003533124923706,
-0.0070463865995407104,
-0.2161051332950592,
0.08465955406427383,
-0.05618339776992798,
0.11402799934148788,
-0.1651839315891266,
0.2350415289402008,
0.1721823513507843,
0.4469515085220337,
0.22060681879520416,
0.022792935371398926,
-0.3903111219406128,
-0.05375688150525093,
0.053937219083309174,
0.06684655696153641,
0.01957463100552559,
0.39621230959892273,
-0.14945676922798157,
0.09371086210012436,
-0.0015383437275886536,
-0.1237230896949768,
0.5652118921279907,
-0.19140216708183289,
0.11894300580024719,
0.09269527345895767,
0.26050543785095215,
-0.2675323486328125,
0.03143700957298279,
-0.03872532397508621,
0.35433077812194824,
0.2630181908607483,
0.7514349222183228,
-0.15363281965255737,
-0.23508837819099426,
0.28249701857566833,
0.1648222655057907,
-0.18648499250411987,
-0.3065163493156433,
-0.22595393657684326,
-0.44059181213378906,
-0.3282618820667267,
-0.010747034102678299,
0.12070871144533157,
0.02780640497803688,
0.1422603577375412,
-0.22936025261878967,
-0.2017836570739746,
0.0002373233437538147,
-0.1323755383491516,
-0.03822801262140274,
0.5094062089920044,
-0.341181218624115,
0.12357400357723236,
-0.07182365655899048,
0.47138965129852295,
0.4534534513950348,
0.5936469435691833,
0.07477860152721405,
-0.3280259072780609,
-0.10513219237327576,
-0.31121402978897095,
0.16623637080192566,
0.1116378903388977,
-0.05198642611503601,
-0.06800186634063721,
0.023891925811767578,
-0.05503613129258156,
-0.07646343111991882,
-0.16311055421829224,
0.3637067973613739,
-0.004537597298622131,
-0.1413203477859497,
-0.37982791662216187,
0.30847859382629395,
0.05493009835481644,
0.015051767230033875,
0.1780015081167221,
0.006501894444227219,
-0.4598080515861511,
0.4519011080265045,
-0.03010471910238266,
0.8407719731330872,
0.358579158782959,
0.11823947727680206,
0.566985011100769,
-0.1571183055639267,
0.30137574672698975,
-0.33364224433898926,
-0.011658728122711182,
-0.3103311061859131,
-0.18820317089557648,
-0.031748998910188675,
-0.2226104885339737,
0.20160165429115295,
0.29413414001464844,
-0.23289716243743896,
0.3685148060321808,
-0.1309378296136856,
-0.05332248657941818,
0.0940999761223793,
0.0864231288433075,
-0.1675126552581787,
0.1532989740371704,
-0.4431326389312744,
0.1221412643790245,
0.05153103545308113,
0.15912926197052002,
-0.06990465521812439,
-0.24557004868984222,
-0.08026879280805588,
-0.36540189385414124,
-0.030336253345012665,
0.21325024962425232,
-0.3977457880973816,
0.08033107221126556,
-0.025886720046401024,
-0.0022129565477371216,
0.024807021021842957,
0.14130671322345734,
-0.01365693286061287,
0.2007555067539215,
-0.09504047781229019,
0.18248265981674194,
-0.10648716986179352,
0.11959933489561081,
-0.12456530332565308,
0.09556559473276138,
0.3945658206939697,
-0.09029962867498398,
-0.3249647617340088,
0.22416779398918152,
-0.5367938280105591,
-0.42024528980255127,
0.10082325339317322,
-0.2200324386358261,
0.06534797698259354,
-0.27126336097717285,
-0.4454425275325775,
-0.08021797239780426,
0.03434097021818161,
-0.22019335627555847,
0.18157526850700378,
0.07957723736763,
-0.17062079906463623,
0.08011932671070099,
-0.066294364631176,
-0.35631221532821655,
-0.062121156603097916,
0.15871666371822357,
0.03093656525015831,
0.042615607380867004,
0.574662446975708,
-0.14524130523204803,
-0.09530983865261078,
-0.3144218623638153,
0.3864411413669586,
0.40903183817863464,
-0.21503528952598572,
0.14090971648693085,
-0.10001519322395325,
0.15301230549812317,
-0.07793821394443512,
0.29194727540016174,
0.17741341888904572,
0.13267874717712402,
-0.03361055627465248,
-0.4432671070098877,
-0.1440315544605255,
0.2895233631134033,
0.0941278487443924,
0.20803862810134888,
0.09607313573360443,
0.03386634588241577,
-0.02216976508498192,
-0.438039630651474,
-0.35990703105926514,
0.09951213747262955,
-0.46330440044403076,
0.17085160315036774,
0.4318113923072815,
0.2519567608833313,
0.09179343283176422,
0.01737717166543007,
0.17995405197143555,
-0.09443208575248718,
0.04654569923877716,
-0.21045929193496704,
-0.1256762593984604,
0.100645050406456,
0.1421555131673813,
0.12292171269655228,
-0.07541313022375107,
-0.29931196570396423,
-0.04648923501372337,
0.06015416234731674,
0.03821562975645065,
0.2646752595901489,
-0.08363598585128784,
0.19161145389080048,
-0.11476582288742065,
0.08598680049180984,
-0.46983012557029724,
0.23433619737625122,
-0.1916814148426056,
0.24308131635189056,
-0.15026693046092987,
0.10411331057548523,
-0.08059625327587128,
0.08310150355100632,
-0.24130287766456604,
0.06116883084177971,
-0.17573480308055878,
0.34920892119407654,
0.14195787906646729,
-0.3950124680995941,
0.10600647330284119,
0.30341383814811707,
-0.007819272577762604,
0.1188015341758728,
-0.4043563902378082,
0.07397492974996567,
0.3193103075027466,
0.34420737624168396,
-0.11213107407093048,
-0.050631169229745865,
0.13996244966983795,
-0.3413136303424835,
0.0626283511519432,
0.13555604219436646,
-0.16073793172836304,
-0.18515443801879883,
0.027157649397850037,
-0.002793148159980774,
0.26030978560447693,
-0.02822907641530037,
0.20592685043811798,
0.4383295476436615,
-0.15598134696483612,
0.03925237059593201,
-0.04063187912106514,
0.08403598517179489,
0.23341670632362366,
0.6601212024688721,
-0.05658184736967087,
0.2733338475227356,
0.17907452583312988,
0.0002125641331076622,
-0.032563380897045135,
-0.1975291669368744,
0.1033204048871994,
-0.09011995792388916,
-0.19526833295822144,
0.07298730313777924,
-0.093208909034729,
-0.07526463270187378,
-0.21880143880844116,
0.01690087839961052,
0.013521865010261536,
-0.07728776335716248,
-0.32635849714279175,
0.02237185463309288,
-0.2970251739025116,
-0.2312852293252945,
-0.08402050286531448,
-0.1316354125738144,
-0.0042655314318835735,
0.2105587124824524,
-0.010845605283975601,
0.07533249258995056,
-0.061584360897541046,
-0.06306006014347076,
0.20127813518047333,
0.4066790044307709,
0.0387684628367424,
-0.366233766078949,
0.23516488075256348,
0.2140047401189804,
-0.05807114765048027,
0.0819258838891983,
0.22364866733551025,
0.46557843685150146,
0.5413345694541931,
0.10969248414039612,
-0.205376535654068,
-0.018680550158023834,
-0.09916161000728607,
-0.018493395298719406,
0.11433466523885727,
-0.1173897460103035,
-0.05964919179677963,
0.20591560006141663,
0.25993239879608154,
-0.21377694606781006,
0.2644481956958771,
0.21733544766902924,
-0.0026954393833875656,
-0.4855744540691376,
0.24089135229587555,
-0.28358128666877747,
-0.33335500955581665,
-0.08343836665153503,
0.0089518241584301,
-0.3461458086967468,
-0.19983138144016266,
0.19510073959827423,
0.1899237185716629,
0.21304577589035034,
0.0205477736890316,
0.1122090071439743,
-0.10171540081501007,
0.14847122132778168,
0.2634023427963257,
0.09947869181632996,
-0.2761399745941162,
0.13232195377349854,
-0.425550252199173,
0.053167711943387985,
-0.13938044011592865,
-0.35610830783843994,
0.009627778083086014,
0.04732445627450943,
-0.14600330591201782,
0.023169662803411484,
0.16968873143196106,
0.22892791032791138,
0.03318949043750763,
0.13286007940769196,
-0.28154969215393066,
-0.2114362269639969,
0.2514520287513733,
0.10686653107404709,
0.05691291391849518,
-0.6404522061347961,
0.061206892132759094,
0.10517217218875885,
0.10639294236898422,
-0.240106999874115,
-0.077520951628685,
-0.03455571085214615,
-0.19619207084178925,
0.3539617955684662,
0.013790218159556389,
0.3806111812591553,
-0.23032236099243164,
-0.4210272431373596,
-0.011533739045262337,
-0.28428202867507935,
-0.11960429698228836,
0.13137823343276978,
0.16775137186050415,
0.4596864879131317,
-0.0923682153224945,
-0.06255877017974854,
-0.37584733963012695,
0.14073500037193298,
-0.20017698407173157,
-0.40033745765686035,
-0.2706625461578369,
0.30596834421157837,
-0.2221164107322693,
0.16571995615959167,
0.1009259819984436,
-0.012544011697173119,
-0.16726548969745636,
0.2680807113647461,
-0.14149796962738037,
-0.12210091948509216,
0.41435542702674866,
-0.21598462760448456,
-0.10580167174339294,
0.03382162004709244,
0.4323510229587555,
-0.16398093104362488,
0.0837085023522377,
-0.3155617117881775,
0.05847148597240448,
0.46956580877304077,
0.16638699173927307,
0.021810002624988556,
0.04178459942340851,
0.032182563096284866,
0.028557494282722473,
0.09542650729417801,
0.2536012530326843,
0.0019029481336474419,
-0.18694016337394714,
0.2884310185909271,
-0.29032206535339355
] |
https://github.com/huggingface/datasets/issues/6182 | Our minimal Python version requirement is 3.8, so we dropped `importlib_metadata`.
Feel free to open a PR in the `evaluate` repo to replace the problematic import with
```python
if PY_VERSION < version.parse("3.8"):
import importlib_metadata
else:
import importlib.metadata as importlib_metadata
``` | Loading Meteor metric in HF evaluate module crashes due to datasets import issue | ### Describe the bug
When using python3.9 and ```evaluate``` module loading Meteor metric crashes at a non-existent import from ```datasets.config``` in ```datasets v2.14```
### Steps to reproduce the bug
```
from evaluate import load
meteor = load("meteor")
```
produces the following error:
```
from datasets.config import importlib_metadata, version
ImportError: cannot import name 'importlib_metadata' from 'datasets.config' (<path_to_project>/venv/lib/python3.9/site-packages/datasets/config.py)
```
### Expected behavior
```datasets``` of v2.10 has the following workaround in ```config.py```:
```
if PY_VERSION < version.parse("3.8"):
import importlib_metadata
else:
import importlib.metadata as importlib_metadata
```
However, it's absent in v2.14 which might be the cause of the issue.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-13.5-arm64-arm-64bit
- Python version: 3.9.6
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
- Evaluate version: 0.4.0 | 40 | Loading Meteor metric in HF evaluate module crashes due to datasets import issue
### Describe the bug
When using python3.9 and ```evaluate``` module loading Meteor metric crashes at a non-existent import from ```datasets.config``` in ```datasets v2.14```
### Steps to reproduce the bug
```
from evaluate import load
meteor = load("meteor")
```
produces the following error:
```
from datasets.config import importlib_metadata, version
ImportError: cannot import name 'importlib_metadata' from 'datasets.config' (<path_to_project>/venv/lib/python3.9/site-packages/datasets/config.py)
```
### Expected behavior
```datasets``` of v2.10 has the following workaround in ```config.py```:
```
if PY_VERSION < version.parse("3.8"):
import importlib_metadata
else:
import importlib.metadata as importlib_metadata
```
However, it's absent in v2.14 which might be the cause of the issue.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-13.5-arm64-arm-64bit
- Python version: 3.9.6
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
- Evaluate version: 0.4.0
Our minimal Python version requirement is 3.8, so we dropped `importlib_metadata`.
Feel free to open a PR in the `evaluate` repo to replace the problematic import with
```python
if PY_VERSION < version.parse("3.8"):
import importlib_metadata
else:
import importlib.metadata as importlib_metadata
``` | [
-0.5889154076576233,
0.22531291842460632,
0.0810803547501564,
0.409982293844223,
0.43138521909713745,
0.07639343291521072,
0.1547071933746338,
0.4468281865119934,
0.044271379709243774,
-0.0648208037018776,
-0.2499675303697586,
0.31032538414001465,
-0.17195433378219604,
-0.11985348165035248,
-0.07961012423038483,
-0.07594424486160278,
-0.11077238619327545,
-0.16757255792617798,
-0.30137819051742554,
0.025934502482414246,
-0.20872154831886292,
0.13104252517223358,
-0.23629462718963623,
-0.042515479028224945,
0.16998256742954254,
0.3535900413990021,
0.03999205678701401,
0.325031042098999,
-0.07472483813762665,
-0.5306124091148376,
0.09937997162342072,
0.08755438774824142,
0.23691165447235107,
0.3963339626789093,
-0.00011443156108725816,
0.004124857485294342,
0.3176575005054474,
0.04950451850891113,
-0.26759418845176697,
-0.4153215289115906,
-0.19717657566070557,
-0.3160712420940399,
0.17223738133907318,
-0.08948688209056854,
0.2342008501291275,
-0.28591129183769226,
-0.28978052735328674,
-0.28352439403533936,
0.26791128516197205,
0.3470437526702881,
0.1872779130935669,
0.2887493371963501,
-0.02648930996656418,
-0.3680139482021332,
0.19179649651050568,
0.12831375002861023,
0.016507811844348907,
0.0299987830221653,
-0.13519716262817383,
-0.14988619089126587,
-0.08906930685043335,
-0.05719959735870361,
-0.018208622932434082,
0.2161906212568283,
0.5451932549476624,
-0.17863546311855316,
-0.05485453084111214,
0.0308837927877903,
-0.09183414280414581,
0.31637194752693176,
0.49950313568115234,
-0.4820542633533478,
-0.2824033498764038,
0.05259926617145538,
-0.0006406828761100769,
-0.4031406342983246,
0.038809940218925476,
-0.03051217645406723,
-0.03833373263478279,
0.027645014226436615,
-0.036252301186323166,
-0.27710840106010437,
-0.2011244297027588,
0.16868731379508972,
-0.1915162056684494,
0.5960685610771179,
-0.12323837727308273,
0.060248468071222305,
-0.011065347120165825,
-0.00847659632563591,
0.2242368906736374,
-0.14144383370876312,
-0.14320431649684906,
0.018450308591127396,
-0.24309146404266357,
0.13966521620750427,
0.15031270682811737,
-0.19485464692115784,
0.16963568329811096,
-0.07426074147224426,
-0.38572201132774353,
0.27373528480529785,
0.2889622151851654,
0.052998967468738556,
0.26811304688453674,
-0.008053485304117203,
0.36134088039398193,
0.03186904266476631,
0.3804283142089844,
0.292061448097229,
0.178262859582901,
-0.02426896244287491,
0.0657646507024765,
-0.1805843710899353,
0.1789897084236145,
0.07998692989349365,
0.08404115587472916,
-0.22254975140094757,
-0.43472379446029663,
0.19476889073848724,
-0.10243446379899979,
-0.03211154788732529,
0.09274662286043167,
0.41431790590286255,
-0.19886822998523712,
0.1150810495018959,
0.17975009977817535,
0.11318596452474594,
-0.22601017355918884,
0.09799215197563171,
-0.16890206933021545,
0.3246261775493622,
-0.13675746321678162,
-0.05916263908147812,
0.033570632338523865,
0.046286989003419876,
0.26279813051223755,
0.01292305439710617,
0.2348392754793167,
-0.10610739141702652,
-0.046147171407938004,
0.041545938700437546,
-0.07601151615381241,
0.39340880513191223,
0.05168020725250244,
0.22373363375663757,
0.10105940699577332,
-0.4444890022277832,
-0.1671244204044342,
-0.07150030136108398,
-0.2984587848186493,
-0.14193053543567657,
-0.13180477917194366,
0.21358530223369598,
-0.2610055208206177,
0.12127292156219482,
-0.2529251277446747,
-0.04680939018726349,
-0.3528149724006653,
0.04202067852020264,
-0.2924971580505371,
-0.3291403651237488,
-0.0681753009557724,
-0.21641504764556885,
0.43839138746261597,
0.5587824583053589,
-0.65373295545578,
0.006718866527080536,
-0.5182114243507385,
0.11198623478412628,
-0.1309029757976532,
-0.03689715266227722,
-0.3194062113761902,
0.2568861246109009,
-0.21591736376285553,
-0.3693233132362366,
0.6026901602745056,
-0.46704673767089844,
-0.12140650302171707,
0.009532827883958817,
0.05357934534549713,
0.14111676812171936,
-0.19940060377120972,
-0.061956778168678284,
-0.0024106577038764954,
-0.17863592505455017,
0.38479048013687134,
-0.0010673068463802338,
0.06439881771802902,
-0.18198144435882568,
-0.13394765555858612,
-0.036691814661026,
-0.08081372082233429,
0.10900281369686127,
0.37982574105262756,
-0.2793823778629303,
0.169223353266716,
0.3093428611755371,
0.15377211570739746,
-0.13414019346237183,
-0.11541888117790222,
0.5530060529708862,
0.649195671081543,
0.057169485837221146,
-0.010530505329370499,
-0.4011511504650116,
-0.2665445804595947,
0.2954391837120056,
0.10159371048212051,
-0.07669121026992798,
0.09973478317260742,
-0.0358256958425045,
-0.4345589280128479,
0.16077081859111786,
-0.08223704248666763,
-0.1298041194677353,
0.1395113468170166,
0.09889692068099976,
-0.4088743031024933,
0.08901888132095337,
-0.13431888818740845,
0.3638312518596649,
-0.135079026222229,
0.1629491001367569,
0.022434532642364502,
0.05389364808797836,
-0.0872591957449913,
-0.024050766602158546,
0.21336127817630768,
0.0933583676815033,
0.03910309076309204,
-0.14853107929229736,
-0.024478688836097717,
0.31243816018104553,
0.18864160776138306,
0.019212286919355392,
0.10913679003715515,
-0.009687989950180054,
0.11177428066730499,
-0.05355377867817879,
-0.015675872564315796,
-0.18452219665050507,
0.16507624089717865,
-0.10694164037704468,
0.07365675270557404,
0.31818121671676636,
0.21849040687084198,
-0.0056504420936107635,
0.13396553695201874,
-0.13925716280937195,
0.1326504349708557,
0.07693876326084137,
-0.04881614074110985,
-0.37133127450942993,
0.14701278507709503,
0.050970520824193954,
0.030368462204933167,
-0.13177990913391113,
0.12462574243545532,
-0.1651914268732071,
0.4639423191547394,
0.14647334814071655,
0.19921529293060303,
0.04485807567834854,
-0.31856176257133484,
0.0632060170173645,
0.03325853496789932,
-0.07142159342765808,
0.6405729651451111,
0.1308792680501938,
0.0508386455476284,
0.44460028409957886,
-0.3180003762245178,
-0.01662525162100792,
0.19970828294754028,
0.32861626148223877,
-0.015261240303516388,
0.17949053645133972,
0.0666145533323288,
0.05916434898972511,
-0.33747899532318115,
-0.3091844916343689,
-0.16406047344207764,
0.3459495007991791,
-0.5729894638061523,
0.23587027192115784,
-0.47026336193084717,
0.3662935793399811,
-0.11318898946046829,
-0.49536842107772827,
-0.21954986453056335,
-0.6300754547119141,
-0.11409918963909149,
0.36770081520080566,
-0.07086852192878723,
0.08716479688882828,
0.1423443853855133,
-0.05334733426570892,
0.005078345537185669,
-0.025362996384501457,
-0.07153922319412231,
-0.3377830684185028,
-0.07587578147649765,
-0.0009361840784549713,
0.22470693290233612,
0.24554605782032013,
0.2937224507331848,
-0.22851061820983887,
0.0016499534249305725,
-0.09334608167409897,
-0.6749230623245239,
0.01307279895991087,
-0.021941371262073517,
0.7849382758140564,
0.15900802612304688,
-0.07539564371109009,
0.027727678418159485,
0.15607914328575134,
0.2467958927154541,
0.07820212095975876,
0.11490222066640854,
0.2090073972940445,
-0.05255161225795746,
-0.276335746049881,
0.05301293730735779,
-0.38977834582328796,
-0.021920882165431976,
-0.48144853115081787,
-0.37635141611099243,
0.04082953929901123,
-0.09509819746017456,
0.1180364191532135,
0.1850382536649704,
0.24377894401550293,
-0.05753543972969055,
0.14777660369873047,
0.006985940039157867,
-0.042905814945697784,
0.3378220796585083,
-0.28172627091407776,
-0.3150652348995209,
0.18025872111320496,
0.09647668898105621,
0.11956564337015152,
0.07508690655231476,
-0.3191063702106476,
-0.47760650515556335,
-0.011254933662712574,
0.09476981312036514,
-0.07822822779417038,
0.17498771846294403,
0.03460310772061348,
0.11988107860088348,
0.04858234152197838,
-0.12918786704540253,
-0.1572292149066925,
-0.08266834169626236,
0.04637164995074272,
0.09653785824775696,
-0.26761049032211304,
0.3470739424228668,
-0.03606478497385979,
0.6492292881011963,
0.31281042098999023,
-0.1826467514038086,
0.36518189311027527,
-0.0026530325412750244,
0.6116807460784912,
-0.17312052845954895,
-0.3035152852535248,
-0.15761232376098633,
0.2637321352958679,
0.29062899947166443,
0.0866055116057396,
-0.12304223328828812,
0.1446826457977295,
-0.2854844927787781,
-0.05180443823337555,
-0.07514004409313202,
-0.3878353238105774,
0.06770120561122894,
-0.017970828339457512,
0.06451065093278885,
0.17745375633239746,
0.15382352471351624,
-0.1175045594573021,
0.021780040115118027,
0.3229868412017822,
0.5066415667533875,
-0.20876404643058777,
0.10259352624416351,
0.18109332025051117,
0.050749652087688446,
-0.1523621678352356,
0.22989365458488464,
0.03630150482058525,
0.46030670404434204,
-0.03982459753751755,
-0.041477400809526443,
-0.1065247654914856,
-0.1864285171031952,
0.33894407749176025,
-0.31621041893959045,
-0.057256195694208145,
0.27919870615005493,
-0.19338764250278473,
-0.7119144201278687,
-0.010408572852611542,
-0.3312256932258606,
-0.048975538462400436,
0.081807941198349,
0.5928133130073547,
-0.24792861938476562,
-0.3676762580871582,
0.0815465897321701,
0.3916800320148468,
-0.1051025539636612,
-0.20169290900230408,
-0.19346190989017487,
-0.20199531316757202,
-0.11488151550292969,
-0.1163172572851181,
-0.014696720987558365,
0.15943244099617004,
0.13843286037445068,
-0.22761152684688568,
-0.13012728095054626,
-0.29621782898902893,
0.3165627121925354,
0.2422523945569992,
0.07265351712703705,
-0.2221820205450058,
0.360304057598114,
-0.18789726495742798,
-0.2434539496898651,
0.5734103918075562,
0.2741798460483551,
-0.03386398404836655,
-0.575645387172699,
-0.08386486768722534,
0.22244736552238464,
0.2523098587989807,
0.13483154773712158,
-0.23162870109081268,
-0.023062851279973984,
-0.2543047070503235,
0.26426517963409424,
-0.3682110905647278,
0.12388116866350174,
0.3327943682670593,
0.17554843425750732,
-0.18528112769126892,
0.007432468235492706,
0.301974356174469,
0.13227930665016174,
-0.05002160370349884,
0.32482460141181946,
0.17732378840446472,
-0.30022209882736206,
-0.008485745638608932,
0.1333659142255783,
0.4281635582447052,
0.14631184935569763,
-0.10443267971277237,
0.24328674376010895,
-0.17617130279541016,
0.155237078666687,
-0.06571689248085022,
-0.045473143458366394,
-0.5269693732261658,
-0.3315320312976837,
-0.032953519374132156,
-0.17800065875053406,
0.5468677282333374,
-0.30232855677604675,
0.1174980103969574,
0.5039981603622437,
-0.1341084986925125,
0.15970151126384735,
-0.09963018447160721,
0.17564751207828522,
-0.19605545699596405,
-0.09950314462184906,
-0.2607635259628296,
0.1803256869316101,
-0.15236268937587738,
0.08396701514720917,
-0.1694435179233551,
0.10613559931516647,
0.07269396632909775,
-0.042952969670295715,
-0.24004247784614563,
0.021513544023036957,
0.12705349922180176,
0.12198272347450256,
0.09582359343767166,
-0.05350763350725174,
0.5069511532783508,
-0.11318681389093399,
0.30812546610832214,
0.35641002655029297,
-0.05009932070970535,
0.25117167830467224,
-0.6258901357650757,
0.2530007064342499,
0.0921383798122406,
0.1418863832950592,
0.1699625849723816,
-0.045568522065877914,
-0.19113685190677643,
0.25137507915496826,
-0.05521426349878311,
0.08808698505163193,
0.2206406593322754,
0.021208232268691063,
0.1607779562473297,
-0.11062571406364441,
0.05330618470907211,
-0.015572160482406616,
0.1700764000415802,
-0.2456713616847992,
0.1507149338722229,
-0.06862138211727142,
-0.041963957250118256,
0.4843612611293793,
0.002056301571428776,
-0.2666777968406677,
-0.020843274891376495,
0.4887738823890686,
-0.26366522908210754,
0.28639185428619385,
0.11406102776527405,
0.14843951165676117,
-0.2672296464443207,
-0.20462408661842346,
0.0217982679605484,
0.11644609272480011,
-0.14883209764957428,
0.0018263347446918488,
0.07644135504961014,
0.1510172337293625,
0.03470374643802643,
0.05488954484462738,
0.18948030471801758,
-0.5505735874176025,
-0.1930994838476181,
-0.5398595333099365,
0.03928143531084061,
0.19123958051204681,
-0.21713659167289734,
-0.1207176148891449,
0.017880462110042572,
-0.0708158016204834,
-0.2998278737068176,
0.18050673604011536,
-0.3134482204914093,
0.05428541451692581,
0.1058707982301712,
0.038654912263154984,
-0.13762184977531433,
-0.08903883397579193,
0.16771161556243896,
-0.02855309098958969,
0.09231631457805634,
0.11351488530635834,
-0.45017531514167786,
-0.16861362755298615,
-0.2909846305847168,
0.11249171197414398,
-0.08205720782279968,
0.16750217974185944,
0.10922490060329437,
-0.16557440161705017,
-0.16679656505584717,
-0.22152505815029144,
0.3847849369049072,
0.31931912899017334,
-0.09970588982105255,
0.24396751821041107,
0.3801022171974182,
-0.0018167700618505478,
0.12101200222969055,
0.17650644481182098,
0.2580409646034241,
0.27034416794776917,
-0.0933094173669815,
0.11420843750238419,
-0.07821525633335114,
-0.0891517922282219,
-0.19792187213897705,
0.11389501392841339,
-0.08658772706985474,
-0.047168973833322525,
0.3511523902416229,
-0.055674102157354355,
0.16536745429039001,
0.32854482531547546,
0.2729218304157257,
0.6272026300430298,
-0.11894315481185913,
-0.09257695078849792,
0.13633745908737183,
0.13597744703292847,
-0.18916621804237366,
-0.17415174841880798,
-0.16546398401260376,
0.31118863821029663,
0.1758289635181427,
0.1550174057483673,
0.08116712421178818,
-0.08973252773284912,
0.2849893569946289,
0.1030140221118927,
0.5619509816169739,
0.02475278079509735,
0.10526525974273682,
0.10135182738304138,
-0.17703428864479065,
0.07653738558292389,
0.346780925989151,
0.10196378827095032,
0.30661749839782715,
0.4155975580215454,
-0.026076097041368484,
0.10419636964797974,
-0.06486053764820099,
0.1928425431251526,
-0.1732545793056488,
-0.41960179805755615,
0.22786572575569153,
0.09820494800806046,
0.2291320562362671,
0.035104330629110336,
0.04990280047059059,
0.23999273777008057,
-0.08246926218271255,
-0.02645757608115673,
-0.13762742280960083,
0.05760867893695831,
-0.08705238997936249,
-0.07003746926784515,
0.04036500304937363,
-0.15679031610488892,
-0.2306075394153595,
-0.00994199514389038,
0.14852949976921082,
-0.24678044021129608,
-0.020733244717121124,
0.08033119887113571,
-0.0977277085185051,
-0.37299543619155884,
-0.02146991901099682,
0.10971192270517349,
-0.0806986391544342,
-0.15469145774841309,
0.12032034248113632,
0.25043749809265137,
-0.02053733542561531,
-0.2041693925857544,
-0.044664416462183,
0.29839128255844116,
0.13681423664093018,
-0.09486280381679535,
-0.023331357166171074,
0.21238139271736145,
-0.0619068369269371,
0.05832342803478241,
-0.0928167998790741,
-0.20751628279685974,
0.17410694062709808,
0.31181827187538147,
0.2434171438217163,
-0.21164995431900024,
-0.08554798364639282,
-0.055123381316661835,
0.26005974411964417,
-0.3707807660102844,
0.6399821043014526,
0.07035133242607117,
0.23588308691978455,
0.07676208764314651,
-0.21479257941246033,
-0.25715166330337524,
-0.07715269923210144,
0.5538487434387207,
0.04484281316399574,
0.04051204398274422,
-0.1283840537071228,
0.06556623429059982,
-0.04602248594164848,
0.1336817443370819,
0.14905521273612976,
-0.47989368438720703,
-0.07141119241714478,
0.031533852219581604,
-0.7290205955505371,
0.11627988517284393,
-0.09308427572250366,
0.17322373390197754,
0.2534562647342682,
-0.13922259211540222,
0.026421038433909416,
0.2088358849287033,
0.38309675455093384,
0.058971304446458817,
0.06061464548110962,
-0.08433017134666443,
-0.5751142501831055,
-0.12663216888904572,
-0.09428146481513977,
-0.2947911024093628,
-0.046540819108486176,
-0.3301546275615692,
0.016461126506328583,
-0.377888947725296,
0.05597895383834839,
-0.23114433884620667,
-0.14230817556381226,
0.2766191065311432,
-0.09905475378036499,
0.4597921371459961,
-0.07936563342809677,
0.27616408467292786,
0.002865344285964966,
-0.027138352394104004,
-0.031105704605579376,
-0.11849061399698257,
0.19897770881652832,
0.2334873080253601,
-0.10058166086673737,
0.26786842942237854,
-0.12280299514532089,
-0.32134729623794556,
-0.18411067128181458,
0.3412279486656189,
0.015431620180606842,
-0.09545599669218063,
-0.21150290966033936,
0.278596431016922,
-0.1790640652179718,
0.24187597632408142,
-0.018057994544506073,
0.29490071535110474,
0.13657264411449432,
0.3771035373210907,
-0.19111883640289307,
-0.42027509212493896,
0.5158806443214417,
-0.02503746747970581,
-0.5000422596931458,
0.034758519381284714,
0.30405139923095703,
-0.21578198671340942,
-0.3790387511253357,
-0.45420804619789124,
0.03665460646152496,
0.3295179307460785,
-0.11312223970890045,
-0.017198197543621063,
0.22554437816143036,
-0.34951409697532654,
0.1289016157388687,
-0.05675623565912247,
-0.019451793283224106,
0.009064171463251114,
-0.16840574145317078,
-0.04572566598653793,
0.07733660936355591
] |
https://github.com/huggingface/datasets/issues/6182 | Any idea when you guys will release the next version which deals with this problem?
I'm still having the same issue with py 3.10 when I install the lib with pip.
I'm assuming that it has not yet been updated since the merge was 3 days ago. | Loading Meteor metric in HF evaluate module crashes due to datasets import issue | ### Describe the bug
When using python3.9 and ```evaluate``` module loading Meteor metric crashes at a non-existent import from ```datasets.config``` in ```datasets v2.14```
### Steps to reproduce the bug
```
from evaluate import load
meteor = load("meteor")
```
produces the following error:
```
from datasets.config import importlib_metadata, version
ImportError: cannot import name 'importlib_metadata' from 'datasets.config' (<path_to_project>/venv/lib/python3.9/site-packages/datasets/config.py)
```
### Expected behavior
```datasets``` of v2.10 has the following workaround in ```config.py```:
```
if PY_VERSION < version.parse("3.8"):
import importlib_metadata
else:
import importlib.metadata as importlib_metadata
```
However, it's absent in v2.14 which might be the cause of the issue.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-13.5-arm64-arm-64bit
- Python version: 3.9.6
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
- Evaluate version: 0.4.0 | 47 | Loading Meteor metric in HF evaluate module crashes due to datasets import issue
### Describe the bug
When using python3.9 and ```evaluate``` module loading Meteor metric crashes at a non-existent import from ```datasets.config``` in ```datasets v2.14```
### Steps to reproduce the bug
```
from evaluate import load
meteor = load("meteor")
```
produces the following error:
```
from datasets.config import importlib_metadata, version
ImportError: cannot import name 'importlib_metadata' from 'datasets.config' (<path_to_project>/venv/lib/python3.9/site-packages/datasets/config.py)
```
### Expected behavior
```datasets``` of v2.10 has the following workaround in ```config.py```:
```
if PY_VERSION < version.parse("3.8"):
import importlib_metadata
else:
import importlib.metadata as importlib_metadata
```
However, it's absent in v2.14 which might be the cause of the issue.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-13.5-arm64-arm-64bit
- Python version: 3.9.6
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
- Evaluate version: 0.4.0
Any idea when you guys will release the next version which deals with this problem?
I'm still having the same issue with py 3.10 when I install the lib with pip.
I'm assuming that it has not yet been updated since the merge was 3 days ago. | [
-0.5422057509422302,
0.2027595341205597,
0.05300013720989227,
0.36066898703575134,
0.31523409485816956,
0.0645938366651535,
0.1598619520664215,
0.4550836682319641,
-0.005709491670131683,
-0.1167023777961731,
-0.17437200248241425,
0.29493311047554016,
-0.1917290985584259,
-0.1674903929233551,
-0.06771482527256012,
-0.11702139675617218,
0.07836183905601501,
-0.20800340175628662,
-0.29582518339157104,
-0.04510553553700447,
-0.24478484690189362,
0.18452845513820648,
-0.33145570755004883,
-0.040620531886816025,
0.20473957061767578,
0.31671246886253357,
-0.016748793423175812,
0.23676668107509613,
-0.0945814996957779,
-0.6092140078544617,
0.1489061564207077,
0.042165037244558334,
0.22233882546424866,
0.43683522939682007,
-0.000124652506201528,
-0.07420580089092255,
0.4270479083061218,
0.13991719484329224,
-0.24481728672981262,
-0.47307804226875305,
-0.19511184096336365,
-0.4066588282585144,
0.15510424971580505,
0.027970388531684875,
0.3167484700679779,
-0.2952386140823364,
-0.30829933285713196,
-0.3057222366333008,
0.23098500072956085,
0.28145575523376465,
0.12142515182495117,
0.20267699658870697,
0.10447785258293152,
-0.3162112832069397,
0.20104989409446716,
0.15621918439865112,
-0.01682800054550171,
0.036747343838214874,
-0.003956776112318039,
-0.21910244226455688,
0.06060374900698662,
-0.02150946483016014,
-0.03285064548254013,
0.18734616041183472,
0.5820626020431519,
-0.14925014972686768,
-0.0709049254655838,
-0.06237472966313362,
-0.20479591190814972,
0.3450498580932617,
0.6581112742424011,
-0.4280135929584503,
-0.4200577139854431,
-0.01420920342206955,
0.019462071359157562,
-0.2934055030345917,
0.04812801256775856,
0.0010103024542331696,
0.02026907354593277,
0.01984817162156105,
0.03274225443601608,
-0.36136719584465027,
-0.22921165823936462,
0.22971704602241516,
-0.12008854746818542,
0.6272294521331787,
-0.08646444231271744,
0.09964007139205933,
-0.011361341923475266,
-0.07973730564117432,
0.35261908173561096,
-0.1459152102470398,
-0.07189710438251495,
0.09452472627162933,
-0.23840709030628204,
0.1125330850481987,
0.09374173730611801,
-0.17741091549396515,
0.11703293770551682,
-0.06041576713323593,
-0.521315336227417,
0.15016032755374908,
0.2783881723880768,
0.09594669938087463,
0.2894684672355652,
-0.0198364220559597,
0.3569159507751465,
0.06655800342559814,
0.4591587781906128,
0.26323458552360535,
0.29039573669433594,
0.10477505624294281,
0.015214063227176666,
-0.16029028594493866,
0.10855595767498016,
-0.009495269507169724,
0.15242953598499298,
-0.19684845209121704,
-0.3813515901565552,
0.17256298661231995,
-0.09889927506446838,
-0.0844142735004425,
-0.05988776311278343,
0.2533300220966339,
-0.2988458573818207,
0.2157057523727417,
0.2115100920200348,
0.09447808563709259,
-0.19044971466064453,
0.12136246263980865,
-0.11060380190610886,
0.25850909948349,
-0.13813333213329315,
-0.05117056518793106,
-0.011713005602359772,
-0.057822130620479584,
0.23031911253929138,
0.07249581813812256,
0.2023134082555771,
-0.10275987535715103,
-0.18251025676727295,
0.023977521806955338,
-0.12264294922351837,
0.45525234937667847,
-0.026471011340618134,
0.2821187973022461,
0.034649115055799484,
-0.4253028333187103,
-0.17276959121227264,
0.0010002348572015762,
-0.34633344411849976,
-0.11493588238954544,
-0.21761485934257507,
0.12195995450019836,
-0.21947671473026276,
0.053868114948272705,
-0.25817379355430603,
-0.03200078755617142,
-0.39831164479255676,
-0.015332214534282684,
-0.2549208998680115,
-0.3535250425338745,
-0.05122137814760208,
-0.2960536479949951,
0.3997175097465515,
0.536196231842041,
-0.7275872826576233,
-0.05123205482959747,
-0.513293445110321,
0.1287858933210373,
-0.20319528877735138,
-0.01833222061395645,
-0.2654114067554474,
0.21940897405147552,
-0.20228011906147003,
-0.42544639110565186,
0.5770442485809326,
-0.5929867029190063,
-0.13421520590782166,
0.032303761690855026,
0.09486931562423706,
0.0996059849858284,
-0.12016212195158005,
-0.011959511786699295,
-0.04234563931822777,
-0.1842235028743744,
0.37022367119789124,
0.0010992269963026047,
-0.05555673688650131,
-0.2768222391605377,
-0.10882306843996048,
-0.11744016408920288,
-0.003139620181173086,
0.12479730695486069,
0.4310181438922882,
-0.2572939991950989,
0.19420212507247925,
0.34477683901786804,
0.1729099303483963,
0.04019216448068619,
-0.03974908962845802,
0.5188233256340027,
0.7925805449485779,
0.10722929239273071,
0.05927081033587456,
-0.3969743847846985,
-0.25003939867019653,
0.2527078092098236,
0.11853328347206116,
-0.14611685276031494,
0.10678818076848984,
0.058476969599723816,
-0.35726550221443176,
0.23775488138198853,
-0.08550940454006195,
-0.05528600141406059,
0.0032344795763492584,
0.024561475962400436,
-0.40310874581336975,
0.1678624004125595,
-0.18904662132263184,
0.4853486716747284,
-0.11084723472595215,
0.2304069548845291,
-0.05785602331161499,
0.15395355224609375,
-0.06445366889238358,
-0.026848867535591125,
0.13789699971675873,
0.11752371490001678,
0.05281733721494675,
-0.18739987909793854,
0.01312205195426941,
0.31117790937423706,
0.24078860878944397,
0.05443914607167244,
0.12642201781272888,
-0.03220474720001221,
0.14829640090465546,
-0.05660310387611389,
0.04190513491630554,
-0.21720054745674133,
0.12878456711769104,
-0.10604721307754517,
0.2084806114435196,
0.2855164408683777,
0.10472066700458527,
0.05595158785581589,
0.1040031909942627,
-0.12408103048801422,
0.01312737911939621,
0.16141262650489807,
-0.1146538108587265,
-0.3620636761188507,
0.1558421552181244,
0.0012621395289897919,
0.09201651811599731,
-0.18203191459178925,
0.07450255751609802,
-0.2330760955810547,
0.48919761180877686,
0.08930961042642593,
0.17783832550048828,
0.11508171260356903,
-0.30075252056121826,
0.04548642784357071,
0.041066043078899384,
0.02886977791786194,
0.6336489319801331,
0.052287764847278595,
-0.010670434683561325,
0.406277060508728,
-0.27652618288993835,
0.0371214859187603,
0.21356797218322754,
0.40466544032096863,
0.0012720078229904175,
0.21522337198257446,
-0.022966260090470314,
0.14325234293937683,
-0.17629700899124146,
-0.21864938735961914,
-0.13897278904914856,
0.3022351562976837,
-0.49288520216941833,
0.1982671320438385,
-0.44295480847358704,
0.29037031531333923,
-0.2793307602405548,
-0.5392370223999023,
-0.31926482915878296,
-0.5925052762031555,
-0.16902899742126465,
0.3861044943332672,
0.01975151151418686,
0.10527253895998001,
0.10851546376943588,
-0.033788904547691345,
-0.029889706522226334,
-0.04634102061390877,
-0.022825688123703003,
-0.15894195437431335,
-0.08910809457302094,
-0.05787009745836258,
0.1605621874332428,
0.08561491221189499,
0.2863234877586365,
-0.2211887091398239,
0.1057240441441536,
-0.11071369051933289,
-0.7305104732513428,
0.034732453525066376,
-0.0890427678823471,
0.7528572678565979,
0.14752915501594543,
-0.08986037969589233,
0.10523305833339691,
0.12143824249505997,
0.20344780385494232,
0.027378752827644348,
0.053998515009880066,
0.09663444757461548,
-0.0421282984316349,
-0.2504541575908661,
0.17498601973056793,
-0.38802391290664673,
-0.145530104637146,
-0.44426649808883667,
-0.302007257938385,
-0.08207207173109055,
-0.09568047523498535,
0.1727815866470337,
0.17809054255485535,
0.18715637922286987,
-0.13722509145736694,
0.08630445599555969,
0.08596491813659668,
-0.06858057528734207,
0.3428955376148224,
-0.24359920620918274,
-0.2953543961048126,
0.2055077850818634,
0.17582067847251892,
0.04875550791621208,
0.04070097953081131,
-0.3346812129020691,
-0.4139063358306885,
0.031966760754585266,
0.1854773759841919,
-0.10241500288248062,
0.23022975027561188,
0.08595893532037735,
0.10851721465587616,
0.12417423725128174,
-0.14295127987861633,
-0.20845291018486023,
-0.17410847544670105,
0.1058448925614357,
0.16468720138072968,
-0.08463846892118454,
0.39730873703956604,
-0.010944999754428864,
0.6345540881156921,
0.44861140847206116,
-0.13558082282543182,
0.3344404101371765,
0.12562023103237152,
0.6340146064758301,
-0.13531196117401123,
-0.35850319266319275,
-0.21544110774993896,
0.2375120371580124,
0.4096030592918396,
0.0721718966960907,
-0.01778809353709221,
0.1444801688194275,
-0.3821508586406708,
-0.09060312807559967,
-0.10597944259643555,
-0.2523043155670166,
-0.012061799876391888,
-0.0490245521068573,
0.08754725754261017,
0.16571953892707825,
0.07769456505775452,
-0.07348282635211945,
-0.01777360960841179,
0.2872549593448639,
0.5606691241264343,
-0.14130651950836182,
0.1845078319311142,
0.24891766905784607,
0.018617119640111923,
-0.06477947533130646,
0.23732469975948334,
0.07740655541419983,
0.5382736325263977,
-0.09167339652776718,
-0.05874196067452431,
-0.08828304708003998,
-0.10753311216831207,
0.34636908769607544,
-0.28343403339385986,
-0.08479122817516327,
0.21887508034706116,
-0.17572516202926636,
-0.578913152217865,
-0.04861043766140938,
-0.21508511900901794,
-0.05871262773871422,
0.14065667986869812,
0.5009579062461853,
-0.11369188874959946,
-0.3999508321285248,
0.19635048508644104,
0.3995607793331146,
-0.0541529506444931,
-0.19798263907432556,
-0.137956440448761,
-0.11155460774898529,
-0.06488527357578278,
-0.15314219892024994,
-0.024698711931705475,
0.18188261985778809,
0.13794709742069244,
-0.22529232501983643,
-0.09615030884742737,
-0.34438440203666687,
0.2597450315952301,
0.0819082260131836,
0.028568170964717865,
-0.26063594222068787,
0.41034024953842163,
-0.028063353151082993,
-0.2969593405723572,
0.677910327911377,
0.25691473484039307,
-0.08735993504524231,
-0.6123510599136353,
-0.08337043970823288,
0.23365604877471924,
0.28936389088630676,
0.1536736637353897,
-0.27164149284362793,
-0.03554745763540268,
-0.23981252312660217,
0.16679883003234863,
-0.31252235174179077,
-0.05481531471014023,
0.4299512207508087,
0.16087254881858826,
-0.27264076471328735,
-0.009258083999156952,
0.3434222936630249,
0.15833118557929993,
-0.04131089895963669,
0.47076913714408875,
0.16334713995456696,
-0.31925052404403687,
-0.0635065883398056,
-0.00854838639497757,
0.5026826858520508,
0.16920074820518494,
-0.055405694991350174,
0.11886435747146606,
-0.20761799812316895,
0.23011723160743713,
-0.05794035270810127,
-0.08724565804004669,
-0.5077437162399292,
-0.24548667669296265,
-0.11641544103622437,
-0.18285207450389862,
0.5998039245605469,
-0.37004581093788147,
0.11651472747325897,
0.533940315246582,
-0.11341287940740585,
0.2685702443122864,
-0.05462072417140007,
0.20167677104473114,
-0.17783190310001373,
-0.009098581969738007,
-0.30227240920066833,
0.09101735800504684,
-0.171905517578125,
0.1971980184316635,
-0.131080761551857,
0.06338893622159958,
0.007918290793895721,
-0.043081652373075485,
-0.3546619713306427,
0.020801618695259094,
0.1928004026412964,
0.2084396928548813,
0.1679796576499939,
-0.12554435431957245,
0.5672512054443359,
-0.05788594111800194,
0.32457926869392395,
0.2866174578666687,
-0.019779415801167488,
0.23005078732967377,
-0.6156185865402222,
0.17406311631202698,
0.00005475059151649475,
0.17507919669151306,
0.22299078106880188,
-0.0923413634300232,
-0.18380945920944214,
0.14441579580307007,
-0.09440724551677704,
-0.04568798840045929,
0.10648675262928009,
0.092251256108284,
0.25721195340156555,
-0.11738178133964539,
0.03126710653305054,
-0.05984426289796829,
0.29637569189071655,
-0.24421201646327972,
0.07456319779157639,
0.07415452599525452,
-0.0012096352875232697,
0.5017809867858887,
0.01585119217634201,
-0.21162866055965424,
-0.009426122531294823,
0.43893110752105713,
-0.25968214869499207,
0.18567681312561035,
0.13850516080856323,
0.19002914428710938,
-0.274679034948349,
-0.10943984985351562,
0.12437684834003448,
0.06952686607837677,
-0.16393333673477173,
-0.017101941630244255,
0.04024840518832207,
0.21871894598007202,
0.06221731752157211,
0.06525792181491852,
0.1906091719865799,
-0.5249411463737488,
-0.2474897801876068,
-0.5713292360305786,
0.0940462276339531,
0.24019725620746613,
-0.22969886660575867,
-0.10480310022830963,
0.010207042098045349,
-0.13029122352600098,
-0.13283106684684753,
0.1324261724948883,
-0.20758363604545593,
0.0621025413274765,
0.20576882362365723,
-0.014621885493397713,
-0.08020992577075958,
-0.04961517080664635,
0.1341213583946228,
-0.019705474376678467,
-0.0055327340960502625,
0.02568657323718071,
-0.4325791597366333,
-0.060519829392433167,
-0.29880616068840027,
0.17457465827465057,
-0.0431956946849823,
0.19657278060913086,
0.09254008531570435,
-0.2823549509048462,
-0.16967548429965973,
-0.12106283009052277,
0.2911990284919739,
0.32441797852516174,
-0.03528539463877678,
0.29755955934524536,
0.40255308151245117,
-0.032548535615205765,
0.17653214931488037,
0.2846934199333191,
0.3198346197605133,
0.2547280788421631,
-0.003171399235725403,
0.16037112474441528,
0.09328512102365494,
-0.06564854085445404,
-0.30002644658088684,
0.13430701196193695,
-0.20045602321624756,
-0.14332066476345062,
0.3846905529499054,
-0.1949833780527115,
0.2049790322780609,
0.3055484890937805,
0.31263718008995056,
0.6475581526756287,
-0.143231600522995,
-0.12515336275100708,
0.1680174618959427,
0.033178865909576416,
-0.24174843728542328,
-0.24960622191429138,
-0.1760251522064209,
0.4422993063926697,
0.03211049735546112,
0.11561103165149689,
0.14761769771575928,
-0.009516745805740356,
0.32554805278778076,
0.20410467684268951,
0.6389536261558533,
0.028273392468690872,
0.2591226100921631,
0.17369183897972107,
-0.0259527787566185,
0.12506315112113953,
0.33625444769859314,
0.17128503322601318,
0.16437266767024994,
0.3604768216609955,
-0.011530693620443344,
0.11655271053314209,
-0.07217414677143097,
0.084983229637146,
-0.049794405698776245,
-0.4705571234226227,
0.2642970085144043,
0.08423886448144913,
0.09749753028154373,
-0.053994324058294296,
0.07131117582321167,
0.38150110840797424,
-0.14631244540214539,
-0.03596466779708862,
-0.14709720015525818,
0.05388777703046799,
-0.09765858948230743,
-0.10602270811796188,
0.13604766130447388,
-0.16265137493610382,
-0.16487760841846466,
-0.04039723053574562,
0.18282538652420044,
-0.2849430441856384,
0.05731470137834549,
0.0926542580127716,
-0.16345949470996857,
-0.49003657698631287,
0.037433091551065445,
0.10079704225063324,
-0.03176378086209297,
-0.12034101039171219,
0.14302466809749603,
0.20664185285568237,
-0.09047991037368774,
-0.2056601345539093,
-0.07605600357055664,
0.3551071882247925,
0.12003619223833084,
-0.15816980600357056,
-0.023922044783830643,
0.12939321994781494,
-0.07193592935800552,
0.23179267346858978,
-0.01992814429104328,
-0.16842146217823029,
0.2117280662059784,
0.23556995391845703,
0.14470601081848145,
-0.08820436894893646,
-0.03852220997214317,
-0.05684163048863411,
0.2085798978805542,
-0.45619794726371765,
0.7021581530570984,
-0.0009658792987465858,
0.16014458239078522,
0.05955253913998604,
-0.09622746706008911,
-0.24188177287578583,
-0.115251325070858,
0.6633857488632202,
0.12088794261217117,
-0.12832008302211761,
-0.1259123980998993,
0.009556721895933151,
-0.018824998289346695,
0.06302167475223541,
0.27655166387557983,
-0.3684549331665039,
-0.06783169507980347,
-0.004841282963752747,
-0.7009034156799316,
0.04155408591032028,
-0.019471343606710434,
0.2365533858537674,
0.26414579153060913,
-0.1243182122707367,
-0.04552255570888519,
0.15714704990386963,
0.4171556830406189,
-0.0040028952062129974,
0.07122649997472763,
-0.08095477521419525,
-0.5346662998199463,
-0.11897867172956467,
-0.062036965042352676,
-0.2238209992647171,
-0.08923150599002838,
-0.28864356875419617,
0.00728906225413084,
-0.43030473589897156,
-0.056196488440036774,
-0.3041428327560425,
-0.1357812136411667,
0.2968832850456238,
-0.17102323472499847,
0.44264501333236694,
-0.12682120501995087,
0.3123851418495178,
0.1266557276248932,
-0.05252815783023834,
-0.13413676619529724,
-0.18505051732063293,
0.24635738134384155,
0.2860543429851532,
-0.13871324062347412,
0.27752143144607544,
-0.24640639126300812,
-0.3795854449272156,
-0.19241750240325928,
0.3505757451057434,
-0.12936997413635254,
-0.11040505021810532,
-0.14517700672149658,
0.17968136072158813,
-0.18784525990486145,
0.20612943172454834,
0.07925016433000565,
0.2311120182275772,
0.05634665861725807,
0.4048914611339569,
-0.2700652480125427,
-0.40348103642463684,
0.43230652809143066,
-0.1181347593665123,
-0.4968116879463196,
-0.009780049324035645,
0.24472585320472717,
-0.17621128261089325,
-0.378497838973999,
-0.6096151471138,
-0.02111724764108658,
0.3738744258880615,
-0.07877928763628006,
-0.0013943985104560852,
0.22631987929344177,
-0.29464423656463623,
0.14439836144447327,
-0.025239530950784683,
0.05130040645599365,
-0.005581768229603767,
-0.1445203423500061,
-0.017613396048545837,
0.038896121084690094
] |
https://github.com/huggingface/datasets/issues/6182 | Yes, this requires a new `evaluate` release (cc @lvwerra for this).
In the meantime, you can get the fixed version by installing `evaluate` from `main`: `pip install git+https://github.com/huggingface/evaluate.git` | Loading Meteor metric in HF evaluate module crashes due to datasets import issue | ### Describe the bug
When using python3.9 and ```evaluate``` module loading Meteor metric crashes at a non-existent import from ```datasets.config``` in ```datasets v2.14```
### Steps to reproduce the bug
```
from evaluate import load
meteor = load("meteor")
```
produces the following error:
```
from datasets.config import importlib_metadata, version
ImportError: cannot import name 'importlib_metadata' from 'datasets.config' (<path_to_project>/venv/lib/python3.9/site-packages/datasets/config.py)
```
### Expected behavior
```datasets``` of v2.10 has the following workaround in ```config.py```:
```
if PY_VERSION < version.parse("3.8"):
import importlib_metadata
else:
import importlib.metadata as importlib_metadata
```
However, it's absent in v2.14 which might be the cause of the issue.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-13.5-arm64-arm-64bit
- Python version: 3.9.6
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
- Evaluate version: 0.4.0 | 28 | Loading Meteor metric in HF evaluate module crashes due to datasets import issue
### Describe the bug
When using python3.9 and ```evaluate``` module loading Meteor metric crashes at a non-existent import from ```datasets.config``` in ```datasets v2.14```
### Steps to reproduce the bug
```
from evaluate import load
meteor = load("meteor")
```
produces the following error:
```
from datasets.config import importlib_metadata, version
ImportError: cannot import name 'importlib_metadata' from 'datasets.config' (<path_to_project>/venv/lib/python3.9/site-packages/datasets/config.py)
```
### Expected behavior
```datasets``` of v2.10 has the following workaround in ```config.py```:
```
if PY_VERSION < version.parse("3.8"):
import importlib_metadata
else:
import importlib.metadata as importlib_metadata
```
However, it's absent in v2.14 which might be the cause of the issue.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-13.5-arm64-arm-64bit
- Python version: 3.9.6
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
- Evaluate version: 0.4.0
Yes, this requires a new `evaluate` release (cc @lvwerra for this).
In the meantime, you can get the fixed version by installing `evaluate` from `main`: `pip install git+https://github.com/huggingface/evaluate.git` | [
-0.5894217491149902,
0.14930866658687592,
0.05532597005367279,
0.3828543424606323,
0.44232669472694397,
0.03887443244457245,
0.14060980081558228,
0.43760135769844055,
0.08918394148349762,
0.01380995288491249,
-0.32333680987358093,
0.2941998243331909,
-0.09656466543674469,
-0.03930320590734482,
-0.08770112693309784,
-0.10333670675754547,
-0.14102309942245483,
-0.1448708027601242,
-0.3752951920032501,
0.0666942149400711,
-0.21880309283733368,
0.1800006628036499,
-0.23663681745529175,
-0.010541070252656937,
0.11550676822662354,
0.32855024933815,
0.024703174829483032,
0.3184923827648163,
-0.04873567819595337,
-0.5248686671257019,
0.09855691343545914,
0.05723536014556885,
0.16597408056259155,
0.43844538927078247,
-0.00011047285079257563,
-0.018629111349582672,
0.3205565810203552,
0.06638775765895844,
-0.22732309997081757,
-0.3946900963783264,
-0.08487281948328018,
-0.301517516374588,
0.2001500278711319,
-0.09614449739456177,
0.14875949919223785,
-0.3015378713607788,
-0.28952091932296753,
-0.23120152950286865,
0.325573593378067,
0.3326103985309601,
0.22504261136054993,
0.3227165937423706,
0.04057130217552185,
-0.39852792024612427,
0.16882891952991486,
0.13509824872016907,
0.031723640859127045,
-0.0034142564982175827,
-0.15995949506759644,
-0.15318414568901062,
-0.12431332468986511,
-0.05280732735991478,
0.038150593638420105,
0.24391494691371918,
0.5107604265213013,
-0.1835094541311264,
-0.09769649058580399,
0.03318614512681961,
-0.13571582734584808,
0.3135945498943329,
0.4557454586029053,
-0.4157369136810303,
-0.23402529954910278,
0.03445315361022949,
-0.02151404693722725,
-0.3763769865036011,
0.04445711523294449,
-0.01590660773217678,
-0.02755213901400566,
0.0242901798337698,
-0.0536356195807457,
-0.1939612329006195,
-0.19057783484458923,
0.15366625785827637,
-0.15758171677589417,
0.492962509393692,
-0.2006026655435562,
0.0767212063074112,
0.07368054986000061,
-0.016723359003663063,
0.20517246425151825,
-0.12832677364349365,
-0.13434068858623505,
0.022420290857553482,
-0.2200826108455658,
0.13657592236995697,
0.14537881314754486,
-0.11375316977500916,
0.22742927074432373,
-0.08307039737701416,
-0.3833811581134796,
0.25000083446502686,
0.24284395575523376,
0.09296175837516785,
0.2503945529460907,
0.029790617525577545,
0.29387548565864563,
-0.029372649267315865,
0.3669154644012451,
0.33351609110832214,
0.1663728654384613,
-0.05422387644648552,
0.1403849869966507,
-0.20740631222724915,
0.1117323711514473,
0.03534916043281555,
0.02951844036579132,
-0.23146530985832214,
-0.4475225806236267,
0.16882020235061646,
-0.08633019030094147,
-0.038372013717889786,
0.10207228362560272,
0.43128588795661926,
-0.18904852867126465,
0.07240555435419083,
0.1993035227060318,
0.10095462203025818,
-0.2188606858253479,
0.10072082281112671,
-0.2061922550201416,
0.33512479066848755,
-0.1423623412847519,
-0.020634055137634277,
0.04683130234479904,
0.018632113933563232,
0.2818187177181244,
-0.009211793541908264,
0.33287546038627625,
-0.12695032358169556,
-0.06400171667337418,
0.02823289856314659,
-0.08143749833106995,
0.38501107692718506,
0.11123494803905487,
0.18646419048309326,
0.11660000681877136,
-0.41573506593704224,
-0.1551322042942047,
-0.1065649539232254,
-0.28153952956199646,
-0.1570344865322113,
-0.119097501039505,
0.2244492471218109,
-0.2370986044406891,
0.12734191119670868,
-0.22624808549880981,
0.00046827318146824837,
-0.36627689003944397,
0.035345643758773804,
-0.28928276896476746,
-0.2820902466773987,
-0.10147570818662643,
-0.21108244359493256,
0.48907536268234253,
0.5330426096916199,
-0.5762225389480591,
0.01171741634607315,
-0.49081194400787354,
0.09336254000663757,
-0.15724657475948334,
0.047314926981925964,
-0.315204381942749,
0.24877245724201202,
-0.2235298752784729,
-0.344729483127594,
0.5317525267601013,
-0.41812026500701904,
-0.15490934252738953,
0.0013274699449539185,
0.0931113064289093,
0.11911977082490921,
-0.25145578384399414,
-0.08546261489391327,
-0.03303245082497597,
-0.1676323115825653,
0.33834198117256165,
0.013153642416000366,
0.06211813539266586,
-0.16113480925559998,
-0.13982990384101868,
-0.008798498660326004,
-0.07170775532722473,
0.07781939953565598,
0.2794971168041229,
-0.2747698724269867,
0.1796237677335739,
0.2241203486919403,
0.12542712688446045,
-0.1485879123210907,
-0.13458478450775146,
0.5375258326530457,
0.6023180484771729,
0.09991416335105896,
0.034448958933353424,
-0.3884527385234833,
-0.2228413075208664,
0.26864808797836304,
0.04563691467046738,
-0.11103595793247223,
0.12743695080280304,
-0.04336104914546013,
-0.45982804894447327,
0.14108246564865112,
-0.053514398634433746,
-0.19474205374717712,
0.1619560420513153,
0.05627793073654175,
-0.32766658067703247,
0.10585224628448486,
-0.08027340471744537,
0.39015787839889526,
-0.06451325118541718,
0.12822823226451874,
-0.03353051468729973,
0.05276595056056976,
-0.16954480111598969,
-0.03597341477870941,
0.23435142636299133,
0.08728989958763123,
0.04190248250961304,
-0.15360583364963531,
-0.04415271431207657,
0.34329843521118164,
0.11246954649686813,
0.019528720527887344,
0.13617204129695892,
-0.02300707995891571,
0.07608207315206528,
-0.10293825715780258,
-0.05591127276420593,
-0.21370700001716614,
0.1367771327495575,
-0.09919315576553345,
-0.010842878371477127,
0.3563336730003357,
0.1416568160057068,
-0.009627465158700943,
0.07815386354923248,
-0.08367049694061279,
0.19426706433296204,
0.0633992999792099,
-0.032160475850105286,
-0.32266706228256226,
0.15300649404525757,
0.0017226748168468475,
-0.015135042369365692,
-0.18416890501976013,
0.07550368458032608,
-0.18639950454235077,
0.45945996046066284,
0.15537801384925842,
0.22797945141792297,
0.09029323607683182,
-0.28265348076820374,
0.05141395330429077,
0.030224310234189034,
-0.11888658255338669,
0.6271929740905762,
0.16778139770030975,
0.02108992263674736,
0.41538944840431213,
-0.30648162961006165,
-0.0379314087331295,
0.1855156123638153,
0.3169457018375397,
-0.034492895007133484,
0.16334305703639984,
0.09289884567260742,
0.0694524273276329,
-0.4298146367073059,
-0.22196756303310394,
-0.20517219603061676,
0.3369673192501068,
-0.5155535936355591,
0.2344830334186554,
-0.43441495299339294,
0.34288647770881653,
-0.11455921828746796,
-0.4312768578529358,
-0.18577167391777039,
-0.6413820385932922,
-0.10210508108139038,
0.4079092741012573,
-0.05550307035446167,
0.12789957225322723,
0.21879546344280243,
0.03191247582435608,
0.013886190950870514,
0.044082388281822205,
-0.1772182136774063,
-0.32972851395606995,
-0.06021037697792053,
0.0348019041121006,
0.20474497973918915,
0.273836612701416,
0.2869901657104492,
-0.1890687346458435,
0.07578667253255844,
-0.14012782275676727,
-0.6814610958099365,
0.00018584821373224258,
-0.10829862952232361,
0.7714837193489075,
0.18564341962337494,
-0.07436336576938629,
-0.028672970831394196,
0.18200749158859253,
0.2883144021034241,
-0.027145493775606155,
0.09761310368776321,
0.22852455079555511,
-0.03899933025240898,
-0.2971309721469879,
0.027685023844242096,
-0.3597976267337799,
0.007224740460515022,
-0.4982980787754059,
-0.29606395959854126,
0.04249635338783264,
-0.1106681078672409,
0.05090727657079697,
0.19115135073661804,
0.27224406599998474,
-0.11819257587194443,
0.1564675271511078,
-0.06915242224931717,
-0.08195828646421432,
0.34324294328689575,
-0.3450150191783905,
-0.35981109738349915,
0.14838388562202454,
0.10691859573125839,
0.1644049882888794,
-0.009138483554124832,
-0.3252853751182556,
-0.5360516309738159,
-0.07031068950891495,
0.03708142042160034,
-0.08298692107200623,
0.20380809903144836,
0.029259273782372475,
0.034101907163858414,
-0.001602359116077423,
-0.11239171028137207,
-0.1701265126466751,
-0.06754932552576065,
0.0490926057100296,
0.11632030457258224,
-0.2500556409358978,
0.39746418595314026,
-0.008528880774974823,
0.6043776869773865,
0.37048113346099854,
-0.16016227006912231,
0.3788139224052429,
-0.015554368495941162,
0.6267249584197998,
-0.2067992389202118,
-0.3141789138317108,
-0.08588846027851105,
0.2196563184261322,
0.3477597236633301,
0.06617419421672821,
-0.10685819387435913,
0.15877538919448853,
-0.285830557346344,
-0.054778091609478,
-0.10321446508169174,
-0.37791213393211365,
0.049833327531814575,
0.06693235039710999,
0.05119292438030243,
0.15062418580055237,
0.1294037103652954,
-0.10625776648521423,
-0.002027280628681183,
0.3903537392616272,
0.4684435725212097,
-0.18196246027946472,
0.07132890820503235,
0.2171173393726349,
0.09203562885522842,
-0.23060420155525208,
0.27365952730178833,
-0.000095367431640625,
0.3567681312561035,
-0.06577354669570923,
-0.02746996283531189,
-0.04763031750917435,
-0.20568913221359253,
0.3992004990577698,
-0.22661204636096954,
-0.08146101236343384,
0.20479023456573486,
-0.2848658561706543,
-0.7586945295333862,
0.016034290194511414,
-0.3654475510120392,
-0.054791901260614395,
0.030281320214271545,
0.5489549040794373,
-0.2833572030067444,
-0.39148786664009094,
0.14774750173091888,
0.33941948413848877,
-0.11817244440317154,
-0.22094959020614624,
-0.2016582489013672,
-0.23471392691135406,
-0.14664828777313232,
-0.0714000016450882,
0.04178473353385925,
0.1944757103919983,
0.1522219181060791,
-0.2388828992843628,
-0.14734962582588196,
-0.30654793977737427,
0.2773621678352356,
0.23426440358161926,
0.0679013803601265,
-0.22544291615486145,
0.3093196749687195,
-0.1282637119293213,
-0.24212105572223663,
0.46236369013786316,
0.3393060564994812,
-0.06169954314827919,
-0.5118412971496582,
-0.07553181052207947,
0.20080436766147614,
0.22573119401931763,
0.12745407223701477,
-0.24777358770370483,
-0.0574244000017643,
-0.24481946229934692,
0.30846357345581055,
-0.3948230445384979,
0.16686339676380157,
0.3915231227874756,
0.20195814967155457,
-0.1240013912320137,
0.028897158801555634,
0.31871718168258667,
0.09441843628883362,
-0.01787726581096649,
0.34923145174980164,
0.27747106552124023,
-0.2312980592250824,
0.02465798705816269,
0.16043876111507416,
0.45283329486846924,
0.06074681505560875,
-0.09326834976673126,
0.2778645157814026,
-0.20289401710033417,
0.12789015471935272,
-0.05738379806280136,
-0.020786091685295105,
-0.5142249464988708,
-0.33647671341896057,
-0.01526259258389473,
-0.15020489692687988,
0.4943697452545166,
-0.332825630903244,
0.11259348690509796,
0.477379709482193,
-0.08317975699901581,
0.14778576791286469,
-0.1412944197654724,
0.19307343661785126,
-0.18814948201179504,
-0.12449175119400024,
-0.24121007323265076,
0.23662489652633667,
-0.15173061192035675,
0.11486450582742691,
-0.1342841237783432,
0.06794154644012451,
0.09645320475101471,
-0.02270134538412094,
-0.2196446657180786,
0.05779682844877243,
0.1351587176322937,
0.12058332562446594,
0.16713249683380127,
-0.04986134171485901,
0.5196740031242371,
-0.07820221781730652,
0.3139430284500122,
0.3414195775985718,
-0.07446155697107315,
0.26508304476737976,
-0.6678417921066284,
0.20296120643615723,
0.044147640466690063,
0.15085051953792572,
0.12558481097221375,
-0.0680704265832901,
-0.19207316637039185,
0.24425241351127625,
0.015200916677713394,
0.05892393738031387,
0.18002967536449432,
0.029872527346014977,
0.116264708340168,
-0.17448878288269043,
0.034904129803180695,
-0.03428511321544647,
0.13973498344421387,
-0.2523570656776428,
0.17875970900058746,
-0.04236434027552605,
-0.06995388865470886,
0.4766382575035095,
0.07186340540647507,
-0.288482129573822,
-0.013873390853404999,
0.49469244480133057,
-0.3158959746360779,
0.3196241855621338,
0.11826002597808838,
0.1799142062664032,
-0.2744731307029724,
-0.20675581693649292,
-0.015041470527648926,
0.22242389619350433,
-0.19069910049438477,
0.020839184522628784,
0.06590020656585693,
0.15395119786262512,
0.058951642364263535,
0.10470990091562271,
0.18256430327892303,
-0.5313404202461243,
-0.20324411988258362,
-0.5029756426811218,
-0.022520914673805237,
0.167018860578537,
-0.2142011970281601,
-0.0940788984298706,
0.08462479710578918,
-0.055580269545316696,
-0.3005511462688446,
0.2497725933790207,
-0.3563939929008484,
0.05395150184631348,
0.053408004343509674,
0.01901783049106598,
-0.10011064261198044,
-0.14456430077552795,
0.24709239602088928,
0.017176896333694458,
0.12613923847675323,
0.18409791588783264,
-0.4744606018066406,
-0.21457736194133759,
-0.3044861853122711,
0.08201002329587936,
-0.0909683108329773,
0.17185893654823303,
0.06250133365392685,
-0.13580626249313354,
-0.17623603343963623,
-0.26914680004119873,
0.3741132915019989,
0.2803286910057068,
-0.1005796417593956,
0.2327527403831482,
0.35951849818229675,
-0.06906341761350632,
0.14225365221500397,
0.11776555329561234,
0.2552548348903656,
0.22151657938957214,
-0.10250717401504517,
0.08575822412967682,
-0.053012944757938385,
-0.10636918246746063,
-0.16809619963169098,
0.1415771245956421,
-0.023814678192138672,
-0.06681210547685623,
0.3349204361438751,
-0.02128707990050316,
0.12924109399318695,
0.2696629762649536,
0.3620484471321106,
0.5324077606201172,
-0.11251924932003021,
-0.09848447889089584,
0.15521372854709625,
0.16139854490756989,
-0.18271151185035706,
-0.1471625566482544,
-0.16898725926876068,
0.318513423204422,
0.18962344527244568,
0.13124403357505798,
0.05940914899110794,
-0.02163907140493393,
0.25935065746307373,
0.10236172378063202,
0.5706049799919128,
-0.03174498677253723,
0.014459677040576935,
0.03664249926805496,
-0.19854635000228882,
0.03028172254562378,
0.38934576511383057,
0.103971466422081,
0.3132745623588562,
0.4070388078689575,
-0.02154545485973358,
0.11751819401979446,
-0.1568494737148285,
0.21406623721122742,
-0.11727795004844666,
-0.36863940954208374,
0.2306395173072815,
0.08086114376783371,
0.23775511980056763,
0.04191473871469498,
0.02511795610189438,
0.34136083722114563,
-0.11205390095710754,
-0.05619576945900917,
-0.14407430589199066,
0.12409491837024689,
-0.09834299981594086,
-0.08473533391952515,
0.02572503685951233,
-0.10764553397893906,
-0.2492232620716095,
0.010935358703136444,
0.15883293747901917,
-0.23752440512180328,
0.05148761346936226,
0.07177102565765381,
-0.07078704237937927,
-0.3897625803947449,
-0.03240993991494179,
0.11786919832229614,
-0.04362707585096359,
-0.12344959378242493,
0.13503625988960266,
0.2711913287639618,
-0.029739614576101303,
-0.21850062906742096,
0.030885210260748863,
0.31584998965263367,
0.07306632399559021,
-0.11676803231239319,
-0.03531423583626747,
0.1429111212491989,
-0.0650734007358551,
0.08539970219135284,
-0.0582372210919857,
-0.19018518924713135,
0.15868769586086273,
0.33196496963500977,
0.2673363983631134,
-0.2539657950401306,
-0.11130823940038681,
-0.0901864692568779,
0.27382776141166687,
-0.365058034658432,
0.578715443611145,
0.037437546998262405,
0.2474084496498108,
0.0006884709000587463,
-0.19909356534481049,
-0.2666858434677124,
-0.10140017420053482,
0.4655255079269409,
-0.059498950839042664,
0.012865427881479263,
-0.1298760622739792,
0.08864542841911316,
-0.03629479184746742,
0.20530514419078827,
0.1668013334274292,
-0.4237869083881378,
-0.07997128367424011,
0.0150814950466156,
-0.7076659202575684,
0.12529334425926208,
-0.052711598575115204,
0.21059304475784302,
0.19276350736618042,
-0.10505867749452591,
-0.01213018223643303,
0.20473244786262512,
0.40576887130737305,
0.04362812265753746,
0.08268413692712784,
-0.08790352940559387,
-0.5139377117156982,
-0.07125858217477798,
-0.14026984572410583,
-0.30091673135757446,
0.0012428387999534607,
-0.22361737489700317,
0.03810375928878784,
-0.33127400279045105,
0.08973002433776855,
-0.17108911275863647,
-0.11663487553596497,
0.18128827214241028,
-0.16186107695102692,
0.39154502749443054,
-0.05691306293010712,
0.24328628182411194,
-0.010543875396251678,
0.027674108743667603,
0.021926309913396835,
-0.15251746773719788,
0.1941390186548233,
0.20072458684444427,
-0.1261283904314041,
0.27027297019958496,
-0.10359399765729904,
-0.3724594712257385,
-0.20618553459644318,
0.39326971769332886,
0.022290483117103577,
-0.17099833488464355,
-0.17009353637695312,
0.2620919644832611,
-0.17436271905899048,
0.23277470469474792,
0.003003828227519989,
0.32773107290267944,
0.13430292904376984,
0.3831194341182709,
-0.17651249468326569,
-0.3938424587249756,
0.5724488496780396,
-0.03323977813124657,
-0.46084895730018616,
0.0813005119562149,
0.24715997278690338,
-0.12919867038726807,
-0.4358159899711609,
-0.47893279790878296,
0.028206586837768555,
0.26113361120224,
-0.061548780649900436,
-0.04729104042053223,
0.2601583003997803,
-0.35605916380882263,
0.10255240648984909,
-0.043567199259996414,
-0.029567454010248184,
0.09874355792999268,
-0.16840769350528717,
0.008930191397666931,
0.08774352073669434
] |
https://github.com/huggingface/datasets/issues/6179 | https://github.com/huggingface/datasets/issues/5147 may be a solution, by passing in the tokenizer in a fn_kwargs and ignoring it in the fingerprint calculations | Map cache with tokenizer | Similar issue to https://github.com/huggingface/datasets/issues/5985, but across different sessions rather than two calls in the same session.
Unlike that issue, explicitly calling tokenizer(my_args) before the map() doesn't help, because the tokenizer was created with a different hash to begin with...
setup
```
from transformers import AutoTokenizer
AutoTokenizer.from_pretrained('bert-base-uncased').save_pretrained("tok")
```
this prints different value each time
```
from transformers import AutoTokenizer
from datasets.utils.py_utils import dumps # Huggingface datasets
print(hash(dumps(AutoTokenizer.from_pretrained("tok"))))
``` | 20 | Map cache with tokenizer
Similar issue to https://github.com/huggingface/datasets/issues/5985, but across different sessions rather than two calls in the same session.
Unlike that issue, explicitly calling tokenizer(my_args) before the map() doesn't help, because the tokenizer was created with a different hash to begin with...
setup
```
from transformers import AutoTokenizer
AutoTokenizer.from_pretrained('bert-base-uncased').save_pretrained("tok")
```
this prints different value each time
```
from transformers import AutoTokenizer
from datasets.utils.py_utils import dumps # Huggingface datasets
print(hash(dumps(AutoTokenizer.from_pretrained("tok"))))
```
https://github.com/huggingface/datasets/issues/5147 may be a solution, by passing in the tokenizer in a fn_kwargs and ignoring it in the fingerprint calculations | [
-0.1412883698940277,
-0.28767916560173035,
0.0715186819434166,
0.1604076325893402,
0.26335832476615906,
-0.13286039233207703,
0.43897342681884766,
0.19649070501327515,
0.12755268812179565,
0.1276402324438095,
-0.16962265968322754,
0.17197611927986145,
0.03746848553419113,
-0.1416044533252716,
-0.018527790904045105,
0.1956823468208313,
0.08944607526063919,
0.1689109355211258,
-0.024451445788145065,
-0.06969943642616272,
-0.030032049864530563,
0.14069391787052155,
-0.0589611679315567,
0.08215738087892532,
-0.42977485060691833,
0.04673074930906296,
-0.000735945999622345,
-0.348496675491333,
0.05896032601594925,
-0.46026915311813354,
0.14110088348388672,
0.16350430250167847,
-0.06612490862607956,
0.33377698063850403,
-0.00011389768769731745,
-0.019559569656848907,
0.14511118829250336,
0.05381268262863159,
0.16350871324539185,
0.013737745583057404,
0.011578820645809174,
0.1032625362277031,
0.05985918641090393,
-0.1717906892299652,
-0.22854211926460266,
-0.08836105465888977,
0.13548873364925385,
-0.08043240010738373,
0.6183650493621826,
-0.03037368878722191,
0.23263642191886902,
0.3047349750995636,
0.012730516493320465,
0.11152288317680359,
-0.01324794813990593,
0.17756734788417816,
-0.04931075498461723,
-0.35622742772102356,
-0.22383390367031097,
-0.21470439434051514,
-0.2922571897506714,
0.3686259984970093,
0.0003316029906272888,
-0.2257332056760788,
0.2867574989795685,
0.2749401330947876,
-0.0881710797548294,
-0.13449391722679138,
0.20944762229919434,
0.1749478280544281,
0.016153154894709587,
-0.28589773178100586,
-0.3837413191795349,
-0.3337620496749878,
-0.24014663696289062,
-0.019901584833860397,
0.281920850276947,
-0.16315266489982605,
0.00966300442814827,
0.05660143122076988,
-0.5203081965446472,
0.08822745084762573,
0.0668782889842987,
-0.04249487817287445,
-0.2779705822467804,
0.2256946861743927,
-0.18353739380836487,
0.10507363080978394,
0.1489158272743225,
-0.2701060175895691,
-0.27351346611976624,
-0.03648589923977852,
-0.016332361847162247,
0.32658377289772034,
-0.2219163179397583,
-0.2170485258102417,
0.3537178635597229,
-0.07382043451070786,
0.044503793120384216,
0.12961755692958832,
0.03691709414124489,
0.37204885482788086,
-0.22236548364162445,
0.04019586741924286,
0.02479509264230728,
0.38189369440078735,
0.20007121562957764,
0.27710673213005066,
0.15820178389549255,
-0.18227878212928772,
-0.2972181439399719,
-0.26092347502708435,
0.13929250836372375,
-0.02861695922911167,
0.4925089180469513,
-0.05467326194047928,
-0.12993235886096954,
-0.18714119493961334,
0.20218338072299957,
-0.026043394580483437,
-0.11924563348293304,
0.15923067927360535,
0.2780996263027191,
0.43788549304008484,
-0.18274526298046112,
-0.07486681640148163,
-0.11452606320381165,
0.09779386222362518,
-0.20999303460121155,
0.2626311480998993,
-0.33772173523902893,
-0.19159825146198273,
-0.031099647283554077,
0.2243967205286026,
0.005326822400093079,
0.04273597523570061,
0.33613139390945435,
0.19979751110076904,
0.122277170419693,
0.043248966336250305,
0.3004492521286011,
-0.08210831880569458,
0.4572676420211792,
0.05363897606730461,
-0.013101644814014435,
0.23190268874168396,
0.13533854484558105,
0.07143328338861465,
-0.3056250810623169,
-0.1629672348499298,
-0.12666483223438263,
-0.097584068775177,
0.2704559862613678,
0.1920391023159027,
-0.26881009340286255,
-0.026200097054243088,
-0.017481643706560135,
-0.00628729909658432,
0.3718872666358948,
-0.06596830487251282,
-0.003181464970111847,
-0.08480484038591385,
-0.341966837644577,
-0.20010344684123993,
0.2828850746154785,
0.30246803164482117,
0.3597862124443054,
-0.4462427794933319,
0.15147756040096283,
0.022350884974002838,
0.1300780177116394,
0.2022518664598465,
-0.1988321840763092,
0.16770870983600616,
-0.3031357526779175,
0.665039598941803,
-0.0705752819776535,
-0.4662005305290222,
-0.5048131346702576,
-0.05295382812619209,
-0.03497731685638428,
0.20542961359024048,
-0.07128015160560608,
-0.0890030637383461,
0.10165578126907349,
-0.09307265281677246,
-0.0040254294872283936,
0.06770691275596619,
-0.04350874572992325,
0.1220957562327385,
-0.25019580125808716,
-0.18086177110671997,
0.2649573087692261,
-0.10442840307950974,
0.14544329047203064,
-0.16488167643547058,
0.0031812340021133423,
0.22171543538570404,
-0.006482791155576706,
-0.11166196316480637,
0.17408853769302368,
0.022050082683563232,
0.24977616965770721,
-0.014300625771284103,
-0.06939325481653214,
0.09957018494606018,
-0.02502143383026123,
0.2498513162136078,
-0.1578523963689804,
0.05395019054412842,
-0.26700472831726074,
-0.3303993046283722,
0.14581280946731567,
-0.06215835362672806,
-0.2594428062438965,
-0.19761985540390015,
0.17730559408664703,
0.1138753667473793,
0.2852240204811096,
0.11651521176099777,
0.16373449563980103,
0.12566418945789337,
0.4379656910896301,
0.10885366797447205,
-0.3800007104873657,
-0.056461989879608154,
0.01579245924949646,
-0.03307651728391647,
-0.23204751312732697,
0.15428832173347473,
0.30097338557243347,
-0.008709222078323364,
0.011515386402606964,
0.24124565720558167,
0.0009746663272380829,
0.21116304397583008,
-0.17550963163375854,
0.12943097949028015,
0.18893960118293762,
-0.04781320318579674,
-0.14025577902793884,
0.059115003794431686,
-0.058729931712150574,
-0.21275892853736877,
0.024136923253536224,
0.5256385803222656,
0.2982967495918274,
0.08653368055820465,
-0.043528296053409576,
-0.07149722427129745,
0.03408949077129364,
-0.0726814940571785,
0.001256987452507019,
-0.494667112827301,
-0.2394702434539795,
0.005983080714941025,
0.2871980369091034,
0.11150112748146057,
-0.010284893214702606,
0.27775779366493225,
0.3037213385105133,
0.1369214951992035,
0.02866566926240921,
0.14523333311080933,
-0.24696676433086395,
-0.23494598269462585,
-0.0290260948240757,
-0.1312057077884674,
0.19082438945770264,
0.17845091223716736,
0.17499300837516785,
-0.02234051749110222,
0.04857035353779793,
-0.05041591823101044,
0.08414071053266525,
-0.07371191680431366,
-0.3470718562602997,
0.058921556919813156,
0.2598264515399933,
0.019642312079668045,
-0.274156779050827,
0.1355823427438736,
0.02529136836528778,
0.08244834840297699,
-0.11308280378580093,
0.011208102107048035,
-0.3015766143798828,
0.09210775792598724,
-0.09710240364074707,
-0.436343252658844,
-0.43354761600494385,
-0.3037105202674866,
0.2214880734682083,
0.1421407014131546,
-0.11280114948749542,
0.2761741280555725,
-0.1281789243221283,
0.14959825575351715,
0.07341320067644119,
-0.14072105288505554,
-0.21830295026302338,
-0.14909055829048157,
-0.21353565156459808,
-0.02676169015467167,
0.04595264792442322,
-0.10355067998170853,
0.3513396978378296,
-0.14687687158584595,
-0.07163185626268387,
-0.16992706060409546,
-0.515084981918335,
0.13687953352928162,
-0.19799268245697021,
0.12183605879545212,
0.2940864861011505,
-0.15250614285469055,
-0.15628132224082947,
-0.12116482108831406,
0.3617454171180725,
-0.39885175228118896,
-0.39423608779907227,
0.0014775916934013367,
0.09653232246637344,
0.07042215019464493,
-0.019267793744802475,
0.11263778805732727,
-0.02594267576932907,
-0.006164714694023132,
0.21667876839637756,
0.07447593659162521,
0.1466541290283203,
0.4066336154937744,
-0.24328464269638062,
0.09543323516845703,
-0.47295311093330383,
-0.09881865978240967,
-0.3777220845222473,
-0.3478115499019623,
0.42890530824661255,
-0.26246073842048645,
-0.12427520751953125,
-0.22894296050071716,
-0.03681228682398796,
0.2314290553331375,
0.07262617349624634,
-0.4022653102874756,
-0.4565228819847107,
-0.22693732380867004,
0.1945207267999649,
0.013681049458682537,
0.08305307477712631,
0.2957674562931061,
0.07559211552143097,
-0.08537311851978302,
-0.07699829339981079,
-0.11665663123130798,
0.31385350227355957,
-0.14418673515319824,
0.1641361564397812,
-0.04304075613617897,
0.07908648252487183,
0.17055131494998932,
0.7634533643722534,
0.2571011781692505,
-0.20379464328289032,
0.21619006991386414,
-0.16158241033554077,
0.19828329980373383,
-0.2398901879787445,
-0.33905553817749023,
-0.024632513523101807,
0.08956361562013626,
0.24683314561843872,
0.16492900252342224,
0.19575166702270508,
0.20533645153045654,
0.13680890202522278,
-0.22138038277626038,
-0.18340805172920227,
-0.6130709052085876,
0.020002996549010277,
0.022126946598291397,
0.10327842831611633,
0.07623922824859619,
0.3603785037994385,
-0.5744010210037231,
-0.24997645616531372,
0.2598404288291931,
-0.15023520588874817,
0.22073902189731598,
-0.011226041242480278,
-0.47735723853111267,
0.21021516621112823,
-0.7559199929237366,
0.2864213287830353,
0.030838418751955032,
0.26053524017333984,
-0.10115037858486176,
-0.2613164782524109,
0.037893351167440414,
0.017914611846208572,
0.5246936678886414,
-0.05781351029872894,
0.2506805956363678,
0.0845678448677063,
-0.6248179078102112,
-0.043916355818510056,
0.24890205264091492,
0.168069988489151,
-0.08291853964328766,
0.19269374012947083,
0.6737369894981384,
-0.375042587518692,
-0.20730720460414886,
-0.3694315552711487,
0.06199114769697189,
-0.12873035669326782,
-0.10476524382829666,
-0.058222103863954544,
-0.05331526696681976,
-0.1770818829536438,
0.04000302776694298,
-0.04445032402873039,
0.07156752049922943,
0.2942882478237152,
-0.11662691831588745,
-0.3286324739456177,
-0.22253400087356567,
0.09907221049070358,
0.30419594049453735,
0.4075660705566406,
-0.11030882596969604,
0.4129462242126465,
0.5334063172340393,
-0.1156870424747467,
0.09734810888767242,
0.2141675353050232,
-0.11280979216098785,
-0.3699508309364319,
-0.04235641658306122,
-0.008316345512866974,
-0.12488816678524017,
0.33248233795166016,
-0.018381312489509583,
0.3245721161365509,
0.04428030550479889,
0.2969112992286682,
-0.3118132948875427,
0.3858951926231384,
0.05858835577964783,
0.23390425741672516,
-0.19331923127174377,
-0.056519344449043274,
0.07677891850471497,
0.0047187358140945435,
-0.1596251130104065,
0.19706061482429504,
0.16245220601558685,
-0.46197155117988586,
0.5855042338371277,
0.13274013996124268,
1.010323405265808,
-0.06097376346588135,
0.32757312059402466,
-0.029328733682632446,
0.2408256232738495,
0.3429931402206421,
0.08052390068769455,
0.07780866324901581,
-0.43719199299812317,
-0.05993954837322235,
0.025442324578762054,
0.018615849316120148,
-0.16031812131404877,
-0.04048934206366539,
-0.1909838169813156,
0.014664329588413239,
0.07645900547504425,
0.5436349511146545,
-0.161709725856781,
0.17656074464321136,
0.06033101677894592,
-0.40470385551452637,
-0.048563867807388306,
0.2228085845708847,
0.34852391481399536,
0.3325955867767334,
0.10435020923614502,
-0.1356450617313385,
0.03600947558879852,
-0.31580981612205505,
0.02876119315624237,
0.03370487689971924,
-0.3736087679862976,
0.22526872158050537,
0.44403135776519775,
0.1240043044090271,
-0.0654899924993515,
0.24619361758232117,
0.5273839235305786,
0.34340688586235046,
-0.2803001403808594,
0.16303950548171997,
0.1003657728433609,
0.21782968938350677,
-0.04620150849223137,
-0.3420449495315552,
0.12410198152065277,
0.11664383113384247,
-0.10574835538864136,
-0.017352424561977386,
0.03421555459499359,
-0.21645860373973846,
-0.32038024067878723,
0.013980369083583355,
0.033001795411109924,
-0.3691972494125366,
0.13819164037704468,
-0.20725788176059723,
0.0633593499660492,
-0.15441352128982544,
0.1492736041545868,
0.0935402363538742,
-0.17585618793964386,
0.15858879685401917,
0.024208882823586464,
-0.1572360396385193,
-0.035877883434295654,
0.5745295286178589,
-0.16977885365486145,
-0.10990004241466522,
0.42788931727409363,
-0.1875244528055191,
-0.23205748200416565,
-0.13096706569194794,
-0.09160969406366348,
0.3198913633823395,
-0.3325265645980835,
-0.02860764041543007,
-0.15475675463676453,
-0.08960514515638351,
0.07094129920005798,
0.2916659116744995,
0.05724344775080681,
-0.14103905856609344,
0.04318692535161972,
-0.1109791174530983,
-0.4752615988254547,
-0.06783658266067505,
-0.06421518325805664,
0.29343080520629883,
0.3761962652206421,
0.3626033067703247,
-0.4384506642818451,
0.5213009715080261,
-0.3499664068222046,
0.04028633236885071,
-0.14492613077163696,
0.2275959849357605,
-0.22946211695671082,
-0.4239955246448517,
0.2928730845451355,
-0.17459675669670105,
0.18723344802856445,
0.4221518933773041,
-0.24800458550453186,
-0.20752167701721191,
-0.2677049934864044,
0.1074758991599083,
0.21899621188640594,
-0.19821861386299133,
0.004576940089464188,
0.24831461906433105,
0.04732145369052887,
-0.4419914186000824,
0.34416434168815613,
0.41235291957855225,
-0.026502512395381927,
-0.11135289072990417,
0.19838477671146393,
0.015163667500019073,
-0.008423760533332825,
-0.13271287083625793,
0.01082790456712246,
0.044700250029563904,
-0.01196322962641716,
0.15192395448684692,
-0.4462162256240845,
0.025547586381435394,
0.47763150930404663,
0.3695199191570282,
0.35689812898635864,
-0.2507454454898834,
0.15458974242210388,
0.018045011907815933,
-0.33311158418655396,
0.3346575200557709,
0.17468109726905823,
0.01834249310195446,
-0.20023350417613983,
-0.2292724847793579,
0.38198554515838623,
0.23762880265712738,
-0.2168465107679367,
-0.10934416949748993,
0.1390608847141266,
-0.07748591899871826,
0.09349475800991058,
0.39584290981292725,
0.07582196593284607,
0.0670110285282135,
0.24803043901920319,
0.010658316314220428,
0.4653153121471405,
-0.34832409024238586,
0.08271504938602448,
0.003484445158392191,
-0.2620435953140259,
0.07679720222949982,
0.617424726486206,
0.14981015026569366,
0.11871442198753357,
0.18005503714084625,
-0.2864568531513214,
0.20550338923931122,
-0.38192635774612427,
0.09374058246612549,
-0.058911122381687164,
-0.3205869197845459,
-0.11142177879810333,
0.2085612416267395,
0.028460387140512466,
0.2145407646894455,
-0.15535849332809448,
0.5357054471969604,
-0.051465779542922974,
-0.25063252449035645,
-0.08557406067848206,
0.5566632747650146,
-0.32897108793258667,
-0.40304070711135864,
0.20816436409950256,
-0.04759828746318817,
-0.2145986706018448,
-0.011649303138256073,
0.0749811977148056,
-0.1329672932624817,
0.12839069962501526,
0.07248988747596741,
-0.1007659062743187,
-0.33875179290771484,
-0.3564729690551758,
-0.08302181959152222,
0.3226156234741211,
-0.38601911067962646,
0.2274022251367569,
-0.08340585976839066,
-0.16000251471996307,
0.05276970937848091,
0.3229020833969116,
0.303189218044281,
0.1743900328874588,
0.045771948993206024,
0.24813160300254822,
-0.08230645954608917,
0.15302033722400665,
-0.26750099658966064,
0.23932984471321106,
-0.005797646939754486,
-0.08042127639055252,
0.12811322510242462,
0.1252025067806244,
-0.25607404112815857,
-0.22294603288173676,
-0.2578842341899872,
0.33705413341522217,
0.061079420149326324,
0.40297800302505493,
-0.06747109442949295,
0.1492534577846527,
-0.22017955780029297,
0.0376112125813961,
-0.27224117517471313,
0.1059722751379013,
0.09209565818309784,
0.04012446478009224,
0.27579212188720703,
-0.2968323826789856,
0.08570341765880585,
0.12268634885549545,
0.26794683933258057,
0.13850051164627075,
-0.2640628218650818,
-0.42816492915153503,
0.04764457046985626,
-0.5080937743186951,
0.2563965916633606,
-0.004834907129406929,
0.12167748063802719,
-0.2673831284046173,
0.07672860473394394,
0.04908372834324837,
-0.0689510852098465,
0.09165209531784058,
0.09482616931200027,
0.0979793518781662,
0.04432787373661995,
-0.06809066981077194,
0.4107840061187744,
-0.307403564453125,
-0.135270893573761,
0.23632287979125977,
-0.24945500493049622,
0.3628684878349304,
-0.004683259874582291,
0.17683827877044678,
0.02098209410905838,
0.13892966508865356,
-0.1065901666879654,
-0.06544341146945953,
0.4342612028121948,
0.23382292687892914,
0.18162667751312256,
-0.1315976232290268,
0.15593063831329346,
-0.09417158365249634,
-0.09260699152946472,
-0.32477977871894836,
-0.1527753472328186,
0.007627788931131363,
0.20075608789920807,
-0.07105463743209839,
-0.25771600008010864,
-0.462075412273407,
-0.0930718332529068,
0.2835933566093445,
-0.2992035448551178,
-0.1314411163330078,
0.3414756655693054,
-0.21053653955459595,
0.011883817613124847,
0.09102525562047958,
0.483261376619339,
-0.015128323808312416,
0.3075396418571472,
-0.31270426511764526,
-0.49115490913391113,
0.46379849314689636,
-0.7772293090820312,
-0.15176966786384583,
-0.10240229964256287,
0.14018715918064117,
0.26705488562583923,
-0.4163019359111786,
-0.6156364679336548,
0.045466348528862,
0.184190571308136,
-0.022231575101614,
-0.28095507621765137,
-0.04299315810203552,
-0.005331922322511673,
-0.03283195197582245,
-0.1766444444656372,
0.42976126074790955,
0.29906702041625977,
-0.1156417652964592,
0.22510819137096405,
-0.04206720367074013
] |
https://github.com/huggingface/datasets/issues/6179 | I have a similar issue. I was using a Jupyter Notebook and every time I call the map function it performs tokenization from scratch again although the cache files of last run still exists.
I ran with 20 processes and now in the cache folder there are two groups of cached results of tokenized dataset:
```
.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:56:46 2023 cache-1982fea76aa54a13_00001_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 13:02:08 2023 cache-1982fea76aa54a13_00004_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:56:40 2023 cache-1982fea76aa54a13_00005_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 241 MB Sat Aug 26 12:50:59 2023 cache-1982fea76aa54a13_00006_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:57:37 2023 cache-1982fea76aa54a13_00007_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:57:31 2023 cache-1982fea76aa54a13_00008_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:59:47 2023 cache-1982fea76aa54a13_00010_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 241 MB Sat Aug 26 12:59:44 2023 cache-1982fea76aa54a13_00011_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 241 MB Sat Aug 26 12:55:24 2023 cache-1982fea76aa54a13_00012_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 241 MB Sat Aug 26 12:56:21 2023 cache-1982fea76aa54a13_00013_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:57:24 2023 cache-1982fea76aa54a13_00014_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 13:00:48 2023 cache-1982fea76aa54a13_00015_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:56:56 2023 cache-1982fea76aa54a13_00017_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:56:54 2023 cache-1982fea76aa54a13_00018_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:57:27 2023 cache-1982fea76aa54a13_00019_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:15:40 2023 cache-454431f643cdc5e8_00000_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:16:46 2023 cache-454431f643cdc5e8_00001_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:14:53 2023 cache-454431f643cdc5e8_00002_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:13:10 2023 cache-454431f643cdc5e8_00003_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:13:04 2023 cache-454431f643cdc5e8_00004_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:16:42 2023 cache-454431f643cdc5e8_00005_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 241 MB Wed Aug 23 19:01:29 2023 cache-454431f643cdc5e8_00006_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:16:41 2023 cache-454431f643cdc5e8_00007_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:14:04 2023 cache-454431f643cdc5e8_00008_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:17:41 2023 cache-454431f643cdc5e8_00009_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:17:06 2023 cache-454431f643cdc5e8_00010_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 241 MB Wed Aug 23 19:17:16 2023 cache-454431f643cdc5e8_00011_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 241 MB Wed Aug 23 19:15:13 2023 cache-454431f643cdc5e8_00012_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 241 MB Wed Aug 23 19:16:01 2023 cache-454431f643cdc5e8_00013_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:16:35 2023 cache-454431f643cdc5e8_00014_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:16:20 2023 cache-454431f643cdc5e8_00015_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:14:48 2023 cache-454431f643cdc5e8_00016_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 18:59:32 2023 cache-454431f643cdc5e8_00017_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:17:58 2023 cache-454431f643cdc5e8_00018_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:15:25 2023 cache-454431f643cdc5e8_00019_of_00020.arrow
```
can we specify the cache file for map so that it won't redo everything again? | Map cache with tokenizer | Similar issue to https://github.com/huggingface/datasets/issues/5985, but across different sessions rather than two calls in the same session.
Unlike that issue, explicitly calling tokenizer(my_args) before the map() doesn't help, because the tokenizer was created with a different hash to begin with...
setup
```
from transformers import AutoTokenizer
AutoTokenizer.from_pretrained('bert-base-uncased').save_pretrained("tok")
```
this prints different value each time
```
from transformers import AutoTokenizer
from datasets.utils.py_utils import dumps # Huggingface datasets
print(hash(dumps(AutoTokenizer.from_pretrained("tok"))))
``` | 457 | Map cache with tokenizer
Similar issue to https://github.com/huggingface/datasets/issues/5985, but across different sessions rather than two calls in the same session.
Unlike that issue, explicitly calling tokenizer(my_args) before the map() doesn't help, because the tokenizer was created with a different hash to begin with...
setup
```
from transformers import AutoTokenizer
AutoTokenizer.from_pretrained('bert-base-uncased').save_pretrained("tok")
```
this prints different value each time
```
from transformers import AutoTokenizer
from datasets.utils.py_utils import dumps # Huggingface datasets
print(hash(dumps(AutoTokenizer.from_pretrained("tok"))))
```
I have a similar issue. I was using a Jupyter Notebook and every time I call the map function it performs tokenization from scratch again although the cache files of last run still exists.
I ran with 20 processes and now in the cache folder there are two groups of cached results of tokenized dataset:
```
.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:56:46 2023 cache-1982fea76aa54a13_00001_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 13:02:08 2023 cache-1982fea76aa54a13_00004_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:56:40 2023 cache-1982fea76aa54a13_00005_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 241 MB Sat Aug 26 12:50:59 2023 cache-1982fea76aa54a13_00006_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:57:37 2023 cache-1982fea76aa54a13_00007_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:57:31 2023 cache-1982fea76aa54a13_00008_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:59:47 2023 cache-1982fea76aa54a13_00010_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 241 MB Sat Aug 26 12:59:44 2023 cache-1982fea76aa54a13_00011_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 241 MB Sat Aug 26 12:55:24 2023 cache-1982fea76aa54a13_00012_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 241 MB Sat Aug 26 12:56:21 2023 cache-1982fea76aa54a13_00013_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:57:24 2023 cache-1982fea76aa54a13_00014_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 13:00:48 2023 cache-1982fea76aa54a13_00015_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:56:56 2023 cache-1982fea76aa54a13_00017_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:56:54 2023 cache-1982fea76aa54a13_00018_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:57:27 2023 cache-1982fea76aa54a13_00019_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:15:40 2023 cache-454431f643cdc5e8_00000_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:16:46 2023 cache-454431f643cdc5e8_00001_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:14:53 2023 cache-454431f643cdc5e8_00002_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:13:10 2023 cache-454431f643cdc5e8_00003_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:13:04 2023 cache-454431f643cdc5e8_00004_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:16:42 2023 cache-454431f643cdc5e8_00005_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 241 MB Wed Aug 23 19:01:29 2023 cache-454431f643cdc5e8_00006_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:16:41 2023 cache-454431f643cdc5e8_00007_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:14:04 2023 cache-454431f643cdc5e8_00008_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:17:41 2023 cache-454431f643cdc5e8_00009_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:17:06 2023 cache-454431f643cdc5e8_00010_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 241 MB Wed Aug 23 19:17:16 2023 cache-454431f643cdc5e8_00011_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 241 MB Wed Aug 23 19:15:13 2023 cache-454431f643cdc5e8_00012_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 241 MB Wed Aug 23 19:16:01 2023 cache-454431f643cdc5e8_00013_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:16:35 2023 cache-454431f643cdc5e8_00014_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:16:20 2023 cache-454431f643cdc5e8_00015_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:14:48 2023 cache-454431f643cdc5e8_00016_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 18:59:32 2023 cache-454431f643cdc5e8_00017_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:17:58 2023 cache-454431f643cdc5e8_00018_of_00020.arrow
.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:15:25 2023 cache-454431f643cdc5e8_00019_of_00020.arrow
```
can we specify the cache file for map so that it won't redo everything again? | [
-0.15014910697937012,
-0.19050332903862,
0.107024647295475,
0.35715073347091675,
0.2963959574699402,
-0.21825259923934937,
0.3743158280849457,
0.1827492117881775,
0.06256527453660965,
-0.07695980370044708,
-0.25926995277404785,
0.3096647560596466,
0.06059178709983826,
-0.29029709100723267,
0.07564427703619003,
0.21803006529808044,
0.15787768363952637,
0.12022892385721207,
0.04943076893687248,
-0.05587991699576378,
0.018105804920196533,
0.1858161836862564,
-0.0484803169965744,
0.0453733392059803,
-0.5816013813018799,
-0.08410279452800751,
-0.06690143793821335,
-0.4912043511867523,
0.11850965023040771,
-0.5517597198486328,
0.19430407881736755,
0.28171053528785706,
-0.07302509993314743,
0.5333382487297058,
-0.00012046945630572736,
-0.04962937533855438,
0.05843610689043999,
0.033997729420661926,
0.04757213220000267,
0.0025007352232933044,
0.21662919223308563,
0.02675051987171173,
0.12134513258934021,
-0.24482855200767517,
-0.1635095775127411,
-0.10338753461837769,
-0.07251331955194473,
-0.30721351504325867,
0.689584493637085,
-0.11790831387042999,
0.1540636420249939,
0.3485565185546875,
-0.15686647593975067,
0.11323218047618866,
-0.07093872129917145,
0.061190638691186905,
-0.1555073857307434,
-0.30384203791618347,
-0.1697569042444229,
-0.15873806178569794,
-0.3015379011631012,
0.4334113597869873,
-0.1723087728023529,
0.02508404478430748,
0.2189381867647171,
0.23030249774456024,
-0.12255951017141342,
-0.2175225019454956,
0.27141624689102173,
0.09980833530426025,
0.17503726482391357,
-0.3410533368587494,
-0.28951704502105713,
-0.3496304750442505,
-0.3121738135814667,
-0.10171731561422348,
0.24012228846549988,
-0.08882582187652588,
0.12312819063663483,
0.06851305812597275,
-0.38784360885620117,
0.2014690637588501,
0.11339069902896881,
-0.012450773268938065,
-0.28480955958366394,
0.07466347515583038,
-0.3172892928123474,
0.16840940713882446,
0.20765289664268494,
-0.13850899040699005,
-0.2356652319431305,
-0.10225780308246613,
-0.16521736979484558,
0.3583577573299408,
-0.3327127695083618,
-0.16493147611618042,
0.2819836735725403,
-0.052624110132455826,
-0.02748972922563553,
0.2305973768234253,
0.09200386703014374,
0.32517048716545105,
-0.18731224536895752,
-0.0248529352247715,
0.13298121094703674,
0.48910582065582275,
0.40578949451446533,
0.27579039335250854,
0.1655813306570053,
-0.16107118129730225,
-0.35597729682922363,
-0.16660228371620178,
0.1478816568851471,
0.09094381332397461,
0.45814380049705505,
-0.1501835733652115,
-0.021549928933382034,
-0.10373444110155106,
0.1847114861011505,
0.1304844319820404,
-0.12209531664848328,
-0.01118144765496254,
0.09148892015218735,
0.2940753102302551,
-0.10255073010921478,
-0.015600515529513359,
-0.16198275983333588,
0.06139061972498894,
-0.19279557466506958,
0.06454630196094513,
-0.2816717028617859,
-0.2687845826148987,
-0.16406646370887756,
0.42833420634269714,
0.09424279630184174,
0.1013878732919693,
0.28283771872520447,
0.265079140663147,
-0.07524433732032776,
-0.24837066233158112,
0.2877063751220703,
-0.0802876278758049,
0.36583733558654785,
0.1181517094373703,
-0.04560767114162445,
0.46559643745422363,
0.1740153431892395,
0.007283613085746765,
-0.3041999042034149,
-0.15000203251838684,
-0.0889679342508316,
-0.1494096964597702,
0.3106466829776764,
0.0628289058804512,
-0.32006779313087463,
0.188632071018219,
-0.12623800337314606,
0.07670257985591888,
0.40267178416252136,
-0.01313704252243042,
0.08791635930538177,
-0.05695509538054466,
-0.2764643132686615,
-0.16612936556339264,
0.1062057837843895,
0.3830389976501465,
0.1830318570137024,
-0.46964842081069946,
0.10930322110652924,
0.0806383341550827,
0.08590883016586304,
0.3916337490081787,
-0.22462525963783264,
0.26057004928588867,
-0.22664034366607666,
0.5278775095939636,
0.015421222895383835,
-0.29064667224884033,
-0.6929976344108582,
-0.06397703289985657,
-0.02881527692079544,
0.23406782746315002,
-0.021329659968614578,
-0.04286208748817444,
0.3404085338115692,
-0.05197363346815109,
0.0970480889081955,
0.006731908768415451,
0.041677869856357574,
0.09074705094099045,
-0.30740678310394287,
-0.05672677233815193,
0.13874533772468567,
-0.126813143491745,
0.05842104181647301,
-0.12698960304260254,
0.005843568593263626,
0.22611460089683533,
0.035020098090171814,
0.024779781699180603,
0.222796231508255,
0.0700942873954773,
0.1325874626636505,
0.2107507735490799,
0.012538425624370575,
0.06403296440839767,
-0.025886863470077515,
0.2379794418811798,
-0.06184758245944977,
-0.03420412167906761,
-0.16219580173492432,
-0.3361411988735199,
0.08775529265403748,
-0.07944068312644958,
-0.34809550642967224,
-0.34397056698799133,
0.0891975685954094,
0.20954115688800812,
0.29826444387435913,
0.13919737935066223,
-0.025192297995090485,
0.2447880208492279,
0.4309003949165344,
0.08981700241565704,
-0.40925323963165283,
-0.11075180023908615,
0.11367367953062057,
-0.10534292459487915,
-0.3501858711242676,
0.0858531966805458,
0.3037281632423401,
-0.08799782395362854,
-0.05522332340478897,
0.22178183495998383,
0.018464669585227966,
0.15728852152824402,
-0.20791444182395935,
0.19316458702087402,
0.2107056826353073,
0.09930766373872757,
0.003970721736550331,
-0.00024902448058128357,
-0.1950587034225464,
-0.2166600078344345,
0.24027226865291595,
0.5171714425086975,
0.3257538378238678,
0.13464514911174774,
-0.21963056921958923,
-0.08151905983686447,
0.1394508183002472,
-0.05813070386648178,
-0.14478793740272522,
-0.4933827817440033,
-0.13893060386180878,
0.06806594133377075,
0.3466886878013611,
0.18580177426338196,
0.22923946380615234,
0.3686833679676056,
0.3631453812122345,
0.02101799100637436,
0.03307397663593292,
0.015452318824827671,
-0.37082937359809875,
-0.1893591582775116,
-0.11468648910522461,
0.06442573666572571,
0.1986188441514969,
0.03547072038054466,
0.11793993413448334,
-0.05058605968952179,
0.05034438148140907,
0.006907548755407333,
-0.015100054442882538,
0.029792265966534615,
-0.1077260822057724,
0.1271260380744934,
0.23257091641426086,
0.10828394442796707,
-0.315448522567749,
0.20259755849838257,
0.08554549515247345,
0.12228688597679138,
0.043316565454006195,
0.05304773151874542,
-0.418323814868927,
0.15114803612232208,
-0.13230133056640625,
-0.24543316662311554,
-0.3275737464427948,
-0.17689701914787292,
0.0025876574218273163,
0.2675330936908722,
0.0335085391998291,
0.44602257013320923,
0.06499674916267395,
0.34826770424842834,
0.0791039764881134,
0.09859012067317963,
-0.18843689560890198,
-0.23669548332691193,
-0.3057839274406433,
-0.16253334283828735,
0.07053142786026001,
-0.37270843982696533,
0.2993851602077484,
-0.17083287239074707,
-0.1021428108215332,
-0.4037012457847595,
-0.4380180239677429,
0.21778157353401184,
-0.07913495600223541,
0.1532706618309021,
-0.015430808067321777,
-0.09447131305932999,
-0.24936756491661072,
-0.08123067021369934,
0.3339700400829315,
-0.4243842661380768,
-0.35952985286712646,
0.04333822429180145,
-0.035236652940511703,
0.014194957911968231,
0.06175938993692398,
0.09051787853240967,
-0.08767122775316238,
0.07516226172447205,
0.3069504499435425,
-0.14226064085960388,
0.0988062247633934,
0.14185473322868347,
-0.3519192337989807,
-0.05421796068549156,
-0.4563034176826477,
-0.14125144481658936,
-0.5299967527389526,
-0.2694743573665619,
0.3225344121456146,
-0.226289764046669,
-0.05831686779856682,
-0.14406774938106537,
-0.08745899796485901,
0.2692353129386902,
0.17765343189239502,
-0.5214080214500427,
-0.20055226981639862,
-0.15343077480793,
0.17233963310718536,
-0.07547858357429504,
-0.0029218699783086777,
0.3620697259902954,
-0.008439194411039352,
0.043613553047180176,
-0.0006835833191871643,
-0.24978794157505035,
0.2943786084651947,
-0.1889708936214447,
0.19704599678516388,
-0.02394506335258484,
0.23123526573181152,
0.20973116159439087,
0.6480697989463806,
0.337679386138916,
-0.08226198703050613,
0.19204239547252655,
-0.06569825112819672,
0.25087738037109375,
-0.2971188724040985,
-0.316579669713974,
-0.12035183608531952,
-0.07667357474565506,
0.11178810894489288,
0.2265806496143341,
0.1793680489063263,
-0.03747003525495529,
0.20977993309497833,
-0.08345501869916916,
-0.17324987053871155,
-0.5262941122055054,
-0.0059173256158828735,
-0.11684730648994446,
0.20140431821346283,
0.131553053855896,
0.2785402536392212,
-0.5666563510894775,
-0.1636098176240921,
0.14543133974075317,
-0.17621572315692902,
0.20749515295028687,
0.05161881074309349,
-0.6369604468345642,
0.28435051441192627,
-0.6962305307388306,
0.28114479780197144,
-0.10714448988437653,
0.34188252687454224,
-0.03895995765924454,
-0.16361558437347412,
0.051840368658304214,
0.10040800273418427,
0.6001381278038025,
0.004152098670601845,
0.1190623790025711,
0.13083839416503906,
-0.5781916975975037,
-0.28418707847595215,
-0.034358929842710495,
0.12779071927070618,
0.15102343261241913,
0.20721206068992615,
0.7124941945075989,
-0.24465671181678772,
-0.17573313415050507,
-0.25071215629577637,
0.13999426364898682,
-0.19447779655456543,
-0.13215191662311554,
-0.12715791165828705,
-0.020757578313350677,
-0.2683963179588318,
0.07274141162633896,
-0.09730446338653564,
0.08156218379735947,
0.2108786404132843,
-0.1554490029811859,
-0.22761932015419006,
-0.15257413685321808,
0.004221878945827484,
0.20932158827781677,
0.47119051218032837,
-0.0684986487030983,
0.36058753728866577,
0.5545471906661987,
-0.2550143599510193,
-0.0023773014545440674,
0.11004544794559479,
-0.027367182075977325,
-0.3815850615501404,
0.14789845049381256,
0.008240167051553726,
-0.16580739617347717,
0.34281492233276367,
-0.05432596430182457,
0.29635539650917053,
-0.10222543776035309,
0.21898797154426575,
-0.19865502417087555,
0.3871454894542694,
0.24452975392341614,
0.24071736633777618,
-0.3025047779083252,
-0.16308775544166565,
0.06221970543265343,
0.14973971247673035,
-0.24231918156147003,
0.4136652946472168,
-0.06272543966770172,
-0.3171505928039551,
0.5760830640792847,
0.03778771683573723,
0.9293311834335327,
-0.05200788751244545,
0.27167069911956787,
-0.03515243902802467,
0.2935866117477417,
0.4111073911190033,
-0.24162998795509338,
0.13825753331184387,
-0.41875603795051575,
-0.016863547265529633,
0.0005622208118438721,
-0.012392520904541016,
-0.07554088532924652,
0.13728182017803192,
-0.09277039766311646,
0.02507193014025688,
0.15297169983386993,
0.6838967204093933,
-0.1270824670791626,
0.06619472801685333,
-0.015410113148391247,
-0.26618170738220215,
0.013663377612829208,
0.13651296496391296,
0.034529536962509155,
0.3980679512023926,
0.060743898153305054,
0.08294793963432312,
0.17272323369979858,
-0.23293425142765045,
-0.1984616219997406,
-0.09140515327453613,
-0.38584136962890625,
0.3068294823169708,
0.41388124227523804,
0.12069071829319,
-0.27522483468055725,
0.162776380777359,
0.4807097911834717,
0.33406007289886475,
-0.1154809519648552,
0.1759803146123886,
0.07403940707445145,
0.1808154284954071,
-0.10261794179677963,
-0.45255497097969055,
0.11838814616203308,
0.14685362577438354,
-0.09629608690738678,
-0.141969233751297,
0.0861760750412941,
-0.29972195625305176,
-0.3748778998851776,
0.13117025792598724,
0.15905170142650604,
-0.30089884996414185,
0.27646973729133606,
-0.011967327445745468,
0.12136153876781464,
-0.19367802143096924,
0.08277807384729385,
0.03245774284005165,
-0.16942039132118225,
0.17470836639404297,
-0.2482275664806366,
-0.1945274919271469,
-0.0703049972653389,
0.5464100241661072,
0.018674075603485107,
-0.26174211502075195,
0.354128360748291,
-0.18837741017341614,
-0.21791335940361023,
-0.1263289451599121,
-0.027963481843471527,
0.25995102524757385,
-0.31601768732070923,
0.10985393822193146,
-0.2704888582229614,
-0.127943217754364,
0.12175451964139938,
0.18855547904968262,
0.14359883964061737,
-0.01992662250995636,
-0.048317939043045044,
-0.18353042006492615,
-0.3425569534301758,
-0.04232014715671539,
-0.004772267770022154,
0.2512141168117523,
0.44625580310821533,
0.2706802487373352,
-0.3861362636089325,
0.6043477058410645,
-0.24910372495651245,
0.11789500713348389,
-0.007151283323764801,
0.19171324372291565,
-0.12755459547042847,
-0.40712353587150574,
0.1157466247677803,
-0.1409090757369995,
0.05739680305123329,
0.5370354652404785,
-0.3062118589878082,
-0.1430525779724121,
-0.27094554901123047,
0.1673249453306198,
0.1675766557455063,
-0.06819503009319305,
-0.08135511726140976,
0.19868330657482147,
0.24212415516376495,
-0.4975721538066864,
0.37928348779678345,
0.4634212255477905,
0.03237535431981087,
-0.1768888384103775,
0.38989773392677307,
0.12430191040039062,
0.025289438664913177,
-0.12149588763713837,
-0.03733045235276222,
0.04279136657714844,
0.19026921689510345,
0.19256654381752014,
-0.2299354076385498,
0.04260667413473129,
0.09574573487043381,
0.2020886242389679,
0.3095585107803345,
-0.17114105820655823,
0.15310540795326233,
-0.1359398365020752,
-0.26379507780075073,
0.27139315009117126,
0.17554789781570435,
0.09682966023683548,
-0.1705436408519745,
-0.38098660111427307,
0.30715030431747437,
0.1689918339252472,
-0.06339867413043976,
-0.3238612115383148,
0.26311054825782776,
-0.04782287776470184,
-0.024871140718460083,
0.34562087059020996,
0.2326962947845459,
-0.003671586513519287,
0.45527079701423645,
0.05820406228303909,
0.6906113028526306,
-0.4692005515098572,
0.3655087947845459,
-0.14013613760471344,
-0.19431549310684204,
0.09586156159639359,
0.6983500123023987,
0.10479013621807098,
0.11304357647895813,
0.1215190663933754,
-0.1846146285533905,
0.16579662263393402,
-0.2335313856601715,
0.030859768390655518,
-0.05581970140337944,
-0.37748274207115173,
-0.13415318727493286,
0.22482623159885406,
-0.1747443675994873,
0.2787818908691406,
-0.22559218108654022,
0.3797409236431122,
-0.1770595908164978,
-0.3225756883621216,
-0.27338314056396484,
0.5356293320655823,
-0.4009302258491516,
-0.3046611547470093,
0.1800232231616974,
-0.15326271951198578,
-0.03619018942117691,
0.2745806574821472,
-0.031169474124908447,
-0.023237306624650955,
0.21476410329341888,
0.035726215690374374,
-0.2266223132610321,
-0.39429670572280884,
-0.3132782578468323,
-0.0433126762509346,
0.3033496141433716,
-0.25912779569625854,
0.3207393288612366,
-0.23770466446876526,
-0.08318306505680084,
-0.19015097618103027,
0.3041514754295349,
0.26533499360084534,
0.2153199464082718,
0.03877973556518555,
0.2436647117137909,
0.011928416788578033,
0.1450398564338684,
-0.1798933446407318,
0.23625324666500092,
0.01038074865937233,
-0.3082234859466553,
-0.08813270926475525,
0.04110006242990494,
-0.1336524486541748,
-0.21474793553352356,
-0.12152112275362015,
0.3162778615951538,
0.06732198596000671,
0.2870447635650635,
-0.17639310657978058,
0.09761427342891693,
-0.04808636009693146,
0.20205804705619812,
-0.32020360231399536,
0.08481409400701523,
0.24636560678482056,
0.002472706139087677,
0.22488652169704437,
-0.4330378770828247,
0.055572759360075,
0.06307240575551987,
0.27961039543151855,
0.1274348348379135,
-0.31688225269317627,
-0.38630229234695435,
-0.1389394998550415,
-0.5562557578086853,
0.33723556995391846,
-0.0659341812133789,
0.2501862049102783,
-0.2749654948711395,
0.1356116086244583,
0.014612765982747078,
0.013465004041790962,
0.07645038515329361,
0.0037808753550052643,
-0.017484866082668304,
-0.013025017455220222,
-0.2884114384651184,
0.36617231369018555,
-0.03590769320726395,
0.012260416522622108,
0.19237655401229858,
-0.27205365896224976,
0.3862024247646332,
0.09117035567760468,
0.041339002549648285,
0.006001533940434456,
0.03967895358800888,
-0.06334218382835388,
-0.00283113494515419,
0.42491161823272705,
0.39783748984336853,
-0.030606504529714584,
0.08987696468830109,
0.15189196169376373,
-0.19657641649246216,
-0.08151771128177643,
-0.19959595799446106,
-0.0921543538570404,
-0.029346104711294174,
0.21474747359752655,
-0.21927165985107422,
-0.14719821512699127,
-0.47131049633026123,
-0.14014099538326263,
0.3473432660102844,
-0.2864474654197693,
-0.1273876130580902,
0.15765701234340668,
-0.14359980821609497,
0.1067206859588623,
0.12585771083831787,
0.6266398429870605,
0.08929671347141266,
0.5286915302276611,
-0.23487642407417297,
-0.3680992126464844,
0.4460313618183136,
-0.8011887669563293,
-0.31719180941581726,
-0.004966910928487778,
0.21535766124725342,
0.3655937910079956,
-0.39507395029067993,
-0.45967191457748413,
-0.04859847575426102,
0.2556559145450592,
-0.06320119649171829,
-0.3377664387226105,
0.018376950174570084,
-0.05348700284957886,
-0.04713638499379158,
-0.1928001046180725,
0.5000789165496826,
0.30686068534851074,
-0.22626839578151703,
0.32831627130508423,
-0.12405120581388474
] |
https://github.com/huggingface/datasets/issues/6179 | @Luosuu [map](https://huggingface.co/docs/datasets/v2.14.4/en/package_reference/main_classes#datasets.Dataset.map) has cache_file_name parameter
In my case, I do want the cache to detect when the map function changes, so I can't pass a constant cache file name. | Map cache with tokenizer | Similar issue to https://github.com/huggingface/datasets/issues/5985, but across different sessions rather than two calls in the same session.
Unlike that issue, explicitly calling tokenizer(my_args) before the map() doesn't help, because the tokenizer was created with a different hash to begin with...
setup
```
from transformers import AutoTokenizer
AutoTokenizer.from_pretrained('bert-base-uncased').save_pretrained("tok")
```
this prints different value each time
```
from transformers import AutoTokenizer
from datasets.utils.py_utils import dumps # Huggingface datasets
print(hash(dumps(AutoTokenizer.from_pretrained("tok"))))
``` | 29 | Map cache with tokenizer
Similar issue to https://github.com/huggingface/datasets/issues/5985, but across different sessions rather than two calls in the same session.
Unlike that issue, explicitly calling tokenizer(my_args) before the map() doesn't help, because the tokenizer was created with a different hash to begin with...
setup
```
from transformers import AutoTokenizer
AutoTokenizer.from_pretrained('bert-base-uncased').save_pretrained("tok")
```
this prints different value each time
```
from transformers import AutoTokenizer
from datasets.utils.py_utils import dumps # Huggingface datasets
print(hash(dumps(AutoTokenizer.from_pretrained("tok"))))
```
@Luosuu [map](https://huggingface.co/docs/datasets/v2.14.4/en/package_reference/main_classes#datasets.Dataset.map) has cache_file_name parameter
In my case, I do want the cache to detect when the map function changes, so I can't pass a constant cache file name. | [
-0.3330538868904114,
-0.25712743401527405,
0.10112573206424713,
0.2790035605430603,
0.32102808356285095,
-0.159580260515213,
0.24012628197669983,
0.1805238425731659,
0.12876078486442566,
0.062470272183418274,
-0.22218045592308044,
0.26421919465065,
-0.08900037407875061,
-0.23877039551734924,
0.08284219354391098,
0.12813988327980042,
0.09941450506448746,
0.07538744807243347,
-0.06487947702407837,
0.012035936117172241,
-0.07124566286802292,
0.13106051087379456,
-0.044299766421318054,
0.04711012542247772,
-0.3802427351474762,
-0.011520898900926113,
-0.09249380975961685,
-0.3853638470172882,
0.07908256351947784,
-0.5553689002990723,
0.28962719440460205,
0.3697673976421356,
-0.07105955481529236,
0.42267826199531555,
-0.00011336545867379755,
0.005411088466644287,
0.13567018508911133,
-0.004638873040676117,
-0.014914583414793015,
-0.06616558134555817,
-0.09408826380968094,
0.02769365906715393,
0.0600644052028656,
-0.23604600131511688,
-0.24398550391197205,
-0.0038056597113609314,
0.10427606105804443,
-0.35571908950805664,
0.5908963084220886,
0.03972889110445976,
0.20985887944698334,
0.3416259288787842,
-0.07589371502399445,
-0.016107313334941864,
0.044449977576732635,
0.08062426000833511,
-0.10741093754768372,
-0.260417640209198,
-0.16244453191757202,
-0.16787531971931458,
-0.402200311422348,
0.424489825963974,
-0.1719665229320526,
-0.025908805429935455,
0.28772178292274475,
0.17089402675628662,
-0.3397670388221741,
-0.07434336096048355,
0.2567729353904724,
0.12256208062171936,
0.21713072061538696,
-0.49328893423080444,
-0.3832111954689026,
-0.33278125524520874,
-0.21069177985191345,
-0.08860129117965698,
0.2902308702468872,
-0.2031833529472351,
0.026200413703918457,
0.10549833625555038,
-0.3637892007827759,
-0.01614907756447792,
0.04857552796602249,
0.0501399040222168,
-0.17310187220573425,
0.033434562385082245,
-0.2767367660999298,
0.16815434396266937,
0.10440143942832947,
-0.27175894379615784,
-0.35761600732803345,
-0.06413224339485168,
-0.1462676078081131,
0.41633450984954834,
-0.36601004004478455,
-0.19558453559875488,
0.32398271560668945,
0.07612935453653336,
0.06591042131185532,
0.16721776127815247,
-0.00838160328567028,
0.31757083535194397,
-0.22511664032936096,
0.04016365855932236,
0.04854125156998634,
0.4423927962779999,
0.42322027683258057,
0.227733314037323,
0.17572617530822754,
-0.07851172238588333,
-0.35861116647720337,
-0.17977997660636902,
0.1890965700149536,
-0.019342968240380287,
0.4495909810066223,
-0.1261184811592102,
0.07878438383340836,
-0.04939163476228714,
0.20085453987121582,
0.08277243375778198,
-0.09248968958854675,
-0.020999591797590256,
0.2947980761528015,
0.45472705364227295,
-0.18044394254684448,
-0.07385501265525818,
-0.1822495311498642,
0.06354261934757233,
-0.1666487753391266,
0.10849417001008987,
-0.3313303291797638,
-0.19140955805778503,
-0.08075477927923203,
0.42664510011672974,
0.1508398950099945,
0.060940153896808624,
0.2903546094894409,
0.14147457480430603,
0.03244395554065704,
0.008596114814281464,
0.2474273145198822,
-0.058350611478090286,
0.3942219316959381,
0.024239202961325645,
-0.028877146542072296,
0.2934595048427582,
0.12256845831871033,
0.008146829903125763,
-0.3201139569282532,
-0.22597447037696838,
-0.10577371716499329,
-0.18954002857208252,
0.3618384003639221,
0.13648642599582672,
-0.2808797359466553,
0.05014542117714882,
-0.10147140175104141,
0.14266365766525269,
0.28603804111480713,
-0.12380146980285645,
0.07506941258907318,
0.05597502738237381,
-0.41369783878326416,
-0.18270213901996613,
0.2588762938976288,
0.49082672595977783,
0.3111715316772461,
-0.44056200981140137,
0.1629909723997116,
-0.010405134409666061,
-0.1034855991601944,
0.19369852542877197,
-0.21104566752910614,
0.04199596121907234,
-0.2213892936706543,
0.4953479766845703,
0.0612257719039917,
-0.43571966886520386,
-0.625584602355957,
-0.07217685878276825,
-0.06946689635515213,
0.17863070964813232,
0.051550328731536865,
-0.0835350900888443,
0.14333558082580566,
-0.14119161665439606,
0.173974871635437,
0.008949540555477142,
-0.05490060895681381,
0.11899403482675552,
-0.2074452042579651,
-0.16325369477272034,
0.07233984768390656,
-0.019892599433660507,
0.06010296940803528,
-0.14611826837062836,
-0.04525404050946236,
0.30397072434425354,
0.014364797621965408,
-0.03150814026594162,
0.24526908993721008,
0.11061258614063263,
0.22571639716625214,
0.12051884829998016,
-0.030806438997387886,
-0.01549142599105835,
-0.21117956936359406,
0.21987853944301605,
0.009528115391731262,
-0.003435121849179268,
-0.2194221019744873,
-0.33786386251449585,
0.10145317018032074,
-0.06728168576955795,
-0.24482527375221252,
-0.2759541869163513,
0.13348929584026337,
0.16869030892848969,
0.25042250752449036,
0.1645561307668686,
-0.05437711253762245,
0.313031941652298,
0.3771139085292816,
0.08869987726211548,
-0.37559810280799866,
-0.22913280129432678,
0.11925433576107025,
-0.14655166864395142,
-0.22786617279052734,
0.04038671776652336,
0.294994980096817,
-0.021700501441955566,
-0.08705751597881317,
0.3679618537425995,
0.04743877798318863,
0.2777682840824127,
-0.18877680599689484,
0.13873568177223206,
0.19058138132095337,
0.08942314982414246,
-0.05454663932323456,
-0.048749689012765884,
-0.1365472674369812,
-0.047890860587358475,
0.012480242177844048,
0.40764808654785156,
0.2876173257827759,
0.10057757794857025,
-0.11063464730978012,
-0.12286326289176941,
0.14955344796180725,
-0.08468878269195557,
-0.17683732509613037,
-0.49809837341308594,
-0.142467200756073,
-0.04546039551496506,
0.4582734704017639,
0.09759025275707245,
-0.05431801825761795,
0.23239746689796448,
0.48118966817855835,
0.1306254267692566,
0.09274132549762726,
0.11230255663394928,
-0.3582707941532135,
-0.18313299119472504,
0.062374234199523926,
-0.0011876970529556274,
0.26026612520217896,
0.1357441544532776,
0.13012412190437317,
0.02819078229367733,
0.0025372616946697235,
-0.023565635085105896,
0.04427596181631088,
-0.03999192267656326,
-0.28226083517074585,
-0.02881487086415291,
0.20727406442165375,
0.05372696369886398,
-0.3087482452392578,
0.11704544723033905,
0.017552770674228668,
0.066329725086689,
-0.03541227802634239,
-0.009630080312490463,
-0.34609001874923706,
0.0289338156580925,
-0.11142142117023468,
-0.18743360042572021,
-0.309423565864563,
-0.18617020547389984,
0.11847109347581863,
0.25265416502952576,
-0.09235942363739014,
0.41128993034362793,
-0.015476293861865997,
0.2958068251609802,
0.1217879205942154,
-0.23559634387493134,
-0.21863941848278046,
-0.23757587373256683,
-0.1839844435453415,
-0.09174294024705887,
0.05586261674761772,
-0.3121311068534851,
0.37810564041137695,
-0.09796550124883652,
-0.004251677542924881,
-0.2603501081466675,
-0.3718802332878113,
0.19246050715446472,
-0.11287862807512283,
0.0726739764213562,
0.12602120637893677,
-0.15258778631687164,
-0.1452140212059021,
-0.08607107400894165,
0.4309621751308441,
-0.3877900242805481,
-0.2656957507133484,
-0.031519290059804916,
0.14955061674118042,
0.07209974527359009,
-0.045172709971666336,
0.026842765510082245,
0.06171149015426636,
-0.1398572325706482,
0.24874666333198547,
-0.14759688079357147,
-0.03431134670972824,
0.27757528424263,
-0.15760576725006104,
0.13426890969276428,
-0.5426852107048035,
-0.05857015401124954,
-0.4760708212852478,
-0.3514627516269684,
0.38489532470703125,
-0.27314916253089905,
-0.08095018565654755,
-0.2013842761516571,
-0.08192981779575348,
0.2609845995903015,
0.19348588585853577,
-0.38837677240371704,
-0.453864187002182,
-0.16819699108600616,
0.16611434519290924,
-0.02145361714065075,
-0.004475457593798637,
0.37376540899276733,
0.06781511008739471,
-0.05373662710189819,
-0.09134665876626968,
-0.27444571256637573,
0.3251931369304657,
-0.11554334312677383,
0.07303756475448608,
-0.005652242340147495,
0.12604837119579315,
0.1974879503250122,
0.6234750151634216,
0.253495454788208,
-0.07463835924863815,
0.3117726743221283,
-0.11672981083393097,
0.3524187207221985,
-0.20541617274284363,
-0.30626431107521057,
-0.0872289314866066,
-0.03075743466615677,
0.1586388647556305,
0.17040084302425385,
0.14939077198505402,
0.06046637147665024,
0.044202037155628204,
-0.19441518187522888,
-0.07939395308494568,
-0.602449357509613,
0.017460135743021965,
-0.05508539080619812,
0.17155364155769348,
0.14493335783481598,
0.29241156578063965,
-0.5417581796646118,
-0.13712537288665771,
0.32528457045555115,
-0.07280082255601883,
0.2159266322851181,
0.015003226697444916,
-0.4751003384590149,
0.3350243866443634,
-0.7256031632423401,
0.33146345615386963,
-0.02106982097029686,
0.24391008913516998,
-0.172854483127594,
-0.2797330617904663,
-0.09515653550624847,
0.02318599447607994,
0.5588986277580261,
-0.09089753776788712,
0.14023159444332123,
0.092551589012146,
-0.505494236946106,
-0.17548009753227234,
0.19130253791809082,
0.15142033994197845,
0.05142873153090477,
0.030189264565706253,
0.8192823529243469,
-0.36241471767425537,
-0.2965063452720642,
-0.3732178509235382,
0.04334312677383423,
-0.09163481742143631,
-0.11682823300361633,
-0.046226318925619125,
0.029580846428871155,
-0.3240514397621155,
0.08544400334358215,
-0.03540264815092087,
0.06166931986808777,
0.29421132802963257,
-0.006803750991821289,
-0.24725502729415894,
-0.045520029962062836,
0.034614548087120056,
0.25462523102760315,
0.44930246472358704,
-0.004036672413349152,
0.3876769542694092,
0.5481849908828735,
-0.13645122945308685,
0.043189339339733124,
0.17574606835842133,
-0.10995297133922577,
-0.3917675018310547,
0.009312361478805542,
0.11262823641300201,
-0.1398579180240631,
0.2427818477153778,
-0.09421239793300629,
0.29191264510154724,
-0.033608268946409225,
0.2729276120662689,
-0.3755803406238556,
0.4044943153858185,
0.17612528800964355,
0.2331770658493042,
-0.2803272306919098,
-0.2882899045944214,
0.15003210306167603,
0.13020630180835724,
-0.16137419641017914,
0.34177419543266296,
0.1491059511899948,
-0.40410152077674866,
0.5163491368293762,
0.014657421037554741,
0.7745347023010254,
0.007662740536034107,
0.35619133710861206,
0.04999605193734169,
0.2059626430273056,
0.4159374237060547,
-0.1514427363872528,
0.14529964327812195,
-0.27515357732772827,
0.01169777661561966,
0.03686133772134781,
0.0405510812997818,
-0.03356233984231949,
0.029284147545695305,
-0.24585260450839996,
0.04921356216073036,
0.27739718556404114,
0.6050980687141418,
-0.17148858308792114,
0.13872675597667694,
-0.11647991091012955,
-0.40072891116142273,
-0.16972222924232483,
0.22614720463752747,
0.16836600005626678,
0.3954983949661255,
0.08038518577814102,
-0.05828458070755005,
0.19533586502075195,
-0.2392348200082779,
-0.08049632608890533,
-0.06541236490011215,
-0.35920020937919617,
0.14975237846374512,
0.23872795701026917,
0.08130660653114319,
-0.10295476019382477,
0.3114299774169922,
0.3734304904937744,
0.3403463661670685,
-0.2617548108100891,
0.20632481575012207,
-0.018641963601112366,
0.2379348874092102,
-0.11071504652500153,
-0.39293280243873596,
0.20095281302928925,
0.16129374504089355,
0.022453486919403076,
-0.0815223902463913,
0.023696374148130417,
-0.21863994002342224,
-0.2579939663410187,
0.07010053843259811,
0.051705606281757355,
-0.3655473589897156,
0.1391439437866211,
-0.11995498836040497,
0.1651700884103775,
-0.1855301558971405,
0.12635020911693573,
0.03518661856651306,
-0.10746130347251892,
0.12169453501701355,
-0.1418037712574005,
-0.16905100643634796,
-0.04901205375790596,
0.5992595553398132,
-0.20963594317436218,
-0.13541439175605774,
0.38445839285850525,
-0.22617414593696594,
-0.15792444348335266,
-0.13874608278274536,
-0.044751740992069244,
0.28833794593811035,
-0.3929409980773926,
0.0010899044573307037,
-0.07872004806995392,
-0.10709583759307861,
0.18916116654872894,
0.1604236662387848,
-0.04449987784028053,
-0.11839805543422699,
0.05917748808860779,
-0.052749600261449814,
-0.5023849606513977,
0.013665219768881798,
-0.03051331639289856,
0.28437328338623047,
0.44729942083358765,
0.2565838098526001,
-0.3273548483848572,
0.4728393852710724,
-0.33085617423057556,
0.03466823697090149,
-0.12287898361682892,
0.13865970075130463,
-0.03572773188352585,
-0.22710606455802917,
0.29011401534080505,
-0.16142022609710693,
0.09519930183887482,
0.38818806409835815,
-0.3835260570049286,
-0.19260120391845703,
-0.2454734444618225,
0.11075091361999512,
0.10351452231407166,
-0.0024471022188663483,
-0.11703960597515106,
0.11814894527196884,
0.21740543842315674,
-0.4852358102798462,
0.3942785859107971,
0.5291054248809814,
-0.02414580062031746,
-0.053208980709314346,
0.24244415760040283,
0.11196162551641464,
0.006603628396987915,
-0.014642937108874321,
0.08329717814922333,
-0.01817432790994644,
0.07539404183626175,
0.12061852961778641,
-0.44737309217453003,
0.02146129310131073,
0.40941476821899414,
0.25884437561035156,
0.4100624918937683,
-0.1652442216873169,
0.07807161659002304,
0.008721563033759594,
-0.3300265669822693,
0.3298414647579193,
0.18415313959121704,
0.00886446051299572,
-0.10847650468349457,
-0.21165171265602112,
0.34112435579299927,
0.23865953087806702,
-0.16324669122695923,
-0.14353202283382416,
0.3205040395259857,
-0.09684552997350693,
0.19354191422462463,
0.28716954588890076,
0.03654986619949341,
0.21585556864738464,
0.45685136318206787,
0.10500571131706238,
0.5354932546615601,
-0.33729565143585205,
0.21535921096801758,
-0.06445035338401794,
-0.09904264658689499,
0.15666991472244263,
0.6420930624008179,
0.19997002184391022,
0.26743578910827637,
0.15726159512996674,
-0.20294879376888275,
0.24318738281726837,
-0.23673248291015625,
0.06001374125480652,
-0.0031816065311431885,
-0.3492846190929413,
-0.1499701738357544,
0.1596543788909912,
-0.10602797567844391,
0.1864144653081894,
-0.2527562975883484,
0.499161958694458,
-0.15202827751636505,
-0.217612624168396,
-0.06147307530045509,
0.40334680676460266,
-0.31607478857040405,
-0.36946985125541687,
0.2892550230026245,
-0.07721389830112457,
-0.08156108856201172,
0.07673674076795578,
0.03771963343024254,
-0.09030663222074509,
0.2918192744255066,
-0.020698118954896927,
0.007305461913347244,
-0.25799521803855896,
-0.3921241760253906,
-0.010540488176047802,
0.22902697324752808,
-0.25476041436195374,
0.22575683891773224,
-0.11518022418022156,
-0.15515658259391785,
-0.060206349939107895,
0.2941911220550537,
0.21847613155841827,
0.08663191646337509,
0.024379238486289978,
0.31730425357818604,
0.08388116210699081,
0.13197146356105804,
-0.3145711421966553,
0.12713591754436493,
0.012981951236724854,
-0.23399624228477478,
0.1474592685699463,
0.1344030350446701,
-0.17453265190124512,
-0.04071458429098129,
-0.2367783486843109,
0.26628372073173523,
-0.04284344241023064,
0.2438194453716278,
-0.07741831243038177,
0.16939738392829895,
-0.12672372162342072,
0.036784522235393524,
-0.34351569414138794,
0.1512458622455597,
0.22512704133987427,
-0.0066070519387722015,
0.24181583523750305,
-0.368513286113739,
0.08330313861370087,
0.2128041386604309,
0.2528488039970398,
0.14223234355449677,
-0.27182698249816895,
-0.3718903064727783,
-0.11729755997657776,
-0.6545003056526184,
0.26436060667037964,
0.03821477293968201,
0.16452284157276154,
-0.28788384795188904,
0.06020600348711014,
0.08354063332080841,
-0.035078324377536774,
0.018394287675619125,
-0.10394640266895294,
0.05032746121287346,
-0.0027640098705887794,
-0.25697797536849976,
0.21167242527008057,
-0.16586069762706757,
0.00130411796271801,
0.29760318994522095,
-0.2638840675354004,
0.27402663230895996,
0.020425308495759964,
0.11898300051689148,
-0.12612272799015045,
0.11785256117582321,
-0.02216748520731926,
-0.13979047536849976,
0.5192855596542358,
0.19617143273353577,
-0.026563789695501328,
-0.03500963747501373,
0.17114856839179993,
-0.22308076918125153,
-0.09083621203899384,
-0.2771209478378296,
-0.26634150743484497,
-0.06946663558483124,
0.26177358627319336,
-0.29514893889427185,
-0.21693268418312073,
-0.3990291655063629,
-0.07087002694606781,
0.2561856508255005,
-0.2771153151988983,
-0.08312247693538666,
0.28086790442466736,
-0.042710743844509125,
-0.01643599383533001,
0.038527533411979675,
0.5698282718658447,
-0.0070475805550813675,
0.489197313785553,
-0.2988184988498688,
-0.3873196840286255,
0.5600082874298096,
-0.7815316319465637,
-0.19756919145584106,
0.030829399824142456,
0.08603166788816452,
0.294301301240921,
-0.5058383345603943,
-0.5349143743515015,
0.08348768949508667,
0.2129267454147339,
0.015952400863170624,
-0.31117990612983704,
0.005465518683195114,
-0.00205790251493454,
0.013115696609020233,
-0.2142099142074585,
0.5408560037612915,
0.3306179940700531,
-0.15964782238006592,
0.36429259181022644,
-0.08274251967668533
] |
https://github.com/huggingface/datasets/issues/6179 | Implementing a proper hashing function for the (fast) tokenizers is currently impossible for the reasons mentioned in the referenced issues. So the only alternative to the `cache_file_name` (or `new_fingerprint`) parameter is a custom serializer (e.g., that deserializes the tokenizer from a local save path) defined using `copyreg` or a class that wraps the tokenizer object and has `__reduce__`(`__setstate__`/`__getstate__`) | Map cache with tokenizer | Similar issue to https://github.com/huggingface/datasets/issues/5985, but across different sessions rather than two calls in the same session.
Unlike that issue, explicitly calling tokenizer(my_args) before the map() doesn't help, because the tokenizer was created with a different hash to begin with...
setup
```
from transformers import AutoTokenizer
AutoTokenizer.from_pretrained('bert-base-uncased').save_pretrained("tok")
```
this prints different value each time
```
from transformers import AutoTokenizer
from datasets.utils.py_utils import dumps # Huggingface datasets
print(hash(dumps(AutoTokenizer.from_pretrained("tok"))))
``` | 58 | Map cache with tokenizer
Similar issue to https://github.com/huggingface/datasets/issues/5985, but across different sessions rather than two calls in the same session.
Unlike that issue, explicitly calling tokenizer(my_args) before the map() doesn't help, because the tokenizer was created with a different hash to begin with...
setup
```
from transformers import AutoTokenizer
AutoTokenizer.from_pretrained('bert-base-uncased').save_pretrained("tok")
```
this prints different value each time
```
from transformers import AutoTokenizer
from datasets.utils.py_utils import dumps # Huggingface datasets
print(hash(dumps(AutoTokenizer.from_pretrained("tok"))))
```
Implementing a proper hashing function for the (fast) tokenizers is currently impossible for the reasons mentioned in the referenced issues. So the only alternative to the `cache_file_name` (or `new_fingerprint`) parameter is a custom serializer (e.g., that deserializes the tokenizer from a local save path) defined using `copyreg` or a class that wraps the tokenizer object and has `__reduce__`(`__setstate__`/`__getstate__`) | [
-0.27431732416152954,
-0.1078001856803894,
0.09937052428722382,
0.0826125219464302,
0.269914835691452,
-0.004246249794960022,
0.4050785303115845,
0.3695800006389618,
0.18029317259788513,
0.13507942855358124,
-0.20782291889190674,
0.22882694005966187,
-0.14012375473976135,
-0.2125345766544342,
0.09537310898303986,
0.22562934458255768,
0.17098794877529144,
0.0939071923494339,
0.12552939355373383,
0.061863012611866,
-0.11362515389919281,
0.045193739235401154,
0.10959824919700623,
0.0327920988202095,
-0.37471693754196167,
0.11836801469326019,
-0.0724225789308548,
-0.2944815158843994,
0.09218797087669373,
-0.6317928433418274,
0.020923852920532227,
0.40660879015922546,
-0.058529485017061234,
0.3055587708950043,
-0.00011593345698202029,
0.022842586040496826,
0.17352287471294403,
0.014258474111557007,
0.050689853727817535,
0.0288255475461483,
-0.03252905234694481,
-0.08767471462488174,
-0.04235482215881348,
-0.26031944155693054,
-0.17515882849693298,
-0.13827700912952423,
0.23025542497634888,
-0.23525576293468475,
0.4825970530509949,
-0.06936296820640564,
0.1721331626176834,
0.36191779375076294,
-0.07516390085220337,
-0.006902389228343964,
0.06195063143968582,
0.05776900425553322,
-0.18589860200881958,
-0.21604643762111664,
-0.15841646492481232,
-0.09828288853168488,
-0.35201495885849,
0.312450647354126,
-0.13860735297203064,
-0.15402446687221527,
0.3861640691757202,
0.3162155747413635,
-0.10365017503499985,
-0.015214236453175545,
0.15991386771202087,
0.24325984716415405,
0.13635532557964325,
-0.398847758769989,
-0.557262659072876,
-0.3970043361186981,
-0.2573030889034271,
-0.15407857298851013,
0.2905923128128052,
-0.22812046110630035,
0.01451849564909935,
0.08988886326551437,
-0.3754250407218933,
0.023818038403987885,
0.11301455646753311,
-0.12382899224758148,
-0.052146270871162415,
0.0711464211344719,
-0.11911740154027939,
0.1023811548948288,
0.23731179535388947,
-0.28362536430358887,
-0.3448481857776642,
-0.08786235749721527,
-0.056066397577524185,
0.35129547119140625,
-0.22489994764328003,
-0.24479340016841888,
0.35229185223579407,
0.0490495041012764,
0.0660904049873352,
0.1930435597896576,
0.044699154794216156,
0.3711968958377838,
-0.10690264403820038,
0.107487753033638,
-0.12503401935100555,
0.33925676345825195,
0.24059543013572693,
0.13223208487033844,
0.2356334924697876,
-0.14382398128509521,
-0.29279187321662903,
-0.2050429880619049,
0.045433685183525085,
0.011398211121559143,
0.49532198905944824,
-0.08449725806713104,
-0.10466627776622772,
-0.06344866752624512,
0.28054389357566833,
0.05059177055954933,
0.028606384992599487,
0.07703959941864014,
0.3097022771835327,
0.46118560433387756,
-0.1881995052099228,
-0.07521135360002518,
-0.23781472444534302,
-0.11968407034873962,
-0.19972150027751923,
0.19948290288448334,
-0.2868117690086365,
-0.12769833207130432,
-0.05771545320749283,
0.36141520738601685,
0.09785252809524536,
-0.023158924654126167,
0.3260340392589569,
0.008071210235357285,
0.137660950422287,
0.1526622623205185,
0.3543011248111725,
-0.04893708601593971,
0.3992047905921936,
0.089485302567482,
-0.033870529383420944,
0.21316933631896973,
0.04517517611384392,
-0.08606278896331787,
-0.36563509702682495,
-0.10978043079376221,
-0.11205960810184479,
-0.2314116358757019,
0.30409449338912964,
0.1319316029548645,
-0.3505043387413025,
-0.013790253549814224,
-0.12239018082618713,
0.048542410135269165,
0.321781724691391,
-0.13856282830238342,
-0.0656481608748436,
0.00275404192507267,
-0.3692624568939209,
-0.23957985639572144,
0.2457301765680313,
0.44953107833862305,
0.32412973046302795,
-0.4354952573776245,
0.1042909175157547,
0.027191564440727234,
0.051040638238191605,
0.18383070826530457,
-0.14312651753425598,
0.10457570850849152,
-0.33238422870635986,
0.6455279588699341,
0.0322188176214695,
-0.5137458443641663,
-0.5577041506767273,
-0.10820211470127106,
-0.1031852513551712,
0.22870638966560364,
0.1473449021577835,
0.0576384998857975,
0.22877268493175507,
-0.25027763843536377,
-0.010064348578453064,
0.08151941001415253,
-0.0861458033323288,
0.14696380496025085,
-0.18564075231552124,
-0.18039709329605103,
0.13135644793510437,
-0.009720578789710999,
0.04909731447696686,
-0.20019692182540894,
-0.025634106248617172,
0.2930488884449005,
-0.10094394534826279,
-0.12785258889198303,
0.1877254843711853,
0.02992315962910652,
0.2569407820701599,
-0.037383317947387695,
0.009276419878005981,
0.08848924934864044,
-0.18903478980064392,
0.3214920461177826,
-0.02213670313358307,
-0.05858183279633522,
-0.2656483054161072,
-0.3477335572242737,
0.25097787380218506,
-0.04357755184173584,
-0.22121907770633698,
-0.11459696292877197,
0.08031795173883438,
0.19935216009616852,
0.25666576623916626,
0.07429823279380798,
-0.06800620257854462,
0.18837793171405792,
0.30183640122413635,
0.13662561774253845,
-0.2793768644332886,
-0.3225554823875427,
0.10467959940433502,
-0.050332266837358475,
-0.36643099784851074,
0.017344413325190544,
0.23246532678604126,
-0.04351387545466423,
0.04222172126173973,
0.27080637216567993,
0.06626451015472412,
0.2581975758075714,
-0.1473829448223114,
0.3327074348926544,
0.17112204432487488,
0.055848196148872375,
0.009676866233348846,
-0.05597437173128128,
-0.1113186925649643,
-0.13015709817409515,
-0.05391610413789749,
0.5842504501342773,
0.2138918787240982,
0.047133222222328186,
-0.02212747186422348,
-0.16271618008613586,
0.16658614575862885,
-0.08462410420179367,
-0.10410687327384949,
-0.4757828712463379,
-0.1558600813150406,
0.07214318215847015,
0.4586294889450073,
0.15823525190353394,
0.036055535078048706,
0.25626423954963684,
0.504047155380249,
0.06828400492668152,
0.053861383348703384,
0.1805243194103241,
-0.20272745192050934,
-0.31491437554359436,
-0.062148213386535645,
0.007500730454921722,
0.29577919840812683,
0.15984466671943665,
0.15682387351989746,
-0.006172294728457928,
0.10653507709503174,
-0.06018805131316185,
0.1553179919719696,
-0.019341185688972473,
-0.45439034700393677,
0.06798768788576126,
0.18672966957092285,
-0.026507515460252762,
-0.28799599409103394,
-0.025875069200992584,
0.1263379156589508,
0.023969823494553566,
-0.06498976051807404,
-0.06786127388477325,
-0.17393186688423157,
0.14955733716487885,
-0.06894077360630035,
-0.25460633635520935,
-0.287810742855072,
-0.2674947679042816,
0.19803427159786224,
0.2737465798854828,
-0.2645164132118225,
0.33031415939331055,
-0.2318475842475891,
0.28801047801971436,
0.02426765114068985,
-0.2986489534378052,
-0.24202030897140503,
-0.243189737200737,
-0.05817585811018944,
-0.07010704278945923,
0.06270179897546768,
-0.2997865080833435,
0.4017868936061859,
-0.08221300691366196,
-0.009771235287189484,
-0.32490840554237366,
-0.4538748860359192,
0.14324457943439484,
-0.18835508823394775,
0.10724606364965439,
0.1468777060508728,
-0.12308313697576523,
-0.1298101544380188,
-0.09888029098510742,
0.325930118560791,
-0.39886587858200073,
-0.32654866576194763,
-0.016941260546445847,
0.1441003829240799,
0.01889296993613243,
-0.010540850460529327,
0.11848717927932739,
-0.12687836587429047,
-0.11560019850730896,
0.2829906642436981,
-0.06261397898197174,
0.1381760984659195,
0.4132586419582367,
-0.3225758969783783,
0.14423900842666626,
-0.4847615957260132,
-0.051669903099536896,
-0.34026986360549927,
-0.4882116913795471,
0.5388109087944031,
-0.30670005083084106,
-0.04910115525126457,
-0.16551288962364197,
-0.059067949652671814,
0.089467853307724,
0.17311465740203857,
-0.29838046431541443,
-0.5190094113349915,
-0.13780459761619568,
0.25852125883102417,
0.1165127232670784,
0.0614197701215744,
0.2946219742298126,
0.12248384952545166,
-0.1070740669965744,
-0.10306224226951599,
-0.15146487951278687,
0.31748342514038086,
-0.16577759385108948,
0.12328222393989563,
0.12358936667442322,
0.1864461898803711,
0.25776705145835876,
0.8326951861381531,
0.21941018104553223,
-0.06577328592538834,
0.2667006552219391,
-0.09744131565093994,
0.2628922462463379,
-0.2545233964920044,
-0.33280324935913086,
-0.08678808063268661,
0.02320033311843872,
0.1279442459344864,
0.19450706243515015,
0.17420712113380432,
0.16639302670955658,
0.12366722524166107,
-0.12836897373199463,
-0.1010906919836998,
-0.5522189140319824,
0.0897255688905716,
-0.013207181356847286,
0.14921972155570984,
0.12996867299079895,
0.3086405396461487,
-0.5756645202636719,
-0.2674545645713806,
0.3357042074203491,
0.024315472692251205,
0.24765154719352722,
-0.06937076151371002,
-0.5282776355743408,
0.2933138906955719,
-0.7453562021255493,
0.322704017162323,
0.0752648264169693,
0.27417629957199097,
-0.0723661333322525,
-0.3351762294769287,
-0.0517229288816452,
-0.044663235545158386,
0.5645143985748291,
-0.004425389692187309,
0.15652211010456085,
0.08451609313488007,
-0.6247774362564087,
-0.003220975399017334,
0.21781179308891296,
0.3130795955657959,
0.016045305877923965,
-0.01317209005355835,
0.6996691226959229,
-0.3577849566936493,
-0.25208479166030884,
-0.3843018412590027,
0.08524024486541748,
-0.11576283723115921,
-0.03563135117292404,
-0.03954818472266197,
-0.07395264506340027,
-0.20387625694274902,
0.06706959009170532,
-0.06422775983810425,
0.05370769649744034,
0.3488618731498718,
-0.003914400935173035,
-0.28240424394607544,
-0.14152297377586365,
0.15407858788967133,
0.3081357181072235,
0.3476104736328125,
-0.03515319153666496,
0.48854368925094604,
0.5338334441184998,
-0.14903590083122253,
0.059582196176052094,
0.17841365933418274,
-0.22162547707557678,
-0.43778377771377563,
-0.08132579177618027,
0.014773018658161163,
-0.049265727400779724,
0.3581000566482544,
-0.07816717028617859,
0.2938525974750519,
0.14422327280044556,
0.1800626516342163,
-0.3618759512901306,
0.40444186329841614,
0.035621605813503265,
0.1583663821220398,
-0.3151862621307373,
-0.20934167504310608,
0.15787455439567566,
0.17535850405693054,
-0.17225506901741028,
0.2838907241821289,
0.124526247382164,
-0.38713449239730835,
0.5428941249847412,
0.02334822714328766,
0.9237949252128601,
-0.12827038764953613,
0.4407537579536438,
-0.11510723829269409,
0.22558003664016724,
0.3634924590587616,
-0.04860050976276398,
0.08744840323925018,
-0.404941201210022,
-0.1300112009048462,
0.023076824843883514,
-0.0399155430495739,
-0.017396289855241776,
-0.000013335607945919037,
-0.09855662286281586,
0.143915057182312,
0.1838550567626953,
0.571631669998169,
-0.1918950378894806,
0.27344566583633423,
-0.07150901108980179,
-0.5054890513420105,
-0.06975656002759933,
0.19212336838245392,
0.15659183263778687,
0.23605608940124512,
0.1379631906747818,
-0.03894127905368805,
0.12008370459079742,
-0.23409125208854675,
-0.03394925594329834,
-0.09086702764034271,
-0.33887043595314026,
0.18488365411758423,
0.297804057598114,
0.12094320356845856,
-0.1709582656621933,
0.07062028348445892,
0.39916542172431946,
0.3387163579463959,
-0.2517756223678589,
0.207905575633049,
-0.01563071459531784,
0.2930510342121124,
-0.009598489850759506,
-0.3933713734149933,
0.2570021152496338,
0.19409146904945374,
0.18822167813777924,
-0.03303913399577141,
0.04484177380800247,
-0.3581799864768982,
-0.20227330923080444,
-0.006132006645202637,
0.1284482777118683,
-0.2747659981250763,
0.021198362112045288,
-0.23769591748714447,
-0.021812815219163895,
-0.2412102073431015,
0.11965271830558777,
0.1591886579990387,
-0.25001251697540283,
0.15153004229068756,
-0.15812644362449646,
-0.0810321718454361,
0.019798822700977325,
0.5449163317680359,
-0.22737917304039001,
-0.22822433710098267,
0.3646010756492615,
-0.24103456735610962,
-0.26261448860168457,
-0.07213769853115082,
-0.01081135869026184,
0.24523776769638062,
-0.3132847249507904,
0.1293032169342041,
-0.0518832802772522,
-0.18252034485340118,
0.0489053837954998,
0.19215922057628632,
0.019312115386128426,
-0.15775959193706512,
-0.026723630726337433,
-0.09769187867641449,
-0.5276300311088562,
0.018198419362306595,
-0.0505962036550045,
0.3864293098449707,
0.39724183082580566,
0.16565577685832977,
-0.5497082471847534,
0.36482688784599304,
-0.320485383272171,
-0.040008414536714554,
-0.10795525461435318,
0.14476025104522705,
-0.07777120918035507,
-0.26267847418785095,
0.3967808485031128,
-0.1636791080236435,
0.1231396496295929,
0.36997586488723755,
-0.24977131187915802,
-0.20338383316993713,
-0.3506840467453003,
0.12708212435245514,
0.08355572819709778,
-0.11032285541296005,
-0.03447309881448746,
0.09421601891517639,
0.06109282001852989,
-0.5194262266159058,
0.35130035877227783,
0.4260113537311554,
-0.04512213543057442,
-0.08762555569410324,
0.26508671045303345,
-0.08608919382095337,
0.09851835668087006,
-0.05533500015735626,
0.10237446427345276,
0.22746418416500092,
0.0049666836857795715,
0.14759349822998047,
-0.5022711753845215,
-0.014994092285633087,
0.40363144874572754,
0.3353247046470642,
0.4642794132232666,
-0.24342410266399384,
0.13242460787296295,
0.09322839975357056,
-0.34578779339790344,
0.42921972274780273,
0.18845729529857635,
0.06361894309520721,
-0.10510538518428802,
-0.2716994881629944,
0.4927898347377777,
0.17234809696674347,
-0.12414467334747314,
-0.29052841663360596,
0.33903026580810547,
-0.20079517364501953,
0.15174809098243713,
0.29225048422813416,
0.09226316213607788,
0.2091294527053833,
0.19858641922473907,
-0.035452455282211304,
0.6133918762207031,
-0.39775392413139343,
0.09316076338291168,
-0.04366152361035347,
-0.08207029849290848,
0.18714918196201324,
0.5932386517524719,
0.2442030906677246,
0.27285197377204895,
0.32553356885910034,
-0.29169607162475586,
0.23457224667072296,
-0.178873211145401,
0.19892753660678864,
-0.18904273211956024,
-0.3698998689651489,
-0.08362376689910889,
0.20348769426345825,
-0.005095809698104858,
0.33779552578926086,
-0.13416850566864014,
0.4863049387931824,
-0.0631631463766098,
-0.09703043103218079,
-0.06598681956529617,
0.521873414516449,
-0.2635238468647003,
-0.4964458644390106,
0.3171987533569336,
0.003063604235649109,
-0.1853603720664978,
0.1363670527935028,
0.0426793172955513,
-0.07093070447444916,
0.20904432237148285,
0.09523729234933853,
0.1853870004415512,
-0.20653031766414642,
-0.25371986627578735,
-0.0936829149723053,
0.3499368727207184,
-0.40947574377059937,
0.09853031486272812,
-0.08351175487041473,
-0.1082221046090126,
-0.006084265187382698,
0.270352303981781,
0.2826871871948242,
0.009074363857507706,
0.038604725152254105,
0.22766192257404327,
-0.1571439802646637,
0.13295197486877441,
-0.3781367540359497,
0.2335197925567627,
-0.07571539282798767,
-0.24580328166484833,
0.05898093059659004,
0.08017369359731674,
-0.18523892760276794,
-0.19518671929836273,
-0.22941721975803375,
0.16442358493804932,
0.01911783590912819,
0.40724673867225647,
0.061587851494550705,
0.10508282482624054,
-0.10571573674678802,
0.1251823753118515,
-0.22553005814552307,
0.003448404371738434,
0.30010032653808594,
0.010017290711402893,
0.17419061064720154,
-0.21042400598526,
0.05970616638660431,
0.1558336615562439,
0.2430671602487564,
0.1810809075832367,
-0.23472842574119568,
-0.47058796882629395,
0.1449056714773178,
-0.4718453586101532,
0.1739342361688614,
0.03145475313067436,
0.17245566844940186,
-0.218718022108078,
0.10718028992414474,
0.03595823049545288,
-0.08275410532951355,
0.007709018886089325,
0.03321889787912369,
0.048705823719501495,
0.06604747474193573,
-0.10685957223176956,
0.32978880405426025,
-0.26888230443000793,
-0.04234635829925537,
0.22247853875160217,
-0.33287355303764343,
0.26545825600624084,
0.040043964982032776,
0.07399621605873108,
-0.07274877279996872,
0.03324645012617111,
0.06587138772010803,
-0.10872802138328552,
0.5503895878791809,
0.15060016512870789,
0.09513672441244125,
-0.06312133371829987,
0.054595768451690674,
-0.10355737805366516,
-0.02949758619070053,
-0.267441064119339,
-0.21596592664718628,
-0.15077629685401917,
0.2418370246887207,
-0.1390487551689148,
-0.17613846063613892,
-0.4475497603416443,
-0.10000841319561005,
0.06402821838855743,
-0.3699486255645752,
-0.12345059216022491,
0.32137206196784973,
-0.1725824773311615,
0.05483151599764824,
0.02061573415994644,
0.5017464756965637,
-0.054100994020700455,
0.3341556787490845,
-0.35086485743522644,
-0.34084421396255493,
0.5392420291900635,
-0.7689493298530579,
-0.12589594721794128,
-0.029276635497808456,
0.12505342066287994,
0.19858524203300476,
-0.283838152885437,
-0.5185224413871765,
0.045897796750068665,
0.1694527119398117,
0.042687587440013885,
-0.4095456004142761,
0.059203941375017166,
0.010426554828882217,
0.001520112156867981,
-0.16013728082180023,
0.4064255356788635,
0.21528209745883942,
-0.19093620777130127,
0.14527633786201477,
0.008638009428977966
] |
https://github.com/huggingface/datasets/issues/6178 | This seems to be related to your environment and not the `datasets` code (e.g., this could happen when exposing the Python 3.9 site packages to a lower Python version (interpreter)) | 'import datasets' throws "invalid syntax error" | ### Describe the bug
Hi,
I have been trying to import the datasets library but I keep gtting this error.
`Traceback (most recent call last):
File /opt/local/jupyterhub/lib64/python3.9/site-packages/IPython/core/interactiveshell.py:3508 in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
Cell In[2], line 1
import datasets
File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/__init__.py:22
from .arrow_dataset import Dataset
File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/arrow_dataset.py:67
from .arrow_writer import ArrowWriter, OptimizedTypedSequence
File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/arrow_writer.py:27
from .features import Features, Image, Value
File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/features/__init__.py:17
from .audio import Audio
File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/features/audio.py:11
from ..download.streaming_download_manager import xopen, xsplitext
File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/download/__init__.py:10
from .streaming_download_manager import StreamingDownloadManager
File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/download/streaming_download_manager.py:18
from aiohttp.client_exceptions import ClientError
File /opt/local/jupyterhub/lib64/python3.9/site-packages/aiohttp/__init__.py:7
from .connector import * # noqa
File /opt/local/jupyterhub/lib64/python3.9/site-packages/aiohttp/connector.py:12
from .client import ClientRequest
File /opt/local/jupyterhub/lib64/python3.9/site-packages/aiohttp/client.py:144
yield from asyncio.async(resp.release(), loop=loop)
^
SyntaxError: invalid syntax`
I have simply used these commands:
`import datasets`
and
`from datasets import load_dataset`
### Environment info
The library has been installed a virtual machine on JupyterHub. Although I have used this library multiple times (on the same VM) before, to train/test an ASR or other ML models, I had never encountered this error. | 30 | 'import datasets' throws "invalid syntax error"
### Describe the bug
Hi,
I have been trying to import the datasets library but I keep gtting this error.
`Traceback (most recent call last):
File /opt/local/jupyterhub/lib64/python3.9/site-packages/IPython/core/interactiveshell.py:3508 in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
Cell In[2], line 1
import datasets
File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/__init__.py:22
from .arrow_dataset import Dataset
File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/arrow_dataset.py:67
from .arrow_writer import ArrowWriter, OptimizedTypedSequence
File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/arrow_writer.py:27
from .features import Features, Image, Value
File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/features/__init__.py:17
from .audio import Audio
File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/features/audio.py:11
from ..download.streaming_download_manager import xopen, xsplitext
File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/download/__init__.py:10
from .streaming_download_manager import StreamingDownloadManager
File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/download/streaming_download_manager.py:18
from aiohttp.client_exceptions import ClientError
File /opt/local/jupyterhub/lib64/python3.9/site-packages/aiohttp/__init__.py:7
from .connector import * # noqa
File /opt/local/jupyterhub/lib64/python3.9/site-packages/aiohttp/connector.py:12
from .client import ClientRequest
File /opt/local/jupyterhub/lib64/python3.9/site-packages/aiohttp/client.py:144
yield from asyncio.async(resp.release(), loop=loop)
^
SyntaxError: invalid syntax`
I have simply used these commands:
`import datasets`
and
`from datasets import load_dataset`
### Environment info
The library has been installed a virtual machine on JupyterHub. Although I have used this library multiple times (on the same VM) before, to train/test an ASR or other ML models, I had never encountered this error.
This seems to be related to your environment and not the `datasets` code (e.g., this could happen when exposing the Python 3.9 site packages to a lower Python version (interpreter)) | [
-0.30676084756851196,
0.12475311756134033,
-0.08762544393539429,
-0.0031121093779802322,
0.21037253737449646,
0.02481812983751297,
0.28338855504989624,
0.35033392906188965,
0.03719150274991989,
-0.23351851105690002,
-0.26056209206581116,
0.2984602451324463,
-0.008803192526102066,
0.25042498111724854,
0.016513261944055557,
-0.16640882194042206,
0.1511252224445343,
0.10893326997756958,
0.0000645127147436142,
0.05819006264209747,
-0.2283868044614792,
0.1817232221364975,
-0.3546437621116638,
0.2671217620372772,
-0.10931652039289474,
-0.191070094704628,
0.030442841351032257,
0.26552537083625793,
-0.4860815405845642,
-0.4623216390609741,
0.08043746650218964,
-0.06340357661247253,
0.3466198742389679,
0.6077053546905518,
-0.00010552348976489156,
-0.008321359753608704,
0.3236660659313202,
-0.042831502854824066,
-0.2760979235172272,
-0.16730229556560516,
-0.3599618673324585,
-0.0801333338022232,
-0.01636233553290367,
-0.22904232144355774,
0.2113959789276123,
-0.17130528390407562,
-0.21654202044010162,
-0.41374483704566956,
0.40509673953056335,
0.5902116894721985,
0.23418974876403809,
0.39407336711883545,
0.3384942412376404,
-0.1784074902534485,
0.03602629154920578,
0.29491230845451355,
0.001689128577709198,
0.32694241404533386,
0.19481462240219116,
-0.10419362783432007,
0.37192004919052124,
0.16140435636043549,
-0.2417340725660324,
0.02808789163827896,
0.2483961582183838,
-0.19168847799301147,
-0.04704822227358818,
-0.2217649519443512,
-0.07194309681653976,
0.12018129229545593,
0.6995599269866943,
-0.5451799631118774,
-0.3537381589412689,
0.008345119655132294,
-0.034058719873428345,
-0.20010972023010254,
0.09431129693984985,
0.18614822626113892,
-0.054341286420822144,
0.18239685893058777,
0.20772784948349,
-0.25842487812042236,
-0.21248725056648254,
0.23708228766918182,
0.09366276860237122,
0.30311888456344604,
-0.10648832470178604,
0.046132683753967285,
0.06221403554081917,
-0.31546980142593384,
0.45538267493247986,
-0.1508723795413971,
-0.0979548841714859,
0.24119539558887482,
-0.1392129510641098,
0.06043234467506409,
0.13816611468791962,
-0.2687532305717468,
-0.14892101287841797,
0.11246193200349808,
0.23291334509849548,
-0.19458350539207458,
-0.2080800086259842,
0.439096599817276,
0.44189730286598206,
-0.011302173137664795,
0.4067498743534088,
0.34214073419570923,
0.21178723871707916,
0.37479424476623535,
0.07693013548851013,
-0.028661182150244713,
-0.08165934681892395,
-0.15425418317317963,
-0.06318382173776627,
-0.03187645599246025,
0.4595728814601898,
-0.20802819728851318,
-0.392367959022522,
-0.026872023940086365,
-0.2210409939289093,
-0.15855953097343445,
0.1273798644542694,
0.14688390493392944,
0.013660494238138199,
-0.0764089897274971,
0.2535755932331085,
0.22264716029167175,
-0.07199549674987793,
-0.3194294273853302,
-0.07988924533128738,
0.46714094281196594,
-0.17635926604270935,
-0.18694734573364258,
0.010368697345256805,
-0.20782095193862915,
0.1782131791114807,
0.0012733116745948792,
0.19769129157066345,
-0.17165374755859375,
0.07860371470451355,
-0.12305153906345367,
-0.08822768181562424,
0.1545698046684265,
0.0073253437876701355,
0.01946990191936493,
0.18378660082817078,
-0.34325432777404785,
-0.07134471833705902,
0.08605742454528809,
-0.27742570638656616,
-0.19571346044540405,
-0.40036606788635254,
0.21457014977931976,
-0.19865381717681885,
-0.131160706281662,
-0.4058244526386261,
-0.11143329739570618,
0.0583454854786396,
-0.32143425941467285,
-0.12369422614574432,
-0.3558276891708374,
0.20295867323875427,
-0.14533954858779907,
0.12841585278511047,
0.3757300078868866,
-0.6353613138198853,
-0.10826325416564941,
-0.3806859254837036,
-0.14666785299777985,
0.006204910576343536,
0.3445892333984375,
-0.20114971697330475,
0.2642926573753357,
-0.09453251957893372,
0.23451459407806396,
0.44558006525039673,
-0.3799397647380829,
-0.15134675800800323,
-0.02298363298177719,
0.10556240379810333,
-0.042136214673519135,
-0.07917717099189758,
-0.006600033491849899,
0.10808242112398148,
-0.13141001760959625,
0.09160099923610687,
0.46829545497894287,
0.12814153730869293,
-0.16256415843963623,
-0.12806367874145508,
-0.038944751024246216,
0.1835174709558487,
0.21549376845359802,
-0.13396665453910828,
-0.2693575620651245,
0.2450624704360962,
0.150865837931633,
0.20341354608535767,
0.0468018613755703,
-0.194362610578537,
0.24408608675003052,
0.14598430693149567,
0.1837124526500702,
-0.09766960144042969,
-0.24395956099033356,
-0.14243771135807037,
-0.02628355473279953,
-0.004152730107307434,
0.05148886516690254,
-0.19583724439144135,
-0.013152211904525757,
-0.37304943799972534,
0.1765463948249817,
-0.21324482560157776,
0.06314940005540848,
0.21197739243507385,
0.0489286370575428,
-0.147452250123024,
0.024466246366500854,
-0.15767009556293488,
0.09420588612556458,
0.1683569699525833,
0.21466347575187683,
-0.43162769079208374,
0.2822582721710205,
-0.28632840514183044,
-0.19367027282714844,
0.16425803303718567,
0.11737002432346344,
0.1851879358291626,
-0.01625601202249527,
-0.2490784376859665,
0.3119388520717621,
0.17714539170265198,
-0.006312381476163864,
-0.1863323301076889,
-0.18461592495441437,
-0.014774495735764503,
-0.20900215208530426,
0.16449686884880066,
0.3924154043197632,
0.256930947303772,
-0.08676937967538834,
-0.14155787229537964,
0.1345362514257431,
0.03637280687689781,
0.09618811309337616,
0.016696512699127197,
0.20491823554039001,
0.1903626024723053,
0.20545092225074768,
-0.00922994315624237,
-0.305417537689209,
0.22413712739944458,
0.07482568174600601,
-0.18952913582324982,
-0.06769092381000519,
-0.044327616691589355,
-0.19830605387687683,
0.340468168258667,
0.05743858218193054,
0.14106182754039764,
-0.13230735063552856,
-0.13839751482009888,
0.06943783909082413,
0.29134371876716614,
0.10184206813573837,
0.4214949607849121,
0.14353612065315247,
-0.2349284440279007,
-0.018598057329654694,
0.024349059909582138,
-0.09903939068317413,
0.28107139468193054,
0.2790372669696808,
0.1927146017551422,
-0.17137208580970764,
0.08591391146183014,
0.043097250163555145,
-0.1281694769859314,
-0.4319801926612854,
-0.07825803756713867,
0.18439103662967682,
-0.460637629032135,
0.2093604952096939,
-0.42282116413116455,
-0.6004534363746643,
-0.14356687664985657,
-0.2760341167449951,
-0.19623740017414093,
-0.35024622082710266,
-0.22630715370178223,
0.15424996614456177,
-0.15045210719108582,
0.04130127280950546,
-0.0291127972304821,
-0.1654129922389984,
0.045104824006557465,
-0.306140273809433,
0.1024729534983635,
-0.16106513142585754,
-0.0004195459187030792,
0.1120491623878479,
0.5138974189758301,
0.288654625415802,
0.3864716589450836,
0.010880440473556519,
0.16470405459403992,
-0.1868649572134018,
-0.2377488911151886,
-0.01786288619041443,
-0.08076281100511551,
0.27422475814819336,
0.1945311576128006,
0.1449267566204071,
0.0545787513256073,
-0.2957977056503296,
0.3607388436794281,
0.06042339652776718,
-0.01486629992723465,
0.15254123508930206,
0.0983397513628006,
-0.3210643529891968,
-0.02886790782213211,
-0.27443957328796387,
-0.37069979310035706,
-0.4788922369480133,
0.09743396937847137,
0.341681569814682,
0.2136906534433365,
0.2512924373149872,
0.07190334796905518,
0.2600911259651184,
0.06514428555965424,
0.0148300901055336,
0.1044626533985138,
-0.14636045694351196,
0.3620641827583313,
-0.2897762060165405,
-0.23280777037143707,
0.0726194977760315,
0.12107563018798828,
0.20559833943843842,
-0.2719621956348419,
-0.11247598379850388,
-0.022979963570833206,
-0.2149946391582489,
0.2746610641479492,
-0.14969006180763245,
0.12461746484041214,
0.04609604924917221,
0.08467169106006622,
0.015062451362609863,
-0.2182593196630478,
-0.2872385084629059,
0.08738791942596436,
0.12541566789150238,
0.15270954370498657,
0.07093305140733719,
0.30448561906814575,
-0.05665992945432663,
0.23019777238368988,
0.25542789697647095,
-0.07494840025901794,
0.4651621878147125,
0.06836098432540894,
0.2904691994190216,
-0.2515217661857605,
-0.4146275520324707,
0.10967898368835449,
-0.12638680636882782,
0.09425726532936096,
-0.08929730951786041,
-0.1483386605978012,
0.043144382536411285,
-0.34851354360580444,
-0.18139302730560303,
-0.08019482344388962,
-0.16379991173744202,
-0.05558249354362488,
-0.15408921241760254,
0.003022601827979088,
0.12849798798561096,
0.02750071883201599,
-0.11461081355810165,
0.03225300833582878,
0.12852945923805237,
0.17603503167629242,
-0.0809146985411644,
0.3202585279941559,
-0.17501476407051086,
-0.17866423726081848,
0.009046824648976326,
0.38681548833847046,
0.10742532461881638,
0.31081706285476685,
0.02963702380657196,
0.11531458795070648,
-0.10253875702619553,
0.17359724640846252,
0.12415473163127899,
-0.2458646595478058,
-0.14353522658348083,
0.38333427906036377,
0.364662230014801,
-0.43238937854766846,
-0.18485809862613678,
-0.32695627212524414,
0.2785242795944214,
0.39398467540740967,
-0.12856155633926392,
-0.18284916877746582,
0.004881821572780609,
0.24937739968299866,
0.32183733582496643,
-0.023412853479385376,
-0.23643742501735687,
-0.21087180078029633,
-0.31478267908096313,
-0.4983123242855072,
-0.1405562162399292,
0.2721608877182007,
0.2669893503189087,
0.3707694709300995,
0.1418893188238144,
0.04205114394426346,
-0.02328953891992569,
0.15943734347820282,
0.12437427043914795,
0.3173225224018097,
-0.14798325300216675,
0.10598663985729218,
-0.15123902261257172,
-0.0498821996152401,
0.7001078724861145,
0.690582275390625,
-0.11256136000156403,
-0.5183261036872864,
-0.41343754529953003,
-0.12994398176670074,
0.19997821748256683,
-0.176205575466156,
-0.04752544313669205,
0.2072579711675644,
-0.13526639342308044,
0.07598338276147842,
0.2539277970790863,
0.04024118557572365,
0.28705620765686035,
0.19246725738048553,
-0.3317273259162903,
-0.42523831129074097,
0.2627999186515808,
-0.048963986337184906,
0.09843342006206512,
0.4187209904193878,
0.15648415684700012,
-0.16505664587020874,
0.07232655584812164,
-0.004712212830781937,
0.6076228618621826,
0.19838973879814148,
-0.07738223671913147,
0.3914807140827179,
-0.283206969499588,
0.5208712220191956,
0.11761132627725601,
-0.09068363904953003,
-0.2301003634929657,
-0.11551789939403534,
0.022191710770130157,
-0.19219747185707092,
0.32830938696861267,
-0.09945429861545563,
-0.38729801774024963,
0.3305596709251404,
-0.46193739771842957,
0.11983773112297058,
0.16224586963653564,
0.27735787630081177,
0.07112053781747818,
-0.10822071135044098,
-0.41779908537864685,
0.1851554811000824,
-0.34959718585014343,
0.10490214079618454,
-0.07856139540672302,
-0.29948753118515015,
-0.039215631783008575,
-0.19882892072200775,
-0.31750261783599854,
0.1584923416376114,
-0.2480320781469345,
0.3904189169406891,
0.13802190124988556,
0.05056889355182648,
0.4076550006866455,
0.08774193376302719,
0.1105523407459259,
0.18762564659118652,
-0.12412212044000626,
-0.07494588941335678,
0.14159700274467468,
-0.18015111982822418,
-0.0489116832613945,
0.06964825838804245,
0.556323230266571,
-0.1894741952419281,
-0.19325634837150574,
0.20057988166809082,
-0.13998132944107056,
-0.04574941471219063,
0.022386640310287476,
0.24015964567661285,
0.2915762960910797,
-0.22244277596473694,
-0.33169564604759216,
-0.11151197552680969,
-0.07820522785186768,
-0.21330450475215912,
0.14807870984077454,
0.1925087720155716,
0.020719580352306366,
0.23405222594738007,
-0.17203731834888458,
-0.023802444338798523,
-0.02284352481365204,
0.07035471498966217,
-0.1447199583053589,
-0.012053631246089935,
0.4522285759449005,
0.29859521985054016,
-0.241106778383255,
-0.20534375309944153,
0.270804762840271,
0.0870758667588234,
-0.22822603583335876,
0.2414780855178833,
-0.055681969970464706,
0.052046194672584534,
-0.1413692981004715,
-0.0560319758951664,
0.05881424620747566,
0.053219251334667206,
-0.03387027606368065,
-0.40148016810417175,
-0.049229055643081665,
0.14667785167694092,
-0.17610770463943481,
-0.16130763292312622,
0.0885908380150795,
0.4267193675041199,
0.3079657554626465,
-0.11603854596614838,
-0.3278478980064392,
0.09717778116464615,
0.04251205921173096,
0.20699253678321838,
0.39676639437675476,
0.1340862512588501,
-0.10962532460689545,
-0.2368493676185608,
0.07911211252212524,
-0.05117218196392059,
-0.056665174663066864,
-0.224263533949852,
-0.26228320598602295,
0.07534053921699524,
0.2116089165210724,
-0.22335100173950195,
0.16531985998153687,
-0.2009073942899704,
-0.14155298471450806,
-0.13404980301856995,
-0.22811059653759003,
0.16194844245910645,
-0.09117618203163147,
0.1804177612066269,
0.16618099808692932,
-0.21769918501377106,
0.00528360903263092,
0.18080061674118042,
-0.05036476254463196,
0.020934222266077995,
-0.09527525305747986,
0.24480712413787842,
0.10415174812078476,
-0.17879809439182281,
-0.25612980127334595,
0.02963389828801155,
-0.18351233005523682,
0.24028067290782928,
0.18473780155181885,
-0.4357425570487976,
0.06942985206842422,
-0.07860957831144333,
0.33055558800697327,
0.6633220314979553,
-0.2656286358833313,
0.16823013126850128,
0.1338922083377838,
0.1811358630657196,
-0.3703337609767914,
-0.28195440769195557,
0.07050196826457977,
0.02877924218773842,
-0.11402053385972977,
0.15891297161579132,
-0.20018160343170166,
-0.02065686136484146,
0.13922907412052155,
0.035158440470695496,
0.15672162175178528,
0.024627242237329483,
0.37776538729667664,
0.45540061593055725,
-0.1291269063949585,
-0.009092079475522041,
0.08242733776569366,
0.13045133650302887,
0.19057334959506989,
0.3862469792366028,
-0.36694711446762085,
-0.09341125190258026,
0.4431280493736267,
-0.2512008845806122,
0.16356360912322998,
-0.2776479125022888,
-0.2835121154785156,
0.026022151112556458,
0.2053075134754181,
0.11955035477876663,
0.13829202950000763,
0.39909565448760986,
-0.2018982172012329,
-0.09412430971860886,
0.10602676868438721,
0.07225684821605682,
0.04416298493742943,
0.25492969155311584,
-0.08055003732442856,
0.04043568670749664,
-0.24378983676433563,
-0.2509901225566864,
0.03434929996728897,
-0.04954759404063225,
-0.12438492476940155,
-0.0024730563163757324,
-0.02369271218776703,
-0.6203146576881409,
0.1787518858909607,
0.1858312338590622,
-0.08707974851131439,
-0.4168287217617035,
0.13479860126972198,
0.3197535574436188,
-0.09191884100437164,
-0.039718177169561386,
0.12784186005592346,
0.7637622356414795,
0.4461698532104492,
0.0838606208562851,
0.03501254692673683,
-0.14535585045814514,
-0.18299070000648499,
0.31005364656448364,
-0.07904526591300964,
0.016849033534526825,
0.15835025906562805,
0.5501791834831238,
0.18082869052886963,
-0.1620989292860031,
-0.03173961490392685,
0.18873590230941772,
0.1145942211151123,
-0.24262559413909912,
0.20468878746032715,
-0.28231626749038696,
-0.1610705852508545,
-0.26274216175079346,
0.022112367674708366,
-0.34264689683914185,
-0.03910137340426445,
0.3811855614185333,
0.06501162052154541,
-0.008207913488149643,
-0.15866181254386902,
0.09312812983989716,
0.028235383331775665,
0.4817964434623718,
0.28808408975601196,
0.35380998253822327,
-0.227080300450325,
-0.008235961198806763,
-0.616480827331543,
-0.06915736943483353,
-0.12748566269874573,
-0.35718172788619995,
0.12972213327884674,
-0.10433251410722733,
0.14742618799209595,
0.2683214545249939,
0.3348817825317383,
0.14586640894412994,
-0.10744862258434296,
-0.1826116293668747,
-0.3843812942504883,
-0.19712407886981964,
0.3193660378456116,
-0.05904078483581543,
0.15569958090782166,
-0.28573596477508545,
0.22560514509677887,
-0.4328960180282593,
0.09857182204723358,
-0.23618969321250916,
-0.18575289845466614,
0.09534714370965958,
0.17344869673252106,
0.2503281235694885,
0.14042629301548004,
0.4723696708679199,
0.06479759514331818,
-0.07334382832050323,
-0.14333322644233704,
-0.2284201681613922,
-0.35833173990249634,
0.5484002232551575,
0.10890007019042969,
0.5969900488853455,
-0.2964627742767334,
-0.1754281371831894,
-0.29358091950416565,
0.44613611698150635,
-0.19168898463249207,
-0.0019095391035079956,
-0.25254756212234497,
-0.034324027597904205,
-0.09652601927518845,
0.2611951529979706,
0.0033790692687034607,
-0.23667693138122559,
-0.21861609816551208,
0.35273489356040955,
-0.4093705117702484,
-0.480587899684906,
0.6123524308204651,
-0.02998928166925907,
-0.4099229574203491,
0.06923779100179672,
0.1602773517370224,
0.1489013284444809,
-0.23754678666591644,
-0.4648871123790741,
0.01364627480506897,
0.3370606005191803,
-0.0033795852214097977,
-0.3065543472766876,
0.2266024649143219,
-0.15605579316616058,
0.11696940660476685,
0.06691551208496094,
0.12253382802009583,
0.05950438231229782,
-0.29633763432502747,
0.11477385461330414,
-0.07415266335010529
] |
https://github.com/huggingface/datasets/issues/6176 | Hi! Can you share the error this reproducer throws in your environment? `streaming=True` streams the dataset as it's iterated over without creating a memory-map file. | how to limit the size of memory mapped file? | ### Describe the bug
Huggingface datasets use memory-mapped file to map large datasets in memory for fast access.
However, it seems like huggingface will occupy all the memory for memory-mapped files, which makes a troublesome situation since we cluster will distribute a small portion of memory to me (once it's over the limit, memory cannot be allocated), however, when the dataset checks the total memory, all of the memory will be taken into account which makes huggingface dataset try to allocate more memory than allowed.
So is there a way to explicitly limit the size of memory mapped file?
### Steps to reproduce the bug
python
>>> from datasets import load_dataset
>>> dataset = load_dataset("c4", "en", streaming=True)
### Expected behavior
In a normal environment, this will not have any problem.
However, when the system allocates a portion of the memory to the program and when the dataset checks the total memory, all of the memory will be taken into account which makes huggingface dataset try to allocate more memory than allowed.
### Environment info
linux cluster with SGE(Sun Grid Engine) | 25 | how to limit the size of memory mapped file?
### Describe the bug
Huggingface datasets use memory-mapped file to map large datasets in memory for fast access.
However, it seems like huggingface will occupy all the memory for memory-mapped files, which makes a troublesome situation since we cluster will distribute a small portion of memory to me (once it's over the limit, memory cannot be allocated), however, when the dataset checks the total memory, all of the memory will be taken into account which makes huggingface dataset try to allocate more memory than allowed.
So is there a way to explicitly limit the size of memory mapped file?
### Steps to reproduce the bug
python
>>> from datasets import load_dataset
>>> dataset = load_dataset("c4", "en", streaming=True)
### Expected behavior
In a normal environment, this will not have any problem.
However, when the system allocates a portion of the memory to the program and when the dataset checks the total memory, all of the memory will be taken into account which makes huggingface dataset try to allocate more memory than allowed.
### Environment info
linux cluster with SGE(Sun Grid Engine)
Hi! Can you share the error this reproducer throws in your environment? `streaming=True` streams the dataset as it's iterated over without creating a memory-map file. | [
-0.07280738651752472,
-0.7916353940963745,
0.008368667215108871,
0.36151984333992004,
0.2634913921356201,
-0.1046992689371109,
-0.13469454646110535,
0.15848267078399658,
0.4648273289203644,
0.27010637521743774,
-0.009281422942876816,
-0.15144601464271545,
-0.2643619179725647,
0.13532045483589172,
0.26024696230888367,
-0.20371808111667633,
-0.011640828102827072,
-0.19275474548339844,
-0.5199363231658936,
0.1229436993598938,
-0.16473859548568726,
0.15811674296855927,
0.1545591652393341,
-0.09463992714881897,
-0.2901291847229004,
-0.0718848928809166,
0.19585809111595154,
0.06976784765720367,
-0.22762441635131836,
-0.2308666706085205,
0.16954658925533295,
-0.2203049659729004,
-0.09227923303842545,
0.40347909927368164,
-0.00012052418605890125,
-0.2583998143672943,
0.07301051914691925,
-0.07406295835971832,
0.07657146453857422,
0.31912463903427124,
-0.10361666977405548,
-0.12521377205848694,
-0.035652387887239456,
-0.21157751977443695,
0.06980276107788086,
-0.08282911777496338,
0.09770242869853973,
-0.4694449007511139,
0.4474460482597351,
0.0958290845155716,
0.11753018945455551,
0.09433826804161072,
0.16421853005886078,
0.08529160916805267,
0.09885035455226898,
0.0742756575345993,
0.026956304907798767,
0.5224827527999878,
0.243929922580719,
-0.1511976420879364,
-0.20546770095825195,
0.07252337038516998,
-0.024913959205150604,
-0.0584949366748333,
0.6338702440261841,
-0.1726243644952774,
-0.4006562829017639,
-0.3192718029022217,
0.2583862841129303,
0.40526703000068665,
0.27895429730415344,
-0.3693479001522064,
-0.05689278244972229,
-0.39950212836265564,
-0.01685534231364727,
0.09787070751190186,
0.2973569333553314,
0.2914539873600006,
-0.3848147690296173,
0.0981631800532341,
-0.5379770994186401,
-0.34293705224990845,
-0.17358499765396118,
-0.04106643423438072,
0.07326052337884903,
0.12233592569828033,
-0.13849352300167084,
0.1558004766702652,
0.3161792755126953,
-0.11957786977291107,
-0.3818954527378082,
0.11557462811470032,
-0.34082454442977905,
0.4712224304676056,
-0.25995534658432007,
-0.03404184430837631,
-0.23673775792121887,
0.37001746892929077,
0.7831326723098755,
-0.1077909991145134,
0.24933530390262604,
-0.10263669490814209,
0.17417776584625244,
-0.018069619312882423,
0.3953968286514282,
0.30170202255249023,
-0.3511313199996948,
0.20659448206424713,
0.2986754775047302,
0.3430019021034241,
0.16445064544677734,
0.014017883688211441,
0.16166430711746216,
-0.3101697564125061,
0.16162818670272827,
-0.3752918541431427,
0.07219153642654419,
-0.07700086385011673,
0.15928396582603455,
0.25496038794517517,
0.09000375866889954,
0.18000802397727966,
0.22790467739105225,
0.23406007885932922,
-0.026292238384485245,
-0.17173081636428833,
-0.14415636658668518,
-0.1151927262544632,
-0.1785886585712433,
-0.05475336313247681,
-0.1672949194908142,
0.0203733928501606,
-0.1931813657283783,
0.10129854828119278,
0.19281791150569916,
-0.1939566433429718,
0.2089630663394928,
0.024510294198989868,
0.01218319870531559,
-0.30159449577331543,
-0.15115801990032196,
-0.303501695394516,
0.22247052192687988,
0.283430814743042,
-0.30036231875419617,
0.1449103057384491,
-0.033733539283275604,
0.20352032780647278,
-0.259088397026062,
0.0800132006406784,
-0.23380210995674133,
-0.23369529843330383,
0.20965251326560974,
0.03997378796339035,
-0.12169653177261353,
0.43871358036994934,
-0.5711165070533752,
0.19653990864753723,
0.2414623498916626,
-0.2753531336784363,
0.3461478650569916,
-0.02950242906808853,
-0.49777209758758545,
-0.21559694409370422,
0.4206200838088989,
0.5220910310745239,
-0.03322102129459381,
-0.18411841988563538,
0.12621232867240906,
-0.24636587500572205,
0.11254076659679413,
0.6930562853813171,
-0.043911319226026535,
-0.05337638407945633,
-0.5338597297668457,
0.08689971268177032,
-0.24227818846702576,
-0.0662350207567215,
-0.639096200466156,
0.46738067269325256,
-0.3176889419555664,
0.29331353306770325,
0.1908387541770935,
0.22324249148368835,
0.1606791615486145,
0.02655140683054924,
0.027283474802970886,
0.2535172402858734,
-0.021663596853613853,
0.24569416046142578,
-0.20445147156715393,
-0.1445481777191162,
-0.07919923216104507,
-0.3584652245044708,
-0.08284476399421692,
-0.022504862397909164,
0.2144877165555954,
0.3129878640174866,
0.2533585727214813,
0.051825784146785736,
0.42321985960006714,
0.44926923513412476,
0.18263423442840576,
-0.17600266635417938,
-0.038496728986501694,
-0.4400613605976105,
-0.32149824500083923,
0.18220651149749756,
-0.3182034492492676,
-0.3288175165653229,
0.00532657653093338,
-0.30124974250793457,
-0.1725195050239563,
0.128214493393898,
0.342278391122818,
-0.09472046792507172,
-0.0812874585390091,
-0.4163186252117157,
0.186504065990448,
0.09986117482185364,
-0.0005437508225440979,
0.46575719118118286,
-0.31283506751060486,
0.07597503811120987,
-0.058502886444330215,
-0.13738805055618286,
0.15815286338329315,
-0.10485506057739258,
0.1006384864449501,
0.034412190318107605,
-0.04402467980980873,
0.07589709013700485,
-0.1913052350282669,
0.4388507604598999,
0.060912441462278366,
0.24477404356002808,
-0.1302608698606491,
0.20270749926567078,
0.20223122835159302,
-0.07633721083402634,
0.07696983963251114,
-0.07687699049711227,
0.02637442573904991,
-0.09921851754188538,
-0.05383319407701492,
-0.044096432626247406,
-0.14291799068450928,
0.10179369151592255,
0.13565915822982788,
-0.06703803688287735,
-0.1253734678030014,
0.05080647021532059,
-0.02999703213572502,
-0.17254595458507538,
0.1333533525466919,
0.06695950031280518,
0.2734961211681366,
0.33300355076789856,
-0.27647221088409424,
-0.37689924240112305,
0.3885851502418518,
0.0017889589071273804,
0.1407996416091919,
0.3289012312889099,
-0.2812806963920593,
-0.027681078761816025,
0.266844779253006,
0.20503246784210205,
0.2511802017688751,
0.15097123384475708,
0.41807621717453003,
0.08855532109737396,
0.14597880840301514,
-0.03791409730911255,
0.15828418731689453,
0.10385516285896301,
-0.02754993550479412,
0.17711195349693298,
0.017572924494743347,
-0.20731762051582336,
-0.10268876701593399,
0.22250165045261383,
-0.18515890836715698,
-0.00455518439412117,
-0.27621757984161377,
-0.15102910995483398,
-0.0765191987156868,
-0.3760792016983032,
-0.25186920166015625,
0.32356151938438416,
-0.4945527911186218,
0.12550047039985657,
-0.018167298287153244,
0.3634212017059326,
0.017192944884300232,
-0.13429903984069824,
0.11629697680473328,
0.31879347562789917,
0.10442537814378738,
-0.025224553421139717,
-0.1481093466281891,
0.16282880306243896,
-0.06978758424520493,
-0.03936991095542908,
0.2811540365219116,
-0.0977790430188179,
0.2330692857503891,
0.3262121081352234,
-0.23175780475139618,
-0.3241487741470337,
-0.0393693670630455,
0.061304472386837006,
-0.11841580271720886,
0.37151971459388733,
0.1533711850643158,
0.4417728781700134,
-0.18842682242393494,
0.09054706990718842,
-0.23851872980594635,
-0.3119778037071228,
-0.17700296640396118,
0.011985667049884796,
0.02730972319841385,
0.25066009163856506,
-0.2005520761013031,
0.05236615240573883,
-0.07338443398475647,
-0.41688042879104614,
0.7586163878440857,
-0.16217264533042908,
0.19953098893165588,
0.18599183857440948,
0.2659446597099304,
-0.03528478369116783,
-0.20744386315345764,
-0.040342703461647034,
0.0032908543944358826,
-0.41202789545059204,
0.314279705286026,
-0.09192956238985062,
-0.35928356647491455,
0.18318814039230347,
0.1940152943134308,
0.11571076512336731,
0.3053302764892578,
-0.4143243432044983,
-0.034754469990730286,
-0.28533393144607544,
-0.0938127413392067,
-0.19163820147514343,
0.060341641306877136,
0.15885375440120697,
-0.17071373760700226,
0.04447610676288605,
0.10278808325529099,
0.09588177502155304,
0.27087682485580444,
-0.02110341005027294,
0.06358715891838074,
0.33753785490989685,
0.30193325877189636,
0.33434468507766724,
0.3178230822086334,
0.4601282477378845,
0.5318067073822021,
0.3051797151565552,
0.026816653087735176,
0.3298361301422119,
-0.25962409377098083,
0.07957290858030319,
0.3194858133792877,
-0.13731476664543152,
-0.23168088495731354,
0.19741082191467285,
0.23629499971866608,
0.2020687609910965,
0.24608170986175537,
-0.39348194003105164,
0.3361518681049347,
-0.12262706458568573,
0.18038402497768402,
0.2886083424091339,
0.2645031809806824,
-0.2065386027097702,
-0.2190549075603485,
-0.06423387676477432,
-0.33049288392066956,
0.0017647519707679749,
0.10427776724100113,
0.16029022634029388,
0.43211638927459717,
-0.46041372418403625,
-0.01664646714925766,
-0.551880419254303,
-0.04318378120660782,
0.06308509409427643,
0.044485338032245636,
-0.32766592502593994,
0.018434517085552216,
0.2050243616104126,
0.21187248826026917,
0.6451989412307739,
0.21959726512432098,
0.2237437218427658,
-0.46455976366996765,
0.03462985157966614,
-0.34481900930404663,
0.22281865775585175,
0.20885935425758362,
0.19819656014442444,
0.12261075526475906,
0.33913108706474304,
-0.1784524917602539,
-0.0006367415189743042,
-0.0866730585694313,
0.19349145889282227,
-0.0773506835103035,
0.015970375388860703,
-0.12092109769582748,
-0.1615813970565796,
0.03465275466442108,
0.22384050488471985,
0.5183306932449341,
-0.022654445841908455,
0.20031914114952087,
-0.10567416250705719,
0.07721325755119324,
0.024124324321746826,
-0.052239879965782166,
-0.10459599643945694,
0.44088178873062134,
0.021721582859754562,
0.15882998704910278,
0.2607901394367218,
0.013820554129779339,
0.13560855388641357,
0.5974034070968628,
-0.0036793090403079987,
0.16297776997089386,
-0.06766641139984131,
0.08683602511882782,
0.2177141159772873,
0.4038344621658325,
-0.16993163526058197,
0.09978494048118591,
0.3897772431373596,
0.2300996333360672,
-0.5375657677650452,
0.07471846789121628,
0.0665799155831337,
0.2154758721590042,
-0.3884463310241699,
-0.5072078108787537,
0.21169275045394897,
0.2623552680015564,
-0.08614553511142731,
0.39825892448425293,
0.22702257335186005,
-0.4984166920185089,
0.05323303863406181,
0.0038993656635284424,
0.8958552479743958,
-0.34798723459243774,
0.15857800841331482,
-0.12371838092803955,
-0.12114419788122177,
0.20402826368808746,
-0.276294469833374,
0.07581128925085068,
-0.06391789019107819,
-0.37110093235969543,
0.028700977563858032,
-0.04985567927360535,
0.18262414634227753,
0.01207884680479765,
-0.005511634051799774,
0.14058732986450195,
0.06245146691799164,
0.07299800217151642,
-0.2586956024169922,
0.27613040804862976,
-0.2828705310821533,
-0.2848227024078369,
-0.010079517960548401,
0.04511711001396179,
-0.4715590476989746,
-0.024337206035852432,
0.19579514861106873,
-0.05220988020300865,
-0.05695637688040733,
-0.32111048698425293,
-0.3016163110733032,
-0.2352447658777237,
-0.5284726023674011,
-0.2205028235912323,
-0.12176045030355453,
0.0328068733215332,
0.16278550028800964,
0.4967253804206848,
-0.24422070384025574,
0.38535672426223755,
-0.25822943449020386,
0.10069062560796738,
-0.21374215185642242,
0.018499039113521576,
-0.20552963018417358,
0.29223713278770447,
0.002833126112818718,
0.0735398605465889,
-0.06318347901105881,
0.15887169539928436,
-0.005686454474925995,
-0.1471361517906189,
-0.2924486994743347,
0.04313109070062637,
-0.23448167741298676,
-0.19316735863685608,
-0.3312934935092926,
-0.30757439136505127,
0.01857703924179077,
0.0422273725271225,
0.025184329599142075,
-0.09666785597801208,
-0.02269825153052807,
0.03828588128089905,
0.0939067006111145,
-0.27275025844573975,
-0.18644961714744568,
0.7587851285934448,
-0.005418422631919384,
0.006464697420597076,
0.2946016490459442,
-0.05507191643118858,
-0.12238967418670654,
-0.14053699374198914,
-0.09609784185886383,
0.3268279731273651,
-0.13513174653053284,
-0.014385182410478592,
-0.06697060912847519,
-0.007428064942359924,
-0.2547757923603058,
-0.02430068328976631,
0.49042776226997375,
-0.16173942387104034,
0.03301501274108887,
0.010992392897605896,
-0.6698437333106995,
0.21428444981575012,
-0.17143641412258148,
0.3107176721096039,
0.031727515161037445,
-0.20011386275291443,
0.07174582779407501,
0.35829293727874756,
-0.16253527998924255,
-0.1630149483680725,
-0.09725365042686462,
-0.30007293820381165,
0.3034449815750122,
0.1805238574743271,
0.2925541400909424,
-0.28347375988960266,
-0.055740710347890854,
0.18191999197006226,
-0.2661072313785553,
-0.09081006050109863,
-0.05992509052157402,
0.14830374717712402,
-0.0026598162949085236,
-0.22841402888298035,
-0.11978089809417725,
-0.568093478679657,
0.10377375781536102,
-0.39868471026420593,
0.41261643171310425,
0.44190895557403564,
0.03681933134794235,
-0.05946946516633034,
0.2085215151309967,
-0.10037921369075775,
0.16811275482177734,
0.10523617267608643,
0.08527342975139618,
0.06946811825037003,
0.10825909674167633,
0.08267335593700409,
0.21599869430065155,
-0.08734428882598877,
-0.11720985174179077,
0.1484404057264328,
0.11536119133234024,
-0.06856183707714081,
0.013495488092303276,
0.12157687544822693,
-0.16674041748046875,
0.20233342051506042,
0.34534329175949097,
0.09248405694961548,
-0.22697696089744568,
0.060741543769836426,
0.160788893699646,
0.03393738716840744,
0.027478523552417755,
-0.23539400100708008,
0.39497703313827515,
-0.10954505205154419,
0.042526498436927795,
0.3508443534374237,
0.3244170844554901,
-0.24290406703948975,
-0.3390923738479614,
0.0667743980884552,
0.37901535630226135,
-0.07537691295146942,
0.005102507770061493,
0.029094872996211052,
0.25166839361190796,
-0.13218018412590027,
0.10411730408668518,
0.4688364863395691,
0.475838840007782,
0.45425543189048767,
0.004639877006411552,
0.07848040759563446,
-0.17345809936523438,
0.26826009154319763,
-0.0040833838284015656,
-0.5793989300727844,
-0.38066068291664124,
0.22096577286720276,
-0.3791944682598114,
0.4367382526397705,
-0.10444417595863342,
0.3939036726951599,
0.017288360744714737,
-0.40643778443336487,
0.09381669759750366,
-0.07612000405788422,
-0.18683753907680511,
-0.1409607082605362,
0.05695149302482605,
-0.05990642309188843,
0.012120738625526428,
0.09050263464450836,
0.16722974181175232,
-0.3304172158241272,
0.6853541731834412,
-0.001369347795844078,
-0.05152876302599907,
0.19922895729541779,
-0.14100582897663116,
0.12195493280887604,
0.06618887186050415,
-0.3983553647994995,
0.22505928575992584,
-0.16011115908622742,
0.09125921130180359,
0.08130837976932526,
0.2281966507434845,
0.08206094801425934,
0.1284269392490387,
0.31064572930336,
0.24155884981155396,
0.17219705879688263,
0.02005589008331299,
-0.07802042365074158,
0.10948464274406433,
-0.006597410887479782,
0.043277204036712646,
0.10120978951454163,
0.003771994262933731,
0.02473585680127144,
0.0884464830160141,
-0.1403532773256302,
0.20167849957942963,
-0.31999844312667847,
-0.18419110774993896,
-0.22448042035102844,
-0.19517287611961365,
-0.08365216851234436,
-0.1048688217997551,
-0.48442041873931885,
0.20238634943962097,
0.2597929835319519,
-0.12366470694541931,
0.1028432548046112,
-0.09022532403469086,
0.0011752806603908539,
0.0008298046886920929,
0.30242446064949036,
0.15933987498283386,
-0.055354904383420944,
-0.12028054893016815,
-0.23692859709262848,
-0.2768365144729614,
-0.0011311545968055725,
-0.46976184844970703,
-0.13590110838413239,
0.07269465923309326,
-0.13242176175117493,
-0.35023581981658936,
-0.33028966188430786,
0.13528090715408325,
-0.3136482536792755,
-0.22679033875465393,
0.26382172107696533,
0.05429064482450485,
-0.5138797760009766,
-0.09060055762529373,
0.15306426584720612,
0.16907840967178345,
-0.19653403759002686,
0.45951002836227417,
-0.1383001059293747,
-0.05417979508638382,
-0.03216908127069473,
0.42938345670700073,
-0.0856536254286766,
0.012161566875874996,
0.26274996995925903,
0.10749243944883347,
0.2502608895301819,
-0.02340656891465187,
-0.02457170933485031,
-0.40139681100845337,
0.11491250991821289,
-0.23600302636623383,
-0.06399250030517578,
-0.07588239014148712,
0.3167775869369507,
-0.45794081687927246,
-0.5335578918457031,
-0.19769005477428436,
0.27586987614631653,
-0.08647507429122925,
0.04961645230650902,
-0.019299469888210297,
-0.1018875390291214,
-0.04630303010344505,
0.10754868388175964,
0.23133781552314758,
0.43394193053245544,
-0.1424332857131958,
-0.02623796835541725,
0.018757730722427368,
-0.2132844179868698,
0.4327329993247986,
-0.43604838848114014,
-0.03881622105836868,
0.25709328055381775,
0.35205549001693726,
0.15005436539649963,
-0.46344247460365295,
-0.428920716047287,
-0.005570828914642334,
0.15566742420196533,
0.0214526429772377,
-0.05618605017662048,
0.16280511021614075,
-0.5148674845695496,
0.005982786417007446,
0.04387123882770538,
0.30755066871643066,
0.13139086961746216,
-0.3205348551273346,
0.2969778776168823,
-0.3584398627281189
] |
https://github.com/huggingface/datasets/issues/6176 | The trace of the error. Streaming works but is slower.
```
Root Cause (first observed failure):
[0]:
time : 2023-08-24_06:06:01
host : compute-126.cm.cluster
rank : 0 (local_rank: 0)
exitcode : 1 (pid: 48442)
error_file: /tmp/torchelastic_4fqzcuuz/none_rx2470jl/attempt_0/0/error.json
traceback : Traceback (most recent call last):
File "/users/yli7/.conda/envs/pytorch2.0/lib/python3.8/site-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 346, in wrapper
return f(*args, **kwargs)
File "Pretrain.py", line 214, in main
pair_dataset, c4_dataset = create_dataset('pretrain', config)
File "/dcs05/qiao/data/william/project/DaVinci/dataset/__init__.py", line 109, in create_dataset
c4_dataset = load_dataset("c4", "en", split="train").to_iterable_dataset(num_shards=1024).map(pre_caption_huggingface)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/load.py", line 1810, in load_dataset
ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/builder.py", line 1145, in as_dataset
datasets = map_nested(
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 436, in map_nested
return function(data_struct)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/builder.py", line 1175, in _build_single_dataset
ds = self._as_dataset(
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/builder.py", line 1246, in _as_dataset
dataset_kwargs = ArrowReader(cache_dir, self.info).read(
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py", line 244, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py", line 265, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py", line 200, in _read_files
pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py", line 336, in _get_table_from_filename
table = ArrowReader.read_table(filename, in_memory=in_memory)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py", line 357, in read_table
return table_cls.from_file(filename)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/table.py", line 1059, in from_file
table = _memory_mapped_arrow_table_from_file(filename)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/table.py", line 65, in _memory_mapped_arrow_table_from_file
opened_stream = _memory_mapped_record_batch_reader_from_file(filename)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/table.py", line 50, in _memory_mapped_record_batch_reader_from_file
memory_mapped_stream = pa.memory_map(filename)
File "pyarrow/io.pxi", line 1009, in pyarrow.lib.memory_map
File "pyarrow/io.pxi", line 956, in pyarrow.lib.MemoryMappedFile._open
File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 115, in pyarrow.lib.check_status
OSError: Memory mapping file failed: Cannot allocate memory
``` | how to limit the size of memory mapped file? | ### Describe the bug
Huggingface datasets use memory-mapped file to map large datasets in memory for fast access.
However, it seems like huggingface will occupy all the memory for memory-mapped files, which makes a troublesome situation since we cluster will distribute a small portion of memory to me (once it's over the limit, memory cannot be allocated), however, when the dataset checks the total memory, all of the memory will be taken into account which makes huggingface dataset try to allocate more memory than allowed.
So is there a way to explicitly limit the size of memory mapped file?
### Steps to reproduce the bug
python
>>> from datasets import load_dataset
>>> dataset = load_dataset("c4", "en", streaming=True)
### Expected behavior
In a normal environment, this will not have any problem.
However, when the system allocates a portion of the memory to the program and when the dataset checks the total memory, all of the memory will be taken into account which makes huggingface dataset try to allocate more memory than allowed.
### Environment info
linux cluster with SGE(Sun Grid Engine) | 229 | how to limit the size of memory mapped file?
### Describe the bug
Huggingface datasets use memory-mapped file to map large datasets in memory for fast access.
However, it seems like huggingface will occupy all the memory for memory-mapped files, which makes a troublesome situation since we cluster will distribute a small portion of memory to me (once it's over the limit, memory cannot be allocated), however, when the dataset checks the total memory, all of the memory will be taken into account which makes huggingface dataset try to allocate more memory than allowed.
So is there a way to explicitly limit the size of memory mapped file?
### Steps to reproduce the bug
python
>>> from datasets import load_dataset
>>> dataset = load_dataset("c4", "en", streaming=True)
### Expected behavior
In a normal environment, this will not have any problem.
However, when the system allocates a portion of the memory to the program and when the dataset checks the total memory, all of the memory will be taken into account which makes huggingface dataset try to allocate more memory than allowed.
### Environment info
linux cluster with SGE(Sun Grid Engine)
The trace of the error. Streaming works but is slower.
```
Root Cause (first observed failure):
[0]:
time : 2023-08-24_06:06:01
host : compute-126.cm.cluster
rank : 0 (local_rank: 0)
exitcode : 1 (pid: 48442)
error_file: /tmp/torchelastic_4fqzcuuz/none_rx2470jl/attempt_0/0/error.json
traceback : Traceback (most recent call last):
File "/users/yli7/.conda/envs/pytorch2.0/lib/python3.8/site-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 346, in wrapper
return f(*args, **kwargs)
File "Pretrain.py", line 214, in main
pair_dataset, c4_dataset = create_dataset('pretrain', config)
File "/dcs05/qiao/data/william/project/DaVinci/dataset/__init__.py", line 109, in create_dataset
c4_dataset = load_dataset("c4", "en", split="train").to_iterable_dataset(num_shards=1024).map(pre_caption_huggingface)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/load.py", line 1810, in load_dataset
ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/builder.py", line 1145, in as_dataset
datasets = map_nested(
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 436, in map_nested
return function(data_struct)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/builder.py", line 1175, in _build_single_dataset
ds = self._as_dataset(
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/builder.py", line 1246, in _as_dataset
dataset_kwargs = ArrowReader(cache_dir, self.info).read(
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py", line 244, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py", line 265, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py", line 200, in _read_files
pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py", line 336, in _get_table_from_filename
table = ArrowReader.read_table(filename, in_memory=in_memory)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py", line 357, in read_table
return table_cls.from_file(filename)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/table.py", line 1059, in from_file
table = _memory_mapped_arrow_table_from_file(filename)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/table.py", line 65, in _memory_mapped_arrow_table_from_file
opened_stream = _memory_mapped_record_batch_reader_from_file(filename)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/table.py", line 50, in _memory_mapped_record_batch_reader_from_file
memory_mapped_stream = pa.memory_map(filename)
File "pyarrow/io.pxi", line 1009, in pyarrow.lib.memory_map
File "pyarrow/io.pxi", line 956, in pyarrow.lib.MemoryMappedFile._open
File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 115, in pyarrow.lib.check_status
OSError: Memory mapping file failed: Cannot allocate memory
``` | [
-0.16914336383342743,
-0.8583163022994995,
0.023879289627075195,
0.3591354787349701,
0.3339625298976898,
-0.09380345791578293,
-0.1925305724143982,
0.2149547040462494,
0.31732621788978577,
0.25976797938346863,
0.04010605067014694,
-0.12824393808841705,
-0.32327800989151,
-0.009292490780353546,
0.20675146579742432,
-0.20985642075538635,
-0.11238563805818558,
-0.27734798192977905,
-0.3356562554836273,
0.15680252015590668,
-0.14312797784805298,
0.13599270582199097,
0.2140207290649414,
-0.12239812314510345,
-0.32368606328964233,
-0.0440179780125618,
0.292796790599823,
0.04210836812853813,
-0.20743776857852936,
-0.27415579557418823,
0.160670667886734,
-0.27547577023506165,
-0.1101757138967514,
0.28271135687828064,
-0.0001235856325365603,
-0.2031855583190918,
0.159653902053833,
-0.08998158574104309,
0.05058125779032707,
0.23678036034107208,
0.054835304617881775,
-0.12845610082149506,
0.0667651817202568,
-0.1798422634601593,
0.015604771673679352,
-0.07659880816936493,
0.07329896837472916,
-0.5109074711799622,
0.4370017945766449,
0.19866955280303955,
0.09688855707645416,
0.1428108513355255,
0.19503691792488098,
0.1595812886953354,
0.20395995676517487,
0.05894942581653595,
-0.017521314322948456,
0.4209589958190918,
0.11678270250558853,
-0.11073796451091766,
-0.22849667072296143,
0.06757764518260956,
-0.08223675191402435,
0.02802911400794983,
0.5858151912689209,
-0.17013458907604218,
-0.5406960248947144,
-0.29094836115837097,
0.235890731215477,
0.3676574230194092,
0.2543463408946991,
-0.3606221377849579,
-0.060480713844299316,
-0.35702383518218994,
0.010161422193050385,
0.05417190492153168,
0.3487466871738434,
0.32816192507743835,
-0.39569222927093506,
-0.01912880130112171,
-0.5355885028839111,
-0.25926318764686584,
-0.23177151381969452,
0.05426973104476929,
0.01363719254732132,
0.13063944876194,
-0.09204348921775818,
0.1911366730928421,
0.4148635268211365,
-0.11013428121805191,
-0.3502681255340576,
0.17333164811134338,
-0.2308136522769928,
0.3993352949619293,
-0.2641392946243286,
0.034921035170555115,
-0.293480783700943,
0.16880881786346436,
0.7178159952163696,
-0.13522370159626007,
0.26026982069015503,
-0.05344236269593239,
0.3336036205291748,
-0.010969869792461395,
0.21137189865112305,
0.3600180149078369,
-0.3637963533401489,
0.32771629095077515,
0.30675458908081055,
0.24221482872962952,
0.10981941968202591,
-0.0010712030343711376,
0.14000603556632996,
-0.3521501421928406,
0.15642444789409637,
-0.3061027526855469,
-0.01900322735309601,
-0.05132115259766579,
0.047884561121463776,
0.22315917909145355,
0.03207699954509735,
0.162277951836586,
0.21171142160892487,
0.2809363901615143,
-0.12122556567192078,
-0.2582758069038391,
0.06269703805446625,
-0.05041560158133507,
-0.16623303294181824,
0.0460740365087986,
-0.10317891091108322,
-0.0031614303588867188,
-0.16530728340148926,
0.09948419779539108,
0.26018697023391724,
-0.3640650510787964,
0.30011945962905884,
-0.03676661476492882,
0.10659093409776688,
-0.2708824574947357,
-0.02622084692120552,
-0.2799612581729889,
0.22144275903701782,
0.29245540499687195,
-0.32327473163604736,
0.15704958140850067,
-0.06431536376476288,
0.4073006212711334,
-0.23246072232723236,
0.026302754878997803,
-0.3027186393737793,
-0.3653210699558258,
0.12712091207504272,
0.014507086016237736,
-0.06996248662471771,
0.44518837332725525,
-0.5356628894805908,
0.12792302668094635,
0.32399260997772217,
-0.30208346247673035,
0.31159648299217224,
-0.07910655438899994,
-0.4375702440738678,
-0.2157188206911087,
0.4626522660255432,
0.4756834805011749,
0.05788643658161163,
-0.23741769790649414,
0.10787469148635864,
-0.05316002294421196,
0.12903812527656555,
0.6817634105682373,
-0.13267436623573303,
-0.12551817297935486,
-0.46455955505371094,
0.10088612139225006,
-0.177463561296463,
-0.19712769985198975,
-0.5978245735168457,
0.47133582830429077,
-0.2943739891052246,
0.2211991548538208,
0.2169961929321289,
0.2589648365974426,
0.2071891874074936,
0.084148108959198,
0.08441229164600372,
0.22769595682621002,
-0.0033951792865991592,
0.21306905150413513,
-0.27143582701683044,
-0.1340743750333786,
-0.07420088350772858,
-0.3010418713092804,
-0.06927625834941864,
-0.11816762387752533,
0.1896025687456131,
0.4142199158668518,
0.13252532482147217,
0.10613790154457092,
0.381249338388443,
0.5289404392242432,
0.06559779495000839,
-0.2522484362125397,
-0.07484298199415207,
-0.4041178226470947,
-0.4199735224246979,
0.15224649012088776,
-0.26603883504867554,
-0.2703089714050293,
-0.06433036178350449,
-0.26118752360343933,
-0.1514127105474472,
0.08467093110084534,
0.32102513313293457,
-0.115094393491745,
-0.11095985770225525,
-0.41278383135795593,
0.13429944217205048,
0.1021234393119812,
0.021267391741275787,
0.42469969391822815,
-0.36567506194114685,
0.08026029169559479,
-0.15798203647136688,
-0.10527859628200531,
0.08942261338233948,
-0.10264691710472107,
0.0712512657046318,
0.024764690548181534,
0.013462577946484089,
0.07899776101112366,
-0.17595545947551727,
0.4436912536621094,
-0.021617131307721138,
0.2533983588218689,
-0.1720965951681137,
0.22249887883663177,
0.22476057708263397,
-0.1846926510334015,
0.1346059888601303,
-0.01682264916598797,
-0.06721417605876923,
-0.07709673047065735,
-0.027901574969291687,
0.04855681583285332,
-0.004170357249677181,
0.08110788464546204,
0.08798113465309143,
-0.16675522923469543,
-0.20689362287521362,
0.14346927404403687,
-0.09762066602706909,
-0.1467592716217041,
0.2020515650510788,
0.0065587349236011505,
0.3055131435394287,
0.25921303033828735,
-0.2328890860080719,
-0.4321070909500122,
0.40532994270324707,
0.06852281093597412,
0.0894380658864975,
0.3928902745246887,
-0.29569804668426514,
-0.05724071338772774,
0.18297912180423737,
0.08510882407426834,
0.29536473751068115,
0.12277495861053467,
0.4352644681930542,
0.049200981855392456,
0.07112137228250504,
-0.09182974696159363,
0.227103590965271,
0.07162509858608246,
-0.06222566217184067,
0.28010302782058716,
0.14627976715564728,
-0.1683662235736847,
-0.13846178352832794,
0.1868247091770172,
-0.11307843029499054,
0.002299124374985695,
-0.30246156454086304,
-0.07337847352027893,
-0.07578414678573608,
-0.24667736887931824,
-0.25257399678230286,
0.2860433757305145,
-0.47514769434928894,
0.08263047784566879,
0.04034686088562012,
0.3848302662372589,
0.04070032387971878,
-0.0760437473654747,
0.16121283173561096,
0.20154023170471191,
0.19262363016605377,
-0.1605832278728485,
-0.16474339365959167,
0.17650075256824493,
-0.0332358181476593,
-0.06457968056201935,
0.22025226056575775,
-0.2053566575050354,
0.19260865449905396,
0.32769709825515747,
-0.34779125452041626,
-0.34467607736587524,
-0.09875547885894775,
0.016081979498267174,
-0.046068787574768066,
0.28973761200904846,
0.15080887079238892,
0.37458914518356323,
-0.1678486317396164,
-0.014978181570768356,
-0.15292638540267944,
-0.30464640259742737,
-0.1812952160835266,
0.03778419643640518,
-0.00045113638043403625,
0.34460142254829407,
-0.1334937959909439,
-0.10365406423807144,
-0.12316463142633438,
-0.4338378310203552,
0.6805452108383179,
-0.2081962376832962,
0.14911378920078278,
0.13510391116142273,
0.3134787678718567,
-0.10287937521934509,
-0.18920570611953735,
-0.012262653559446335,
0.024014517664909363,
-0.38195401430130005,
0.2990533411502838,
-0.06185811758041382,
-0.30886110663414,
0.11118735373020172,
0.22300207614898682,
0.17795948684215546,
0.4936608076095581,
-0.4556537866592407,
0.0010808072984218597,
-0.15368959307670593,
-0.012701757252216339,
-0.24552571773529053,
0.0534830242395401,
0.17727310955524445,
-0.13277511298656464,
0.06461343169212341,
0.19797861576080322,
0.09688599407672882,
0.20564956963062286,
-0.02714494802057743,
0.09877632558345795,
0.2773389220237732,
0.3900688588619232,
0.35263127088546753,
0.5640642642974854,
0.3367992043495178,
0.30629074573516846,
0.35379621386528015,
-0.05437537282705307,
0.2608106732368469,
-0.2655770182609558,
0.06567229330539703,
0.3522353768348694,
-0.16577041149139404,
-0.1520742028951645,
0.1286596953868866,
0.12549374997615814,
0.09283444285392761,
0.24901562929153442,
-0.32651859521865845,
0.2392769157886505,
-0.09859514981508255,
0.3222050368785858,
0.2054944485425949,
0.3061465620994568,
-0.20682458579540253,
-0.1546711027622223,
-0.07393527776002884,
-0.4111081063747406,
-0.02564672753214836,
-0.0015578456223011017,
0.16378942131996155,
0.3529037833213806,
-0.30629628896713257,
-0.07483059912919998,
-0.5424739718437195,
0.04683232679963112,
0.0961374044418335,
0.07485207915306091,
-0.29156559705734253,
0.05405624210834503,
0.23215559124946594,
0.2469969242811203,
0.5791918635368347,
0.18571937084197998,
0.15583664178848267,
-0.47730445861816406,
-0.07585669308900833,
-0.5071892738342285,
0.2190108448266983,
0.22958135604858398,
0.1789902001619339,
0.13541793823242188,
0.33799973130226135,
-0.22031062841415405,
-0.010808415710926056,
-0.14935991168022156,
0.23231320083141327,
-0.07814205437898636,
0.060668978840112686,
-0.14325444400310516,
-0.1347915232181549,
0.005202069878578186,
0.2970693111419678,
0.5532432794570923,
0.02400432899594307,
0.16953855752944946,
-0.19344791769981384,
0.02294296957552433,
0.01255200058221817,
-0.07650943100452423,
-0.0981195867061615,
0.46559545397758484,
-0.09818342328071594,
0.16332636773586273,
0.20548616349697113,
0.044874805957078934,
0.25736135244369507,
0.5117926597595215,
-0.0033287731930613518,
0.23489952087402344,
-0.00935303047299385,
0.18604840338230133,
0.1467747688293457,
0.42388930916786194,
-0.1902625858783722,
0.10663363337516785,
0.35071778297424316,
0.24581749737262726,
-0.45744606852531433,
0.1177506297826767,
0.21336135268211365,
0.19416619837284088,
-0.3421141505241394,
-0.48255467414855957,
0.2661499083042145,
0.27544260025024414,
-0.02650834619998932,
0.4056742787361145,
0.14568373560905457,
-0.48821303248405457,
0.07846699655056,
0.10147014260292053,
0.8723798990249634,
-0.30689722299575806,
0.20900285243988037,
-0.19079676270484924,
-0.01439964771270752,
0.17318522930145264,
-0.5321405529975891,
0.22418108582496643,
-0.13159748911857605,
-0.33666589856147766,
0.061937958002090454,
-0.059579089283943176,
0.07802166044712067,
0.018812213093042374,
0.05463467538356781,
0.10196873545646667,
0.04401038587093353,
0.1138853207230568,
-0.31919193267822266,
0.30491331219673157,
-0.26978328824043274,
-0.3056604266166687,
-0.052389852702617645,
0.015387166291475296,
-0.4624634385108948,
0.022486917674541473,
0.23993493616580963,
-0.040437810122966766,
0.005558662116527557,
-0.4175739884376526,
-0.36519134044647217,
-0.23454803228378296,
-0.5999876260757446,
-0.18063834309577942,
-0.1707722246646881,
0.0036686956882476807,
0.15430548787117004,
0.5112221240997314,
-0.2122742235660553,
0.38815227150917053,
-0.2068619579076767,
0.07529854774475098,
-0.22209158539772034,
-0.027307569980621338,
-0.17591433227062225,
0.25244849920272827,
-0.03840111941099167,
-0.009038761258125305,
-0.04289596527814865,
0.23013244569301605,
0.017300032079219818,
-0.1622694581747055,
-0.13377147912979126,
0.07330578565597534,
-0.21217074990272522,
-0.2037232369184494,
-0.28418204188346863,
-0.32305777072906494,
-0.03145372495055199,
-0.021875962615013123,
-0.0019730059430003166,
-0.09638483822345734,
-0.12506277859210968,
0.005856579169631004,
0.12626317143440247,
-0.3138287663459778,
-0.1645233929157257,
0.8471754789352417,
0.031145047396421432,
-0.008330561220645905,
0.32860398292541504,
-0.08094587177038193,
-0.11079195141792297,
-0.10052862763404846,
-0.08077415823936462,
0.4513425827026367,
-0.2855834364891052,
-0.00966697745025158,
-0.042225420475006104,
-0.11787404865026474,
-0.21238824725151062,
-0.02035621926188469,
0.4512033462524414,
-0.052112579345703125,
0.004329666495323181,
0.028688952326774597,
-0.6793379187583923,
0.20335346460342407,
-0.12264980375766754,
0.34564563632011414,
0.032719388604164124,
-0.20087748765945435,
0.062425531446933746,
0.38383954763412476,
-0.13441674411296844,
-0.112404003739357,
-0.07435641437768936,
-0.22595813870429993,
0.20502661168575287,
0.20029936730861664,
0.39949357509613037,
-0.18944770097732544,
-0.07731893658638,
0.23833182454109192,
-0.2364950180053711,
-0.04274844005703926,
-0.035247355699539185,
0.14427345991134644,
-0.04720252379775047,
-0.1617431342601776,
-0.1696561872959137,
-0.6442431211471558,
0.09334142506122589,
-0.3868948221206665,
0.4894157350063324,
0.4554125666618347,
0.04719894751906395,
0.01522991806268692,
0.218869149684906,
-0.10011056065559387,
0.23632609844207764,
0.0971977561712265,
0.039152346551418304,
0.09173722565174103,
0.13874727487564087,
0.12378476560115814,
0.2176075577735901,
-0.08472419530153275,
-0.20480777323246002,
0.05031553655862808,
0.05551115795969963,
0.015123480930924416,
-0.028920266777276993,
0.14461293816566467,
-0.29523932933807373,
0.07309839129447937,
0.3313612639904022,
0.17409034073352814,
-0.16246378421783447,
-0.045927342027425766,
0.10152049362659454,
-0.01137099601328373,
0.046405501663684845,
-0.2746480405330658,
0.29172125458717346,
-0.10955827683210373,
0.10651933401823044,
0.29516154527664185,
0.3860500454902649,
-0.24857573211193085,
-0.2511090338230133,
0.08716513961553574,
0.3931049406528473,
-0.17701011896133423,
-0.009550601243972778,
-0.0469280406832695,
0.2688215374946594,
-0.11576303839683533,
0.05410554260015488,
0.40533193945884705,
0.5433439612388611,
0.38832521438598633,
-0.012025013566017151,
0.20200353860855103,
-0.05728204548358917,
0.17642845213413239,
0.03226536512374878,
-0.4461817741394043,
-0.41943225264549255,
0.1993529200553894,
-0.3620482087135315,
0.4647136628627777,
-0.0794859379529953,
0.4223557114601135,
0.08227869868278503,
-0.45517927408218384,
0.10293317586183548,
-0.025288593024015427,
-0.18713396787643433,
-0.22623310983181,
0.0833662673830986,
-0.15859486162662506,
0.021331563591957092,
0.11524949967861176,
0.13485780358314514,
-0.2498021274805069,
0.7389401197433472,
0.07545822858810425,
-0.06485848873853683,
0.25050675868988037,
-0.11574775725603104,
0.12938767671585083,
0.09080544114112854,
-0.3546667993068695,
0.30612462759017944,
-0.08191007375717163,
0.07217782735824585,
0.06900197267532349,
0.18744327127933502,
0.17909786105155945,
0.05884486064314842,
0.2099040448665619,
0.29803407192230225,
0.24424797296524048,
0.07824744284152985,
-0.08352305740118027,
0.12399434298276901,
0.08506924659013748,
0.013743681833148003,
0.07997001707553864,
-0.010235156863927841,
0.01002635806798935,
0.06519298255443573,
-0.15950196981430054,
0.19232375919818878,
-0.21874988079071045,
-0.18859431147575378,
-0.23054420948028564,
-0.1799115538597107,
-0.10273522138595581,
-0.05790365859866142,
-0.49451351165771484,
0.23517179489135742,
0.2685610055923462,
-0.08771008253097534,
0.07981280982494354,
0.014067597687244415,
-0.015970971435308456,
-0.03387843444943428,
0.3392374515533447,
0.14635857939720154,
-0.04169432073831558,
-0.1930520236492157,
-0.17155788838863373,
-0.2202073633670807,
0.11785237491130829,
-0.4416109025478363,
-0.0620868057012558,
0.052923817187547684,
-0.05838862434029579,
-0.31055527925491333,
-0.3964015543460846,
0.09995472431182861,
-0.3457260727882385,
-0.1462640017271042,
0.3345646560192108,
-0.012378975749015808,
-0.4838041365146637,
-0.14755719900131226,
0.14727331697940826,
0.18350327014923096,
-0.13617858290672302,
0.3285587728023529,
-0.12354370951652527,
-0.09545796364545822,
-0.1015578955411911,
0.33687150478363037,
-0.058828964829444885,
0.07036929577589035,
0.30279260873794556,
0.07482519745826721,
0.26686739921569824,
-0.0741569846868515,
-0.07999544590711594,
-0.38726359605789185,
0.08406690508127213,
-0.18892015516757965,
-0.0646413117647171,
0.07549118995666504,
0.3796367943286896,
-0.38252201676368713,
-0.5713517069816589,
-0.3364920914173126,
0.30188262462615967,
-0.08645734190940857,
-0.04210275784134865,
0.0344090461730957,
-0.11296142637729645,
-0.012126743793487549,
0.11177954822778702,
0.1976509988307953,
0.517775297164917,
-0.03812231868505478,
-0.0645236074924469,
-0.04895245283842087,
-0.30168887972831726,
0.4952715039253235,
-0.3784630596637726,
0.00750993937253952,
0.2676721215248108,
0.34655052423477173,
0.34915241599082947,
-0.3037199378013611,
-0.5475487112998962,
0.025938719511032104,
0.161693274974823,
-0.047645583748817444,
-0.07520140707492828,
0.10946281999349594,
-0.46401989459991455,
0.0012792497873306274,
-0.0026844367384910583,
0.23480039834976196,
0.19968675076961517,
-0.3112201690673828,
0.23736701905727386,
-0.43418124318122864
] |
https://github.com/huggingface/datasets/issues/6176 | This issue has previously been reported here: https://github.com/huggingface/datasets/issues/5710. Reporting it in the Arrow repo makes more sense as they have control over memory mapping.
PS: this is the API to reduce the size of the generated Arrow file:
```python
from datasets import load_dataset
builder = load_dataset_builder("c4", "en")
builder.download_and_prepare(max_shard_size="5GB")
dataset = builder.as_dataset()
```
If this resolves the issue, we can consider exposing `max_shard_size` in `load_dataset`. | how to limit the size of memory mapped file? | ### Describe the bug
Huggingface datasets use memory-mapped file to map large datasets in memory for fast access.
However, it seems like huggingface will occupy all the memory for memory-mapped files, which makes a troublesome situation since we cluster will distribute a small portion of memory to me (once it's over the limit, memory cannot be allocated), however, when the dataset checks the total memory, all of the memory will be taken into account which makes huggingface dataset try to allocate more memory than allowed.
So is there a way to explicitly limit the size of memory mapped file?
### Steps to reproduce the bug
python
>>> from datasets import load_dataset
>>> dataset = load_dataset("c4", "en", streaming=True)
### Expected behavior
In a normal environment, this will not have any problem.
However, when the system allocates a portion of the memory to the program and when the dataset checks the total memory, all of the memory will be taken into account which makes huggingface dataset try to allocate more memory than allowed.
### Environment info
linux cluster with SGE(Sun Grid Engine) | 64 | how to limit the size of memory mapped file?
### Describe the bug
Huggingface datasets use memory-mapped file to map large datasets in memory for fast access.
However, it seems like huggingface will occupy all the memory for memory-mapped files, which makes a troublesome situation since we cluster will distribute a small portion of memory to me (once it's over the limit, memory cannot be allocated), however, when the dataset checks the total memory, all of the memory will be taken into account which makes huggingface dataset try to allocate more memory than allowed.
So is there a way to explicitly limit the size of memory mapped file?
### Steps to reproduce the bug
python
>>> from datasets import load_dataset
>>> dataset = load_dataset("c4", "en", streaming=True)
### Expected behavior
In a normal environment, this will not have any problem.
However, when the system allocates a portion of the memory to the program and when the dataset checks the total memory, all of the memory will be taken into account which makes huggingface dataset try to allocate more memory than allowed.
### Environment info
linux cluster with SGE(Sun Grid Engine)
This issue has previously been reported here: https://github.com/huggingface/datasets/issues/5710. Reporting it in the Arrow repo makes more sense as they have control over memory mapping.
PS: this is the API to reduce the size of the generated Arrow file:
```python
from datasets import load_dataset
builder = load_dataset_builder("c4", "en")
builder.download_and_prepare(max_shard_size="5GB")
dataset = builder.as_dataset()
```
If this resolves the issue, we can consider exposing `max_shard_size` in `load_dataset`. | [
-0.060643520206213,
-0.6810961365699768,
0.02764938399195671,
0.3898550868034363,
0.26697027683258057,
-0.1753149926662445,
-0.12749415636062622,
0.1609777808189392,
0.3836739659309387,
0.2431078851222992,
0.005299530923366547,
-0.09389012306928635,
-0.2719050943851471,
0.06746187061071396,
0.19812807440757751,
-0.16038759052753448,
-0.06752949953079224,
-0.19412286579608917,
-0.5369085669517517,
0.12725752592086792,
-0.16905295848846436,
0.17142845690250397,
0.19882987439632416,
-0.10046075284481049,
-0.3177814185619354,
-0.01311851479113102,
0.2590635120868683,
0.07208971679210663,
-0.21957892179489136,
-0.2738719582557678,
0.2360558807849884,
-0.2626050114631653,
-0.1486569195985794,
0.2749374508857727,
-0.0001219858750118874,
-0.2519383430480957,
0.1261782944202423,
0.013933658599853516,
0.06828644871711731,
0.3250490128993988,
-0.10854816436767578,
-0.16451363265514374,
0.09105014055967331,
-0.10057881474494934,
0.1382749378681183,
-0.08326856046915054,
-0.007406311109662056,
-0.38701367378234863,
0.4388093650341034,
0.05404650419950485,
0.10460002720355988,
0.07767064869403839,
0.26828330755233765,
0.14120519161224365,
0.16153484582901,
0.14992716908454895,
-0.03862762823700905,
0.480917364358902,
0.06642480939626694,
-0.06464316695928574,
-0.2062196135520935,
0.05759487301111221,
0.09165659546852112,
-0.006454791873693466,
0.590981125831604,
-0.10138356685638428,
-0.348204106092453,
-0.2694249451160431,
0.26569485664367676,
0.44512051343917847,
0.28769394755363464,
-0.42495831847190857,
-0.051020823419094086,
-0.45691388845443726,
0.00033222511410713196,
0.09906700998544693,
0.3523724675178528,
0.3041287362575531,
-0.36671918630599976,
0.04129113256931305,
-0.44682854413986206,
-0.34294867515563965,
-0.15132640302181244,
0.05299565941095352,
0.07043436169624329,
0.005688127130270004,
-0.17009992897510529,
0.1696162074804306,
0.43583178520202637,
-0.23013141751289368,
-0.401786744594574,
0.14303427934646606,
-0.40254101157188416,
0.4919697046279907,
-0.22569549083709717,
-0.061796367168426514,
-0.3288302719593048,
0.285599023103714,
0.8255470395088196,
-0.04277516156435013,
0.21845251321792603,
-0.03141811862587929,
0.14510640501976013,
-0.04802720248699188,
0.38230058550834656,
0.30051031708717346,
-0.269869327545166,
0.24037916958332062,
0.21279644966125488,
0.3123777210712433,
0.16534286737442017,
0.09707452356815338,
0.13541777431964874,
-0.426510751247406,
0.1849125474691391,
-0.39945822954177856,
-0.0037420466542243958,
-0.09313717484474182,
0.25125807523727417,
0.24256527423858643,
0.1621670424938202,
0.16929739713668823,
0.1584697961807251,
0.22679691016674042,
0.027841340750455856,
-0.1136602908372879,
-0.13366898894309998,
-0.08640171587467194,
-0.12464408576488495,
0.008504029363393784,
-0.10860482603311539,
-0.019287561997771263,
-0.19273756444454193,
0.12823884189128876,
0.20069481432437897,
-0.08920225501060486,
0.2266017645597458,
-0.021587833762168884,
0.11892674118280411,
-0.31298312544822693,
-0.10058313608169556,
-0.2765679657459259,
0.27752256393432617,
0.31049981713294983,
-0.3911020755767822,
0.18558895587921143,
-0.12208393216133118,
0.2682788670063019,
-0.26882266998291016,
0.027483899146318436,
-0.26714643836021423,
-0.20502978563308716,
0.13683822751045227,
0.013958943076431751,
-0.12676972150802612,
0.46514105796813965,
-0.6885693669319153,
0.11621982604265213,
0.2648238241672516,
-0.14513947069644928,
0.35028666257858276,
-0.05808504670858383,
-0.45438238978385925,
-0.2377428412437439,
0.40897154808044434,
0.47312915325164795,
-0.0236646831035614,
-0.20298829674720764,
0.01060127466917038,
-0.18568935990333557,
0.0068782418966293335,
0.7222141623497009,
-0.12082606554031372,
-0.18015450239181519,
-0.47279050946235657,
0.1288899928331375,
-0.14956475794315338,
-0.07946719974279404,
-0.6838281154632568,
0.4060143828392029,
-0.22990545630455017,
0.18890878558158875,
0.09314046055078506,
0.1943141669034958,
0.05117584764957428,
0.1078873798251152,
-0.07496745884418488,
0.2424718737602234,
0.08147910237312317,
0.17746961116790771,
-0.19772368669509888,
-0.23455315828323364,
-0.20512451231479645,
-0.3692520558834076,
-0.11983692646026611,
-0.1512751281261444,
0.22245395183563232,
0.155123770236969,
0.21343854069709778,
0.11993385851383209,
0.44531381130218506,
0.4911525845527649,
0.13231073319911957,
-0.2713945209980011,
0.013879060745239258,
-0.3984917104244232,
-0.4188711643218994,
0.17857232689857483,
-0.38294991850852966,
-0.3645836114883423,
-0.14787700772285461,
-0.2874484360218048,
-0.1233997642993927,
0.17013627290725708,
0.3193362355232239,
0.03574633598327637,
-0.11100117862224579,
-0.5086937546730042,
0.20197120308876038,
0.09264248609542847,
0.02353838086128235,
0.2928802967071533,
-0.26969173550605774,
0.1477559357881546,
-0.06614500284194946,
-0.18225902318954468,
0.21235860884189606,
-0.07472552359104156,
0.08329570293426514,
0.054117489606142044,
-0.08316947519779205,
0.1120852455496788,
-0.14573217928409576,
0.38284561038017273,
0.09664623439311981,
0.2307484745979309,
-0.08218704164028168,
0.24573224782943726,
0.18747957050800323,
-0.13119342923164368,
0.08127626776695251,
-0.1566992998123169,
-0.03502052649855614,
-0.024854540824890137,
-0.06565345823764801,
0.02334326133131981,
-0.14184622466564178,
0.1699921190738678,
0.12391781806945801,
-0.038763657212257385,
-0.14735299348831177,
0.010393410921096802,
-0.024615906178951263,
-0.2829652726650238,
0.03184165433049202,
0.1071067750453949,
0.2937335968017578,
0.42561015486717224,
-0.13506853580474854,
-0.3759332299232483,
0.44085371494293213,
0.03390368074178696,
0.11925571411848068,
0.37183767557144165,
-0.3954549729824066,
0.02367919683456421,
0.2425314486026764,
0.2841896712779999,
0.16461321711540222,
0.15383653342723846,
0.3942389488220215,
0.02003779448568821,
0.13582518696784973,
-0.0420309416949749,
0.19776809215545654,
0.1390276998281479,
0.08549671620130539,
0.17968207597732544,
0.031657468527555466,
-0.21574315428733826,
-0.07254664599895477,
0.24728761613368988,
-0.23161068558692932,
-0.04129093140363693,
-0.2676173448562622,
-0.14560335874557495,
-0.11788664758205414,
-0.23064205050468445,
-0.29804471135139465,
0.2831785976886749,
-0.5303808450698853,
0.11620822548866272,
-0.055686917155981064,
0.2063378244638443,
-0.04403643310070038,
-0.12964674830436707,
0.03896118700504303,
0.20828382670879364,
0.0788094773888588,
-0.083522267639637,
-0.1246911808848381,
0.15121646225452423,
-0.01272000651806593,
-0.04858490824699402,
0.28471940755844116,
-0.11671790480613708,
0.18845881521701813,
0.30540409684181213,
-0.23192957043647766,
-0.2636949419975281,
-0.029325470328330994,
0.04184246435761452,
-0.06222173571586609,
0.2540105879306793,
0.1142197772860527,
0.2810803949832916,
-0.22259987890720367,
0.17605724930763245,
-0.21217356622219086,
-0.22732853889465332,
-0.19224977493286133,
0.0437239408493042,
-0.04571685194969177,
0.25935155153274536,
-0.15702718496322632,
0.12973155081272125,
-0.020827971398830414,
-0.3763589859008789,
0.8570419549942017,
-0.06926728785037994,
0.17599792778491974,
0.21574032306671143,
0.3389751613140106,
-0.0746435895562172,
-0.38740476965904236,
-0.06757050007581711,
0.04835859686136246,
-0.32886743545532227,
0.33659547567367554,
-0.0667172223329544,
-0.34407803416252136,
0.1736910045146942,
0.09282691776752472,
0.21750764548778534,
0.3236522078514099,
-0.38231557607650757,
0.0455319881439209,
-0.34943854808807373,
-0.016700491309165955,
-0.2192641794681549,
0.08342985063791275,
0.1820647418498993,
-0.08173982799053192,
0.06307228654623032,
0.15439799427986145,
0.10873456299304962,
0.3327764868736267,
-0.08628450334072113,
0.05487119033932686,
0.3173476457595825,
0.20481735467910767,
0.3119310438632965,
0.42235150933265686,
0.398799866437912,
0.40449729561805725,
0.2036750614643097,
-0.009131024591624737,
0.33096012473106384,
-0.23612113296985626,
0.1710798144340515,
0.2458539456129074,
-0.10380861163139343,
-0.035914450883865356,
0.10700219124555588,
0.28928932547569275,
0.2501762807369232,
0.3958222270011902,
-0.3462483882904053,
0.3352331817150116,
-0.1707594394683838,
0.24414436519145966,
0.1577596217393875,
0.21355150640010834,
-0.21943485736846924,
-0.23642873764038086,
-0.04989955574274063,
-0.36400818824768066,
0.047377750277519226,
-0.04119953513145447,
0.11277540773153305,
0.39120975136756897,
-0.37414026260375977,
0.015278924256563187,
-0.5145608186721802,
-0.029347233474254608,
0.04146042838692665,
-0.03057386353611946,
-0.20421573519706726,
-0.013316154479980469,
0.21694418787956238,
0.23702725768089294,
0.527389645576477,
0.3179040551185608,
0.10738374292850494,
-0.5079511404037476,
0.023122243583202362,
-0.4876041114330292,
0.30589941143989563,
0.30186715722084045,
0.1625182330608368,
0.01531374454498291,
0.3061414957046509,
-0.2265893965959549,
-0.07915851473808289,
-0.17355932295322418,
0.22000527381896973,
-0.06798528134822845,
0.025267161428928375,
-0.09557107090950012,
-0.014396198093891144,
0.004109606146812439,
0.18690186738967896,
0.5064125657081604,
-0.03399074450135231,
0.230507031083107,
-0.17047297954559326,
0.014369575306773186,
-0.09446169435977936,
-0.07043963670730591,
-0.0568566657602787,
0.5006462931632996,
-0.02726149931550026,
0.19142937660217285,
0.269762247800827,
0.02640451118350029,
0.22688809037208557,
0.6065230369567871,
0.004682954400777817,
0.13887763023376465,
-0.19829332828521729,
0.05634602904319763,
0.21232348680496216,
0.3094490170478821,
-0.20955631136894226,
0.15316280722618103,
0.2940727770328522,
0.24244529008865356,
-0.46253058314323425,
0.07416190207004547,
0.08667288720607758,
0.20768949389457703,
-0.324874609708786,
-0.37557917833328247,
0.29139766097068787,
0.22143694758415222,
-0.0428873673081398,
0.42632538080215454,
0.39773499965667725,
-0.46560221910476685,
0.0432419590651989,
0.14075639843940735,
0.8549152612686157,
-0.3568468689918518,
0.258482426404953,
-0.18564525246620178,
-0.11779468506574631,
0.1865670084953308,
-0.0949222594499588,
0.02532649040222168,
-0.10913695394992828,
-0.1251504123210907,
0.0821298286318779,
-0.06882603466510773,
0.12234644591808319,
0.09819543361663818,
0.12300637364387512,
0.01529998704791069,
0.07231372594833374,
-0.05948295071721077,
-0.3183635473251343,
0.29598161578178406,
-0.21332359313964844,
-0.34211626648902893,
0.05486886575818062,
0.0275738425552845,
-0.4489843249320984,
-0.09301283210515976,
0.2763454020023346,
-0.059421129524707794,
-0.17545044422149658,
-0.344181090593338,
-0.295850545167923,
-0.24719475209712982,
-0.5762397050857544,
-0.21970491111278534,
0.016733869910240173,
0.0018476396799087524,
0.22820992767810822,
0.4205959737300873,
-0.22462575137615204,
0.38264209032058716,
-0.2321901023387909,
0.16129831969738007,
-0.18626943230628967,
-0.0222118329256773,
-0.173223614692688,
0.25345948338508606,
-0.11201564222574234,
0.07748091220855713,
-0.004458799958229065,
0.0545320063829422,
0.03678392618894577,
-0.1638501137495041,
-0.2395840585231781,
0.06333675235509872,
-0.25464898347854614,
-0.16535045206546783,
-0.26903676986694336,
-0.31329095363616943,
-0.03244148567318916,
0.07547915726900101,
0.01809028908610344,
-0.016711249947547913,
0.03336215019226074,
0.04563000053167343,
0.1688166707754135,
-0.329298198223114,
-0.15398907661437988,
0.6785663962364197,
0.00010303128510713577,
0.04459148645401001,
0.3631466031074524,
-0.09442886710166931,
-0.09398096054792404,
-0.1275099813938141,
-0.04388832300901413,
0.49098101258277893,
-0.3380250334739685,
0.02270304039120674,
-0.014075469225645065,
-0.031069204211235046,
-0.2391258031129837,
-0.03756421059370041,
0.44752204418182373,
-0.1643770933151245,
-0.01950106769800186,
0.06158893555402756,
-0.7031691074371338,
0.24680167436599731,
-0.2284737080335617,
0.32551854848861694,
-0.05385974794626236,
-0.2484697848558426,
-0.006212569773197174,
0.3936561942100525,
-0.1261299103498459,
-0.07443605363368988,
-0.014063835144042969,
-0.31347668170928955,
0.21881787478923798,
0.17870870232582092,
0.34359481930732727,
-0.26390403509140015,
-0.08708490431308746,
0.12553821504116058,
-0.21816085278987885,
-0.0843309685587883,
-0.0786835178732872,
0.13302284479141235,
-0.0416184701025486,
-0.22771044075489044,
-0.10235200822353363,
-0.5344895720481873,
0.1348605901002884,
-0.4227673411369324,
0.3471214771270752,
0.35955068469047546,
0.04998239874839783,
-0.00248897448182106,
0.23735885322093964,
-0.13138043880462646,
0.15583238005638123,
0.13655425608158112,
0.07768839597702026,
0.15299522876739502,
0.14835120737552643,
0.16085541248321533,
0.2071785181760788,
-0.08855614811182022,
-0.08614476025104523,
0.09995107352733612,
0.055388081818819046,
-0.14765118062496185,
-0.04216213524341583,
0.16049787402153015,
-0.3013240098953247,
0.13735170662403107,
0.34784165024757385,
0.15876439213752747,
-0.1769682765007019,
0.0073605552315711975,
0.112474724650383,
0.022353729233145714,
0.09304328262805939,
-0.23847508430480957,
0.38859888911247253,
-0.08185908198356628,
0.02199949324131012,
0.2736735939979553,
0.3078354597091675,
-0.2650299668312073,
-0.29142796993255615,
0.06075555831193924,
0.23692837357521057,
-0.12431495636701584,
-0.05781754106283188,
0.024728162214159966,
0.29029232263565063,
-0.16120532155036926,
0.23378784954547882,
0.4579605460166931,
0.5980214476585388,
0.45084884762763977,
-0.09578662365674973,
0.12163565307855606,
-0.1990957111120224,
0.19278337061405182,
0.05033940449357033,
-0.5210715532302856,
-0.4175218939781189,
0.19693049788475037,
-0.3374604284763336,
0.3748778700828552,
-0.047955017536878586,
0.56214439868927,
0.18161092698574066,
-0.39596545696258545,
0.10550156235694885,
-0.15699845552444458,
-0.16166213154792786,
-0.22813761234283447,
0.033743828535079956,
-0.08379675447940826,
-0.03989977389574051,
0.09411650151014328,
0.12684398889541626,
-0.43135684728622437,
0.7775413393974304,
0.013287191279232502,
-0.03720327839255333,
0.15030384063720703,
-0.0653257966041565,
0.16361525654792786,
0.058382291346788406,
-0.36417752504348755,
0.1991264969110489,
-0.17433375120162964,
0.0799659714102745,
0.02338729053735733,
0.14733466506004333,
0.08001038432121277,
0.062125883996486664,
0.2802083492279053,
0.21501685678958893,
0.23774176836013794,
0.03638662397861481,
-0.13220593333244324,
0.13103434443473816,
0.04481472447514534,
0.034544751048088074,
0.09438881278038025,
0.0010795146226882935,
-0.0021690092980861664,
-0.08178513497114182,
-0.17652302980422974,
0.24928703904151917,
-0.2502083480358124,
-0.18303316831588745,
-0.2578522861003876,
-0.24907387793064117,
-0.11295891553163528,
-0.02344907447695732,
-0.37902894616127014,
0.1370324194431305,
0.2972933351993561,
-0.1319940984249115,
0.0074766650795936584,
-0.17203237116336823,
-0.0070950984954833984,
-0.018726518377661705,
0.3551923632621765,
0.1454382687807083,
0.022623809054493904,
-0.08081471174955368,
-0.18146511912345886,
-0.2197643369436264,
0.05457701534032822,
-0.46629393100738525,
-0.07496917992830276,
0.04572992026805878,
-0.034024327993392944,
-0.353028267621994,
-0.34323328733444214,
0.1952083259820938,
-0.2756235599517822,
-0.11096718162298203,
0.23486700654029846,
0.058472611010074615,
-0.41343554854393005,
-0.035510070621967316,
0.03759172558784485,
0.18100741505622864,
-0.2033008337020874,
0.3952941596508026,
-0.10280540585517883,
-0.1334851235151291,
-0.04121270775794983,
0.3900604248046875,
-0.0616714246571064,
0.025860656052827835,
0.3574931025505066,
0.13750246167182922,
0.13866691291332245,
-0.0043495818972587585,
-0.0784066841006279,
-0.4298582971096039,
0.09643833339214325,
-0.1384332925081253,
-0.01800122857093811,
-0.05557186156511307,
0.27688321471214294,
-0.4752888083457947,
-0.40873485803604126,
-0.20548050105571747,
0.16925740242004395,
-0.1608075201511383,
0.0370476096868515,
0.06548549234867096,
-0.09535863995552063,
0.007524654269218445,
0.1262601912021637,
0.19993461668491364,
0.3945840895175934,
-0.12354965507984161,
-0.09046527743339539,
0.05997954308986664,
-0.20603570342063904,
0.34859710931777954,
-0.3738293945789337,
0.001139611005783081,
0.35889771580696106,
0.31657809019088745,
0.24658703804016113,
-0.5413987040519714,
-0.5387954711914062,
0.012565523386001587,
0.14789986610412598,
0.03214144706726074,
-0.04588466137647629,
0.07452861219644547,
-0.49325451254844666,
0.028136275708675385,
0.01588844507932663,
0.4867604076862335,
0.1166403517127037,
-0.25946342945098877,
0.24008430540561676,
-0.3906766474246979
] |
https://github.com/huggingface/datasets/issues/6176 | Thanks for the response. The problem seems not resolved. The memory I allocated to the environment is 64G and the following error still occurs
`Python 3.8.16 (default, Jun 12 2023, 18:09:05)
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from datasets import load_dataset_builder
>>> builder = load_dataset_builder("c4", "en")
>>> builder.download_and_prepare(max_shard_size="5GB")
Found cached dataset c4 (/users/yli7/.cache/huggingface/datasets/c4/en/0.0.0/df532b158939272d032cc63ef19cd5b83e9b4d00c922b833e4cb18b2e9869b01)
>>> dataset = builder.as_dataset()
0%| | 0/2 [00:00<?, ?it/s]Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/builder.py", line 1145, in as_dataset
datasets = map_nested(
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 444, in map_nested
mapped = [
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 445, in <listcomp>
_single_map_nested((function, obj, types, None, True, None))
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 347, in _single_map_nested
return function(data_struct)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/builder.py", line 1175, in _build_single_dataset
ds = self._as_dataset(
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/builder.py", line 1246, in _as_dataset
dataset_kwargs = ArrowReader(cache_dir, self.info).read(
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py", line 244, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py", line 265, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py", line 200, in _read_files
pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py", line 336, in _get_table_from_filename
table = ArrowReader.read_table(filename, in_memory=in_memory)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py", line 357, in read_table
return table_cls.from_file(filename)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/table.py", line 1059, in from_file
table = _memory_mapped_arrow_table_from_file(filename)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/table.py", line 65, in _memory_mapped_arrow_table_from_file
opened_stream = _memory_mapped_record_batch_reader_from_file(filename)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/table.py", line 50, in _memory_mapped_record_batch_reader_from_file
memory_mapped_stream = pa.memory_map(filename)
File "pyarrow/io.pxi", line 1009, in pyarrow.lib.memory_map
File "pyarrow/io.pxi", line 956, in pyarrow.lib.MemoryMappedFile._open
File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 115, in pyarrow.lib.check_status
OSError: Memory mapping file failed: Cannot allocate memory` | how to limit the size of memory mapped file? | ### Describe the bug
Huggingface datasets use memory-mapped file to map large datasets in memory for fast access.
However, it seems like huggingface will occupy all the memory for memory-mapped files, which makes a troublesome situation since we cluster will distribute a small portion of memory to me (once it's over the limit, memory cannot be allocated), however, when the dataset checks the total memory, all of the memory will be taken into account which makes huggingface dataset try to allocate more memory than allowed.
So is there a way to explicitly limit the size of memory mapped file?
### Steps to reproduce the bug
python
>>> from datasets import load_dataset
>>> dataset = load_dataset("c4", "en", streaming=True)
### Expected behavior
In a normal environment, this will not have any problem.
However, when the system allocates a portion of the memory to the program and when the dataset checks the total memory, all of the memory will be taken into account which makes huggingface dataset try to allocate more memory than allowed.
### Environment info
linux cluster with SGE(Sun Grid Engine) | 248 | how to limit the size of memory mapped file?
### Describe the bug
Huggingface datasets use memory-mapped file to map large datasets in memory for fast access.
However, it seems like huggingface will occupy all the memory for memory-mapped files, which makes a troublesome situation since we cluster will distribute a small portion of memory to me (once it's over the limit, memory cannot be allocated), however, when the dataset checks the total memory, all of the memory will be taken into account which makes huggingface dataset try to allocate more memory than allowed.
So is there a way to explicitly limit the size of memory mapped file?
### Steps to reproduce the bug
python
>>> from datasets import load_dataset
>>> dataset = load_dataset("c4", "en", streaming=True)
### Expected behavior
In a normal environment, this will not have any problem.
However, when the system allocates a portion of the memory to the program and when the dataset checks the total memory, all of the memory will be taken into account which makes huggingface dataset try to allocate more memory than allowed.
### Environment info
linux cluster with SGE(Sun Grid Engine)
Thanks for the response. The problem seems not resolved. The memory I allocated to the environment is 64G and the following error still occurs
`Python 3.8.16 (default, Jun 12 2023, 18:09:05)
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from datasets import load_dataset_builder
>>> builder = load_dataset_builder("c4", "en")
>>> builder.download_and_prepare(max_shard_size="5GB")
Found cached dataset c4 (/users/yli7/.cache/huggingface/datasets/c4/en/0.0.0/df532b158939272d032cc63ef19cd5b83e9b4d00c922b833e4cb18b2e9869b01)
>>> dataset = builder.as_dataset()
0%| | 0/2 [00:00<?, ?it/s]Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/builder.py", line 1145, in as_dataset
datasets = map_nested(
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 444, in map_nested
mapped = [
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 445, in <listcomp>
_single_map_nested((function, obj, types, None, True, None))
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 347, in _single_map_nested
return function(data_struct)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/builder.py", line 1175, in _build_single_dataset
ds = self._as_dataset(
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/builder.py", line 1246, in _as_dataset
dataset_kwargs = ArrowReader(cache_dir, self.info).read(
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py", line 244, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py", line 265, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py", line 200, in _read_files
pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py", line 336, in _get_table_from_filename
table = ArrowReader.read_table(filename, in_memory=in_memory)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py", line 357, in read_table
return table_cls.from_file(filename)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/table.py", line 1059, in from_file
table = _memory_mapped_arrow_table_from_file(filename)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/table.py", line 65, in _memory_mapped_arrow_table_from_file
opened_stream = _memory_mapped_record_batch_reader_from_file(filename)
File "/users/yli7/.local/lib/python3.8/site-packages/datasets/table.py", line 50, in _memory_mapped_record_batch_reader_from_file
memory_mapped_stream = pa.memory_map(filename)
File "pyarrow/io.pxi", line 1009, in pyarrow.lib.memory_map
File "pyarrow/io.pxi", line 956, in pyarrow.lib.MemoryMappedFile._open
File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 115, in pyarrow.lib.check_status
OSError: Memory mapping file failed: Cannot allocate memory` | [
-0.06064550206065178,
-0.6840006113052368,
0.02686559408903122,
0.3980749249458313,
0.2742254137992859,
-0.055651359260082245,
-0.12921030819416046,
0.19934308528900146,
0.3999030590057373,
0.23436371982097626,
-0.05561879277229309,
-0.2157185673713684,
-0.23776403069496155,
0.08629578351974487,
0.1907270848751068,
-0.10643218457698822,
-0.042109981179237366,
-0.20770062506198883,
-0.5171834826469421,
0.14561575651168823,
-0.21841539442539215,
0.21934548020362854,
0.1666901856660843,
-0.07137078791856766,
-0.3238588273525238,
-0.0726904645562172,
0.20699068903923035,
0.05610422044992447,
-0.18139250576496124,
-0.2640856206417084,
0.30213475227355957,
-0.20196227729320526,
-0.09943326562643051,
0.34330400824546814,
-0.00012255212641321123,
-0.24794502556324005,
0.12227711081504822,
-0.027404144406318665,
0.07328438758850098,
0.33565378189086914,
-0.13189883530139923,
-0.10898367315530777,
0.0072053298354148865,
-0.1763906031847,
0.06043757498264313,
0.017380960285663605,
0.06211491674184799,
-0.48414233326911926,
0.4087419807910919,
0.10676462948322296,
0.09480741620063782,
0.01358155906200409,
0.2698327600955963,
0.046632423996925354,
0.060022078454494476,
0.07687708735466003,
0.000699460506439209,
0.4868772327899933,
0.10805679857730865,
-0.08838807046413422,
-0.071473628282547,
0.03447746858000755,
-0.048661407083272934,
0.0014292392879724503,
0.5655543208122253,
-0.12768015265464783,
-0.30426985025405884,
-0.3246679902076721,
0.3021174967288971,
0.3433430790901184,
0.3256281614303589,
-0.3864037096500397,
-0.05363081395626068,
-0.3930636942386627,
-0.0020398907363414764,
0.08595065027475357,
0.31107741594314575,
0.29243144392967224,
-0.4114919602870941,
0.12821915745735168,
-0.5074940323829651,
-0.3069359064102173,
-0.15582232177257538,
0.028325464576482773,
0.0007491931319236755,
0.018300672993063927,
-0.19485624134540558,
0.18624462187290192,
0.39742496609687805,
-0.15619692206382751,
-0.40340256690979004,
0.07303134351968765,
-0.3468175530433655,
0.4822028577327728,
-0.2510773837566376,
-0.07147641479969025,
-0.2870965600013733,
0.38819563388824463,
0.8133193254470825,
-0.11891898512840271,
0.10102653503417969,
-0.1199590414762497,
0.16208899021148682,
-0.03646564856171608,
0.3362811803817749,
0.34806346893310547,
-0.3183431029319763,
0.26879337430000305,
0.30250898003578186,
0.319319486618042,
0.10429379343986511,
0.040993500500917435,
0.14334701001644135,
-0.3882894515991211,
0.17815238237380981,
-0.3368048667907715,
0.0423910990357399,
-0.13559052348136902,
0.08822107315063477,
0.25948208570480347,
0.20494946837425232,
0.15436699986457825,
0.20272168517112732,
0.3358892798423767,
-0.057175781577825546,
-0.2985001802444458,
-0.10243880748748779,
-0.0730539858341217,
-0.12885847687721252,
-0.026186129078269005,
-0.11977088451385498,
-0.005193373188376427,
-0.18940812349319458,
0.1158284991979599,
0.2428545504808426,
-0.15158390998840332,
0.2158035933971405,
0.006725233048200607,
0.11555898189544678,
-0.32300782203674316,
-0.1661139726638794,
-0.3066849112510681,
0.18762774765491486,
0.30918699502944946,
-0.3857120871543884,
0.20007619261741638,
-0.004269365221261978,
0.15277183055877686,
-0.3303700089454651,
0.030424930155277252,
-0.2223239541053772,
-0.23420679569244385,
0.14556220173835754,
0.009064649231731892,
-0.1427476704120636,
0.47635945677757263,
-0.5761051177978516,
0.12620188295841217,
0.3583216667175293,
-0.1322098970413208,
0.28305119276046753,
0.008583450689911842,
-0.4854068458080292,
-0.21911920607089996,
0.41176095604896545,
0.5761711001396179,
0.028768450021743774,
-0.1451636254787445,
0.08289927989244461,
-0.18713444471359253,
0.03447076678276062,
0.6638688445091248,
-0.022089917212724686,
-0.12867259979248047,
-0.5182123184204102,
0.011780321598052979,
-0.2448178231716156,
-0.14950312674045563,
-0.70162034034729,
0.3765542209148407,
-0.20242558419704437,
0.22492747008800507,
0.1281452775001526,
0.20125387609004974,
0.08143845945596695,
-0.002519272267818451,
0.04683130234479904,
0.278266042470932,
0.03229490667581558,
0.1310555338859558,
-0.21991990506649017,
-0.1903490126132965,
-0.1649022400379181,
-0.33554762601852417,
-0.14550946652889252,
0.014856254681944847,
0.23913562297821045,
0.25130990147590637,
0.16794897615909576,
0.09658576548099518,
0.4143492579460144,
0.48909419775009155,
0.17611625790596008,
-0.23951268196105957,
-0.055484920740127563,
-0.38735178112983704,
-0.43252211809158325,
0.18500518798828125,
-0.3389728367328644,
-0.3136575520038605,
-0.06541678309440613,
-0.3075945973396301,
-0.2111685574054718,
0.12730564177036285,
0.30750012397766113,
-0.09611141681671143,
-0.11937853693962097,
-0.44108664989471436,
0.26306092739105225,
0.12944838404655457,
0.04938875883817673,
0.5484795570373535,
-0.3171237111091614,
0.11650972068309784,
-0.0352616049349308,
-0.19185975193977356,
0.08210945129394531,
-0.0868060290813446,
0.11621230840682983,
0.06425104290246964,
0.0067911227233707905,
0.026374660432338715,
-0.15237927436828613,
0.36440181732177734,
0.09220670163631439,
0.15015468001365662,
-0.21101243793964386,
0.18774285912513733,
0.1620829999446869,
-0.048971593379974365,
0.12516465783119202,
-0.12967300415039062,
-0.0385904461145401,
-0.04908960685133934,
-0.010241296142339706,
0.005927965044975281,
-0.10505914688110352,
0.1275768280029297,
0.13371893763542175,
-0.04759784787893295,
-0.05424429476261139,
-0.00784146785736084,
0.0664035975933075,
-0.2971353828907013,
0.09282824397087097,
0.15466395020484924,
0.3171042203903198,
0.3790411055088043,
-0.1532939076423645,
-0.4234924614429474,
0.42930614948272705,
0.051608651876449585,
0.1114826649427414,
0.37253522872924805,
-0.2772780656814575,
0.047399185597896576,
0.2172747254371643,
0.2899853587150574,
0.30189770460128784,
0.13071925938129425,
0.37156984210014343,
0.11083822697401047,
0.1461338847875595,
-0.04380234330892563,
0.11917310953140259,
0.05702661722898483,
0.03188599273562431,
0.11697888374328613,
0.02691560611128807,
-0.18040001392364502,
-0.007455416023731232,
0.17224110662937164,
-0.20845600962638855,
0.036749668419361115,
-0.2730039358139038,
-0.12311990559101105,
-0.09737260639667511,
-0.31855320930480957,
-0.23471960425376892,
0.36222562193870544,
-0.5151299834251404,
0.14587052166461945,
-0.0819292664527893,
0.30866673588752747,
0.04073195159435272,
-0.1149306520819664,
0.06685784459114075,
0.2646843194961548,
0.047236137092113495,
-0.04260213300585747,
-0.13437148928642273,
0.17842493951320648,
-0.10455045104026794,
-0.07339014112949371,
0.3405168056488037,
-0.19903843104839325,
0.18473362922668457,
0.20853477716445923,
-0.26110929250717163,
-0.20778411626815796,
-0.07990026473999023,
0.05589243397116661,
-0.030186204239726067,
0.3931226432323456,
0.06269749253988266,
0.36112305521965027,
-0.20078247785568237,
0.11528109759092331,
-0.17459411919116974,
-0.20297396183013916,
-0.18904128670692444,
-0.008321911096572876,
0.028503015637397766,
0.21647202968597412,
-0.14625367522239685,
0.14029626548290253,
-0.1556246131658554,
-0.39709627628326416,
0.7698928713798523,
-0.0694534033536911,
0.19635826349258423,
0.2829029858112335,
0.253370463848114,
-0.10599199682474136,
-0.29733288288116455,
-0.020915597677230835,
-0.023516202345490456,
-0.40104159712791443,
0.33041101694107056,
-0.1026851087808609,
-0.33972397446632385,
0.12448598444461823,
0.10955911874771118,
0.2711610794067383,
0.2725685238838196,
-0.38866639137268066,
0.0630769282579422,
-0.3564462959766388,
0.02398921549320221,
-0.14877967536449432,
0.05618762969970703,
0.1979573518037796,
-0.1517612338066101,
0.07660837471485138,
0.1181645542383194,
0.061281561851501465,
0.2965608537197113,
-0.04929652065038681,
0.04126358777284622,
0.3119037449359894,
0.24420499801635742,
0.3025575578212738,
0.33100950717926025,
0.4925025403499603,
0.3803841471672058,
0.3386383354663849,
-0.00442544836550951,
0.34713014960289,
-0.2575649619102478,
0.05535970628261566,
0.29085472226142883,
-0.055571049451828,
-0.1566699743270874,
0.10720986127853394,
0.22803634405136108,
0.25713804364204407,
0.2764698266983032,
-0.41313767433166504,
0.2881300151348114,
-0.16338250041007996,
0.18265584111213684,
0.21924138069152832,
0.28001296520233154,
-0.15409128367900848,
-0.2677523195743561,
-0.045222748070955276,
-0.33171364665031433,
-0.008052155375480652,
0.12699779868125916,
0.09927821159362793,
0.4012422561645508,
-0.4249495267868042,
-0.03219521790742874,
-0.5223671197891235,
0.05703621730208397,
0.027600884437561035,
0.02566472440958023,
-0.2910919189453125,
0.0705123245716095,
0.21392205357551575,
0.32077932357788086,
0.6481680870056152,
0.23834876716136932,
0.14664192497730255,
-0.42160117626190186,
0.025645844638347626,
-0.4612627327442169,
0.2438397854566574,
0.32997995615005493,
0.20145249366760254,
0.10553677380084991,
0.348495751619339,
-0.1955420821905136,
-0.03743533417582512,
-0.0935005247592926,
0.2692609131336212,
-0.08735819905996323,
-0.039743341505527496,
-0.14794902503490448,
-0.14876554906368256,
-0.02447183057665825,
0.19781295955181122,
0.5348784923553467,
-0.0005083233118057251,
0.28717154264450073,
-0.18684835731983185,
-0.0004946142435073853,
-0.03702685236930847,
-0.04153825342655182,
-0.045660972595214844,
0.4316297173500061,
-0.004651330411434174,
0.23233777284622192,
0.15167072415351868,
-0.07322648912668228,
0.19748109579086304,
0.5466724038124084,
-0.0645463839173317,
0.16941072046756744,
-0.13484369218349457,
0.08170630037784576,
0.21205946803092957,
0.29864227771759033,
-0.21115189790725708,
0.06412874907255173,
0.2570446729660034,
0.26006197929382324,
-0.48028886318206787,
0.04823463037610054,
0.0353475958108902,
0.29726460576057434,
-0.3949771523475647,
-0.48258113861083984,
0.26002123951911926,
0.24117982387542725,
-0.06578610837459564,
0.3815394639968872,
0.29672229290008545,
-0.4678057134151459,
0.0037326477468013763,
0.07718570530414581,
0.9006134271621704,
-0.4091971516609192,
0.1901644617319107,
-0.22409573197364807,
-0.038667500019073486,
0.2536681294441223,
-0.17918452620506287,
0.09354159981012344,
-0.08013421297073364,
-0.23261621594429016,
0.09997506439685822,
-0.08679228276014328,
0.23083288967609406,
0.05902419984340668,
0.011042959988117218,
0.06877855956554413,
0.0030281543731689453,
-0.002044475404545665,
-0.26574504375457764,
0.2733653783798218,
-0.27506259083747864,
-0.28546518087387085,
0.011754769831895828,
0.030080974102020264,
-0.4367423355579376,
0.056827109307050705,
0.2273942232131958,
0.0009095221757888794,
-0.13855046033859253,
-0.31420907378196716,
-0.3356837034225464,
-0.21526148915290833,
-0.5011172890663147,
-0.2071777582168579,
-0.00879606418311596,
0.050381988286972046,
0.23030337691307068,
0.4637349247932434,
-0.03221811726689339,
0.44273728132247925,
-0.221939817070961,
0.10717561095952988,
-0.28450873494148254,
-0.013805396854877472,
-0.12917274236679077,
0.26915785670280457,
-0.03723297268152237,
0.044692084193229675,
-0.06713517010211945,
0.06741446256637573,
0.05113039165735245,
-0.14852628111839294,
-0.2264259159564972,
0.06728760898113251,
-0.28115591406822205,
-0.20994167029857635,
-0.3010740876197815,
-0.2963290512561798,
0.06684301048517227,
0.049349620938301086,
0.015889916568994522,
-0.0679377019405365,
-0.06536330282688141,
0.08962282538414001,
0.05047653615474701,
-0.3412311375141144,
-0.11637704074382782,
0.705671489238739,
0.04885837808251381,
0.0017254427075386047,
0.3577711284160614,
-0.12393595278263092,
-0.09520939737558365,
-0.12391118705272675,
-0.14535531401634216,
0.3204535245895386,
-0.20484861731529236,
0.003869965672492981,
-0.05942792445421219,
0.0060720294713974,
-0.2864757776260376,
-0.04583369940519333,
0.4554532468318939,
-0.1614351123571396,
0.06094996631145477,
-0.029046662151813507,
-0.7448316216468811,
0.13806000351905823,
-0.2714283764362335,
0.2607356011867523,
0.06460258364677429,
-0.11165379732847214,
0.027049265801906586,
0.4495250880718231,
-0.12950164079666138,
-0.12950587272644043,
-0.16947878897190094,
-0.2913074195384979,
0.3467559814453125,
0.15244224667549133,
0.2677156925201416,
-0.2695860266685486,
-0.07608941197395325,
0.172309011220932,
-0.21942919492721558,
-0.06833821535110474,
-0.07258593291044235,
0.17665407061576843,
-0.062071554362773895,
-0.2308845967054367,
-0.06744576245546341,
-0.5503065586090088,
0.11531633883714676,
-0.4100363552570343,
0.37199413776397705,
0.4206143021583557,
0.03616868704557419,
0.01328323408961296,
0.12662088871002197,
-0.12784354388713837,
0.17063917219638824,
0.11185604333877563,
0.04760293662548065,
0.11447800695896149,
0.18285132944583893,
0.1897387057542801,
0.1765199899673462,
-0.051250189542770386,
-0.1423248052597046,
0.10825125873088837,
-0.023978713899850845,
-0.11218547821044922,
-0.003768322989344597,
0.143968403339386,
-0.19178341329097748,
0.18905110657215118,
0.26608243584632874,
0.029343407601118088,
-0.186301127076149,
0.04616110771894455,
0.19087554514408112,
0.002480565570294857,
0.04210274666547775,
-0.2176535278558731,
0.4987298548221588,
-0.10391809046268463,
0.0235060453414917,
0.3974391222000122,
0.3486301302909851,
-0.27228766679763794,
-0.2137683480978012,
0.03596112132072449,
0.4068397879600525,
-0.028899790719151497,
0.01120590791106224,
0.08091247826814651,
0.35306113958358765,
-0.09576776623725891,
0.28747692704200745,
0.4865204095840454,
0.5522096157073975,
0.5137813091278076,
-0.11345857381820679,
0.0356442928314209,
-0.29886001348495483,
0.24770082533359528,
0.032258618623018265,
-0.5990632772445679,
-0.2809932231903076,
0.22966870665550232,
-0.33990663290023804,
0.37247392535209656,
-0.10789316892623901,
0.4080168604850769,
0.06379939615726471,
-0.36258360743522644,
0.10179858654737473,
-0.07138320803642273,
-0.18282701075077057,
-0.20027859508991241,
0.11813418567180634,
-0.08030152320861816,
0.018499702215194702,
0.07759140431880951,
0.15168149769306183,
-0.46083199977874756,
0.7768099308013916,
-0.050488702952861786,
-0.11010968685150146,
0.1794300675392151,
-0.057002175599336624,
0.16625511646270752,
0.029261691495776176,
-0.3871264159679413,
0.2721047103404999,
-0.1924344301223755,
0.05873964726924896,
0.01810167171061039,
0.2345411628484726,
0.13439838588237762,
0.12765565514564514,
0.34212207794189453,
0.2574496269226074,
0.20047180354595184,
0.04857034236192703,
-0.17509245872497559,
0.1426120400428772,
-0.0036098361015319824,
0.11605722457170486,
0.03422277420759201,
-0.008327575400471687,
0.042490262538194656,
-0.050876956433057785,
-0.12724468111991882,
0.2653738856315613,
-0.30555886030197144,
-0.1871614307165146,
-0.26806652545928955,
-0.2500818371772766,
-0.08281661570072174,
0.03076895698904991,
-0.4188558757305145,
0.17237134277820587,
0.29021012783050537,
-0.21250343322753906,
0.08387734740972519,
-0.09037464112043381,
-0.010839475318789482,
-0.02849426493048668,
0.29891085624694824,
0.1265399307012558,
0.006555117666721344,
-0.14677055180072784,
-0.25347864627838135,
-0.2521827816963196,
0.05622785538434982,
-0.47398072481155396,
-0.13269534707069397,
0.05991119146347046,
-0.1202656626701355,
-0.3658946454524994,
-0.3711334466934204,
0.17925532162189484,
-0.22231748700141907,
-0.17678532004356384,
0.20569971203804016,
0.0452139675617218,
-0.46714821457862854,
-0.14442342519760132,
0.03692488372325897,
0.17770147323608398,
-0.2353837639093399,
0.3653358817100525,
-0.1001521646976471,
-0.12313955277204514,
-0.07921312749385834,
0.46536803245544434,
-0.05931936204433441,
-0.04929737374186516,
0.3243132531642914,
0.1741533875465393,
0.19784560799598694,
0.010101988911628723,
-0.048259325325489044,
-0.3814617395401001,
0.12730678915977478,
-0.18582004308700562,
-0.022373482584953308,
-0.027430875226855278,
0.19609643518924713,
-0.5123342871665955,
-0.4655313193798065,
-0.2638844847679138,
0.2782319188117981,
-0.0562564879655838,
0.041340604424476624,
0.09679992496967316,
-0.12489569187164307,
-0.04492294788360596,
0.1253737360239029,
0.27126187086105347,
0.4220229387283325,
-0.08351486176252365,
-0.029000449925661087,
-0.03739439696073532,
-0.1416746973991394,
0.3496130704879761,
-0.39642491936683655,
-0.08082815259695053,
0.30118614435195923,
0.35519373416900635,
0.12454686313867569,
-0.5498672723770142,
-0.4734572470188141,
0.02185206115245819,
0.206244558095932,
0.02746790647506714,
-0.09401429444551468,
0.16511563956737518,
-0.48263320326805115,
-0.040536485612392426,
0.053352780640125275,
0.3204176723957062,
0.13140246272087097,
-0.2901759445667267,
0.2499200701713562,
-0.36239373683929443
] |
https://github.com/huggingface/datasets/issues/6172 | Hi! The streaming mode also retries requests - `datasets.config.STREAMING_READ_MAX_RETRIES` (20 sec by default) controls the number of retries and `datasets.config.STREAMING_READ_RETRY_INTERVAL` (5 sec) the sleep time between retries.
> At step 1800 I got a 504 HTTP status code error from Huggingface hub for my pytorch dataloader
A minor Hub outage that we experienced yesterday could be the cause. | Make Dataset streaming queries retryable | ### Feature request
Streaming datasets, as intended, do not load the entire dataset in memory or disk. However, while querying the next data chunk from the remote, sometimes it is possible that the service is down or there might be other issues that may cause the query to fail. In such a scenario, it would be nice to make these queries retryable (perhaps with a backoff strategy).
### Motivation
I was working on a model and the model checkpoints after every 1000 steps. At step 1800 I got a 504 HTTP status code error from Huggingface hub for my pytorch `dataloader`. Given the size of my model and data, it took around 2 hours to reach 1800 steps and now it will take about an hour to recover the lost 800. It would be better to get a retryable querying strategy.
### Your contribution
It would be better if someone having experience in this area takes this up as this would require some testing. | 58 | Make Dataset streaming queries retryable
### Feature request
Streaming datasets, as intended, do not load the entire dataset in memory or disk. However, while querying the next data chunk from the remote, sometimes it is possible that the service is down or there might be other issues that may cause the query to fail. In such a scenario, it would be nice to make these queries retryable (perhaps with a backoff strategy).
### Motivation
I was working on a model and the model checkpoints after every 1000 steps. At step 1800 I got a 504 HTTP status code error from Huggingface hub for my pytorch `dataloader`. Given the size of my model and data, it took around 2 hours to reach 1800 steps and now it will take about an hour to recover the lost 800. It would be better to get a retryable querying strategy.
### Your contribution
It would be better if someone having experience in this area takes this up as this would require some testing.
Hi! The streaming mode also retries requests - `datasets.config.STREAMING_READ_MAX_RETRIES` (20 sec by default) controls the number of retries and `datasets.config.STREAMING_READ_RETRY_INTERVAL` (5 sec) the sleep time between retries.
> At step 1800 I got a 504 HTTP status code error from Huggingface hub for my pytorch dataloader
A minor Hub outage that we experienced yesterday could be the cause. | [
-0.29541707038879395,
-0.2703626751899719,
0.0007498636841773987,
-0.021915271878242493,
0.10868605971336365,
0.013974592089653015,
-0.12818649411201477,
0.09762012958526611,
-0.013967953622341156,
-0.19625216722488403,
-0.18767207860946655,
0.0036080479621887207,
-0.1256556361913681,
0.39839935302734375,
0.18668612837791443,
-0.29653599858283997,
-0.34636160731315613,
0.11227008700370789,
0.12365483492612839,
0.2588014602661133,
0.0815972238779068,
-0.2508304715156555,
-0.020374342799186707,
-0.3388586640357971,
-0.13781856000423431,
0.05921193212270737,
0.00957462191581726,
0.0007380275055766106,
-0.06732352077960968,
-0.6246376037597656,
0.17132142186164856,
0.4430934488773346,
0.4661674201488495,
0.301101952791214,
-0.00011579432612052187,
-0.11990417540073395,
0.14660990238189697,
-0.2111143171787262,
-0.721375584602356,
0.05927672237157822,
-0.2657698392868042,
0.05514270067214966,
0.22689983248710632,
-0.03304297477006912,
0.04379122704267502,
0.052479736506938934,
0.22446827590465546,
-0.2147330939769745,
0.48302480578422546,
0.3403301537036896,
0.10658624023199081,
0.4668280780315399,
-0.15917791426181793,
0.11094322055578232,
-0.35599344968795776,
0.31586095690727234,
-0.1949995756149292,
0.4027954936027527,
0.496052622795105,
0.12887048721313477,
-0.18732544779777527,
0.3632460832595825,
-0.13156580924987793,
0.17876935005187988,
0.023839816451072693,
-0.3852141201496124,
-0.2452983558177948,
-0.249495729804039,
-0.10626000165939331,
0.18964582681655884,
0.41227391362190247,
-0.012847441248595715,
-0.31117701530456543,
-0.5874390602111816,
0.10507892072200775,
-0.2830791771411896,
-0.13693222403526306,
-0.02125292643904686,
-0.09248533844947815,
0.14323461055755615,
-0.3695390224456787,
-0.29999521374702454,
-0.08230838179588318,
-0.156221404671669,
0.020645469427108765,
-0.1599237322807312,
0.017253108322620392,
0.15037181973457336,
0.03387005627155304,
0.03292258083820343,
0.4520016312599182,
-0.06404697895050049,
-0.03525179252028465,
-0.16971716284751892,
-0.5733368396759033,
-0.008142098784446716,
0.07032616436481476,
0.23552419245243073,
0.15892651677131653,
0.4469142556190491,
0.6489377617835999,
0.16139322519302368,
0.09632419049739838,
0.0347948856651783,
0.08602797240018845,
0.04632464051246643,
0.3463922441005707,
-0.08086363971233368,
0.27352645993232727,
0.4750582277774811,
-0.3037619888782501,
-0.08559665083885193,
-0.002194676548242569,
0.1297425627708435,
0.4287428855895996,
0.17739194631576538,
0.3389730453491211,
-0.2268686443567276,
-0.0017219632863998413,
-0.09656521677970886,
-0.2471621185541153,
-0.17547082901000977,
0.31668710708618164,
0.19086596369743347,
-0.18337886035442352,
0.2868892550468445,
0.011956803500652313,
-0.10256586968898773,
-0.1253749579191208,
-0.7020438313484192,
-0.02226240560412407,
-0.46266698837280273,
-0.013288810849189758,
0.3659743070602417,
0.43946897983551025,
-0.5332961082458496,
0.12107282876968384,
-0.1756441295146942,
0.1332634687423706,
-0.02732882648706436,
0.4574124217033386,
0.05031229183077812,
-0.03792873024940491,
0.09118689596652985,
-0.3239949941635132,
-0.10712970793247223,
0.22286592423915863,
0.32124200463294983,
-0.11080845445394516,
0.0438557043671608,
-0.0034655481576919556,
-0.4027083218097687,
0.3211916983127594,
0.14898382127285004,
-0.005951769649982452,
-0.2394692301750183,
-0.43649592995643616,
0.32719966769218445,
-0.02170495316386223,
-0.08759292960166931,
0.3884226381778717,
-0.06399737298488617,
0.14750945568084717,
-0.02879505231976509,
0.2486911118030548,
0.6825337409973145,
-0.206974595785141,
-0.21601997315883636,
-0.06365325301885605,
0.06787899136543274,
0.12808775901794434,
0.22286134958267212,
-0.28687870502471924,
0.042285189032554626,
-0.11119097471237183,
-0.027619436383247375,
0.4916827082633972,
-0.16616883873939514,
-0.1343519240617752,
0.12771373987197876,
-0.22714164853096008,
0.05471620708703995,
-0.00925976037979126,
0.2555113136768341,
0.3740985095500946,
0.13388752937316895,
0.1041780412197113,
0.1048327088356018,
-0.3128146827220917,
-0.15079054236412048,
-0.2603496015071869,
-0.3192700147628784,
0.2154320925474167,
0.3805047571659088,
0.20574331283569336,
0.04154052585363388,
0.21495002508163452,
-0.28164973855018616,
0.1481621265411377,
-0.011727634817361832,
0.057717807590961456,
0.012664781883358955,
0.09261152893304825,
0.03248796612024307,
-0.043848004192113876,
-0.31230953335762024,
-0.45127370953559875,
0.1824718713760376,
0.11505807936191559,
-0.1690497249364853,
0.10153625160455704,
-0.002672456204891205,
-0.21952715516090393,
-0.29440170526504517,
-0.2704227566719055,
-0.0003257598727941513,
0.032860953360795975,
0.10343311727046967,
0.00868990272283554,
0.14817512035369873,
-0.3756175637245178,
0.4267134964466095,
-0.3898700773715973,
0.004366543143987656,
-0.2360091507434845,
0.45520883798599243,
0.16183406114578247,
-0.026943091303110123,
-0.1147182360291481,
-0.1569189578294754,
0.36371976137161255,
0.058404937386512756,
-0.012073365971446037,
0.2312423586845398,
-0.29401957988739014,
0.3067159056663513,
0.3682374954223633,
0.19216406345367432,
0.10819096863269806,
0.04081493616104126,
0.2076190710067749,
0.2254142314195633,
-0.057583749294281006,
-0.28709614276885986,
0.14161622524261475,
0.08278634399175644,
-0.035137951374053955,
0.14997391402721405,
0.025781922042369843,
-0.030049670487642288,
0.18221494555473328,
-0.012082800269126892,
-0.45464521646499634,
0.10487932711839676,
0.4068942666053772,
-0.2256316840648651,
-0.09699376672506332,
-0.06570155173540115,
-0.44204652309417725,
0.26959407329559326,
0.08229928463697433,
-0.13806793093681335,
0.27838262915611267,
0.13208752870559692,
-0.07230055332183838,
-0.13034452497959137,
0.45193561911582947,
0.19014549255371094,
0.3605138063430786,
-0.0048393551260232925,
0.1377962827682495,
0.0605679526925087,
-0.047217246145009995,
-0.30306658148765564,
0.14565280079841614,
-0.19371964037418365,
0.029489081352949142,
0.16282664239406586,
0.3314610719680786,
-0.1632618010044098,
-0.5489234924316406,
-0.21770627796649933,
0.27811747789382935,
-0.06924588978290558,
-0.27294111251831055,
0.09319932013750076,
-0.44200950860977173,
-0.23918214440345764,
-0.04008913412690163,
0.14116232097148895,
-0.15408873558044434,
-0.3129417896270752,
0.12695352733135223,
0.45939260721206665,
-0.06106468290090561,
0.17681032419204712,
-0.28625598549842834,
0.35794609785079956,
-0.07386152446269989,
-0.09857374429702759,
-0.3053772449493408,
-0.20680414140224457,
0.042285386472940445,
0.0036889538168907166,
-0.11867426335811615,
-0.03143179416656494,
0.5322058796882629,
-0.10208922624588013,
0.031640127301216125,
-0.694966197013855,
-0.17090219259262085,
0.13508820533752441,
0.13304287195205688,
0.09885336458683014,
0.0970587208867073,
0.33709144592285156,
-0.17014957964420319,
-0.06708573549985886,
0.056230418384075165,
-0.15507739782333374,
0.12879717350006104,
-0.020771276205778122,
0.001731783151626587,
0.6250604391098022,
-0.03324570134282112,
-0.03154752030968666,
-0.3103235363960266,
-0.37380456924438477,
0.4574665427207947,
-0.3009895384311676,
-0.0508435033261776,
0.1384878009557724,
-0.06384646892547607,
-0.02367396280169487,
-0.3413759469985962,
-0.05692195147275925,
-0.2623242139816284,
-0.4798536002635956,
0.3108038306236267,
-0.00958491861820221,
-0.16714352369308472,
-0.004896074533462524,
0.04419844597578049,
0.1256006956100464,
0.24118918180465698,
-0.6167525053024292,
-0.4241224229335785,
0.09836781024932861,
0.29399871826171875,
-0.1087101548910141,
-0.06721467524766922,
-0.0030677951872348785,
0.03860897570848465,
0.033201370388269424,
0.22104482352733612,
0.10844138264656067,
-0.20445457100868225,
0.4770115911960602,
0.3042914867401123,
-0.15765774250030518,
0.38718828558921814,
-0.057327836751937866,
0.5570813417434692,
0.08746620267629623,
0.06040533632040024,
0.536299467086792,
0.1645173579454422,
0.24585729837417603,
-0.06604015827178955,
-0.33190223574638367,
0.1357339322566986,
-0.36800962686538696,
-0.23767900466918945,
-0.10729373246431351,
0.07027138769626617,
-0.0023493692278862,
-0.1789931058883667,
-0.19991707801818848,
0.014138124883174896,
-0.41588926315307617,
0.07158240675926208,
-0.17208972573280334,
0.27860546112060547,
-0.0010098442435264587,
0.15690355002880096,
-0.25531405210494995,
0.04833132028579712,
-0.03102562390267849,
0.20297369360923767,
0.6561940312385559,
-0.1066950261592865,
-0.30789715051651,
0.07694454491138458,
-0.5279971361160278,
0.10516931116580963,
0.032022785395383835,
0.2875622510910034,
-0.011854246258735657,
0.26984933018684387,
-0.10712816566228867,
0.03968213126063347,
0.2917567193508148,
-0.20753346383571625,
-0.07915206998586655,
-0.07622712850570679,
-0.13123425841331482,
-0.01445465162396431,
-0.031150422990322113,
0.31555578112602234,
0.011201728135347366,
-0.020436367020010948,
0.07752987742424011,
-0.3882023096084595,
0.15178601443767548,
-0.009032239206135273,
0.3615759313106537,
-0.18681257963180542,
-0.020728982985019684,
0.1419314593076706,
-0.43258795142173767,
-0.3081449866294861,
0.06979694962501526,
-0.0422244518995285,
-0.3264515697956085,
-0.1722221076488495,
-0.11186632513999939,
-0.06697404384613037,
0.23550347983837128,
0.015459846705198288,
0.051667943596839905,
0.1231168806552887,
-0.047511812299489975,
0.3467578887939453,
0.2573557198047638,
-0.07187294960021973,
0.3793278634548187,
0.4363870918750763,
-0.06036386638879776,
-0.10214461386203766,
0.05619686096906662,
0.3084316849708557,
0.17782659828662872,
0.36723172664642334,
-0.07609941810369492,
0.6129276752471924,
0.46052807569503784,
0.4239582121372223,
-0.4817168712615967,
-0.03117380477488041,
0.07601688802242279,
0.07740579545497894,
-0.2842133343219757,
-0.5925436615943909,
0.30900439620018005,
-0.24091586470603943,
0.07229557633399963,
0.3064042031764984,
-0.08239215612411499,
0.09611771255731583,
-0.19909165799617767,
0.17029698193073273,
0.9642576575279236,
-0.12178337574005127,
0.059911489486694336,
0.14541499316692352,
-0.21104049682617188,
0.43369755148887634,
-0.31128937005996704,
0.3207915127277374,
-0.15052667260169983,
-0.19428330659866333,
-0.07134109735488892,
-0.06250426173210144,
0.04813864454627037,
-0.18453150987625122,
-0.16513913869857788,
0.5121215581893921,
0.03170691430568695,
0.5975414514541626,
0.09215018898248672,
0.14588548243045807,
-0.49965423345565796,
-0.01381047535687685,
-0.43190667033195496,
0.10263393819332123,
-0.2387799173593521,
-0.1754155158996582,
-0.11872687935829163,
0.06500619649887085,
0.6887849569320679,
0.1209394708275795,
-0.22792652249336243,
-0.18632128834724426,
-0.40421995520591736,
0.03250410035252571,
-0.48335182666778564,
-0.28666484355926514,
-0.017628449946641922,
0.06305296719074249,
-0.172937273979187,
-0.09723123908042908,
-0.2853436768054962,
0.20391735434532166,
0.09309956431388855,
-0.022766515612602234,
-0.11218908429145813,
-0.09401848912239075,
-0.07371873408555984,
0.09238867461681366,
-0.44912731647491455,
0.06886274367570877,
0.08175759762525558,
-0.5874561667442322,
-0.2524779438972473,
0.012938465923070908,
-0.10510320961475372,
-0.15160873532295227,
0.1504240185022354,
-0.015243478119373322,
-0.1181035190820694,
-0.22592730820178986,
0.011528167873620987,
0.05440934747457504,
0.2026597559452057,
0.1188417598605156,
0.09284950792789459,
0.06221650540828705,
-0.3375343978404999,
0.5052089095115662,
0.09459759294986725,
-0.23626850545406342,
0.3641327917575836,
0.23004314303398132,
-0.2730177044868469,
-0.19483889639377594,
-0.09170084446668625,
0.001223340630531311,
-0.34942013025283813,
0.33719906210899353,
-0.20780102908611298,
0.024417072534561157,
0.054063934832811356,
-0.1255214661359787,
0.11996050179004669,
-0.19843970239162445,
-0.33729031682014465,
-0.07941100001335144,
-0.36608538031578064,
0.2072734832763672,
0.23722736537456512,
0.07402433454990387,
-0.04014196991920471,
-0.03411491587758064,
-0.18315622210502625,
0.06649309396743774,
-0.2653486430644989,
0.11536075919866562,
-0.12109903246164322,
0.16944041848182678,
-0.23152048885822296,
-0.2168256640434265,
0.2899463176727295,
-0.03379421681165695,
-0.05367385223507881,
0.2672327160835266,
-0.07307323813438416,
-0.06289449334144592,
0.049913190305233,
0.20194336771965027,
0.030827131122350693,
-0.19767475128173828,
-0.26224392652511597,
-0.4183293282985687,
-0.11502830684185028,
-0.3109724521636963,
0.0074806734919548035,
0.3877354860305786,
0.13308551907539368,
-0.07754641771316528,
0.5485705733299255,
-0.17906233668327332,
-0.1304049789905548,
0.2521955370903015,
0.15104779601097107,
0.1740519404411316,
-0.01922472193837166,
0.049576956778764725,
-0.159429669380188,
0.06008484214544296,
-0.23749075829982758,
0.2345975637435913,
0.44959136843681335,
0.011662442237138748,
0.46100977063179016,
-0.03851069509983063,
-0.3857663869857788,
-0.16001439094543457,
0.4661071002483368,
0.4464748203754425,
0.14561331272125244,
-0.03208153694868088,
-0.05225018039345741,
0.09749919176101685,
-0.13778284192085266,
-0.057954512536525726,
0.1580972671508789,
0.16914460062980652,
0.2999016046524048,
0.18255773186683655,
-0.05199627950787544,
-0.14717347919940948,
0.21813549101352692,
-0.04833899438381195,
0.35710251331329346,
0.10169896483421326,
0.1506892442703247,
0.20927025377750397,
0.285211980342865,
-0.22277463972568512,
0.23262466490268707,
0.22885504364967346,
0.20728521049022675,
-0.4094075560569763,
-0.12968334555625916,
0.2359350025653839,
0.2789524793624878,
0.2366751879453659,
0.027330845594406128,
-0.12877312302589417,
-0.08110454678535461,
-0.09502938389778137,
-0.09595847129821777,
0.15967950224876404,
0.07725036144256592,
0.08170018345117569,
-0.06587742269039154,
-0.07173275947570801,
-0.16259899735450745,
0.2130374014377594,
0.08494269102811813,
0.03584083169698715,
-0.08511260151863098,
-0.3888740837574005,
-0.09479277580976486,
-0.01852608472108841,
0.0745709091424942,
0.05931645259261131,
0.08133500814437866,
0.025017354637384415,
0.10500715672969818,
-0.41798800230026245,
-0.06715720146894455,
0.3530810475349426,
0.4598931670188904,
-0.12681244313716888,
-0.033958807587623596,
0.6732091307640076,
0.03840871527791023,
0.25452813506126404,
0.25303712487220764,
0.010946141555905342,
-0.007488670758903027,
-0.10430771112442017,
0.3864264488220215,
0.19491636753082275,
0.06418810039758682,
-0.04963410645723343,
0.14984503388404846,
0.09615284204483032,
-0.08509473502635956,
0.22625800967216492,
0.13604477047920227,
-0.052876055240631104,
0.2614767253398895,
-0.24266317486763,
-0.1703343689441681,
-0.42009010910987854,
0.23184192180633545,
0.23896992206573486,
-0.008245222270488739,
0.0913843959569931,
-0.22991451621055603,
-0.23139211535453796,
0.31364139914512634,
0.5174262523651123,
-0.21029359102249146,
0.009783413261175156,
-0.007681816816329956,
0.05542600899934769,
-0.19829845428466797,
0.3670206367969513,
0.4681605398654938,
0.2614961564540863,
-0.3034343123435974,
0.1206379383802414,
-0.5665380358695984,
-0.21125750243663788,
-0.09859490394592285,
-0.11328087002038956,
0.37287184596061707,
0.13398480415344238,
0.14318209886550903,
0.21039287745952606,
0.15923169255256653,
-0.01637282595038414,
0.09087874740362167,
-0.016395600512623787,
-0.22703814506530762,
-0.47768253087997437,
0.24419081211090088,
0.19852973520755768,
-0.14918649196624756,
-0.18055057525634766,
0.4719679653644562,
0.1090167909860611,
-0.05474110692739487,
0.0002632066607475281,
-0.22922782599925995,
0.18680579960346222,
-0.21857622265815735,
0.29134637117385864,
-0.03195244073867798,
0.06383202224969864,
0.08251949399709702,
-0.26494818925857544,
-0.17852355539798737,
-0.2320004105567932,
0.04359332472085953,
-0.24376404285430908,
-0.07047300040721893,
0.5515286922454834,
0.03672078251838684,
-0.25320273637771606,
-0.5732106566429138,
0.4293729066848755,
-0.02869875356554985,
-0.04945366829633713,
0.02882271260023117,
0.08837191015481949,
0.16971996426582336,
0.006380055099725723,
-0.06216208264231682,
0.22903311252593994,
-0.06067419424653053,
0.36684805154800415,
0.010172471404075623,
-0.19221231341362,
0.6426931023597717,
-0.32302021980285645,
-0.01702149212360382,
-0.15808160603046417,
0.23815682530403137,
0.383867472410202,
-0.10090529918670654,
-0.6986379623413086,
-0.2353023886680603,
0.2966553568840027,
-0.1143275648355484,
0.14336365461349487,
0.2651509642601013,
0.19616948068141937,
0.0684707835316658,
-0.22958813607692719,
0.18263165652751923,
-0.03165849670767784,
0.08881935477256775,
-0.007397092878818512,
-0.13904112577438354
] |
https://github.com/huggingface/datasets/issues/6172 | I wanted something similar. I have a huge dataset I want to process (laion-2b), but after processing several batches, it sometimes fails with this error: `HTTP 502 Bad Gateway for url`. I had the following code to handle it but this way I believe it restarts processing the data from the first batch? How can I set the attribute values you mention above?
```
iterable_dataset = load_dataset("laion/laion2B-multi", streaming=True, split='train')
dataloader = DataLoader(iterable_dataset, batch_size=131072, collate_fn=custom_collate_fn, num_workers=8)
MAX_RETRIES = 5
RETRY_WAIT = 10 # wait 10 seconds before retry
for retry in range(MAX_RETRIES):
try:
for j, batch in enumerate(dataloader):
< process batch>
except HfHubHTTPError as e:
if "502" in str(e) and retry < MAX_RETRIES - 1:
logging.warning(f"Encountered a 502 error on batch {j}. Waiting for {RETRY_WAIT} seconds before retrying.")
time.sleep(RETRY_WAIT)
continue
else:
raise | Make Dataset streaming queries retryable | ### Feature request
Streaming datasets, as intended, do not load the entire dataset in memory or disk. However, while querying the next data chunk from the remote, sometimes it is possible that the service is down or there might be other issues that may cause the query to fail. In such a scenario, it would be nice to make these queries retryable (perhaps with a backoff strategy).
### Motivation
I was working on a model and the model checkpoints after every 1000 steps. At step 1800 I got a 504 HTTP status code error from Huggingface hub for my pytorch `dataloader`. Given the size of my model and data, it took around 2 hours to reach 1800 steps and now it will take about an hour to recover the lost 800. It would be better to get a retryable querying strategy.
### Your contribution
It would be better if someone having experience in this area takes this up as this would require some testing. | 131 | Make Dataset streaming queries retryable
### Feature request
Streaming datasets, as intended, do not load the entire dataset in memory or disk. However, while querying the next data chunk from the remote, sometimes it is possible that the service is down or there might be other issues that may cause the query to fail. In such a scenario, it would be nice to make these queries retryable (perhaps with a backoff strategy).
### Motivation
I was working on a model and the model checkpoints after every 1000 steps. At step 1800 I got a 504 HTTP status code error from Huggingface hub for my pytorch `dataloader`. Given the size of my model and data, it took around 2 hours to reach 1800 steps and now it will take about an hour to recover the lost 800. It would be better to get a retryable querying strategy.
### Your contribution
It would be better if someone having experience in this area takes this up as this would require some testing.
I wanted something similar. I have a huge dataset I want to process (laion-2b), but after processing several batches, it sometimes fails with this error: `HTTP 502 Bad Gateway for url`. I had the following code to handle it but this way I believe it restarts processing the data from the first batch? How can I set the attribute values you mention above?
```
iterable_dataset = load_dataset("laion/laion2B-multi", streaming=True, split='train')
dataloader = DataLoader(iterable_dataset, batch_size=131072, collate_fn=custom_collate_fn, num_workers=8)
MAX_RETRIES = 5
RETRY_WAIT = 10 # wait 10 seconds before retry
for retry in range(MAX_RETRIES):
try:
for j, batch in enumerate(dataloader):
< process batch>
except HfHubHTTPError as e:
if "502" in str(e) and retry < MAX_RETRIES - 1:
logging.warning(f"Encountered a 502 error on batch {j}. Waiting for {RETRY_WAIT} seconds before retrying.")
time.sleep(RETRY_WAIT)
continue
else:
raise | [
-0.3285529613494873,
-0.22608637809753418,
0.009165838360786438,
-0.042981378734111786,
0.07556532323360443,
-0.07040054351091385,
-0.03591199591755867,
0.10144767165184021,
-0.12809261679649353,
-0.2123432606458664,
-0.22453515231609344,
-0.15045294165611267,
-0.04445352405309677,
0.45431724190711975,
0.0918397381901741,
-0.30311185121536255,
-0.3512148857116699,
0.1650540679693222,
0.15733331441879272,
0.25695890188217163,
-0.03730577230453491,
-0.1564430445432663,
0.0029809772968292236,
-0.2707706689834595,
-0.026869310066103935,
-0.04975568503141403,
0.04526510834693909,
0.0965358167886734,
-0.05097225308418274,
-0.7027879953384399,
0.08832094073295593,
0.47951358556747437,
0.5202824473381042,
0.2292674332857132,
-0.00012537204020190984,
-0.09398356080055237,
0.09193342924118042,
-0.18722324073314667,
-0.6247248649597168,
0.01936723291873932,
-0.31893277168273926,
-0.09647087007761002,
0.18600037693977356,
-0.13849620521068573,
0.1121833398938179,
0.054373614490032196,
0.11240455508232117,
-0.1346316784620285,
0.5433717370033264,
0.2636464238166809,
0.028984829783439636,
0.28258612751960754,
-0.12148159742355347,
0.297573447227478,
-0.10580720007419586,
0.13336420059204102,
-0.13328976929187775,
0.417832612991333,
0.40963828563690186,
0.10146279633045197,
-0.1785885989665985,
0.24691030383110046,
-0.2226114422082901,
0.16969609260559082,
-0.050485361367464066,
-0.2799859046936035,
0.0800907164812088,
-0.2564370930194855,
-0.05874645337462425,
0.21381151676177979,
0.1652660071849823,
-0.13275954127311707,
-0.34348154067993164,
-0.5485994219779968,
0.07508139312267303,
-0.5539431571960449,
-0.09874376654624939,
0.034354597330093384,
0.03869560360908508,
0.18415246903896332,
-0.2724054455757141,
-0.19701406359672546,
-0.2275569587945938,
-0.0078219473361969,
0.14238795638084412,
-0.015454966574907303,
0.012038048356771469,
0.17798005044460297,
0.026913244277238846,
0.13421346247196198,
0.2764098048210144,
0.03120926022529602,
-0.1619562953710556,
-0.06624278426170349,
-0.5763355493545532,
0.012932710349559784,
0.0155898816883564,
0.1709565818309784,
0.2027035355567932,
0.536738932132721,
0.6547712683677673,
0.010029464960098267,
0.17991332709789276,
0.13295353949069977,
-0.004360862076282501,
0.1862575113773346,
0.294614315032959,
-0.26168474555015564,
0.3511699438095093,
0.463800847530365,
-0.17961136996746063,
0.02141740918159485,
-0.0029417797923088074,
-0.048425931483507156,
0.46860530972480774,
0.43563929200172424,
0.2656402587890625,
-0.05176845192909241,
-0.17373794317245483,
0.06159653142094612,
-0.375188946723938,
-0.2825140058994293,
0.42469996213912964,
0.24157676100730896,
-0.24554193019866943,
0.3577966094017029,
-0.050349317491054535,
0.06815917044878006,
-0.16359631717205048,
-0.6158173084259033,
0.09777692705392838,
-0.32566457986831665,
0.0019519925117492676,
0.3932899534702301,
0.4542374014854431,
-0.3270436227321625,
0.1457425206899643,
-0.17399294674396515,
0.09845513105392456,
-0.12816549837589264,
0.5850683450698853,
-0.18341943621635437,
-0.05871234089136124,
0.15651844441890717,
-0.24172081053256989,
0.05682351440191269,
0.24572405219078064,
0.12003718316555023,
-0.11202432215213776,
0.02460179105401039,
-0.041002824902534485,
-0.47697609663009644,
0.40460073947906494,
0.01867673173546791,
0.017514854669570923,
-0.22226761281490326,
-0.4995326101779938,
0.2650204598903656,
0.1154516190290451,
0.030631542205810547,
0.38555362820625305,
0.017406918108463287,
0.07852889597415924,
-0.10375746339559555,
0.2976211905479431,
0.7100101709365845,
-0.22395610809326172,
-0.18477115035057068,
0.12368728220462799,
0.10063213109970093,
0.23361685872077942,
0.15941296517848969,
-0.2414563149213791,
0.22630777955055237,
-0.043316882103681564,
-0.09587651491165161,
0.4028816819190979,
-0.2272091507911682,
-0.11689621955156326,
0.13708749413490295,
-0.13419198989868164,
0.002134062349796295,
0.1858905851840973,
0.20696879923343658,
0.43005239963531494,
-0.005387455224990845,
0.195369154214859,
0.10706827789545059,
-0.10805205255746841,
-0.08793666213750839,
-0.18850526213645935,
-0.22500652074813843,
0.17958438396453857,
0.19551759958267212,
0.13745835423469543,
0.14669135212898254,
0.11470703780651093,
-0.42265909910202026,
0.17195305228233337,
-0.09375125914812088,
0.12937095761299133,
0.027888190001249313,
0.19851508736610413,
0.06116381287574768,
0.009198807179927826,
-0.06930124014616013,
-0.4072802662849426,
0.12325471639633179,
-0.13046106696128845,
-0.27657490968704224,
0.0479256771504879,
0.014310985803604126,
-0.3583638072013855,
-0.25089287757873535,
-0.2637924551963806,
-0.004307033494114876,
-0.05260870233178139,
0.07420100271701813,
0.02493961900472641,
0.10580137372016907,
-0.3734322190284729,
0.5317687392234802,
-0.39615562558174133,
0.023478176444768906,
-0.20513640344142914,
0.4171878695487976,
0.14517948031425476,
0.005688454955816269,
-0.07828046381473541,
-0.1147392988204956,
0.3891930878162384,
0.05701938271522522,
-0.02111121639609337,
0.296345591545105,
-0.22219040989875793,
0.17502343654632568,
0.378153532743454,
0.3180904686450958,
0.11682678759098053,
0.08731382340192795,
0.06221579760313034,
0.13684357702732086,
-0.09223487973213196,
-0.24532091617584229,
0.2818021774291992,
0.23098036646842957,
-0.11513698846101761,
0.21608230471611023,
0.1156693696975708,
-0.060066305100917816,
0.274152010679245,
0.009788140654563904,
-0.47296568751335144,
0.07798422873020172,
0.4661729633808136,
-0.2210707664489746,
-0.06304499506950378,
-0.19332550466060638,
-0.39442938566207886,
0.13125459849834442,
-0.23323577642440796,
-0.09382322430610657,
0.3311108648777008,
0.05351939797401428,
0.05391644686460495,
-0.046449147164821625,
0.37849095463752747,
0.2780623435974121,
0.2650761604309082,
-0.10458388924598694,
-0.02895512804389,
0.04667636752128601,
-0.23428156971931458,
-0.22330348193645477,
0.21700549125671387,
-0.13692277669906616,
0.09208537638187408,
0.21092452108860016,
0.29689788818359375,
-0.11970657110214233,
-0.4467964768409729,
-0.4560164213180542,
0.33030152320861816,
0.030631152912974358,
-0.4202655553817749,
0.123361736536026,
-0.3063877820968628,
-0.12986598908901215,
-0.051340967416763306,
0.13931235671043396,
-0.10233144462108612,
-0.18543612957000732,
0.029529012739658356,
0.43530499935150146,
-0.08611447364091873,
0.18930111825466156,
-0.5308994054794312,
0.4023531675338745,
0.011437423527240753,
-0.22574178874492645,
-0.23207473754882812,
-0.22708240151405334,
0.0217670239508152,
-0.12093766033649445,
-0.21920393407344818,
-0.2141912877559662,
0.4413304030895233,
-0.14929957687854767,
-0.08356764912605286,
-0.5246233344078064,
-0.1794491410255432,
0.098869189620018,
0.12936623394489288,
0.18405862152576447,
0.0809687077999115,
0.4912487864494324,
-0.274431049823761,
-0.07797573506832123,
0.21511708199977875,
0.0832960233092308,
0.14987289905548096,
0.02855224907398224,
-0.04621078819036484,
0.5109715461730957,
0.15024088323116302,
-0.10735656321048737,
-0.21259313821792603,
-0.31105220317840576,
0.34394532442092896,
-0.32953140139579773,
0.09646616131067276,
0.2533613443374634,
-0.04542502760887146,
-0.04816654324531555,
-0.1407211571931839,
-0.016319014132022858,
-0.24703675508499146,
-0.5252516269683838,
0.384558767080307,
-0.20398083329200745,
-0.06575243175029755,
-0.09678599238395691,
-0.07582451403141022,
0.13150110840797424,
0.3876054286956787,
-0.5247449278831482,
-0.5420214533805847,
0.06644502282142639,
0.12583637237548828,
-0.1089930534362793,
-0.048019833862781525,
-0.05882083624601364,
-0.03419741243124008,
0.10753418505191803,
0.042535170912742615,
0.11669895052909851,
0.05207487940788269,
0.5480721592903137,
0.22944647073745728,
-0.03304583206772804,
0.5322856903076172,
-0.10722095519304276,
0.6509118676185608,
0.06911060214042664,
0.15743228793144226,
0.6760733127593994,
0.1105971410870552,
0.08311856538057327,
0.10862709581851959,
-0.25966158509254456,
-0.05672314018011093,
-0.2700985074043274,
-0.26560091972351074,
-0.1120510846376419,
0.04100283235311508,
0.03997444361448288,
-0.22147467732429504,
-0.2531738877296448,
-0.09503916651010513,
-0.3914819359779358,
0.20235267281532288,
-0.15856093168258667,
0.4313216507434845,
-0.13098600506782532,
0.01984543353319168,
-0.28180691599845886,
-0.058795660734176636,
0.05571579933166504,
0.2614714205265045,
0.4444110095500946,
-0.06562075763940811,
-0.2697448134422302,
-0.15963898599147797,
-0.5180010795593262,
0.1471327841281891,
0.09745164215564728,
0.4926551580429077,
0.12670418620109558,
0.2839440703392029,
-0.06689642369747162,
-0.042045652866363525,
0.3952995240688324,
-0.2754826545715332,
0.02840789034962654,
-0.16323235630989075,
-0.1466715931892395,
-0.16216862201690674,
-0.05731317028403282,
0.22455540299415588,
0.045039016753435135,
0.09266653656959534,
-0.07171039283275604,
-0.4871172308921814,
0.22458311915397644,
0.040937747806310654,
0.1531008929014206,
-0.1298648864030838,
-0.0034216418862342834,
0.07433503866195679,
-0.5143760442733765,
-0.3270053565502167,
0.13215970993041992,
0.031226426362991333,
-0.20707100629806519,
-0.12278635054826736,
-0.09235522896051407,
-0.10290759801864624,
0.1406705677509308,
0.1153445616364479,
0.07384592294692993,
0.026896700263023376,
0.11051969230175018,
0.24865515530109406,
0.1777397096157074,
0.07045518606901169,
0.24851557612419128,
0.49003371596336365,
-0.16792063415050507,
-0.1908353567123413,
0.015555992722511292,
0.29622945189476013,
0.21405813097953796,
0.48995551466941833,
-0.15379822254180908,
0.5512128472328186,
0.46829789876937866,
0.3807361423969269,
-0.4065071642398834,
0.08790680021047592,
0.1563340723514557,
0.04919207841157913,
-0.32278311252593994,
-0.597237765789032,
0.43417680263519287,
-0.261724054813385,
-0.03477229177951813,
0.2531753480434418,
-0.023526068776845932,
0.014079537242650986,
-0.05295833572745323,
0.2768750488758087,
1.110890507698059,
-0.07812076807022095,
0.1642175018787384,
0.1304769515991211,
-0.1407400369644165,
0.2675093710422516,
-0.3703082203865051,
0.31948307156562805,
-0.2139081060886383,
0.06811048090457916,
-0.11020012199878693,
-0.13462334871292114,
0.06659300625324249,
-0.08733987808227539,
-0.11228480935096741,
0.43668052554130554,
-0.03220796585083008,
0.48065420985221863,
0.004841886460781097,
0.12396042048931122,
-0.4391445517539978,
-0.10923227667808533,
-0.31526634097099304,
-0.05528255179524422,
-0.29616230726242065,
-0.1487414389848709,
-0.20721016824245453,
0.13395018875598907,
0.47464802861213684,
0.09434640407562256,
-0.21884769201278687,
-0.3234219551086426,
-0.706180989742279,
0.16894029080867767,
-0.4652157723903656,
-0.4195737838745117,
-0.1686348170042038,
-0.027147531509399414,
0.03595834970474243,
-0.20769289135932922,
-0.24914202094078064,
0.19510003924369812,
0.014283927157521248,
0.06210974603891373,
-0.16703519225120544,
-0.1732443869113922,
0.14785228669643402,
0.05267433077096939,
-0.44484439492225647,
0.0023928089067339897,
0.1481873095035553,
-0.39334049820899963,
-0.24583812057971954,
-0.16060863435268402,
-0.06933318823575974,
-0.25620245933532715,
0.2747963070869446,
-0.04253070428967476,
-0.14574465155601501,
-0.22764992713928223,
-0.06659063696861267,
0.13876739144325256,
0.09272101521492004,
0.24575187265872955,
-0.021253768354654312,
-0.06351995468139648,
-0.26655349135398865,
0.3210905194282532,
0.015536108985543251,
-0.12090391665697098,
0.45204785466194153,
0.17460554838180542,
-0.20165181159973145,
-0.08238063007593155,
-0.1213088408112526,
-0.11813469976186752,
-0.4272654056549072,
0.38739097118377686,
-0.1472334861755371,
-0.008514419198036194,
-0.0539432168006897,
-0.029882855713367462,
0.051092665642499924,
0.10976509749889374,
-0.12577608227729797,
-0.2186630368232727,
-0.2125547230243683,
0.14428465068340302,
0.3242782950401306,
0.19312693178653717,
-0.0421706922352314,
0.03143744170665741,
-0.03054424375295639,
0.15378323197364807,
-0.1641191989183426,
-0.007226809859275818,
-0.06899607181549072,
0.21937304735183716,
-0.16736361384391785,
-0.059067368507385254,
0.3106297552585602,
0.023380551487207413,
-0.12774957716464996,
0.2175629585981369,
-0.09789510816335678,
0.02430376037955284,
-0.24175971746444702,
0.2645106911659241,
0.039019182324409485,
-0.20680628716945648,
-0.2028142362833023,
-0.46091586351394653,
-0.08521632850170135,
-0.32233530282974243,
-0.004022769629955292,
0.3279359042644501,
0.12652826309204102,
0.005921673029661179,
0.41286832094192505,
-0.18557648360729218,
-0.13156726956367493,
0.21560901403427124,
0.12456005811691284,
0.24839191138744354,
0.12474095821380615,
0.17479372024536133,
-0.17715336382389069,
-0.006816528737545013,
-0.20268304646015167,
0.15629252791404724,
0.41800373792648315,
-0.08230549097061157,
0.35683250427246094,
-0.14206141233444214,
-0.4037519693374634,
-0.27577733993530273,
0.3711633086204529,
0.4630003571510315,
0.12231390178203583,
-0.0825897753238678,
0.1558455228805542,
-0.005396619439125061,
-0.02792837843298912,
0.09328679740428925,
0.20122018456459045,
0.005973491817712784,
0.31245163083076477,
0.34865275025367737,
0.09931600093841553,
-0.14110535383224487,
0.0344938263297081,
-0.1457844078540802,
0.34146955609321594,
0.13457316160202026,
0.07367581129074097,
0.03887518122792244,
0.2625429034233093,
-0.16345182061195374,
0.178621307015419,
0.18541188538074493,
0.37994498014450073,
-0.4150488078594208,
0.08448673039674759,
0.24043996632099152,
0.3108772933483124,
0.31504034996032715,
-0.11348782479763031,
-0.28982865810394287,
-0.09388510882854462,
-0.12429454922676086,
-0.1390276551246643,
0.1508702039718628,
0.05082925036549568,
0.3600974977016449,
0.18752630054950714,
-0.0067397356033325195,
-0.10655830800533295,
0.34927380084991455,
0.19499680399894714,
-0.2059548795223236,
-0.39648857712745667,
-0.3694272041320801,
-0.13040144741535187,
-0.026197947561740875,
0.10131845623254776,
0.0743555948138237,
0.022639231756329536,
0.16556157171726227,
0.2088949978351593,
-0.5199719667434692,
-0.05429982393980026,
0.3752194344997406,
0.47080090641975403,
-0.11515939235687256,
0.06574104726314545,
0.7106806635856628,
-0.07250390201807022,
0.1415446400642395,
0.2016822099685669,
0.12598344683647156,
0.08609914034605026,
-0.1604001522064209,
0.3921763598918915,
0.16505801677703857,
0.10777425020933151,
-0.15571261942386627,
0.021304860711097717,
0.14460906386375427,
-0.1366603672504425,
0.25593188405036926,
-0.0011693648993968964,
-0.0035734549164772034,
0.18234401941299438,
-0.18295620381832123,
-0.28967219591140747,
-0.2848885655403137,
0.3609911799430847,
0.38280776143074036,
-0.015502460300922394,
0.11576749384403229,
-0.3453747034072876,
-0.2965807318687439,
0.29549795389175415,
0.5292680859565735,
-0.3376287817955017,
0.08342572301626205,
0.1010906994342804,
-0.019435059279203415,
-0.2069200873374939,
0.3930758833885193,
0.3885344862937927,
0.3588155508041382,
-0.2999096214771271,
0.1812276989221573,
-0.4580843448638916,
-0.1858060508966446,
-0.16916827857494354,
-0.08385968208312988,
0.40892332792282104,
0.08463398367166519,
0.033769119530916214,
0.26277798414230347,
0.2693291902542114,
-0.07282648980617523,
-0.036466166377067566,
0.050083812326192856,
-0.2656885087490082,
-0.472425639629364,
0.17461511492729187,
0.40675783157348633,
-0.18429851531982422,
-0.13683445751667023,
0.34091421961784363,
0.21708878874778748,
-0.12994730472564697,
-0.07132385671138763,
-0.2859894633293152,
0.16333913803100586,
-0.5349938273429871,
0.3931150436401367,
0.06308586150407791,
0.1171131432056427,
0.028349563479423523,
-0.11153481155633926,
-0.10141248255968094,
-0.21000564098358154,
0.06787966936826706,
-0.348021924495697,
0.07142804563045502,
0.5684844255447388,
-0.10535430163145065,
-0.3709303140640259,
-0.6195388436317444,
0.55760657787323,
-0.06205753609538078,
-0.06906338036060333,
0.05401027202606201,
0.13204994797706604,
0.1771705001592636,
0.01964874193072319,
-0.15392860770225525,
0.3544780910015106,
-0.12043154239654541,
0.5981874465942383,
-0.2021646797657013,
-0.3415241837501526,
0.580412745475769,
-0.5454187393188477,
-0.06109733134508133,
-0.17385251820087433,
0.4253159463405609,
0.2788125276565552,
0.23649083077907562,
-0.4871777594089508,
-0.041351206600666046,
0.25698322057724,
-0.0027124937623739243,
-0.10075438022613525,
0.26489782333374023,
0.16175183653831482,
0.11819431185722351,
-0.15727832913398743,
-0.003903863951563835,
0.08281445503234863,
0.07884921878576279,
-0.16570526361465454,
-0.14640650153160095
] |
https://github.com/huggingface/datasets/issues/6172 | Hey all! Wondering if there's a way of making Datasets streaming mode somewhat robust to Hub outages? Over the weekend, I got two quite cryptic errors, which I reckon were probably from Hub issues:
<details>
<summary> Stack Trace 1 </summary>
```
File "/home/sanchitgandhi/small-12-4-tpu-timestamped-prob-0.2/run_distillation.py", line 2119, in <module>
main()
File "/home/sanchitgandhi/small-12-4-tpu-timestamped-prob-0.2/run_distillation.py", line 1954, in main
for batch in train_loader:
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 630, in __next__
data = self._next_data()
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1325, in _next_data
return self._process_data(data)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1371, in _process_data
data.reraise()
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/_utils.py", line 694, in reraise
raise exception
ConnectionError: Caught ConnectionError in DataLoader worker process 8.
Original Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/aiohttp/connector.py", line 1155, in _create_direct_connection
hosts = await asyncio.shield(host_resolved)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/aiohttp/connector.py", line 874, in _resolve_host
addrs = await self._resolver.resolve(host, port, family=self._family)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/aiohttp/resolver.py", line 33, in resolve
infos = await self._loop.getaddrinfo(
File "/usr/lib/python3.10/asyncio/base_events.py", line 863, in getaddrinfo
return await self.run_in_executor(
File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/lib/python3.10/socket.py", line 955, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/sanchitgandhi/datasets/src/datasets/download/streaming_download_manager.py", line 333, in read_with_retries
out = read(*args, **kwargs)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/implementations/http.py", line 612, in read
return super().read(length)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/spec.py", line 1856, in read
out = self.cache._fetch(self.loc, self.loc + length)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/caching.py", line 439, in _fetch
new = self.fetcher(self.end, bend)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/asyn.py", line 118, in wrapper
return sync(self.loop, func, *args, **kwargs)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/asyn.py", line 103, in sync
raise return_result
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/asyn.py", line 56, in _runner
result[0] = await coro
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/implementations/http.py", line 660, in async_fetch_range
r = await self.session.get(
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/aiohttp/client.py", line 562, in _request
conn = await self._connector.connect(
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/aiohttp/connector.py", line 540, in connect
proto = await self._create_connection(req, traces, timeout)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/aiohttp/connector.py", line 901, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/aiohttp/connector.py", line 1169, in _create_direct_connection
raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host huggingface.co:443 ssl:default [Temporary failure in name resolution]
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop
data = fetcher.fetch(index)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 32, in fetch
data.append(next(self.dataset_iter))
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 1358, in __iter__
yield from self._iter_pytorch()
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 1293, in _iter_pytorch
for key, example in ex_iterable:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 982, in __iter__
for x in self.ex_iterable:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 862, in __iter__
yield from self._iter()
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 899, in _iter
for key, example in iterator:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 862, in __iter__
yield from self._iter()
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 899, in _iter
for key, example in iterator:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 678, in __iter__
yield from self._iter()
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 740, in _iter
for key, example in iterator:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 862, in __iter__
yield from self._iter()
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 899, in _iter
for key, example in iterator:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 1114, in __iter__
for key, example in self.ex_iterable:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 429, in __iter__
if not iterators[i].hasnext():
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 106, in hasnext
self._thenext = next(self.it)
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 678, in __iter__
yield from self._iter()
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 740, in _iter
for key, example in iterator:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 1114, in __iter__
for key, example in self.ex_iterable:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 281, in __iter__
for key, pa_table in self.generate_tables_fn(**self.kwargs):
File "/home/sanchitgandhi/.cache/huggingface/modules/datasets_modules/datasets/distil-whisper--switchboard-data/9472ee64cca0e1a7e11909c7033c2354511fa62805f81a2e07616980c765abfe/switchboard-data.py", line 247, in _generate_tables
for record_batch in pf.iter_batches():
File "pyarrow/_parquet.pyx", line 1327, in iter_batches
File "/home/sanchitgandhi/datasets/src/datasets/download/streaming_download_manager.py", line 342, in read_with_retries
raise ConnectionError("Server Disconnected") from disconnect_err
ConnectionError: Server Disconnected
```
</details>
<details>
<summary> Stack Trace 2 </summary>
```
File "/home/sanchitgandhi/small-12-2-tpu-v3-timestamped-prob-0.2-bs-512/run_distillation.py", line 2119, in <module>
main()
File "/home/sanchitgandhi/small-12-2-tpu-v3-timestamped-prob-0.2-bs-512/run_distillation.py", line 1954, in main
for batch in train_loader:
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 630, in __next__
data = self._next_data()
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1325, in _next_data
return self._process_data(data)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1371, in _process_data
data.reraise()
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/_utils.py", line 694, in reraise
raise exception
requests.exceptions.ConnectionError: Caught ConnectionError in DataLoader worker process 13.
Original Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/connectionpool.py", line 791, in urlopen
response = self._make_request(
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/connectionpool.py", line 537, in _make_request
response = conn.getresponse()
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/connection.py", line 461, in getresponse
httplib_response = super().getresponse()
File "/usr/lib/python3.10/http/client.py", line 1375, in getresponse
response.begin()
File "/usr/lib/python3.10/http/client.py", line 318, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.10/http/client.py", line 287, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/requests/adapters.py", line 486, in send
resp = conn.urlopen(
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/connectionpool.py", line 845, in urlopen
retries = retries.increment(
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/util/retry.py", line 470, in increment
raise reraise(type(error), error, _stacktrace)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/util/util.py", line 38, in reraise
raise value.with_traceback(tb)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/connectionpool.py", line 791, in urlopen
response = self._make_request(
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/connectionpool.py", line 537, in _make_request
response = conn.getresponse()
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/connection.py", line 461, in getresponse
httplib_response = super().getresponse()
File "/usr/lib/python3.10/http/client.py", line 1375, in getresponse
response.begin()
File "/usr/lib/python3.10/http/client.py", line 318, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.10/http/client.py", line 287, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop
data = fetcher.fetch(index)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 32, in fetch
data.append(next(self.dataset_iter))
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 1358, in __iter__
yield from self._iter_pytorch()
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 1293, in _iter_pytorch
for key, example in ex_iterable:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 982, in __iter__
for x in self.ex_iterable:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 862, in __iter__
yield from self._iter()
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 899, in _iter
for key, example in iterator:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 862, in __iter__
yield from self._iter()
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 899, in _iter
for key, example in iterator:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 678, in __iter__
yield from self._iter()
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 740, in _iter
for key, example in iterator:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 862, in __iter__
yield from self._iter()
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 899, in _iter
for key, example in iterator:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 1114, in __iter__
for key, example in self.ex_iterable:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 429, in __iter__
if not iterators[i].hasnext():
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 106, in hasnext
self._thenext = next(self.it)
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 678, in __iter__
yield from self._iter()
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 740, in _iter
for key, example in iterator:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 1114, in __iter__
for key, example in self.ex_iterable:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 281, in __iter__
for key, pa_table in self.generate_tables_fn(**self.kwargs):
File "/home/sanchitgandhi/datasets/src/datasets/packaged_modules/parquet/parquet.py", line 87, in _generate_tables
for batch_idx, record_batch in enumerate(
File "pyarrow/_parquet.pyx", line 1327, in iter_batches
File "/home/sanchitgandhi/datasets/src/datasets/download/streaming_download_manager.py", line 333, in read_with_retries
out = read(*args, **kwargs)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/spec.py", line 1856, in read
out = self.cache._fetch(self.loc, self.loc + length)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/caching.py", line 189, in _fetch
self.cache = self.fetcher(start, end) # new block replaces old
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/huggingface_hub/hf_file_system.py", line 410, in _fetch_range
r = http_backoff("GET", url, headers=headers)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/huggingface_hub/utils/_http.py", line 258, in http_backoff
response = session.request(method=method, url=url, **kwargs)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/huggingface_hub/utils/_http.py", line 63, in send
return super().send(request, *args, **kwargs)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/requests/adapters.py", line 501, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')), '(Request ID: 5fce9fc2-e22f-41c2-91af-529f13f1d611)')
```
</details>
Having streaming mode fail when the Hub goes down makes using it problematic for long training runs where large amounts of data is involved. However, this is the precise situation for which streaming mode is so appealing!
Wondering if there were a 'common' set of Hub errors that we could catch in `iterable_datasets` and prevent from crashing the script?
cc @lhoestq @mariosasko | Make Dataset streaming queries retryable | ### Feature request
Streaming datasets, as intended, do not load the entire dataset in memory or disk. However, while querying the next data chunk from the remote, sometimes it is possible that the service is down or there might be other issues that may cause the query to fail. In such a scenario, it would be nice to make these queries retryable (perhaps with a backoff strategy).
### Motivation
I was working on a model and the model checkpoints after every 1000 steps. At step 1800 I got a 504 HTTP status code error from Huggingface hub for my pytorch `dataloader`. Given the size of my model and data, it took around 2 hours to reach 1800 steps and now it will take about an hour to recover the lost 800. It would be better to get a retryable querying strategy.
### Your contribution
It would be better if someone having experience in this area takes this up as this would require some testing. | 1,228 | Make Dataset streaming queries retryable
### Feature request
Streaming datasets, as intended, do not load the entire dataset in memory or disk. However, while querying the next data chunk from the remote, sometimes it is possible that the service is down or there might be other issues that may cause the query to fail. In such a scenario, it would be nice to make these queries retryable (perhaps with a backoff strategy).
### Motivation
I was working on a model and the model checkpoints after every 1000 steps. At step 1800 I got a 504 HTTP status code error from Huggingface hub for my pytorch `dataloader`. Given the size of my model and data, it took around 2 hours to reach 1800 steps and now it will take about an hour to recover the lost 800. It would be better to get a retryable querying strategy.
### Your contribution
It would be better if someone having experience in this area takes this up as this would require some testing.
Hey all! Wondering if there's a way of making Datasets streaming mode somewhat robust to Hub outages? Over the weekend, I got two quite cryptic errors, which I reckon were probably from Hub issues:
<details>
<summary> Stack Trace 1 </summary>
```
File "/home/sanchitgandhi/small-12-4-tpu-timestamped-prob-0.2/run_distillation.py", line 2119, in <module>
main()
File "/home/sanchitgandhi/small-12-4-tpu-timestamped-prob-0.2/run_distillation.py", line 1954, in main
for batch in train_loader:
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 630, in __next__
data = self._next_data()
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1325, in _next_data
return self._process_data(data)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1371, in _process_data
data.reraise()
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/_utils.py", line 694, in reraise
raise exception
ConnectionError: Caught ConnectionError in DataLoader worker process 8.
Original Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/aiohttp/connector.py", line 1155, in _create_direct_connection
hosts = await asyncio.shield(host_resolved)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/aiohttp/connector.py", line 874, in _resolve_host
addrs = await self._resolver.resolve(host, port, family=self._family)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/aiohttp/resolver.py", line 33, in resolve
infos = await self._loop.getaddrinfo(
File "/usr/lib/python3.10/asyncio/base_events.py", line 863, in getaddrinfo
return await self.run_in_executor(
File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/lib/python3.10/socket.py", line 955, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/sanchitgandhi/datasets/src/datasets/download/streaming_download_manager.py", line 333, in read_with_retries
out = read(*args, **kwargs)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/implementations/http.py", line 612, in read
return super().read(length)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/spec.py", line 1856, in read
out = self.cache._fetch(self.loc, self.loc + length)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/caching.py", line 439, in _fetch
new = self.fetcher(self.end, bend)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/asyn.py", line 118, in wrapper
return sync(self.loop, func, *args, **kwargs)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/asyn.py", line 103, in sync
raise return_result
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/asyn.py", line 56, in _runner
result[0] = await coro
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/implementations/http.py", line 660, in async_fetch_range
r = await self.session.get(
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/aiohttp/client.py", line 562, in _request
conn = await self._connector.connect(
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/aiohttp/connector.py", line 540, in connect
proto = await self._create_connection(req, traces, timeout)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/aiohttp/connector.py", line 901, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/aiohttp/connector.py", line 1169, in _create_direct_connection
raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host huggingface.co:443 ssl:default [Temporary failure in name resolution]
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop
data = fetcher.fetch(index)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 32, in fetch
data.append(next(self.dataset_iter))
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 1358, in __iter__
yield from self._iter_pytorch()
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 1293, in _iter_pytorch
for key, example in ex_iterable:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 982, in __iter__
for x in self.ex_iterable:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 862, in __iter__
yield from self._iter()
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 899, in _iter
for key, example in iterator:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 862, in __iter__
yield from self._iter()
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 899, in _iter
for key, example in iterator:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 678, in __iter__
yield from self._iter()
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 740, in _iter
for key, example in iterator:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 862, in __iter__
yield from self._iter()
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 899, in _iter
for key, example in iterator:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 1114, in __iter__
for key, example in self.ex_iterable:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 429, in __iter__
if not iterators[i].hasnext():
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 106, in hasnext
self._thenext = next(self.it)
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 678, in __iter__
yield from self._iter()
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 740, in _iter
for key, example in iterator:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 1114, in __iter__
for key, example in self.ex_iterable:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 281, in __iter__
for key, pa_table in self.generate_tables_fn(**self.kwargs):
File "/home/sanchitgandhi/.cache/huggingface/modules/datasets_modules/datasets/distil-whisper--switchboard-data/9472ee64cca0e1a7e11909c7033c2354511fa62805f81a2e07616980c765abfe/switchboard-data.py", line 247, in _generate_tables
for record_batch in pf.iter_batches():
File "pyarrow/_parquet.pyx", line 1327, in iter_batches
File "/home/sanchitgandhi/datasets/src/datasets/download/streaming_download_manager.py", line 342, in read_with_retries
raise ConnectionError("Server Disconnected") from disconnect_err
ConnectionError: Server Disconnected
```
</details>
<details>
<summary> Stack Trace 2 </summary>
```
File "/home/sanchitgandhi/small-12-2-tpu-v3-timestamped-prob-0.2-bs-512/run_distillation.py", line 2119, in <module>
main()
File "/home/sanchitgandhi/small-12-2-tpu-v3-timestamped-prob-0.2-bs-512/run_distillation.py", line 1954, in main
for batch in train_loader:
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 630, in __next__
data = self._next_data()
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1325, in _next_data
return self._process_data(data)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1371, in _process_data
data.reraise()
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/_utils.py", line 694, in reraise
raise exception
requests.exceptions.ConnectionError: Caught ConnectionError in DataLoader worker process 13.
Original Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/connectionpool.py", line 791, in urlopen
response = self._make_request(
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/connectionpool.py", line 537, in _make_request
response = conn.getresponse()
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/connection.py", line 461, in getresponse
httplib_response = super().getresponse()
File "/usr/lib/python3.10/http/client.py", line 1375, in getresponse
response.begin()
File "/usr/lib/python3.10/http/client.py", line 318, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.10/http/client.py", line 287, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/requests/adapters.py", line 486, in send
resp = conn.urlopen(
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/connectionpool.py", line 845, in urlopen
retries = retries.increment(
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/util/retry.py", line 470, in increment
raise reraise(type(error), error, _stacktrace)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/util/util.py", line 38, in reraise
raise value.with_traceback(tb)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/connectionpool.py", line 791, in urlopen
response = self._make_request(
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/connectionpool.py", line 537, in _make_request
response = conn.getresponse()
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/connection.py", line 461, in getresponse
httplib_response = super().getresponse()
File "/usr/lib/python3.10/http/client.py", line 1375, in getresponse
response.begin()
File "/usr/lib/python3.10/http/client.py", line 318, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.10/http/client.py", line 287, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop
data = fetcher.fetch(index)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 32, in fetch
data.append(next(self.dataset_iter))
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 1358, in __iter__
yield from self._iter_pytorch()
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 1293, in _iter_pytorch
for key, example in ex_iterable:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 982, in __iter__
for x in self.ex_iterable:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 862, in __iter__
yield from self._iter()
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 899, in _iter
for key, example in iterator:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 862, in __iter__
yield from self._iter()
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 899, in _iter
for key, example in iterator:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 678, in __iter__
yield from self._iter()
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 740, in _iter
for key, example in iterator:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 862, in __iter__
yield from self._iter()
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 899, in _iter
for key, example in iterator:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 1114, in __iter__
for key, example in self.ex_iterable:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 429, in __iter__
if not iterators[i].hasnext():
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 106, in hasnext
self._thenext = next(self.it)
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 678, in __iter__
yield from self._iter()
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 740, in _iter
for key, example in iterator:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 1114, in __iter__
for key, example in self.ex_iterable:
File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 281, in __iter__
for key, pa_table in self.generate_tables_fn(**self.kwargs):
File "/home/sanchitgandhi/datasets/src/datasets/packaged_modules/parquet/parquet.py", line 87, in _generate_tables
for batch_idx, record_batch in enumerate(
File "pyarrow/_parquet.pyx", line 1327, in iter_batches
File "/home/sanchitgandhi/datasets/src/datasets/download/streaming_download_manager.py", line 333, in read_with_retries
out = read(*args, **kwargs)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/spec.py", line 1856, in read
out = self.cache._fetch(self.loc, self.loc + length)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/caching.py", line 189, in _fetch
self.cache = self.fetcher(start, end) # new block replaces old
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/huggingface_hub/hf_file_system.py", line 410, in _fetch_range
r = http_backoff("GET", url, headers=headers)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/huggingface_hub/utils/_http.py", line 258, in http_backoff
response = session.request(method=method, url=url, **kwargs)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/huggingface_hub/utils/_http.py", line 63, in send
return super().send(request, *args, **kwargs)
File "/home/sanchitgandhi/hf/lib/python3.10/site-packages/requests/adapters.py", line 501, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')), '(Request ID: 5fce9fc2-e22f-41c2-91af-529f13f1d611)')
```
</details>
Having streaming mode fail when the Hub goes down makes using it problematic for long training runs where large amounts of data is involved. However, this is the precise situation for which streaming mode is so appealing!
Wondering if there were a 'common' set of Hub errors that we could catch in `iterable_datasets` and prevent from crashing the script?
cc @lhoestq @mariosasko | [
-0.31669193506240845,
-0.3005366027355194,
0.026153191924095154,
0.12597687542438507,
0.21646489202976227,
-0.011194460093975067,
0.008134115487337112,
0.09827639162540436,
-0.03988838195800781,
-0.09810177236795425,
-0.21523436903953552,
-0.0718231126666069,
-0.11203938722610474,
0.33470675349235535,
0.11482495069503784,
-0.20855405926704407,
-0.25233837962150574,
-0.05096868798136711,
0.13148969411849976,
0.16846147179603577,
0.12604230642318726,
-0.1379648894071579,
-0.08585810661315918,
-0.17004916071891785,
-0.38026678562164307,
-0.08192029595375061,
0.05051373690366745,
0.12892642617225647,
-0.10957463830709457,
-0.48054593801498413,
0.20898088812828064,
0.4161652624607086,
0.36697423458099365,
0.22081267833709717,
-0.00013003434287384152,
-0.02260645478963852,
0.21205134689807892,
-0.11088144034147263,
-0.6389005184173584,
-0.044093117117881775,
-0.40791088342666626,
-0.04063676670193672,
0.18855911493301392,
-0.03469718247652054,
0.22273021936416626,
0.20929831266403198,
0.09948862344026566,
-0.1230662390589714,
0.48302868008613586,
0.34780874848365784,
-0.008858457207679749,
0.5916526317596436,
-0.17320126295089722,
-0.008240766823291779,
-0.22469522058963776,
0.32715311646461487,
-0.1571422815322876,
0.4383649230003357,
0.5354479551315308,
0.02721688151359558,
-0.2360353171825409,
0.4123278260231018,
-0.05891895666718483,
-0.04867596924304962,
-0.001499374397099018,
-0.2666904926300049,
-0.28879037499427795,
-0.2287100851535797,
-0.11174267530441284,
0.19677510857582092,
0.25233083963394165,
-0.08771146833896637,
-0.3980608880519867,
-0.6566237211227417,
0.0863335132598877,
-0.11472947150468826,
0.004840156063437462,
-0.13624456524848938,
-0.08753038942813873,
0.13207602500915527,
-0.33624473214149475,
-0.3018166720867157,
-0.1599286049604416,
-0.1082373857498169,
0.040899477899074554,
-0.0789775550365448,
0.156765878200531,
0.13650360703468323,
-0.06428766250610352,
0.06700639426708221,
0.5307140350341797,
-0.0924261137843132,
-0.006588801741600037,
-0.046274300664663315,
-0.5179758667945862,
0.002936922013759613,
0.05931531637907028,
0.3626435101032257,
0.10989685356616974,
0.3388001620769501,
0.33470964431762695,
0.16341832280158997,
-0.24413111805915833,
0.013889648020267487,
0.20991909503936768,
0.01316649466753006,
0.35987523198127747,
0.00603066012263298,
0.3380349278450012,
0.5348798036575317,
-0.21740268170833588,
-0.059052541851997375,
-0.008500609546899796,
0.04227224364876747,
0.2667132019996643,
0.2755545973777771,
0.3426494598388672,
-0.2599320709705353,
-0.0837256908416748,
0.0365908108651638,
-0.24323229491710663,
-0.08476826548576355,
0.32538703083992004,
0.017454631626605988,
0.029852911829948425,
0.4563296139240265,
0.017107069492340088,
0.11893206089735031,
-0.24273210763931274,
-0.5597414374351501,
-0.030211450532078743,
-0.2682490348815918,
-0.04010845720767975,
0.3622135818004608,
0.2763068377971649,
-0.487771213054657,
-0.03807694464921951,
-0.15068721771240234,
0.30655306577682495,
-0.09376900643110275,
0.18275994062423706,
-0.15148970484733582,
-0.11902275681495667,
0.14144526422023773,
-0.2275901734828949,
0.12728220224380493,
0.2369428128004074,
0.3085162043571472,
0.04418468475341797,
-0.09119299054145813,
0.04939163848757744,
-0.5619155168533325,
0.2863937318325043,
0.019314836710691452,
-0.23708069324493408,
-0.11484427750110626,
-0.4163362681865692,
0.09618942439556122,
-0.027223169803619385,
-0.18843069672584534,
0.39520418643951416,
-0.030880821868777275,
0.20035232603549957,
0.09934508055448532,
-0.017409440129995346,
0.7408576011657715,
-0.18197286128997803,
-0.17123742401599884,
0.001738220453262329,
-0.048047810792922974,
0.043484292924404144,
0.27164560556411743,
-0.19936983287334442,
0.1772809624671936,
-0.10422472655773163,
-0.01372787356376648,
0.3831735849380493,
-0.36016324162483215,
-0.21469350159168243,
0.12423954904079437,
-0.1407022774219513,
0.11624377220869064,
-0.022248506546020508,
0.185828298330307,
0.3563900291919708,
-0.05292044207453728,
0.1489701122045517,
0.06054305285215378,
-0.29014867544174194,
-0.08973962068557739,
-0.29459115862846375,
-0.2396843433380127,
0.01869450882077217,
0.322750985622406,
0.5381971001625061,
-0.007145781069993973,
0.15212243795394897,
-0.03263697773218155,
0.16753911972045898,
0.028773972764611244,
0.21596060693264008,
0.05005885660648346,
0.014227555133402348,
0.09532301127910614,
-0.009851612150669098,
-0.2959509491920471,
-0.3986133933067322,
0.17298384010791779,
0.12797413766384125,
-0.02398001216351986,
-0.27476659417152405,
-0.022794555872678757,
-0.24061661958694458,
-0.2720419764518738,
-0.15362834930419922,
0.13614435493946075,
-0.0759635865688324,
0.0018687695264816284,
-0.18669524788856506,
-0.001111343502998352,
-0.3931539058685303,
0.49864158034324646,
-0.3176870048046112,
0.08729401230812073,
-0.2071545124053955,
0.6655657887458801,
0.17506174743175507,
-0.09522777795791626,
-0.13210728764533997,
-0.0972042828798294,
0.3566143214702606,
0.09123536944389343,
-0.13607507944107056,
0.2040536254644394,
-0.25753265619277954,
0.49989980459213257,
0.3242045044898987,
0.1716630458831787,
0.29748305678367615,
0.12062960863113403,
0.24244067072868347,
0.06864091753959656,
-0.00862843543291092,
-0.33085089921951294,
0.09606344252824783,
0.026897862553596497,
-0.2649366557598114,
0.19320228695869446,
-0.002824053168296814,
0.10227552801370621,
0.13663026690483093,
0.15955188870429993,
-0.3608386814594269,
-0.036327339708805084,
0.38460731506347656,
-0.1898212730884552,
-0.0026241689920425415,
-0.1472947895526886,
-0.2991489768028259,
0.21923664212226868,
0.11015535891056061,
-0.1719135046005249,
0.19520065188407898,
-0.05876132473349571,
-0.011324774473905563,
-0.034179504960775375,
0.5547243356704712,
0.13482166826725006,
0.26830387115478516,
-0.1487829089164734,
0.04363249987363815,
0.16474343836307526,
-0.17043046653270721,
-0.3442414700984955,
0.1170501708984375,
0.012988924980163574,
0.12262479215860367,
0.26584869623184204,
0.20539754629135132,
-0.22469276189804077,
-0.4491991400718689,
-0.2901744842529297,
0.3324004113674164,
-0.051775973290205,
-0.4478965401649475,
0.003280945122241974,
-0.37366363406181335,
-0.2603517770767212,
-0.0760890394449234,
-0.13581445813179016,
-0.23772192001342773,
-0.5349393486976624,
0.09923066198825836,
0.41694438457489014,
-0.16969068348407745,
0.1593685746192932,
-0.13326981663703918,
0.30514097213745117,
0.014007985591888428,
-0.09432842582464218,
-0.17544034123420715,
-0.2914666533470154,
0.13185718655586243,
-0.08048499375581741,
-0.035323791205883026,
-0.05361487343907356,
0.38033854961395264,
-0.18776294589042664,
-0.11513607203960419,
-0.6461216807365417,
0.07054844498634338,
0.22416982054710388,
-0.00706374179571867,
-0.0028462912887334824,
0.270112007856369,
0.287015825510025,
-0.1404091864824295,
0.05693363398313522,
0.08576333522796631,
-0.10523667931556702,
0.23730811476707458,
0.0604366660118103,
0.029977981001138687,
0.6254504323005676,
-0.031360700726509094,
0.0506347119808197,
-0.4293482303619385,
-0.3410835266113281,
0.23939120769500732,
-0.474612832069397,
-0.020440854132175446,
0.20791813731193542,
-0.1567705124616623,
-0.045710816979408264,
-0.19114233553409576,
-0.2109529823064804,
-0.14060501754283905,
-0.5102100372314453,
0.2794031500816345,
0.06428863108158112,
-0.09085488319396973,
-0.07608313858509064,
0.012981638312339783,
0.021764613687992096,
0.3330727815628052,
-0.4919885993003845,
-0.6355571746826172,
0.1679496020078659,
0.2748737335205078,
-0.0309631135314703,
-0.01848985254764557,
0.13259610533714294,
-0.023636385798454285,
0.14569970965385437,
0.09569904208183289,
0.13919179141521454,
-0.10564378648996353,
0.4994363784790039,
0.18671786785125732,
-0.15693023800849915,
0.4198459982872009,
-0.051088497042655945,
0.3801175653934479,
0.10490767657756805,
0.2345767319202423,
0.5726710557937622,
0.1956571489572525,
0.1640080064535141,
0.07373113930225372,
-0.1278361976146698,
0.09704482555389404,
-0.2151334434747696,
-0.4435666799545288,
-0.1000889390707016,
0.1605805605649948,
0.17815765738487244,
-0.1739301234483719,
-0.3117440342903137,
-0.07730402052402496,
-0.48006823658943176,
0.08424104005098343,
-0.20149445533752441,
0.22542181611061096,
0.09870646148920059,
0.3380330801010132,
-0.26409536600112915,
-0.08673693239688873,
0.12676090002059937,
0.2173060178756714,
0.5017634630203247,
-0.1146979108452797,
-0.20602041482925415,
-0.18762440979480743,
-0.4494137167930603,
0.16450005769729614,
0.18011492490768433,
0.2845965027809143,
0.08151339739561081,
0.27906548976898193,
-0.03719964995980263,
0.062703937292099,
0.3185066282749176,
-0.4562546908855438,
0.059836018830537796,
0.045341894030570984,
-0.11794222891330719,
-0.11312206089496613,
-0.17785578966140747,
0.05471089482307434,
0.1513906717300415,
-0.10280411690473557,
0.14442066848278046,
-0.3459496796131134,
0.0729638934135437,
-0.05973884463310242,
0.31450214982032776,
-0.15156808495521545,
0.03355656936764717,
0.3146634101867676,
-0.2976406216621399,
-0.2680923640727997,
0.07404367625713348,
0.00538906455039978,
-0.2363809049129486,
-0.3785565495491028,
-0.06012887880206108,
-0.009960928931832314,
0.31359684467315674,
0.06596573442220688,
0.09710106253623962,
0.18817588686943054,
-0.13064314424991608,
0.16554243862628937,
0.27288928627967834,
-0.03667476773262024,
0.46557867527008057,
0.5360720753669739,
-0.020934123545885086,
-0.16172626614570618,
0.0890139788389206,
0.2012932151556015,
0.09060025215148926,
0.6163680553436279,
-0.07923507690429688,
0.5254030227661133,
0.3508615493774414,
0.39675384759902954,
-0.3971951901912689,
0.004021521657705307,
0.13759586215019226,
0.03308820724487305,
-0.3222815692424774,
-0.44788840413093567,
0.3447505235671997,
-0.18416160345077515,
-0.10875909775495529,
0.17534561455249786,
0.17540375888347626,
-0.028063207864761353,
-0.058528218418359756,
0.09927374124526978,
1.0377705097198486,
-0.07591862231492996,
0.050899963825941086,
0.12043312937021255,
-0.2102871537208557,
0.5443015098571777,
-0.48049530386924744,
0.20403505861759186,
-0.14179912209510803,
-0.0883285254240036,
-0.13809186220169067,
0.06452899426221848,
-0.062298115342855453,
-0.10244247317314148,
-0.14692163467407227,
0.5941163301467896,
0.03096023201942444,
0.8230950832366943,
-0.07159169018268585,
-0.007486671209335327,
-0.6330011487007141,
-0.08866336196660995,
-0.5615472197532654,
-0.012200679630041122,
-0.10112668573856354,
-0.06833238899707794,
-0.3273703455924988,
0.0806766152381897,
0.5039961338043213,
0.0935053676366806,
-0.3556392788887024,
-0.10924042761325836,
-0.23230436444282532,
0.014723297208547592,
-0.39921462535858154,
-0.20418092608451843,
-0.02644573152065277,
0.004615916404873133,
-0.02185555174946785,
-0.12586882710456848,
-0.3405662477016449,
0.15031179785728455,
-0.012896932661533356,
0.09598924219608307,
-0.07546472549438477,
-0.03427211195230484,
0.17041100561618805,
0.15557391941547394,
-0.5496264696121216,
0.10802553594112396,
0.004655182361602783,
-0.3953503966331482,
-0.19944411516189575,
-0.11991360783576965,
-0.13086184859275818,
-0.2069685310125351,
0.2439728081226349,
-0.021347369998693466,
-0.12247657775878906,
-0.2582390308380127,
-0.09454792737960815,
0.12827688455581665,
0.21074774861335754,
0.30704963207244873,
0.02308039739727974,
0.05365686118602753,
-0.14981621503829956,
0.4162825345993042,
0.007524676620960236,
-0.14997118711471558,
0.2680415213108063,
0.24853602051734924,
-0.30686837434768677,
-0.16350603103637695,
-0.09369184076786041,
-0.04109537973999977,
-0.3685670495033264,
0.4141567647457123,
-0.15560084581375122,
-0.15647950768470764,
-0.006333824247121811,
-0.11496472358703613,
0.1092427596449852,
0.024978090077638626,
-0.3456616997718811,
-0.3299686312675476,
-0.2610667049884796,
0.3942793011665344,
0.3652152717113495,
0.041688866913318634,
-0.07540876418352127,
-0.01765461266040802,
-0.11386770009994507,
-0.07166536897420883,
-0.13422498106956482,
0.15332239866256714,
-0.2080707550048828,
0.2347399890422821,
-0.6264387369155884,
-0.08472965657711029,
0.4022228419780731,
-0.29818642139434814,
-0.16753171384334564,
0.3407755196094513,
-0.1240677684545517,
0.07060448825359344,
0.04695641249418259,
0.28269416093826294,
0.07928630709648132,
-0.2211155891418457,
-0.1127152368426323,
-0.41199037432670593,
0.09889783710241318,
-0.3475606441497803,
0.22111208736896515,
0.5028614401817322,
0.12643003463745117,
-0.08750923722982407,
0.6399369835853577,
-0.00042002834379673004,
-0.18712502717971802,
0.27040529251098633,
0.23337583243846893,
0.21883362531661987,
-0.08721204847097397,
0.053340572863817215,
0.0060964226722717285,
0.0696902871131897,
0.04925576597452164,
0.32656049728393555,
0.4920727610588074,
0.004331192001700401,
0.4519651234149933,
-0.05569067969918251,
-0.2930613160133362,
0.011038888245821,
0.4765644371509552,
0.5348994135856628,
0.1326819360256195,
-0.10030224174261093,
-0.16943883895874023,
-0.02908167615532875,
-0.08242565393447876,
-0.07702402025461197,
0.0923755019903183,
0.18689587712287903,
0.23596641421318054,
0.21725431084632874,
0.10523121058940887,
-0.3033221364021301,
0.10529637336730957,
-0.013330601155757904,
0.37179648876190186,
0.254176527261734,
0.12600934505462646,
0.2597963511943817,
0.30104294419288635,
-0.03107960894703865,
0.03163369745016098,
-0.024602694436907768,
0.11558308452367783,
-0.3110920786857605,
-0.06586551666259766,
0.221792072057724,
0.20509949326515198,
0.23236195743083954,
0.16323299705982208,
-0.1735590547323227,
-0.16009119153022766,
-0.04892125725746155,
-0.06065673008561134,
-0.022276535630226135,
0.08177340030670166,
0.11664615571498871,
-0.14573615789413452,
-0.021518906578421593,
-0.0827934592962265,
0.11316772550344467,
-0.0036323927342891693,
0.08169172704219818,
-0.21509933471679688,
-0.33657482266426086,
-0.14132346212863922,
-0.15423855185508728,
-0.04721182957291603,
0.03932305797934532,
0.1317904144525528,
0.13870108127593994,
0.2909550666809082,
-0.23333200812339783,
-0.07690946757793427,
0.32726189494132996,
0.4311239421367645,
-0.11125599592924118,
0.11253656446933746,
0.7224065065383911,
0.13307440280914307,
0.3683042824268341,
0.36101827025413513,
0.11327555775642395,
-0.025678686797618866,
-0.21765318512916565,
0.35249564051628113,
0.24985083937644958,
0.13689757883548737,
0.07633526623249054,
0.006197098642587662,
0.08966176211833954,
0.005025042220950127,
0.2706710398197174,
0.03329445421695709,
0.003183957189321518,
0.21566517651081085,
-0.2777475118637085,
-0.3106236457824707,
-0.19117878377437592,
0.4027034342288971,
0.1695154309272766,
-0.05045650154352188,
0.12621310353279114,
-0.286454439163208,
-0.14866694808006287,
0.19362536072731018,
0.5265061259269714,
-0.2046791911125183,
0.10193577408790588,
0.09159935265779495,
-0.03444910794496536,
-0.12209649384021759,
0.42569512128829956,
0.5739265084266663,
0.16060036420822144,
-0.2635824382305145,
0.03958098590373993,
-0.41201913356781006,
-0.1434350162744522,
-0.13515354692935944,
-0.15906235575675964,
0.2740478217601776,
-0.08452307432889938,
0.18415890634059906,
0.14952600002288818,
0.24560782313346863,
-0.010050732642412186,
0.01952619105577469,
0.03698218613862991,
-0.457633376121521,
-0.426282674074173,
0.3975204527378082,
0.03184736520051956,
-0.15934878587722778,
-0.11251112073659897,
0.42288732528686523,
0.19107654690742493,
-0.1800936907529831,
0.1023981124162674,
-0.15219496190547943,
0.06311993300914764,
-0.4343351721763611,
0.42558905482292175,
-0.007701754570007324,
0.2482820600271225,
0.11799965053796768,
-0.21988680958747864,
-0.2906436324119568,
-0.3501643240451813,
0.07173241674900055,
-0.22508306801319122,
-0.16341252624988556,
0.5731837153434753,
-0.0030597634613513947,
-0.1886788308620453,
-0.4061587154865265,
0.2796371877193451,
-0.20026461780071259,
0.09120385348796844,
-0.18500950932502747,
0.040245421230793,
-0.07327857613563538,
0.04441232979297638,
-0.04460129514336586,
0.31354355812072754,
-0.06226104497909546,
0.48914414644241333,
-0.013410180807113647,
-0.3671819567680359,
0.7417516112327576,
-0.20543357729911804,
-0.14022299647331238,
-0.36179232597351074,
0.2985749840736389,
0.39872080087661743,
-0.1614808738231659,
-0.7040437459945679,
-0.245102196931839,
0.10513442754745483,
-0.022044580429792404,
0.12578725814819336,
0.1900797337293625,
0.39633211493492126,
0.03417609632015228,
-0.2752544581890106,
0.09321586042642593,
-0.13764190673828125,
0.07123883813619614,
-0.04542817547917366,
-0.19330105185508728
] |
https://github.com/huggingface/datasets/issues/6172 | Errors are already caught and requests are already retried.
What you can do is increase the number of retries before an error is raised.
```python
import datasets
datasets.config.STREAMING_READ_MAX_RETRIES = 20 # default
datasets.config.STREAMING_READ_RETRY_INTERVAL = 5 # default
``` | Make Dataset streaming queries retryable | ### Feature request
Streaming datasets, as intended, do not load the entire dataset in memory or disk. However, while querying the next data chunk from the remote, sometimes it is possible that the service is down or there might be other issues that may cause the query to fail. In such a scenario, it would be nice to make these queries retryable (perhaps with a backoff strategy).
### Motivation
I was working on a model and the model checkpoints after every 1000 steps. At step 1800 I got a 504 HTTP status code error from Huggingface hub for my pytorch `dataloader`. Given the size of my model and data, it took around 2 hours to reach 1800 steps and now it will take about an hour to recover the lost 800. It would be better to get a retryable querying strategy.
### Your contribution
It would be better if someone having experience in this area takes this up as this would require some testing. | 38 | Make Dataset streaming queries retryable
### Feature request
Streaming datasets, as intended, do not load the entire dataset in memory or disk. However, while querying the next data chunk from the remote, sometimes it is possible that the service is down or there might be other issues that may cause the query to fail. In such a scenario, it would be nice to make these queries retryable (perhaps with a backoff strategy).
### Motivation
I was working on a model and the model checkpoints after every 1000 steps. At step 1800 I got a 504 HTTP status code error from Huggingface hub for my pytorch `dataloader`. Given the size of my model and data, it took around 2 hours to reach 1800 steps and now it will take about an hour to recover the lost 800. It would be better to get a retryable querying strategy.
### Your contribution
It would be better if someone having experience in this area takes this up as this would require some testing.
Errors are already caught and requests are already retried.
What you can do is increase the number of retries before an error is raised.
```python
import datasets
datasets.config.STREAMING_READ_MAX_RETRIES = 20 # default
datasets.config.STREAMING_READ_RETRY_INTERVAL = 5 # default
``` | [
-0.23975394666194916,
-0.2946740984916687,
-0.020980656147003174,
-0.020639386028051376,
0.1214011013507843,
0.012881293892860413,
-0.12980765104293823,
0.1379736214876175,
0.017742745578289032,
-0.13985763490200043,
-0.18616732954978943,
-0.04306444898247719,
-0.16090549528598785,
0.38718166947364807,
0.16150671243667603,
-0.275302916765213,
-0.28777098655700684,
0.09784185886383057,
0.11079434305429459,
0.2369256615638733,
0.07527942955493927,
-0.20706556737422943,
-0.0725943073630333,
-0.31403276324272156,
-0.15854285657405853,
0.04977060854434967,
-0.00427912175655365,
0.03619261085987091,
-0.007615972310304642,
-0.6853703260421753,
0.23128578066825867,
0.4255921244621277,
0.43814441561698914,
0.3927961587905884,
-0.00011360201460774988,
-0.10471247881650925,
0.15988841652870178,
-0.20279960334300995,
-0.6968667507171631,
0.0016794279217720032,
-0.12664863467216492,
-0.06076078861951828,
0.2408774495124817,
-0.05077032744884491,
0.014664292335510254,
-0.012871721759438515,
0.20088531076908112,
-0.16735512018203735,
0.5592764616012573,
0.3531944751739502,
0.13720056414604187,
0.557233989238739,
-0.13011080026626587,
0.1666073352098465,
-0.35330623388290405,
0.275463342666626,
-0.15051335096359253,
0.38962045311927795,
0.44419631361961365,
0.049270667135715485,
-0.19981223344802856,
0.390790730714798,
-0.15747177600860596,
0.20613545179367065,
-0.024875834584236145,
-0.3237234950065613,
-0.259379118680954,
-0.2581617832183838,
-0.14627104997634888,
0.21584643423557281,
0.26743003726005554,
-0.08450651913881302,
-0.40145933628082275,
-0.6294685006141663,
0.0669880285859108,
-0.3149661719799042,
-0.08795969188213348,
0.013449721038341522,
-0.10864636301994324,
0.11366535723209381,
-0.3222309350967407,
-0.23539069294929504,
-0.11115965992212296,
-0.12578502297401428,
-0.011334024369716644,
-0.1123448833823204,
0.016734223812818527,
0.13549061119556427,
0.10290822386741638,
0.0018738117069005966,
0.43984946608543396,
-0.00968699436634779,
-0.005350366234779358,
-0.09475015103816986,
-0.6071107387542725,
-0.010760068893432617,
0.1325489580631256,
0.21493811905384064,
0.20957615971565247,
0.40695181488990784,
0.5788484215736389,
0.1857014149427414,
0.08053916692733765,
0.05105385556817055,
0.11807171255350113,
-0.011392727494239807,
0.27270591259002686,
-0.04860351234674454,
0.34515732526779175,
0.4634949564933777,
-0.24895460903644562,
-0.04820331931114197,
0.018839091062545776,
0.04984092339873314,
0.4996756315231323,
0.15172797441482544,
0.39107128977775574,
-0.1860140711069107,
0.01223638653755188,
0.014898795634508133,
-0.2912806272506714,
-0.12455955892801285,
0.2649447023868561,
0.210840106010437,
-0.20444518327713013,
0.27216285467147827,
0.07162563502788544,
-0.09979203343391418,
-0.17939138412475586,
-0.6304905414581299,
-0.035976044833660126,
-0.4283304214477539,
0.0528111606836319,
0.30718910694122314,
0.43825915455818176,
-0.5078580975532532,
0.12967121601104736,
-0.1642410159111023,
0.1717211902141571,
-0.010626271367073059,
0.3780750036239624,
0.026976685971021652,
-0.03595166280865669,
0.19033728539943695,
-0.26966023445129395,
-0.12174202501773834,
0.2306070476770401,
0.20386826992034912,
-0.13114887475967407,
-0.024982258677482605,
-0.01213834434747696,
-0.42111414670944214,
0.28166723251342773,
0.17898720502853394,
-0.03630511835217476,
-0.21157661080360413,
-0.46634793281555176,
0.3033946454524994,
-0.002048049122095108,
-0.002766646444797516,
0.3724009692668915,
-0.0905010774731636,
0.1261587142944336,
-0.029563400894403458,
0.232021301984787,
0.7641012072563171,
-0.0757545530796051,
-0.18657757341861725,
-0.006124261766672134,
0.03891221061348915,
0.11338020861148834,
0.2445729374885559,
-0.2589559853076935,
0.04194848984479904,
-0.12857303023338318,
0.012892201542854309,
0.4714982211589813,
-0.2303413301706314,
-0.1849793642759323,
0.09825399518013,
-0.17297831177711487,
0.1210329532623291,
0.012136004865169525,
0.22136104106903076,
0.3899904489517212,
0.08203175663948059,
0.1201171725988388,
0.15570251643657684,
-0.28384900093078613,
-0.07115797698497772,
-0.2856564521789551,
-0.27913081645965576,
0.20785054564476013,
0.3723888397216797,
0.18324890732765198,
-0.03265568986535072,
0.1531939059495926,
-0.2749290466308594,
0.2177702933549881,
-0.07327966392040253,
0.005167480558156967,
0.009929539635777473,
0.13018697500228882,
0.11419271677732468,
-0.0385439470410347,
-0.30204227566719055,
-0.506381630897522,
0.17390908300876617,
0.12176533788442612,
-0.10121633112430573,
0.01891443319618702,
-0.033201515674591064,
-0.23535174131393433,
-0.1914045363664627,
-0.2736826539039612,
0.04306396096944809,
0.07745128124952316,
0.07586419582366943,
0.036975763738155365,
0.1860886663198471,
-0.3396093547344208,
0.4746822714805603,
-0.42005813121795654,
0.06805752217769623,
-0.21872904896736145,
0.4482260048389435,
0.14331887662410736,
-0.060031257569789886,
-0.026586830615997314,
-0.19328470528125763,
0.372417151927948,
0.027553927153348923,
-0.045823607593774796,
0.2614689767360687,
-0.22940553724765778,
0.2922179698944092,
0.2845625579357147,
0.1863553822040558,
0.15388482809066772,
0.10777986794710159,
0.10070182383060455,
0.32775330543518066,
-0.022142061963677406,
-0.22795486450195312,
0.12082597613334656,
0.1207793802022934,
-0.03546614944934845,
0.1563490331172943,
0.038219355046749115,
-0.02617696300148964,
0.22105321288108826,
0.02979859709739685,
-0.477927029132843,
0.09849479049444199,
0.38805702328681946,
-0.28611165285110474,
-0.08771635591983795,
-0.11540496349334717,
-0.4516006112098694,
0.19785308837890625,
0.06127315014600754,
-0.1590368151664734,
0.2461131364107132,
0.16759860515594482,
-0.03295773267745972,
-0.09672470390796661,
0.4000353217124939,
0.24817559123039246,
0.32340502738952637,
0.01656407117843628,
0.11470507085323334,
0.12124698609113693,
-0.12122602015733719,
-0.28802603483200073,
0.18006165325641632,
-0.12582120299339294,
-0.04471556469798088,
0.14307183027267456,
0.36131900548934937,
-0.14172644913196564,
-0.5845301151275635,
-0.26857712864875793,
0.13692550361156464,
-0.017050854861736298,
-0.31410306692123413,
0.11866109073162079,
-0.44043421745300293,
-0.20289242267608643,
-0.08889113366603851,
0.042538318783044815,
-0.1675225794315338,
-0.3518875539302826,
0.15296807885169983,
0.4433804750442505,
-0.14009065926074982,
0.1717914342880249,
-0.30528026819229126,
0.27067410945892334,
0.009895004332065582,
-0.10924132168292999,
-0.25969767570495605,
-0.20077362656593323,
0.007911336608231068,
0.0027058646082878113,
-0.08606435358524323,
-0.028384290635585785,
0.618976354598999,
-0.1432213932275772,
0.019349150359630585,
-0.6322964429855347,
-0.21146473288536072,
0.1006186455488205,
0.1352936327457428,
0.11402300000190735,
0.1531190425157547,
0.3228420913219452,
-0.11865636706352234,
-0.07507558912038803,
0.09684213995933533,
-0.17738288640975952,
0.13304397463798523,
0.020291440188884735,
0.026811860501766205,
0.6163581013679504,
-0.025700945407152176,
-0.08550899475812912,
-0.3579060435295105,
-0.3867569863796234,
0.3759082853794098,
-0.2866818308830261,
0.017085660248994827,
0.16129617393016815,
-0.013603925704956055,
0.0060045793652534485,
-0.31364983320236206,
-0.0027447566390037537,
-0.2534003257751465,
-0.4567430317401886,
0.32430925965309143,
-0.006780244410037994,
-0.2257160246372223,
0.026374340057373047,
-0.010770834982395172,
0.08086013793945312,
0.20277583599090576,
-0.6423749923706055,
-0.5079110860824585,
0.04485074430704117,
0.263569712638855,
-0.08420515060424805,
0.02080797217786312,
0.0026147030293941498,
0.06921974569559097,
0.02013932541012764,
0.21106520295143127,
0.09572134912014008,
-0.20886611938476562,
0.4190441071987152,
0.23893678188323975,
-0.16342653334140778,
0.40512815117836,
-0.07957232743501663,
0.5565266013145447,
0.1323302686214447,
0.03511958196759224,
0.5455622673034668,
0.0974191352725029,
0.20209404826164246,
-0.03396882489323616,
-0.3562058210372925,
-0.005647663027048111,
-0.3588387966156006,
-0.20192578434944153,
-0.12617287039756775,
0.09355901926755905,
0.07357821613550186,
-0.15795275568962097,
-0.21364332735538483,
0.003085896372795105,
-0.47115573287010193,
0.11225492507219315,
-0.137010395526886,
0.25962215662002563,
-0.018897373229265213,
0.12015578895807266,
-0.24025917053222656,
0.07661709189414978,
-0.052492495626211166,
0.1800736039876938,
0.5907945036888123,
-0.08528821170330048,
-0.20427118241786957,
0.008527159690856934,
-0.5620362162590027,
0.12095026671886444,
0.04619717225432396,
0.31214219331741333,
0.07329791784286499,
0.18796101212501526,
-0.11489914357662201,
0.022807545959949493,
0.31975603103637695,
-0.19615653157234192,
-0.10243266075849533,
-0.08866102248430252,
-0.1926155984401703,
-0.11002971976995468,
-0.01503106951713562,
0.2229606956243515,
-0.005680672824382782,
-0.039867550134658813,
0.11220285296440125,
-0.40248000621795654,
0.142994225025177,
0.026526302099227905,
0.3861860930919647,
-0.2045697569847107,
0.007079850882291794,
0.027582168579101562,
-0.48237621784210205,
-0.38599497079849243,
0.1278458833694458,
0.004716940224170685,
-0.3162675201892853,
-0.15732508897781372,
-0.10627958923578262,
-0.0942145511507988,
0.243332639336586,
0.023391861468553543,
0.12516853213310242,
0.13801726698875427,
-0.06877627968788147,
0.3559577167034149,
0.22831733524799347,
-0.06737406551837921,
0.3816145360469818,
0.5008106827735901,
-0.1065986305475235,
-0.17740413546562195,
-0.04968583583831787,
0.36977720260620117,
0.13736996054649353,
0.3425423502922058,
-0.07201547920703888,
0.5516960024833679,
0.42076873779296875,
0.4726369082927704,
-0.45741307735443115,
0.01566227152943611,
0.08628714084625244,
0.12012095749378204,
-0.30370062589645386,
-0.5812875628471375,
0.32416704297065735,
-0.20116758346557617,
0.09581924974918365,
0.25856295228004456,
0.017248818650841713,
0.04397010803222656,
-0.10605844855308533,
0.0893937349319458,
0.9071255922317505,
-0.11558570712804794,
0.08203268051147461,
0.2356134057044983,
-0.29301637411117554,
0.4230841398239136,
-0.3096159100532532,
0.29154065251350403,
-0.13629648089408875,
-0.15955054759979248,
-0.0757705420255661,
-0.04786817356944084,
0.04669179394841194,
-0.21243350207805634,
-0.15854209661483765,
0.5421891808509827,
0.0019784867763519287,
0.5297532677650452,
0.02586902305483818,
0.16944053769111633,
-0.49032577872276306,
-0.09382009506225586,
-0.5729727745056152,
0.13039305806159973,
-0.19536852836608887,
-0.14719155430793762,
-0.09218481183052063,
0.08019749820232391,
0.664615273475647,
-0.012669533491134644,
-0.24145621061325073,
-0.23856490850448608,
-0.36392587423324585,
-0.0112228374928236,
-0.38861778378486633,
-0.30666908621788025,
-0.07303924113512039,
0.030467135831713676,
-0.19931678473949432,
-0.06656910479068756,
-0.24511852860450745,
0.13650259375572205,
0.031352363526821136,
0.023727811872959137,
-0.13088008761405945,
-0.0865226536989212,
-0.03102433681488037,
0.09148821234703064,
-0.47296905517578125,
0.0883614718914032,
0.07139565050601959,
-0.49989748001098633,
-0.18014785647392273,
0.07845604419708252,
-0.12182958424091339,
-0.14617526531219482,
0.17591990530490875,
-0.052576854825019836,
-0.08601471781730652,
-0.23613138496875763,
0.04822523146867752,
0.04178199917078018,
0.12086649239063263,
0.11298389732837677,
0.09111678600311279,
0.03403767943382263,
-0.3094314634799957,
0.5180907249450684,
0.1093723401427269,
-0.1814459264278412,
0.39027246832847595,
0.2560988962650299,
-0.24786123633384705,
-0.2050260454416275,
-0.07691097259521484,
-0.04510524868965149,
-0.37711119651794434,
0.4029361307621002,
-0.19712689518928528,
0.017465442419052124,
0.038071587681770325,
-0.0835064947605133,
0.12523934245109558,
-0.21562951803207397,
-0.29931366443634033,
-0.06819143891334534,
-0.39995452761650085,
0.14606574177742004,
0.2860146760940552,
0.11713825911283493,
-0.01828080415725708,
0.029430441558361053,
-0.1639222651720047,
0.0822327584028244,
-0.2953043282032013,
0.07805962860584259,
-0.16944879293441772,
0.17206858098506927,
-0.23562365770339966,
-0.1649351716041565,
0.25779181718826294,
-0.021047066897153854,
-0.01652682013809681,
0.2915407717227936,
-0.07687649130821228,
-0.11088401079177856,
-0.027597274631261826,
0.17718200385570526,
-0.008743420243263245,
-0.18099713325500488,
-0.20185475051403046,
-0.37047314643859863,
-0.10261351615190506,
-0.3051322102546692,
0.06410788744688034,
0.3888894319534302,
0.10554355382919312,
-0.020988576114177704,
0.5446398258209229,
-0.17594179511070251,
-0.04902590438723564,
0.2081490010023117,
0.13461396098136902,
0.19517382979393005,
0.03419293835759163,
0.016113560646772385,
-0.1690264195203781,
0.045783840119838715,
-0.1544240117073059,
0.25842657685279846,
0.45583292841911316,
-0.05129304528236389,
0.4269993007183075,
-0.0795135423541069,
-0.44014063477516174,
-0.13024809956550598,
0.5167297720909119,
0.4547143578529358,
0.11140060424804688,
-0.016436781734228134,
-0.003735695034265518,
0.1289825439453125,
-0.21851846575737,
-0.07253782451152802,
0.19051198661327362,
0.13557325303554535,
0.3378744125366211,
0.24478848278522491,
-0.10167209804058075,
-0.16105695068836212,
0.20580491423606873,
-0.011566422879695892,
0.3879588842391968,
0.07542476803064346,
0.15068431198596954,
0.19331082701683044,
0.16283516585826874,
-0.19386321306228638,
0.19825877249240875,
0.1516266018152237,
0.2810404598712921,
-0.3860875070095062,
-0.12830844521522522,
0.26312586665153503,
0.22342632710933685,
0.19865329563617706,
0.002017352730035782,
-0.18582668900489807,
-0.07184609770774841,
-0.1085309237241745,
-0.10086873173713684,
0.12960006296634674,
0.08495361357927322,
0.09875845909118652,
-0.030626336112618446,
-0.08274293690919876,
-0.2141546756029129,
0.24723783135414124,
0.10790231823921204,
-0.01240566372871399,
0.0687255710363388,
-0.31898409128189087,
-0.1006450206041336,
0.01783990114927292,
0.10993297398090363,
0.0023770909756422043,
0.08061614632606506,
0.027551844716072083,
0.11968617886304855,
-0.46877968311309814,
-0.13013431429862976,
0.2894017994403839,
0.485263854265213,
-0.10801349580287933,
-0.0675814151763916,
0.7332803010940552,
-0.009975839406251907,
0.14683890342712402,
0.25718992948532104,
0.09498760104179382,
0.0133742056787014,
-0.12926658987998962,
0.4411267340183258,
0.11818389594554901,
0.11905372142791748,
-0.04530491307377815,
0.2056565284729004,
0.024113494902849197,
-0.06182725727558136,
0.21169808506965637,
0.13763010501861572,
-0.09070122241973877,
0.26736703515052795,
-0.26127201318740845,
-0.18282145261764526,
-0.49248039722442627,
0.2860368490219116,
0.18787644803524017,
0.03047870099544525,
-0.008580729365348816,
-0.23900502920150757,
-0.2744475305080414,
0.3081352710723877,
0.5371020436286926,
-0.18382826447486877,
0.04180343449115753,
-0.044603705406188965,
0.06782753765583038,
-0.16824263334274292,
0.4300330579280853,
0.47658613324165344,
0.32990676164627075,
-0.2766672372817993,
0.156032994389534,
-0.6348432898521423,
-0.23443153500556946,
-0.199357807636261,
-0.14822077751159668,
0.3584674894809723,
0.113739013671875,
0.08106227219104767,
0.2633592486381531,
0.19754251837730408,
-0.048500578850507736,
0.02156873792409897,
-0.05254654586315155,
-0.1819736659526825,
-0.4785529375076294,
0.13805973529815674,
0.11266101896762848,
-0.12518543004989624,
-0.26709169149398804,
0.4292561709880829,
0.014817740768194199,
-0.004639714956283569,
-0.0011168327182531357,
-0.1603928655385971,
0.20131556689739227,
-0.20668451488018036,
0.32143208384513855,
0.03418560326099396,
0.02564135566353798,
0.04611045867204666,
-0.21784457564353943,
-0.22692731022834778,
-0.19402027130126953,
-0.009895171970129013,
-0.2500721514225006,
-0.033574774861335754,
0.5044026970863342,
0.0095309317111969,
-0.33334827423095703,
-0.5201688408851624,
0.398206502199173,
0.04408803582191467,
-0.09774969518184662,
0.03041660785675049,
0.13451986014842987,
0.1711920201778412,
0.026187464594841003,
-0.1507575809955597,
0.2567077875137329,
-0.07774618268013,
0.38727232813835144,
0.04513101279735565,
-0.24540668725967407,
0.6505569219589233,
-0.35667842626571655,
-0.04220903292298317,
-0.1905096173286438,
0.30562523007392883,
0.2788868248462677,
-0.07636477798223495,
-0.7257064580917358,
-0.13317066431045532,
0.25972211360931396,
-0.10139653086662292,
0.008636660873889923,
0.3481620252132416,
0.20202815532684326,
0.04119792580604553,
-0.1689702272415161,
0.1967652589082718,
-0.015747468918561935,
0.09970297664403915,
0.07156962156295776,
-0.1473855972290039
] |
https://github.com/huggingface/datasets/issues/6169 | Unfortunately, I cannot reproduce this behavior on my machine or Colab - the reproducer returns `['main_data', 'additional_data']` as expected. | Configurations in yaml not working | ### Dataset configurations cannot be created in YAML/README
Hello! I'm trying to follow the docs here in order to create structure in my dataset as added from here (#5331): https://github.com/huggingface/datasets/blob/8b8e6ee067eb74e7965ca2a6768f15f9398cb7c8/docs/source/repository_structure.mdx#L110-L118
I have the exact example in my config file for [my data repo](https://huggingface.co/datasets/tsor13/test):
```
configs:
- config_name: main_data
data_files: "main_data.csv"
- config_name: additional_data
data_files: "additional_data.csv"
```
Yet, I'm unable to load different configurations:
```
from datasets import get_dataset_config_names
get_dataset_config_names('tsor13/test', use_auth_token=True)
```
returns a single split, `['tsor13--test']`
Does anyone have any insights?
@polinaeterna thank you for adding this feature, it is super useful. Do you happen to have any ideas?
### Steps to reproduce the bug
from datasets import get_dataset_config_names
get_dataset_config_names('tsor13/test')
### Expected behavior
I would expect there to be two splits, `main_data` and `additional_data`. However, only `['tsor13--test']` test is returned.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-13.4-arm64-arm-64bit
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.1 | 19 | Configurations in yaml not working
### Dataset configurations cannot be created in YAML/README
Hello! I'm trying to follow the docs here in order to create structure in my dataset as added from here (#5331): https://github.com/huggingface/datasets/blob/8b8e6ee067eb74e7965ca2a6768f15f9398cb7c8/docs/source/repository_structure.mdx#L110-L118
I have the exact example in my config file for [my data repo](https://huggingface.co/datasets/tsor13/test):
```
configs:
- config_name: main_data
data_files: "main_data.csv"
- config_name: additional_data
data_files: "additional_data.csv"
```
Yet, I'm unable to load different configurations:
```
from datasets import get_dataset_config_names
get_dataset_config_names('tsor13/test', use_auth_token=True)
```
returns a single split, `['tsor13--test']`
Does anyone have any insights?
@polinaeterna thank you for adding this feature, it is super useful. Do you happen to have any ideas?
### Steps to reproduce the bug
from datasets import get_dataset_config_names
get_dataset_config_names('tsor13/test')
### Expected behavior
I would expect there to be two splits, `main_data` and `additional_data`. However, only `['tsor13--test']` test is returned.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-13.4-arm64-arm-64bit
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.1
Unfortunately, I cannot reproduce this behavior on my machine or Colab - the reproducer returns `['main_data', 'additional_data']` as expected. | [
-0.11527468264102936,
-0.4213189482688904,
0.05717824399471283,
0.45447349548339844,
0.3572370409965515,
0.04673733562231064,
0.29891225695610046,
-0.016127929091453552,
-0.13951528072357178,
-0.04843568056821823,
-0.3127571940422058,
0.02011093869805336,
0.17264369130134583,
0.1834748238325119,
0.1445549875497818,
0.10658880323171616,
-0.07879949361085892,
-0.044019896537065506,
-0.13814102113246918,
0.06637439131736755,
-0.10647982358932495,
0.23906859755516052,
-0.007155679166316986,
-0.21589092910289764,
-0.23652830719947815,
0.10588287562131882,
-0.3053048253059387,
0.265173077583313,
-0.21397313475608826,
-0.16401171684265137,
0.4307832717895508,
0.22203503549098969,
-0.2170935869216919,
0.5009014010429382,
-0.00012478163989726454,
0.24261394143104553,
0.2726430892944336,
-0.24558959901332855,
-0.11674079298973083,
-0.222080260515213,
-0.2692434787750244,
-0.3274082839488983,
0.16771236062049866,
0.005749687552452087,
-0.14180204272270203,
0.09768503904342651,
-0.12340221554040909,
-0.36095792055130005,
0.2932656407356262,
0.08186410367488861,
0.1033555120229721,
0.04860787093639374,
0.11903920769691467,
-0.14079996943473816,
0.20400400459766388,
0.5938513278961182,
-0.33208808302879333,
0.03151540085673332,
0.17639310657978058,
0.04897084832191467,
0.31094419956207275,
-0.09440848231315613,
0.002355717122554779,
-0.012448853813111782,
0.06362122297286987,
0.4108019471168518,
0.07075020670890808,
-0.46277356147766113,
0.1428050547838211,
0.4055679738521576,
0.559900164604187,
-0.293613076210022,
-0.35576242208480835,
-0.3671363890171051,
-0.1048458069562912,
-0.03691447153687477,
0.2759285271167755,
0.45761415362358093,
-0.057538941502571106,
0.11788550764322281,
-0.3664836585521698,
-0.05280941724777222,
-0.12696121633052826,
0.17230835556983948,
-0.23929500579833984,
0.05858823284506798,
-0.07760550081729889,
-0.012042902410030365,
0.056055475026369095,
-0.03105808049440384,
0.014147013425827026,
-0.14327479898929596,
-0.0823139026761055,
0.19040361046791077,
-0.2920355498790741,
-0.0007651522755622864,
-0.21501585841178894,
-0.0026955250650644302,
0.5524056553840637,
0.1857241690158844,
-0.11468034982681274,
0.10800378769636154,
0.09388422966003418,
-0.03740373253822327,
0.03311238810420036,
0.24858734011650085,
0.15550151467323303,
0.4087483286857605,
0.04284372925758362,
0.1956367939710617,
0.06669395416975021,
-0.10322324931621552,
-0.011523216962814331,
-0.31993937492370605,
-0.19015178084373474,
-0.2982245087623596,
0.23692354559898376,
0.08215426653623581,
0.005086764693260193,
-0.16927304863929749,
-0.39205190539360046,
-0.10041798651218414,
0.37438639998435974,
0.45780083537101746,
0.036516834050416946,
-0.38212424516677856,
-0.04844168946146965,
0.3368009328842163,
-0.29102128744125366,
0.23005042970180511,
-0.22807511687278748,
0.02640470489859581,
-0.3772624135017395,
0.17567038536071777,
0.4518132209777832,
-0.20777612924575806,
0.3615209758281708,
0.4727407395839691,
0.12005327641963959,
-0.21618571877479553,
-0.19812607765197754,
0.04720228165388107,
-0.04606495425105095,
0.35171493887901306,
0.11733730137348175,
0.14116671681404114,
0.0794934555888176,
-0.12359288334846497,
-0.2092439979314804,
-0.18128816783428192,
-0.36788028478622437,
-0.32695430517196655,
0.15959106385707855,
0.0794687494635582,
-0.36637258529663086,
0.2980629503726959,
-0.35802581906318665,
0.2780285179615021,
0.4770563542842865,
0.2902429699897766,
-0.017081953585147858,
0.044306907802820206,
0.06806550920009613,
-0.13922104239463806,
0.3842078447341919,
0.5372316837310791,
-0.2492184042930603,
-0.22452490031719208,
-0.025565868243575096,
-0.1552724987268448,
0.1454126089811325,
-0.11246299743652344,
-0.05543595552444458,
-0.0548262782394886,
-0.21711942553520203,
0.4524365961551666,
0.11171460151672363,
-0.4549823999404907,
-0.24637536704540253,
0.1002735048532486,
0.19285748898983002,
0.13330815732479095,
0.2634052038192749,
-0.23672446608543396,
0.14116403460502625,
0.12445307523012161,
-0.141769677400589,
0.041353631764650345,
-0.05504573881626129,
-0.12763462960720062,
-0.104796402156353,
-0.11717323958873749,
-0.27449309825897217,
0.0484028086066246,
-0.06008270010352135,
-0.14976629614830017,
0.1782958209514618,
0.0074022077023983,
0.1830829232931137,
-0.0032174354419112206,
0.2906051278114319,
0.2504481375217438,
0.24187225103378296,
0.36064696311950684,
0.05580371245741844,
0.03865623474121094,
-0.6388128399848938,
0.20898127555847168,
0.08611876517534256,
0.23023831844329834,
-0.02876976504921913,
0.028350383043289185,
-0.3459704518318176,
-0.05086295306682587,
-0.406947523355484,
-0.5459333062171936,
-0.02999725751578808,
0.1945721060037613,
0.15072153508663177,
-0.03265776485204697,
-0.2913292646408081,
0.5859560370445251,
0.23485496640205383,
0.23677510023117065,
-0.40047943592071533,
0.5031298995018005,
0.046478718519210815,
0.046364977955818176,
-0.01790950447320938,
0.2557550370693207,
0.10158510506153107,
-0.17803359031677246,
0.18024460971355438,
0.38596755266189575,
0.2907944917678833,
0.09828367084264755,
-0.2524922788143158,
-0.03823104500770569,
0.37593692541122437,
0.0688466727733612,
0.019569573923945427,
-0.27366340160369873,
-0.09239457547664642,
-0.12957939505577087,
-0.21955090761184692,
0.3828538656234741,
-0.0879041999578476,
0.2666979432106018,
0.04762580990791321,
0.05259008705615997,
0.29716193675994873,
-0.11963267624378204,
-0.25176551938056946,
-0.60633784532547,
0.23493516445159912,
-0.23671051859855652,
0.3123478293418884,
0.03784739226102829,
-0.2667301893234253,
0.14691485464572906,
0.1460953950881958,
0.08874917775392532,
-0.11607164889574051,
0.008487595245242119,
0.0073729995638132095,
0.06714147329330444,
-0.013332808390259743,
0.41147541999816895,
0.44149458408355713,
0.062189873307943344,
-0.0497211329638958,
0.24797621369361877,
-0.1059277355670929,
-0.19294166564941406,
0.22612524032592773,
-0.10021040588617325,
0.29506418108940125,
0.30729958415031433,
0.14626368880271912,
-0.20542314648628235,
-0.1886245757341385,
-0.05688156932592392,
0.15465107560157776,
0.012889457866549492,
-0.4493170380592346,
0.03568386286497116,
-0.4260271191596985,
-0.13287745416164398,
-0.23008619248867035,
-0.3564504384994507,
-0.24136202037334442,
-0.2874259948730469,
0.08597046136856079,
0.12174897640943527,
0.20899060368537903,
0.2171543538570404,
0.17140567302703857,
-0.16176246106624603,
-0.09342396259307861,
-0.11747922748327255,
-0.2823854088783264,
0.248457670211792,
-0.005852068308740854,
-0.06369638442993164,
0.09231188893318176,
0.00040421262383461,
0.08014264702796936,
-0.24763411283493042,
-0.358625590801239,
-0.34436267614364624,
-0.3377210795879364,
0.3601122498512268,
-0.20756778120994568,
0.6309164762496948,
0.36867719888687134,
0.07020850479602814,
-0.10586218535900116,
-0.1253950595855713,
0.504474937915802,
0.43379056453704834,
-0.3410661220550537,
0.18030095100402832,
0.11436590552330017,
-0.12279918789863586,
-0.29198992252349854,
-0.3186318874359131,
-0.22053425014019012,
-0.12653857469558716,
0.20980243384838104,
0.14506813883781433,
0.09263934940099716,
0.4181278347969055,
-0.012980140745639801,
-0.202946737408638,
-0.23284012079238892,
0.035803668200969696,
-0.12743934988975525,
-0.24005621671676636,
0.5002617835998535,
-0.51341313123703,
-0.17517957091331482,
-0.026648402214050293,
0.03641106188297272,
0.21635404229164124,
0.19432365894317627,
-0.3612251877784729,
0.01312270388007164,
-0.0856936052441597,
0.00820913165807724,
0.25046369433403015,
0.20183977484703064,
0.2461935430765152,
0.04061097651720047,
0.18733270466327667,
-0.3004106283187866,
-0.2958674430847168,
0.16377729177474976,
-0.03066474385559559,
0.33608388900756836,
-0.07060737907886505,
0.14506927132606506,
-0.16032946109771729,
0.3710399270057678,
0.4809802770614624,
0.19794361293315887,
0.1899670660495758,
-0.47592979669570923,
0.22886264324188232,
-0.261443555355072,
-0.3545071482658386,
-0.11518582701683044,
0.16677424311637878,
0.19445675611495972,
0.2474219799041748,
0.4086814224720001,
0.20964623987674713,
-0.12235471606254578,
0.11083588749170303,
-0.198499858379364,
-0.3889693319797516,
-0.3024117648601532,
-0.06928655505180359,
0.2204986810684204,
-0.025647830218076706,
0.20105355978012085,
0.24991868436336517,
-0.0759287029504776,
-0.2516712546348572,
0.6492069959640503,
-0.18070827424526215,
0.21748684346675873,
-0.5047118067741394,
0.19018259644508362,
-0.2838273346424103,
0.09945697337388992,
-0.17437613010406494,
0.012661933898925781,
0.02985726296901703,
0.17303140461444855,
0.2268218994140625,
0.0650576651096344,
0.5481380224227905,
0.009298427030444145,
-0.025974273681640625,
0.15513679385185242,
-0.42659151554107666,
-0.27105993032455444,
-0.1768471896648407,
0.08634348958730698,
0.18169932067394257,
0.026175346225500107,
0.5480863451957703,
-0.4880596995353699,
-0.1507573276758194,
-0.14376023411750793,
0.26489001512527466,
-0.10446956753730774,
-0.0750434622168541,
-0.07776188850402832,
-0.47895848751068115,
-0.15099304914474487,
-0.2854411005973816,
-0.09598221629858017,
0.20857740938663483,
0.1103164404630661,
-0.1812913715839386,
0.06927607953548431,
-0.1379745751619339,
0.2558639943599701,
0.1729220151901245,
0.36052000522613525,
-0.33117878437042236,
0.3700575828552246,
0.22121766209602356,
-0.02926921844482422,
0.8179552555084229,
0.5237499475479126,
-0.05052869766950607,
-0.21419759094715118,
-0.0397721529006958,
-0.19688493013381958,
0.26053526997566223,
0.13398268818855286,
-0.07760587334632874,
-0.015095941722393036,
0.009761303663253784,
0.04435603320598602,
-0.1256273239850998,
-0.11392839252948761,
0.25223779678344727,
0.058334387838840485,
-0.3111516237258911,
-0.5659910440444946,
0.2735135853290558,
0.08429645001888275,
0.14170539379119873,
0.18039879202842712,
0.4967750310897827,
-0.5347510576248169,
0.005860287696123123,
-0.08810025453567505,
0.6616196632385254,
0.006803495809435844,
-0.041387952864170074,
0.4450657367706299,
0.1390463262796402,
0.09947475045919418,
-0.2333046793937683,
0.25142043828964233,
-0.32365715503692627,
0.30490729212760925,
0.005143053829669952,
-0.1951327621936798,
0.4175845980644226,
0.06259337067604065,
-0.22627337276935577,
0.07956142723560333,
-0.2244437336921692,
0.31405964493751526,
-0.15993978083133698,
0.043583132326602936,
-0.20998157560825348,
-0.25706809759140015,
-0.27622777223587036,
0.017303474247455597,
0.0696587860584259,
0.2908293604850769,
0.059173762798309326,
-0.17250582575798035,
-0.4782007336616516,
0.013401210308074951,
-0.3572213649749756,
-0.1687120497226715,
-0.3664819002151489,
0.018824368715286255,
0.44336163997650146,
-0.2743080258369446,
0.19640299677848816,
0.3077629506587982,
0.22253605723381042,
0.30906033515930176,
-0.29233840107917786,
-0.026629233732819557,
0.10068254172801971,
-0.04331973195075989,
-0.041523970663547516,
-0.24260973930358887,
0.02064637653529644,
-0.10627433657646179,
-0.25941410660743713,
-0.4911334216594696,
0.17793159186840057,
0.037065982818603516,
-0.14279866218566895,
-0.11386673152446747,
-0.06540588289499283,
-0.49840858578681946,
0.10503163933753967,
-0.0008813627064228058,
0.32702988386154175,
-0.22816172242164612,
-0.00005814153701066971,
0.11192747950553894,
-0.09956330060958862,
0.1557491570711136,
-0.025900522246956825,
-0.027684472501277924,
-0.3019023537635803,
-0.00869942456483841,
-0.12110774219036102,
-0.001006796956062317,
0.29715093970298767,
0.15162572264671326,
-0.1951647400856018,
-0.12458406388759613,
0.3909696042537689,
0.06108832359313965,
-0.4551095962524414,
0.05435650423169136,
0.04901840537786484,
-0.0403340607881546,
0.14680621027946472,
0.3375381827354431,
0.06693373620510101,
0.09307048469781876,
0.21946042776107788,
-0.5225404500961304,
-0.021246183663606644,
0.2421998381614685,
-0.14435192942619324,
0.08221262693405151,
-0.2686661183834076,
0.22427229583263397,
-0.08345412462949753,
0.11468899250030518,
-0.13581421971321106,
-0.022491304203867912,
-0.06524010747671127,
0.047376640141010284,
0.2209051549434662,
0.07338759303092957,
0.07675057649612427,
-0.23714837431907654,
0.08097337186336517,
-0.15329551696777344,
-0.3567616045475006,
-0.03874959424138069,
-0.2301064282655716,
0.21250450611114502,
-0.14275497198104858,
-0.013035222887992859,
0.14507904648780823,
-0.04139327630400658,
-0.24926415085792542,
-0.3606545627117157,
0.2862594723701477,
0.45632171630859375,
-0.14531603455543518,
-0.022385388612747192,
0.11079613119363785,
-0.10540241003036499,
-0.37601491808891296,
0.017411192879080772,
0.0378107875585556,
0.12398877739906311,
0.048885446041822433,
0.0640241801738739,
-0.3160735070705414,
-0.0016961321234703064,
-0.0870404988527298,
0.3034874200820923,
-0.08862648159265518,
0.007311835885047913,
0.39351534843444824,
-0.17483800649642944,
0.30874836444854736,
0.11945213377475739,
0.45626944303512573,
0.38078007102012634,
-0.005402009934186935,
0.24029281735420227,
0.07344174385070801,
0.01957898959517479,
-0.13070693612098694,
0.07587000727653503,
0.449851930141449,
0.0018616802990436554,
0.025026902556419373,
0.7167217135429382,
0.3359237313270569,
-0.03781764209270477,
-0.220743328332901,
0.021126046776771545,
0.4878375232219696,
0.0333101861178875,
0.39592716097831726,
0.6556975245475769,
-0.3937567472457886,
0.3148249089717865,
0.43161991238594055,
0.12738315761089325,
-0.12772244215011597,
0.2663271725177765,
-0.09784078598022461,
0.047930024564266205,
-0.09293173253536224,
0.03168283402919769,
0.15943652391433716,
-0.16180534660816193,
-0.038586266338825226,
-0.07187703996896744,
-0.08403825759887695,
-0.162223681807518,
-0.3102084994316101,
0.5546659231185913,
-0.10264015942811966,
0.05694256350398064,
-0.131812185049057,
0.32497692108154297,
-0.05638858303427696,
-0.2204006463289261,
0.0761338472366333,
-0.42439237236976624,
-0.07923279702663422,
-0.14026154577732086,
-0.026803648099303246,
-0.36820080876350403,
0.4546010494232178,
-0.15022632479667664,
-0.0016453862190246582,
-0.271538645029068,
0.5645602345466614,
0.0025787539780139923,
0.11871755123138428,
-0.142780140042305,
0.37089401483535767,
-0.07862028479576111,
-0.18224841356277466,
0.016697818413376808,
0.2602626085281372,
0.39998283982276917,
0.3286268711090088,
0.31364503502845764,
-0.008014783263206482,
0.003018561750650406,
-0.09457571804523468,
-0.01951799914240837,
0.3356216251850128,
0.056400321424007416,
-0.30687570571899414,
0.24564896523952484,
0.004396382719278336,
-0.03582488000392914,
-0.08345840126276016,
0.06984938681125641,
0.13665050268173218,
-0.22013427317142487,
0.30821365118026733,
-0.3687182664871216,
0.03377193212509155,
0.2153049111366272,
0.020597197115421295,
-0.16485044360160828,
-0.29982584714889526,
0.5431453585624695,
0.1498734951019287,
0.1719447672367096,
-0.14300136268138885,
0.003095921128988266,
0.1125309020280838,
0.36774706840515137,
-0.11989383399486542,
-0.2519668936729431,
-0.11005465686321259,
-0.05157327651977539,
-0.4101305603981018,
-0.1930880844593048,
-0.2930196523666382,
-0.2936003804206848,
-0.15391463041305542,
0.1604025810956955,
0.08652487397193909,
-0.07574053108692169,
0.06042172387242317,
-0.19545723497867584,
0.2967430055141449,
0.19102686643600464,
-0.16318799555301666,
-0.11553443968296051,
-0.014744102954864502,
0.1832914799451828,
0.05547095090150833,
-0.2032146453857422,
0.14887532591819763,
-0.3198885917663574,
-0.08884164690971375,
-0.01656016893684864,
0.44249168038368225,
0.3950088620185852,
-0.0893835797905922,
-0.10162319988012314,
0.18212641775608063,
0.27687782049179077,
0.034821249544620514,
-0.11968967318534851,
-0.427204430103302,
-0.3135145604610443,
-0.08079080283641815,
0.4416634440422058,
0.006242740899324417,
0.074016273021698,
-0.28003066778182983,
-0.4701399505138397,
-0.3640671670436859,
0.008317634463310242,
0.19098696112632751,
-0.005811706185340881,
0.10105481743812561,
0.20502158999443054,
-0.11259868741035461,
-0.07981224358081818,
0.3910194933414459,
0.19024546444416046,
-0.2608087360858917,
0.10114441066980362,
-0.11222970485687256,
-0.5271542072296143,
0.34082967042922974,
-0.1064416915178299,
-0.1842249035835266,
0.05870537459850311,
0.01300785318017006,
0.37680816650390625,
-0.07025408744812012,
-0.40567389130592346,
-0.049791574478149414,
0.41553163528442383,
-0.24686844646930695,
-0.3452727496623993,
0.17349828779697418,
0.0960526242852211,
-0.3750406503677368,
0.042386554181575775,
0.2887156009674072,
0.1561024785041809,
-0.22815196216106415,
0.06818827986717224,
-0.05904662236571312
] |
https://github.com/huggingface/datasets/issues/6169 | Thank you for looking into this, Mario. Is this on [my repository](https://huggingface.co/datasets/tsor13/test), or on another one that you have reproduced? Would you mind pointing me to it if so? | Configurations in yaml not working | ### Dataset configurations cannot be created in YAML/README
Hello! I'm trying to follow the docs here in order to create structure in my dataset as added from here (#5331): https://github.com/huggingface/datasets/blob/8b8e6ee067eb74e7965ca2a6768f15f9398cb7c8/docs/source/repository_structure.mdx#L110-L118
I have the exact example in my config file for [my data repo](https://huggingface.co/datasets/tsor13/test):
```
configs:
- config_name: main_data
data_files: "main_data.csv"
- config_name: additional_data
data_files: "additional_data.csv"
```
Yet, I'm unable to load different configurations:
```
from datasets import get_dataset_config_names
get_dataset_config_names('tsor13/test', use_auth_token=True)
```
returns a single split, `['tsor13--test']`
Does anyone have any insights?
@polinaeterna thank you for adding this feature, it is super useful. Do you happen to have any ideas?
### Steps to reproduce the bug
from datasets import get_dataset_config_names
get_dataset_config_names('tsor13/test')
### Expected behavior
I would expect there to be two splits, `main_data` and `additional_data`. However, only `['tsor13--test']` test is returned.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-13.4-arm64-arm-64bit
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.1 | 29 | Configurations in yaml not working
### Dataset configurations cannot be created in YAML/README
Hello! I'm trying to follow the docs here in order to create structure in my dataset as added from here (#5331): https://github.com/huggingface/datasets/blob/8b8e6ee067eb74e7965ca2a6768f15f9398cb7c8/docs/source/repository_structure.mdx#L110-L118
I have the exact example in my config file for [my data repo](https://huggingface.co/datasets/tsor13/test):
```
configs:
- config_name: main_data
data_files: "main_data.csv"
- config_name: additional_data
data_files: "additional_data.csv"
```
Yet, I'm unable to load different configurations:
```
from datasets import get_dataset_config_names
get_dataset_config_names('tsor13/test', use_auth_token=True)
```
returns a single split, `['tsor13--test']`
Does anyone have any insights?
@polinaeterna thank you for adding this feature, it is super useful. Do you happen to have any ideas?
### Steps to reproduce the bug
from datasets import get_dataset_config_names
get_dataset_config_names('tsor13/test')
### Expected behavior
I would expect there to be two splits, `main_data` and `additional_data`. However, only `['tsor13--test']` test is returned.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-13.4-arm64-arm-64bit
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.1
Thank you for looking into this, Mario. Is this on [my repository](https://huggingface.co/datasets/tsor13/test), or on another one that you have reproduced? Would you mind pointing me to it if so? | [
-0.11032769083976746,
-0.4404180645942688,
0.03916045278310776,
0.4693024158477783,
0.36660531163215637,
0.059038251638412476,
0.27848830819129944,
-0.010496852919459343,
-0.15312331914901733,
-0.078360915184021,
-0.29099804162979126,
-0.017551109194755554,
0.18407945334911346,
0.16513051092624664,
0.1630392074584961,
0.08940005302429199,
-0.08928991854190826,
-0.06946926563978195,
-0.13382449746131897,
0.05129154771566391,
-0.09563373029232025,
0.22795751690864563,
-0.0015934854745864868,
-0.18583135306835175,
-0.20843443274497986,
0.10974720865488052,
-0.2825872302055359,
0.28024235367774963,
-0.20973311364650726,
-0.19157260656356812,
0.4044707119464874,
0.21338003873825073,
-0.21588841080665588,
0.4833870232105255,
-0.0001234443625435233,
0.240642249584198,
0.27236536145210266,
-0.24531257152557373,
-0.08278324455022812,
-0.21191486716270447,
-0.26320621371269226,
-0.34279918670654297,
0.1397607922554016,
0.012737661600112915,
-0.1332542896270752,
0.045532356947660446,
-0.1342073529958725,
-0.37262392044067383,
0.2810511887073517,
0.10127046704292297,
0.1160380020737648,
0.06070886552333832,
0.1569574773311615,
-0.1330350637435913,
0.1824292242527008,
0.5621121525764465,
-0.3096503019332886,
0.02325807511806488,
0.17629890143871307,
0.08029636740684509,
0.30138257145881653,
-0.08496655523777008,
0.007439188659191132,
-0.008658304810523987,
0.09094858169555664,
0.38661807775497437,
0.08544950187206268,
-0.4595714807510376,
0.1341879665851593,
0.4062111973762512,
0.6034606099128723,
-0.27888742089271545,
-0.3673224449157715,
-0.3555593192577362,
-0.12927547097206116,
-0.03861773759126663,
0.266457736492157,
0.46031051874160767,
-0.037947870790958405,
0.11185421794652939,
-0.35485830903053284,
-0.10084769129753113,
-0.13575471937656403,
0.19698910415172577,
-0.2255968153476715,
0.03801773115992546,
-0.06946159899234772,
-0.008462030440568924,
0.03557460010051727,
-0.04823140799999237,
-0.013184495270252228,
-0.1372208297252655,
-0.081940196454525,
0.20027145743370056,
-0.3169475197792053,
-0.00918281078338623,
-0.2178793102502823,
-0.04240751266479492,
0.5592436790466309,
0.23489414155483246,
-0.12500174343585968,
0.11806473135948181,
0.09370357543230057,
-0.059114351868629456,
0.07625564932823181,
0.23836542665958405,
0.1594371199607849,
0.43034255504608154,
0.02135395258665085,
0.159942626953125,
0.09481590241193771,
-0.10392901301383972,
-0.005457796156406403,
-0.3541046380996704,
-0.17321136593818665,
-0.3037533164024353,
0.23966258764266968,
0.08442144095897675,
0.048349156975746155,
-0.16477617621421814,
-0.3752366304397583,
-0.12293190509080887,
0.36085134744644165,
0.4611353278160095,
0.07325244694948196,
-0.3352298140525818,
-0.05788062512874603,
0.3529801666736603,
-0.2808992862701416,
0.21216076612472534,
-0.24142950773239136,
0.027961336076259613,
-0.36581340432167053,
0.16416336596012115,
0.423293799161911,
-0.22841998934745789,
0.3603615164756775,
0.44534844160079956,
0.09100104868412018,
-0.22211448848247528,
-0.18860700726509094,
0.05826824903488159,
-0.039374228566884995,
0.3335892856121063,
0.0970618799328804,
0.1416216492652893,
0.07764853537082672,
-0.0825585424900055,
-0.2057485431432724,
-0.19503100216388702,
-0.3769971430301666,
-0.3284386396408081,
0.16687268018722534,
0.09589410573244095,
-0.3255712389945984,
0.28586962819099426,
-0.349800705909729,
0.2921757996082306,
0.465318500995636,
0.2905208468437195,
-0.0035340599715709686,
0.05491990968585014,
0.09131484478712082,
-0.1431911736726761,
0.3639199137687683,
0.527677059173584,
-0.25331243872642517,
-0.2112528383731842,
-0.01965838298201561,
-0.18931257724761963,
0.11598654091358185,
-0.10451925545930862,
-0.0533050112426281,
-0.03479912132024765,
-0.2187422811985016,
0.4866011142730713,
0.14278040826320648,
-0.4694114923477173,
-0.2388395369052887,
0.1261332929134369,
0.18061091005802155,
0.10393597930669785,
0.25492915511131287,
-0.2257801741361618,
0.1476699411869049,
0.11405155062675476,
-0.16920985281467438,
0.032730985432863235,
-0.05537624657154083,
-0.13260430097579956,
-0.09123238176107407,
-0.09390468150377274,
-0.2766256332397461,
0.05841907113790512,
-0.0727405846118927,
-0.16645190119743347,
0.17294129729270935,
0.005118068307638168,
0.16710488498210907,
-0.00018720049411058426,
0.2964136004447937,
0.2768252193927765,
0.1994253396987915,
0.4207454025745392,
0.04719575121998787,
0.03565312176942825,
-0.6444905996322632,
0.19980686902999878,
0.05515233427286148,
0.21031107008457184,
0.000944383442401886,
0.0455479621887207,
-0.3318888545036316,
-0.08807961642742157,
-0.4105190634727478,
-0.5477449297904968,
-0.01351204514503479,
0.17478233575820923,
0.14651142060756683,
-0.046758975833654404,
-0.29740476608276367,
0.5484473705291748,
0.23682978749275208,
0.23831342160701752,
-0.4248810410499573,
0.48789018392562866,
0.038941390812397,
0.07605061680078506,
0.00048661231994628906,
0.24607446789741516,
0.09964761137962341,
-0.18328748643398285,
0.17360231280326843,
0.40453287959098816,
0.27286407351493835,
0.11120565235614777,
-0.2217285931110382,
-0.010144241154193878,
0.3513469398021698,
0.049130454659461975,
0.033149734139442444,
-0.2675880193710327,
-0.09229594469070435,
-0.13332030177116394,
-0.21371561288833618,
0.34165072441101074,
-0.07255831360816956,
0.2655147314071655,
0.04812021553516388,
0.06642531603574753,
0.3067944645881653,
-0.11674600094556808,
-0.26121193170547485,
-0.6062472462654114,
0.23879647254943848,
-0.24573899805545807,
0.3169451057910919,
0.02129065804183483,
-0.2755891978740692,
0.10892736166715622,
0.13264122605323792,
0.07041972875595093,
-0.1077469065785408,
0.020368149504065514,
-0.005159471184015274,
0.05897059291601181,
-0.04102141410112381,
0.3735884428024292,
0.4391724467277527,
0.08361926674842834,
-0.07705120742321014,
0.239488884806633,
-0.07364662736654282,
-0.18521317839622498,
0.2451586276292801,
-0.09429915994405746,
0.2689518928527832,
0.30697768926620483,
0.1167285293340683,
-0.20695075392723083,
-0.18084782361984253,
-0.03360270336270332,
0.13838794827461243,
0.0232196394354105,
-0.4698092043399811,
0.011737093329429626,
-0.4051153063774109,
-0.10522827506065369,
-0.22985456883907318,
-0.3588560223579407,
-0.23929721117019653,
-0.30166688561439514,
0.08443737030029297,
0.08266787230968475,
0.1972033977508545,
0.20629729330539703,
0.15542742609977722,
-0.17365536093711853,
-0.08405016362667084,
-0.1068924069404602,
-0.28367048501968384,
0.23348037898540497,
0.004446408711373806,
-0.05483574420213699,
0.1046328991651535,
0.005186721682548523,
0.11044424772262573,
-0.2483406662940979,
-0.3572886288166046,
-0.35959070920944214,
-0.33781927824020386,
0.3341260850429535,
-0.20460504293441772,
0.5880508422851562,
0.37669792771339417,
0.09817880392074585,
-0.06126571446657181,
-0.09008672833442688,
0.5086587071418762,
0.4223637878894806,
-0.3355850577354431,
0.184037446975708,
0.12522315979003906,
-0.11738130450248718,
-0.2706948518753052,
-0.3865014314651489,
-0.21987245976924896,
-0.1430046707391739,
0.19996526837348938,
0.1538921296596527,
0.07884258031845093,
0.3954334259033203,
-0.029035495594143867,
-0.20800134539604187,
-0.25274893641471863,
0.0434638112783432,
-0.15769347548484802,
-0.23959295451641083,
0.499970406293869,
-0.513595461845398,
-0.18404170870780945,
-0.023946411907672882,
0.04887090623378754,
0.2183666229248047,
0.1676006019115448,
-0.3746577501296997,
0.04780736193060875,
-0.07502236217260361,
-0.0014565587043762207,
0.2333478331565857,
0.2056184560060501,
0.25488123297691345,
0.044586360454559326,
0.16525912284851074,
-0.2923133373260498,
-0.267525851726532,
0.1598907709121704,
-0.04846145585179329,
0.3049383759498596,
-0.059744592756032944,
0.14632686972618103,
-0.17276504635810852,
0.3927326202392578,
0.49676811695098877,
0.20053914189338684,
0.1874319612979889,
-0.46315231919288635,
0.21772179007530212,
-0.25394588708877563,
-0.35344475507736206,
-0.1222909539937973,
0.17656239867210388,
0.24271249771118164,
0.2428870052099228,
0.40814605355262756,
0.22311295568943024,
-0.11594848334789276,
0.10544368624687195,
-0.21643146872520447,
-0.36278602480888367,
-0.30323654413223267,
-0.10453584045171738,
0.2337597757577896,
-0.040673669427633286,
0.20364320278167725,
0.24462845921516418,
-0.0672653466463089,
-0.23797693848609924,
0.6469985842704773,
-0.17437009513378143,
0.21107226610183716,
-0.5593036413192749,
0.23187950253486633,
-0.24847494065761566,
0.1102895438671112,
-0.1908547580242157,
0.0224013514816761,
0.020901143550872803,
0.18246810138225555,
0.22199341654777527,
0.06324660032987595,
0.5502455830574036,
-0.010827766731381416,
-0.03803827241063118,
0.14339330792427063,
-0.4146231710910797,
-0.2646375298500061,
-0.1468982696533203,
0.09036053717136383,
0.15285073220729828,
0.01792227104306221,
0.5380843877792358,
-0.5187390446662903,
-0.17261934280395508,
-0.13799884915351868,
0.26417556405067444,
-0.12259628623723984,
-0.07317572087049484,
-0.05734505504369736,
-0.4597955346107483,
-0.1563987135887146,
-0.3012937307357788,
-0.12052193284034729,
0.19618429243564606,
0.13434982299804688,
-0.16470980644226074,
0.08249983191490173,
-0.12490613758563995,
0.24086397886276245,
0.12453661859035492,
0.3863495886325836,
-0.3433643877506256,
0.3621966540813446,
0.27497246861457825,
-0.013670336455106735,
0.8185643553733826,
0.5239181518554688,
-0.04524767026305199,
-0.22353793680667877,
-0.05356084555387497,
-0.20510035753250122,
0.25454181432724,
0.1258532851934433,
-0.06572981178760529,
-0.015818040817975998,
0.03129606321454048,
0.05750793591141701,
-0.16671596467494965,
-0.14395588636398315,
0.2866721749305725,
0.07986877858638763,
-0.292331725358963,
-0.598081111907959,
0.2758488357067108,
0.0702178105711937,
0.15079712867736816,
0.1940566897392273,
0.4813784062862396,
-0.5388411283493042,
-0.014297083020210266,
-0.0973275825381279,
0.6579005718231201,
0.03035585954785347,
-0.02125585824251175,
0.44627419114112854,
0.13345591723918915,
0.06059408187866211,
-0.2518137991428375,
0.22582480311393738,
-0.3238837718963623,
0.3358795940876007,
-0.0033821165561676025,
-0.2070130705833435,
0.4298824369907379,
0.10248328745365143,
-0.21159842610359192,
0.10842519998550415,
-0.24276167154312134,
0.31727135181427,
-0.17433860898017883,
0.08945585787296295,
-0.17907564342021942,
-0.24123863875865936,
-0.2554672360420227,
0.033733583986759186,
0.0761832445859909,
0.2801564931869507,
0.06033770740032196,
-0.1775437742471695,
-0.4656498432159424,
0.0016737356781959534,
-0.3571726679801941,
-0.18973179161548615,
-0.33148181438446045,
0.04688771069049835,
0.43014609813690186,
-0.2506251633167267,
0.2097851186990738,
0.31371009349823,
0.21653930842876434,
0.29042303562164307,
-0.2978462874889374,
0.00003938423469662666,
0.11578600108623505,
-0.05835183337330818,
-0.03212358430027962,
-0.20926427841186523,
0.0059677474200725555,
-0.11459434032440186,
-0.2791571021080017,
-0.45897477865219116,
0.16716687381267548,
0.025438547134399414,
-0.1945103406906128,
-0.13360273838043213,
-0.048717349767684937,
-0.5040852427482605,
0.08442632853984833,
0.017089078202843666,
0.304021418094635,
-0.21515727043151855,
0.01337578147649765,
0.12228482961654663,
-0.09033036977052689,
0.13623526692390442,
0.003883662633597851,
-0.005933433771133423,
-0.30400753021240234,
-0.004044301807880402,
-0.13342003524303436,
-0.023376144468784332,
0.3156767785549164,
0.15902835130691528,
-0.21341130137443542,
-0.14855478703975677,
0.40614864230155945,
0.07011421024799347,
-0.459550142288208,
0.029595062136650085,
0.07782919704914093,
-0.015911415219306946,
0.13387489318847656,
0.3038285970687866,
0.05620308965444565,
0.08177779614925385,
0.22148597240447998,
-0.5124310255050659,
-0.019615061581134796,
0.24682573974132538,
-0.15795683860778809,
0.07929951697587967,
-0.2903769314289093,
0.2096245288848877,
-0.08536890894174576,
0.14089317619800568,
-0.1534556746482849,
-0.013733930885791779,
-0.0648176446557045,
0.04696899652481079,
0.23066869378089905,
0.0727977454662323,
0.07674959301948547,
-0.24007034301757812,
0.09776449203491211,
-0.1901807188987732,
-0.38790076971054077,
-0.04593466594815254,
-0.2074059545993805,
0.21139803528785706,
-0.15128137171268463,
-0.045151885598897934,
0.1524198353290558,
-0.06585366278886795,
-0.2470729947090149,
-0.3296511471271515,
0.26419562101364136,
0.46893349289894104,
-0.13613438606262207,
-0.0011537261307239532,
0.10237415134906769,
-0.1250043362379074,
-0.3922780156135559,
0.024230480194091797,
0.019409362226724625,
0.11498600244522095,
0.02596867084503174,
0.04686766117811203,
-0.3174011707305908,
-0.01650933176279068,
-0.14025606215000153,
0.33287298679351807,
-0.041368354111909866,
0.0033490192145109177,
0.41311484575271606,
-0.16314667463302612,
0.32068169116973877,
0.14829033613204956,
0.4475950598716736,
0.3751526474952698,
-0.05308059975504875,
0.2599498927593231,
0.05440328270196915,
0.041733723133802414,
-0.1455027461051941,
0.08983905613422394,
0.41427329182624817,
-0.020754313096404076,
0.023004144430160522,
0.6736748218536377,
0.33740752935409546,
-0.03062867373228073,
-0.23072093725204468,
0.030567333102226257,
0.488474041223526,
0.01036084070801735,
0.41707247495651245,
0.6588180065155029,
-0.38117700815200806,
0.27118489146232605,
0.4416813850402832,
0.1531444936990738,
-0.13812226057052612,
0.2590823769569397,
-0.08941219002008438,
0.05247773230075836,
-0.0974234789609909,
0.05174034833908081,
0.13855955004692078,
-0.1676047146320343,
-0.04783111438155174,
-0.03426145017147064,
-0.09471265226602554,
-0.17709475755691528,
-0.32339200377464294,
0.5371546149253845,
-0.06482113897800446,
0.029413122683763504,
-0.11077307164669037,
0.3235052227973938,
-0.04386257752776146,
-0.21759702265262604,
0.07412882149219513,
-0.4367612302303314,
-0.06820818781852722,
-0.16311010718345642,
-0.024878360331058502,
-0.4015182554721832,
0.430526465177536,
-0.15218016505241394,
0.002698540687561035,
-0.28335317969322205,
0.5920886993408203,
-0.025548210367560387,
0.10034506022930145,
-0.14039483666419983,
0.3541603088378906,
-0.05055532976984978,
-0.18048352003097534,
0.06317064166069031,
0.27252888679504395,
0.38950487971305847,
0.3078857958316803,
0.3196795582771301,
0.010474398732185364,
0.012960061430931091,
-0.11154227703809738,
0.010843127965927124,
0.341941773891449,
0.0198178980499506,
-0.3311890959739685,
0.25348779559135437,
0.02300175651907921,
-0.04056253284215927,
-0.08174144476652145,
0.07212064415216446,
0.1474255919456482,
-0.2272738665342331,
0.3283858299255371,
-0.36937522888183594,
0.023534953594207764,
0.1948162317276001,
0.011173132807016373,
-0.1672310084104538,
-0.310369610786438,
0.5607647895812988,
0.17107586562633514,
0.16532857716083527,
-0.16687175631523132,
0.012680590152740479,
0.12221714854240417,
0.3736349046230316,
-0.12022846937179565,
-0.2642498314380646,
-0.1251835972070694,
-0.05017034709453583,
-0.4160453975200653,
-0.19572457671165466,
-0.28770923614501953,
-0.290560245513916,
-0.13022878766059875,
0.16139289736747742,
0.11343406140804291,
-0.06799488514661789,
0.09951495379209518,
-0.20072989165782928,
0.2796960771083832,
0.18963146209716797,
-0.1505761295557022,
-0.08374245464801788,
-0.002712588757276535,
0.2431391328573227,
0.06351858377456665,
-0.19602461159229279,
0.15088464319705963,
-0.3202228546142578,
-0.07912503927946091,
-0.01932050660252571,
0.4856875240802765,
0.40961527824401855,
-0.0715242475271225,
-0.11567579209804535,
0.1567099392414093,
0.2873486280441284,
0.035424187779426575,
-0.1321721374988556,
-0.4257693886756897,
-0.31754806637763977,
-0.08143139630556107,
0.4478578269481659,
-0.010485131293535233,
0.06251212954521179,
-0.2965790033340454,
-0.5068182945251465,
-0.37116721272468567,
-0.008410397917032242,
0.16063378751277924,
-0.019050532951951027,
0.08434948325157166,
0.2159300148487091,
-0.07966809719800949,
-0.09450788795948029,
0.38862377405166626,
0.17818406224250793,
-0.24103689193725586,
0.09275855869054794,
-0.11079183220863342,
-0.5154270529747009,
0.353381872177124,
-0.07030929625034332,
-0.1568601131439209,
0.08528512716293335,
0.0004507601261138916,
0.3827134072780609,
-0.03197396919131279,
-0.3983965516090393,
-0.028781749308109283,
0.4444583058357239,
-0.21626286208629608,
-0.34220683574676514,
0.16687960922718048,
0.09857340157032013,
-0.376302570104599,
0.05490657687187195,
0.26885008811950684,
0.146229088306427,
-0.21325266361236572,
0.07150165736675262,
-0.04602228105068207
] |
https://github.com/huggingface/datasets/issues/6169 | Whoa, in colab I received the correct behavior using my dataset. It must have something to do with my local copy of `datasets` (which again just failed).
I've tried uninstalling/reinstnalling to no avail | Configurations in yaml not working | ### Dataset configurations cannot be created in YAML/README
Hello! I'm trying to follow the docs here in order to create structure in my dataset as added from here (#5331): https://github.com/huggingface/datasets/blob/8b8e6ee067eb74e7965ca2a6768f15f9398cb7c8/docs/source/repository_structure.mdx#L110-L118
I have the exact example in my config file for [my data repo](https://huggingface.co/datasets/tsor13/test):
```
configs:
- config_name: main_data
data_files: "main_data.csv"
- config_name: additional_data
data_files: "additional_data.csv"
```
Yet, I'm unable to load different configurations:
```
from datasets import get_dataset_config_names
get_dataset_config_names('tsor13/test', use_auth_token=True)
```
returns a single split, `['tsor13--test']`
Does anyone have any insights?
@polinaeterna thank you for adding this feature, it is super useful. Do you happen to have any ideas?
### Steps to reproduce the bug
from datasets import get_dataset_config_names
get_dataset_config_names('tsor13/test')
### Expected behavior
I would expect there to be two splits, `main_data` and `additional_data`. However, only `['tsor13--test']` test is returned.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-13.4-arm64-arm-64bit
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.1 | 33 | Configurations in yaml not working
### Dataset configurations cannot be created in YAML/README
Hello! I'm trying to follow the docs here in order to create structure in my dataset as added from here (#5331): https://github.com/huggingface/datasets/blob/8b8e6ee067eb74e7965ca2a6768f15f9398cb7c8/docs/source/repository_structure.mdx#L110-L118
I have the exact example in my config file for [my data repo](https://huggingface.co/datasets/tsor13/test):
```
configs:
- config_name: main_data
data_files: "main_data.csv"
- config_name: additional_data
data_files: "additional_data.csv"
```
Yet, I'm unable to load different configurations:
```
from datasets import get_dataset_config_names
get_dataset_config_names('tsor13/test', use_auth_token=True)
```
returns a single split, `['tsor13--test']`
Does anyone have any insights?
@polinaeterna thank you for adding this feature, it is super useful. Do you happen to have any ideas?
### Steps to reproduce the bug
from datasets import get_dataset_config_names
get_dataset_config_names('tsor13/test')
### Expected behavior
I would expect there to be two splits, `main_data` and `additional_data`. However, only `['tsor13--test']` test is returned.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-13.4-arm64-arm-64bit
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.1
Whoa, in colab I received the correct behavior using my dataset. It must have something to do with my local copy of `datasets` (which again just failed).
I've tried uninstalling/reinstnalling to no avail | [
-0.1206040158867836,
-0.4372705817222595,
0.07081729918718338,
0.460095077753067,
0.34331145882606506,
0.031300708651542664,
0.2949771285057068,
-0.05509854853153229,
-0.17239221930503845,
-0.04089412838220596,
-0.3166311979293823,
0.05706300958991051,
0.1723296344280243,
0.20787203311920166,
0.11841223388910294,
0.13721951842308044,
-0.07864493131637573,
-0.02514306828379631,
-0.11447082459926605,
0.05023792386054993,
-0.10842683911323547,
0.25866836309432983,
-0.04369894415140152,
-0.24967893958091736,
-0.26623234152793884,
0.0769217386841774,
-0.31733888387680054,
0.2590164244174957,
-0.2352447509765625,
-0.13479527831077576,
0.47462064027786255,
0.23302103579044342,
-0.19202721118927002,
0.4693908989429474,
-0.00012491297093220055,
0.21015769243240356,
0.27685052156448364,
-0.26717299222946167,
-0.12541627883911133,
-0.22553987801074982,
-0.2910850942134857,
-0.3382071852684021,
0.21295255422592163,
0.001966327428817749,
-0.1679631620645523,
0.17552009224891663,
-0.10291038453578949,
-0.304088830947876,
0.3091495633125305,
0.08623015880584717,
0.10116077959537506,
0.016778334975242615,
0.061499327421188354,
-0.12198187410831451,
0.22172613441944122,
0.6029417514801025,
-0.34227776527404785,
0.0839710533618927,
0.1780228316783905,
0.05585470050573349,
0.3055514693260193,
-0.08522029221057892,
-0.026893552392721176,
0.0029521919786930084,
0.0594877265393734,
0.43003416061401367,
0.055085983127355576,
-0.4763176143169403,
0.16937439143657684,
0.3808373212814331,
0.5403507351875305,
-0.2792162001132965,
-0.30358266830444336,
-0.36590683460235596,
-0.08966150134801865,
-0.07830196619033813,
0.2849481999874115,
0.4463815689086914,
-0.0482761487364769,
0.12124589830636978,
-0.3534630537033081,
-0.02094673551619053,
-0.10244835168123245,
0.17503371834754944,
-0.2621314525604248,
0.115048348903656,
-0.10396000742912292,
-0.006647299975156784,
0.04275805130600929,
-0.004077229183167219,
0.1119350790977478,
-0.14896883070468903,
-0.100882887840271,
0.1879119873046875,
-0.2641049325466156,
-0.008805058896541595,
-0.2498246431350708,
0.08497371524572372,
0.5492653846740723,
0.1534738838672638,
-0.11099348217248917,
0.11223635077476501,
0.08871312439441681,
-0.04394733905792236,
0.038823168724775314,
0.24488958716392517,
0.17617934942245483,
0.383365273475647,
0.033871233463287354,
0.23712055385112762,
0.03663170337677002,
-0.10982159525156021,
-0.020735589787364006,
-0.2974978983402252,
-0.20426592230796814,
-0.27108585834503174,
0.25176477432250977,
0.06061840057373047,
0.02475099265575409,
-0.1962183713912964,
-0.4229552745819092,
-0.09075893461704254,
0.383562296628952,
0.4734479486942291,
0.012495968490839005,
-0.4086686670780182,
-0.07503484189510345,
0.3027064800262451,
-0.29560035467147827,
0.23888863623142242,
-0.23270896077156067,
0.025845065712928772,
-0.3837069869041443,
0.21156175434589386,
0.4375549554824829,
-0.20441843569278717,
0.39633113145828247,
0.46875083446502686,
0.12634876370429993,
-0.2185484766960144,
-0.19989049434661865,
-0.0007457956671714783,
-0.03300278261303902,
0.34390655159950256,
0.1380344182252884,
0.1340615451335907,
0.08291933685541153,
-0.18034666776657104,
-0.20790675282478333,
-0.1511601358652115,
-0.40375038981437683,
-0.32278528809547424,
0.1765204817056656,
0.07194069027900696,
-0.38794445991516113,
0.27583110332489014,
-0.4056093096733093,
0.30538052320480347,
0.5006729364395142,
0.24883928894996643,
0.004173848778009415,
0.03386332094669342,
0.027105197310447693,
-0.15568691492080688,
0.3637275695800781,
0.5256354212760925,
-0.260248064994812,
-0.1973053514957428,
-0.04623712599277496,
-0.1188727617263794,
0.21841584146022797,
-0.12067723274230957,
-0.07911578565835953,
-0.08198785781860352,
-0.2065902203321457,
0.40930160880088806,
0.1060774028301239,
-0.4324091672897339,
-0.28410804271698,
0.06907333433628082,
0.2148936688899994,
0.15701782703399658,
0.2465621680021286,
-0.23709024488925934,
0.15287578105926514,
0.10244862735271454,
-0.09457897394895554,
0.04374385252594948,
-0.07029437273740768,
-0.10018013417720795,
-0.13155287504196167,
-0.11207355558872223,
-0.29516011476516724,
0.026104241609573364,
-0.08501075208187103,
-0.14584600925445557,
0.16113802790641785,
-0.021564152091741562,
0.18624870479106903,
0.0014121206477284431,
0.2531493306159973,
0.20843398571014404,
0.2878309488296509,
0.32959699630737305,
0.040801577270030975,
0.07528403401374817,
-0.6524983048439026,
0.20146594941616058,
0.1296168714761734,
0.25187912583351135,
-0.055636391043663025,
0.022755898535251617,
-0.3471648693084717,
-0.0576004758477211,
-0.4081278443336487,
-0.5872907638549805,
-0.040124502032995224,
0.21267151832580566,
0.1351180374622345,
-0.026200905442237854,
-0.27313679456710815,
0.6265970468521118,
0.2186271846294403,
0.23162858188152313,
-0.37482136487960815,
0.5169671177864075,
0.04064875841140747,
0.03111743927001953,
-0.04191175848245621,
0.24558553099632263,
0.08830632269382477,
-0.19467075169086456,
0.15379434823989868,
0.37520933151245117,
0.3316899836063385,
0.05862637236714363,
-0.2564460039138794,
-0.06544696539640427,
0.4048914611339569,
0.0735645666718483,
-0.005317524075508118,
-0.30319643020629883,
-0.07439740002155304,
-0.11318069696426392,
-0.19171294569969177,
0.4039725363254547,
-0.13078486919403076,
0.25455403327941895,
0.02480451762676239,
0.036197587847709656,
0.33123570680618286,
-0.11038641631603241,
-0.25988858938217163,
-0.6019843220710754,
0.19689378142356873,
-0.21018488705158234,
0.30283719301223755,
0.061165884137153625,
-0.2776256501674652,
0.1960138976573944,
0.18843232095241547,
0.11221186816692352,
-0.12219606339931488,
0.010150586254894733,
0.00300709530711174,
0.042996250092983246,
0.04433656483888626,
0.4742935299873352,
0.47584718465805054,
0.05645142123103142,
-0.06522637605667114,
0.24917849898338318,
-0.08914588391780853,
-0.20208372175693512,
0.2523779273033142,
-0.11266115307807922,
0.3471999168395996,
0.2652561664581299,
0.16326534748077393,
-0.19901533424854279,
-0.17702710628509521,
-0.061499111354351044,
0.1443650722503662,
0.012746693566441536,
-0.42235904932022095,
0.053673937916755676,
-0.43139776587486267,
-0.17776289582252502,
-0.23733185231685638,
-0.35984981060028076,
-0.2001688927412033,
-0.28229671716690063,
0.07553248852491379,
0.13007579743862152,
0.2249201238155365,
0.20057649910449982,
0.21529003977775574,
-0.1604292392730713,
-0.10247208178043365,
-0.13436155021190643,
-0.27859559655189514,
0.2069166600704193,
-0.02847498282790184,
-0.06521685421466827,
0.08848676830530167,
0.0153590627014637,
0.038785241544246674,
-0.2724207639694214,
-0.3489396274089813,
-0.29047107696533203,
-0.35673439502716064,
0.38533830642700195,
-0.22064310312271118,
0.66094970703125,
0.34340107440948486,
0.04355814680457115,
-0.17493599653244019,
-0.14513447880744934,
0.4961596727371216,
0.4182929992675781,
-0.33723074197769165,
0.12631776928901672,
0.089509978890419,
-0.14723514020442963,
-0.29485172033309937,
-0.2883903384208679,
-0.2388959527015686,
-0.12196586281061172,
0.16506712138652802,
0.1668986976146698,
0.09214635193347931,
0.44391539692878723,
-0.005211994051933289,
-0.20016878843307495,
-0.19320979714393616,
0.018202226608991623,
-0.141537144780159,
-0.25046178698539734,
0.49270543456077576,
-0.5022122263908386,
-0.17507952451705933,
-0.03062417358160019,
-0.017132658511400223,
0.21618889272212982,
0.1881023645401001,
-0.36315813660621643,
-0.06593143939971924,
-0.07857029885053635,
-0.008196420967578888,
0.26463544368743896,
0.15718621015548706,
0.2505762577056885,
0.05495579168200493,
0.20396432280540466,
-0.2958907186985016,
-0.3382726013660431,
0.14723476767539978,
0.0051065292209386826,
0.3552812933921814,
-0.09621751308441162,
0.12978804111480713,
-0.18488025665283203,
0.398580402135849,
0.44711780548095703,
0.15718930959701538,
0.1864275336265564,
-0.4573972225189209,
0.2310210019350052,
-0.2733389139175415,
-0.36698973178863525,
-0.10576795041561127,
0.18957653641700745,
0.16583019495010376,
0.2959294617176056,
0.39198631048202515,
0.1570139229297638,
-0.13517381250858307,
0.09346522390842438,
-0.2156827449798584,
-0.41855964064598083,
-0.2874499559402466,
-0.006396470125764608,
0.17416682839393616,
0.017833814024925232,
0.2080094963312149,
0.2560194730758667,
-0.08972056210041046,
-0.3011090159416199,
0.6673743724822998,
-0.24806152284145355,
0.203200101852417,
-0.4155265986919403,
0.15819522738456726,
-0.29790422320365906,
0.12775591015815735,
-0.14287427067756653,
-0.0385502353310585,
0.06577390432357788,
0.17480479180812836,
0.23696023225784302,
0.06031526252627373,
0.5223815441131592,
0.015243953093886375,
-0.08808605372905731,
0.12646368145942688,
-0.42346668243408203,
-0.22612352669239044,
-0.17603251338005066,
0.06890927255153656,
0.20743818581104279,
0.021851055324077606,
0.5445254445075989,
-0.4727337062358856,
-0.14231476187705994,
-0.1222795844078064,
0.2457849085330963,
-0.08680856972932816,
-0.04408709332346916,
-0.07898057997226715,
-0.5200539827346802,
-0.14695662260055542,
-0.279471755027771,
-0.10900954902172089,
0.19100040197372437,
0.11983897536993027,
-0.20284324884414673,
0.08904064446687698,
-0.12928980588912964,
0.23690149188041687,
0.20447713136672974,
0.3524130880832672,
-0.27687737345695496,
0.34960848093032837,
0.15295757353305817,
-0.00244036503136158,
0.8413981199264526,
0.5428624749183655,
-0.03716520220041275,
-0.21116477251052856,
-0.05404666066169739,
-0.1897345781326294,
0.2676580846309662,
0.1459859013557434,
-0.1025712788105011,
-0.027270298451185226,
-0.041364509612321854,
0.03233013302087784,
-0.06585442274808884,
-0.06398226320743561,
0.23025688529014587,
0.07381545752286911,
-0.31789904832839966,
-0.576355516910553,
0.26377835869789124,
0.07910053431987762,
0.12681323289871216,
0.16967570781707764,
0.4751700162887573,
-0.5373135209083557,
0.04682432487607002,
-0.05955444276332855,
0.6935896873474121,
-0.002134556882083416,
-0.057277847081422806,
0.47913336753845215,
0.15034574270248413,
0.1360194832086563,
-0.1915086954832077,
0.2794508934020996,
-0.3222925662994385,
0.27308040857315063,
0.008163407444953918,
-0.1769421398639679,
0.39823195338249207,
0.03230717033147812,
-0.2710358500480652,
0.08036799728870392,
-0.1727810800075531,
0.28120529651641846,
-0.14671799540519714,
-0.009302012622356415,
-0.19879379868507385,
-0.2595268189907074,
-0.30305197834968567,
0.005125708878040314,
0.0441349595785141,
0.29474687576293945,
0.04729451984167099,
-0.17559337615966797,
-0.5048385858535767,
0.025916770100593567,
-0.34063106775283813,
-0.16821908950805664,
-0.4232870936393738,
-0.0070179905742406845,
0.4345685541629791,
-0.2804691791534424,
0.17480552196502686,
0.3081933856010437,
0.2140921950340271,
0.30265069007873535,
-0.28850257396698,
-0.019632555544376373,
0.12889353930950165,
-0.055755872279405594,
-0.05944551154971123,
-0.26931703090667725,
0.030897853896021843,
-0.10338421165943146,
-0.2321854829788208,
-0.5390990972518921,
0.1925203651189804,
0.06322820484638214,
-0.08727221190929413,
-0.07124190032482147,
-0.06421156227588654,
-0.4946141839027405,
0.07361148297786713,
0.028421081602573395,
0.3322785198688507,
-0.21634045243263245,
-0.0010066190734505653,
0.09088371694087982,
-0.08167895674705505,
0.16080471873283386,
-0.024387052282691002,
-0.053739406168460846,
-0.32014745473861694,
-0.037735991179943085,
-0.0971887856721878,
0.016709059476852417,
0.29703181982040405,
0.11902250349521637,
-0.16171972453594208,
-0.10884706676006317,
0.4006114602088928,
-0.012324335053563118,
-0.44493985176086426,
0.08468357473611832,
0.04858129099011421,
-0.052473634481430054,
0.1754235327243805,
0.4101448655128479,
0.08193457126617432,
0.11363360285758972,
0.2157905548810959,
-0.5050913095474243,
-0.0402393564581871,
0.2131529152393341,
-0.13960546255111694,
0.057760316878557205,
-0.2495627999305725,
0.25978514552116394,
-0.09489258378744125,
0.12168539315462112,
-0.1335618644952774,
-0.00911412388086319,
-0.07747089862823486,
0.0650835707783699,
0.19818033277988434,
0.08011116832494736,
0.09922058880329132,
-0.2001996636390686,
0.069483682513237,
-0.12864306569099426,
-0.3562714457511902,
-0.05067625641822815,
-0.22697244584560394,
0.2166793942451477,
-0.1312386691570282,
-0.02025371417403221,
0.12679940462112427,
-0.014663804322481155,
-0.23541420698165894,
-0.3809213638305664,
0.277757465839386,
0.43299779295921326,
-0.12489251792430878,
-0.0480257123708725,
0.13999789953231812,
-0.10307663679122925,
-0.38217592239379883,
0.02470199391245842,
0.019114535301923752,
0.13179874420166016,
0.06570281833410263,
0.04721343144774437,
-0.32347142696380615,
-0.004996307194232941,
0.000324442982673645,
0.26017552614212036,
-0.09282343834638596,
0.02645968273282051,
0.38746190071105957,
-0.1547217071056366,
0.2956262230873108,
0.10507449507713318,
0.4002746343612671,
0.3625975549221039,
0.026224058121442795,
0.22694283723831177,
0.06526637077331543,
0.004925766494125128,
-0.11531971395015717,
0.12477166950702667,
0.47563716769218445,
0.016371332108974457,
0.04147733747959137,
0.7501527070999146,
0.31449025869369507,
0.017041951417922974,
-0.20605486631393433,
0.01040293276309967,
0.4929138422012329,
0.07549082487821579,
0.4110226631164551,
0.6130048632621765,
-0.41108226776123047,
0.3500373959541321,
0.4372924566268921,
0.102373868227005,
-0.11235462129116058,
0.2475355863571167,
-0.11116571724414825,
0.050398603081703186,
-0.09292773902416229,
0.022851955145597458,
0.21692392230033875,
-0.1790117770433426,
0.01741892099380493,
-0.06569395214319229,
-0.08956760168075562,
-0.18735039234161377,
-0.28357213735580444,
0.5530983209609985,
-0.11667197942733765,
0.08035080134868622,
-0.12892992794513702,
0.3305245041847229,
-0.04626820608973503,
-0.22482740879058838,
0.0934775322675705,
-0.4007464647293091,
-0.09796582907438278,
-0.13792943954467773,
-0.03801039978861809,
-0.3519604504108429,
0.45230334997177124,
-0.1386200338602066,
-0.007747035473585129,
-0.24323147535324097,
0.5473602414131165,
0.017337283119559288,
0.12557414174079895,
-0.11997581273317337,
0.41137075424194336,
-0.10513068735599518,
-0.19312915205955505,
-0.017599740996956825,
0.24400846660137177,
0.40432029962539673,
0.35538551211357117,
0.3047654628753662,
-0.026991359889507294,
0.03699164092540741,
-0.09388120472431183,
-0.01747981086373329,
0.32472866773605347,
0.10190482437610626,
-0.29261070489883423,
0.25096893310546875,
0.005330979824066162,
-0.04212300851941109,
-0.043004922568798065,
0.0584087073802948,
0.10654520988464355,
-0.189771831035614,
0.2622685134410858,
-0.3435424268245697,
0.05393955111503601,
0.2120184302330017,
0.03028140589594841,
-0.16878578066825867,
-0.24848103523254395,
0.4979121685028076,
0.10119685530662537,
0.1835448145866394,
-0.12106717377901077,
0.0023852400481700897,
0.107441246509552,
0.3858412504196167,
-0.12882955372333527,
-0.20209626853466034,
-0.12353871762752533,
-0.06251784414052963,
-0.38900232315063477,
-0.15462049841880798,
-0.2615654468536377,
-0.288146436214447,
-0.19642269611358643,
0.15926623344421387,
0.08845041692256927,
-0.04057282209396362,
-0.0013402625918388367,
-0.19004689157009125,
0.3478855788707733,
0.1450774073600769,
-0.15670761466026306,
-0.14445820450782776,
-0.025768056511878967,
0.12349957972764969,
0.054595671594142914,
-0.20647861063480377,
0.12661968171596527,
-0.33313053846359253,
-0.09522169828414917,
-0.011098092421889305,
0.3949389159679413,
0.37328845262527466,
-0.08845366537570953,
-0.11461977660655975,
0.19655513763427734,
0.2953697144985199,
0.01621195673942566,
-0.08428307622671127,
-0.37930354475975037,
-0.3100326657295227,
-0.07569169253110886,
0.4411269426345825,
0.039902281016111374,
0.08267909288406372,
-0.2673238515853882,
-0.4191329777240753,
-0.35712260007858276,
0.018299661576747894,
0.21770630776882172,
0.006562311202287674,
0.1134827584028244,
0.19046062231063843,
-0.13499878346920013,
-0.08659122884273529,
0.38033154606819153,
0.22177381813526154,
-0.2811196744441986,
0.09567873924970627,
-0.10006293654441833,
-0.5319759249687195,
0.3666144907474518,
-0.13195982575416565,
-0.16113722324371338,
0.06599387526512146,
0.0031019002199172974,
0.3892343044281006,
-0.08506481349468231,
-0.39283567667007446,
-0.06613703072071075,
0.4001108407974243,
-0.2617388367652893,
-0.3730712831020355,
0.196533665060997,
0.12545502185821533,
-0.35167789459228516,
0.01383933424949646,
0.3128073811531067,
0.17365819215774536,
-0.2363753318786621,
0.034042805433273315,
-0.07775377482175827
] |
https://github.com/huggingface/datasets/issues/6169 | hi @tsor13 , I haven't been able to reproduce your issue on `tsor13/test` dataset locally either. reinstalling doesn't help? | Configurations in yaml not working | ### Dataset configurations cannot be created in YAML/README
Hello! I'm trying to follow the docs here in order to create structure in my dataset as added from here (#5331): https://github.com/huggingface/datasets/blob/8b8e6ee067eb74e7965ca2a6768f15f9398cb7c8/docs/source/repository_structure.mdx#L110-L118
I have the exact example in my config file for [my data repo](https://huggingface.co/datasets/tsor13/test):
```
configs:
- config_name: main_data
data_files: "main_data.csv"
- config_name: additional_data
data_files: "additional_data.csv"
```
Yet, I'm unable to load different configurations:
```
from datasets import get_dataset_config_names
get_dataset_config_names('tsor13/test', use_auth_token=True)
```
returns a single split, `['tsor13--test']`
Does anyone have any insights?
@polinaeterna thank you for adding this feature, it is super useful. Do you happen to have any ideas?
### Steps to reproduce the bug
from datasets import get_dataset_config_names
get_dataset_config_names('tsor13/test')
### Expected behavior
I would expect there to be two splits, `main_data` and `additional_data`. However, only `['tsor13--test']` test is returned.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-13.4-arm64-arm-64bit
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.1 | 19 | Configurations in yaml not working
### Dataset configurations cannot be created in YAML/README
Hello! I'm trying to follow the docs here in order to create structure in my dataset as added from here (#5331): https://github.com/huggingface/datasets/blob/8b8e6ee067eb74e7965ca2a6768f15f9398cb7c8/docs/source/repository_structure.mdx#L110-L118
I have the exact example in my config file for [my data repo](https://huggingface.co/datasets/tsor13/test):
```
configs:
- config_name: main_data
data_files: "main_data.csv"
- config_name: additional_data
data_files: "additional_data.csv"
```
Yet, I'm unable to load different configurations:
```
from datasets import get_dataset_config_names
get_dataset_config_names('tsor13/test', use_auth_token=True)
```
returns a single split, `['tsor13--test']`
Does anyone have any insights?
@polinaeterna thank you for adding this feature, it is super useful. Do you happen to have any ideas?
### Steps to reproduce the bug
from datasets import get_dataset_config_names
get_dataset_config_names('tsor13/test')
### Expected behavior
I would expect there to be two splits, `main_data` and `additional_data`. However, only `['tsor13--test']` test is returned.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-13.4-arm64-arm-64bit
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.1
hi @tsor13 , I haven't been able to reproduce your issue on `tsor13/test` dataset locally either. reinstalling doesn't help? | [
-0.1241253986954689,
-0.46657809615135193,
0.044537708163261414,
0.45027482509613037,
0.3804835081100464,
0.04604162275791168,
0.2761646509170532,
-0.010582834482192993,
-0.12343527376651764,
-0.07216480374336243,
-0.3147639036178589,
-0.009312260895967484,
0.17964068055152893,
0.19876345992088318,
0.16059763729572296,
0.0968252420425415,
-0.08723720163106918,
-0.053649310022592545,
-0.14122696220874786,
0.06484924256801605,
-0.1067783534526825,
0.22427313029766083,
0.025012776255607605,
-0.18708284199237823,
-0.22830067574977875,
0.11342452466487885,
-0.2683677077293396,
0.2697240710258484,
-0.2035430669784546,
-0.19069045782089233,
0.4089867174625397,
0.21718266606330872,
-0.20005552470684052,
0.5074594616889954,
-0.00012403330765664577,
0.24862995743751526,
0.27590733766555786,
-0.24815204739570618,
-0.10457093268632889,
-0.21362343430519104,
-0.24907293915748596,
-0.3183373510837555,
0.14664322137832642,
0.035446569323539734,
-0.13573448359966278,
0.05697999149560928,
-0.14408081769943237,
-0.36753612756729126,
0.2909821569919586,
0.08543309569358826,
0.10820835828781128,
0.07933022826910019,
0.16786092519760132,
-0.1295163333415985,
0.2041212022304535,
0.5739378929138184,
-0.3300613462924957,
0.024761121720075607,
0.18007197976112366,
0.06196387857198715,
0.3186987042427063,
-0.08644881844520569,
0.025086410343647003,
-0.011129996739327908,
0.07913520932197571,
0.38032519817352295,
0.10129350423812866,
-0.4457753896713257,
0.1264343410730362,
0.4172394573688507,
0.6215198040008545,
-0.2797830104827881,
-0.38025903701782227,
-0.3402760624885559,
-0.12925881147384644,
-0.03492135554552078,
0.2691417932510376,
0.44186586141586304,
-0.03620990365743637,
0.11068503558635712,
-0.3699806332588196,
-0.08263597637414932,
-0.14843416213989258,
0.20151032507419586,
-0.21913667023181915,
0.019385926425457,
-0.0696873813867569,
-0.01670554280281067,
0.03549657389521599,
-0.05235215276479721,
-0.008627481758594513,
-0.12731696665287018,
-0.08269897103309631,
0.1979927122592926,
-0.3309171795845032,
-0.015391521155834198,
-0.2103027105331421,
-0.05045164003968239,
0.5537941455841064,
0.22239768505096436,
-0.1278669238090515,
0.11937513202428818,
0.09578587114810944,
-0.05822228267788887,
0.048717156052589417,
0.24435779452323914,
0.1641334891319275,
0.4106132984161377,
0.01978505775332451,
0.15987500548362732,
0.07640109956264496,
-0.1121492087841034,
-0.005952715873718262,
-0.33592063188552856,
-0.16738411784172058,
-0.32006797194480896,
0.23239146173000336,
0.09773391485214233,
0.04633145034313202,
-0.1515866219997406,
-0.38262394070625305,
-0.11300185322761536,
0.34802642464637756,
0.4602679908275604,
0.07274526357650757,
-0.34532707929611206,
-0.024544745683670044,
0.36283817887306213,
-0.27707239985466003,
0.2366664856672287,
-0.23116043210029602,
0.018055077642202377,
-0.36626505851745605,
0.17235435545444489,
0.4267807900905609,
-0.19605836272239685,
0.3549795150756836,
0.45294708013534546,
0.0972672551870346,
-0.22205142676830292,
-0.18118777871131897,
0.06346575915813446,
-0.049305494874715805,
0.34013986587524414,
0.0989208072423935,
0.14484041929244995,
0.07753017544746399,
-0.08750459551811218,
-0.2014499008655548,
-0.19280150532722473,
-0.3781002163887024,
-0.3434431254863739,
0.16869375109672546,
0.09061073511838913,
-0.33556246757507324,
0.2888224720954895,
-0.3502742350101471,
0.27040550112724304,
0.4849696755409241,
0.2996886968612671,
-0.007531795650720596,
0.04853544011712074,
0.07330117374658585,
-0.13086827099323273,
0.3493954539299011,
0.5205391645431519,
-0.2383541464805603,
-0.21774248778820038,
0.005059029906988144,
-0.1822587102651596,
0.10502694547176361,
-0.09525933116674423,
-0.05872152000665665,
-0.026581261307001114,
-0.20855161547660828,
0.46894094347953796,
0.13005197048187256,
-0.4759986996650696,
-0.2212556004524231,
0.13654154539108276,
0.17611536383628845,
0.11223755031824112,
0.26014503836631775,
-0.22869813442230225,
0.12441211938858032,
0.120271697640419,
-0.17798812687397003,
0.04967965558171272,
-0.04614933580160141,
-0.12236638367176056,
-0.0922914668917656,
-0.08739302307367325,
-0.2715393900871277,
0.06774640083312988,
-0.08023443818092346,
-0.17020219564437866,
0.17911353707313538,
0.011244989931583405,
0.1812654733657837,
-0.007722333073616028,
0.3053799569606781,
0.29549720883369446,
0.20099471509456635,
0.4197819232940674,
0.04985128715634346,
0.018650628626346588,
-0.626115620136261,
0.19477835297584534,
0.061279699206352234,
0.2125157117843628,
0.0030427351593971252,
0.03352072089910507,
-0.34505826234817505,
-0.0825875848531723,
-0.39805394411087036,
-0.5241051912307739,
-0.021939286962151527,
0.1701819747686386,
0.15817321836948395,
-0.04443587362766266,
-0.2861587107181549,
0.5416611433029175,
0.21731248497962952,
0.24198952317237854,
-0.40823420882225037,
0.491995632648468,
0.058676883578300476,
0.05442168563604355,
-0.000972360372543335,
0.23894742131233215,
0.10376912355422974,
-0.17897729575634003,
0.16285525262355804,
0.41089579463005066,
0.28776079416275024,
0.10793185979127884,
-0.23891723155975342,
-0.026120543479919434,
0.35049521923065186,
0.061612531542778015,
0.012365669012069702,
-0.24716350436210632,
-0.089716836810112,
-0.12652167677879333,
-0.2104564607143402,
0.3513042628765106,
-0.10451371222734451,
0.25327757000923157,
0.053876832127571106,
0.06932705640792847,
0.3005024790763855,
-0.1362980604171753,
-0.2510843276977539,
-0.6023856401443481,
0.24884937703609467,
-0.24540695548057556,
0.2825689911842346,
0.02853655256330967,
-0.2645035684108734,
0.11826230585575104,
0.1313410997390747,
0.06470008939504623,
-0.11476951837539673,
0.010106527246534824,
0.0017266012728214264,
0.07393520325422287,
-0.06155586242675781,
0.39762699604034424,
0.43508434295654297,
0.06808219850063324,
-0.07876312732696533,
0.22086212038993835,
-0.08056777715682983,
-0.18961331248283386,
0.24874748289585114,
-0.09549643099308014,
0.2968672513961792,
0.3338800370693207,
0.1150418221950531,
-0.21907705068588257,
-0.18871814012527466,
-0.03436397388577461,
0.15289080142974854,
0.019662389531731606,
-0.46989497542381287,
-0.0018415525555610657,
-0.4003920555114746,
-0.10149453580379486,
-0.2397225946187973,
-0.35491955280303955,
-0.25142380595207214,
-0.28258541226387024,
0.08383151888847351,
0.10079805552959442,
0.2032839059829712,
0.22423584759235382,
0.16265375912189484,
-0.19319230318069458,
-0.07066836208105087,
-0.11966411769390106,
-0.2807474136352539,
0.23563605546951294,
0.011073112487792969,
-0.06069300323724747,
0.0891435295343399,
-0.005846809595823288,
0.09522391855716705,
-0.25168824195861816,
-0.3549182415008545,
-0.3698185682296753,
-0.33030229806900024,
0.32377034425735474,
-0.21136219799518585,
0.5925693511962891,
0.36654967069625854,
0.10731351375579834,
-0.07092610001564026,
-0.10622958838939667,
0.509007453918457,
0.4097931683063507,
-0.3390524089336395,
0.1961669921875,
0.12577135860919952,
-0.12747514247894287,
-0.2856443524360657,
-0.37233859300613403,
-0.20475220680236816,
-0.14091354608535767,
0.21835768222808838,
0.15300653874874115,
0.07938635349273682,
0.4057391881942749,
-0.022143356502056122,
-0.22971558570861816,
-0.25123104453086853,
0.0447569265961647,
-0.14821621775627136,
-0.24424801766872406,
0.5098467469215393,
-0.5203995108604431,
-0.18722698092460632,
-0.017047353088855743,
0.05034605413675308,
0.21649450063705444,
0.19318175315856934,
-0.35280317068099976,
0.03869394585490227,
-0.08053213357925415,
-0.005465291440486908,
0.22398370504379272,
0.21527816355228424,
0.2519940733909607,
0.04660893604159355,
0.1633019894361496,
-0.2988731861114502,
-0.2629585266113281,
0.16669268906116486,
-0.06017838045954704,
0.3196437656879425,
-0.05843430757522583,
0.16948078572750092,
-0.17362146079540253,
0.3682415187358856,
0.48876824975013733,
0.20329460501670837,
0.19701240956783295,
-0.4679597020149231,
0.2123652547597885,
-0.2490115612745285,
-0.3412064015865326,
-0.12742677330970764,
0.152497798204422,
0.25526949763298035,
0.22756242752075195,
0.40941476821899414,
0.23564422130584717,
-0.11007239669561386,
0.11153003573417664,
-0.19649828970432281,
-0.3617480993270874,
-0.31080272793769836,
-0.09925016015768051,
0.25274530053138733,
-0.047108493745326996,
0.18836432695388794,
0.23945705592632294,
-0.07391662150621414,
-0.21920090913772583,
0.6505002975463867,
-0.16182774305343628,
0.20678673684597015,
-0.57967209815979,
0.2372787743806839,
-0.24321317672729492,
0.10379043221473694,
-0.17821714282035828,
0.031871650367975235,
0.03602081537246704,
0.17437757551670074,
0.22052067518234253,
0.05866306647658348,
0.5502462983131409,
-0.011177273467183113,
-0.019830137491226196,
0.13676531612873077,
-0.4405665993690491,
-0.29366371035575867,
-0.14454509317874908,
0.08852420747280121,
0.13754095137119293,
0.027890093624591827,
0.5466436743736267,
-0.5107476711273193,
-0.17844951152801514,
-0.14758217334747314,
0.2546986937522888,
-0.11437233537435532,
-0.08268433809280396,
-0.060257554054260254,
-0.4550405442714691,
-0.1600053906440735,
-0.29083675146102905,
-0.11042878776788712,
0.2086993157863617,
0.12811991572380066,
-0.15894672274589539,
0.07302556931972504,
-0.11994653940200806,
0.24441559612751007,
0.11591196805238724,
0.3808477520942688,
-0.33937937021255493,
0.38186216354370117,
0.23928555846214294,
-0.019170869141817093,
0.8310441970825195,
0.510565996170044,
-0.049703825265169144,
-0.22912567853927612,
-0.06830466538667679,
-0.20519335567951202,
0.26163217425346375,
0.12707825005054474,
-0.06753379106521606,
0.004751633852720261,
0.007230497896671295,
0.05485016480088234,
-0.16080862283706665,
-0.1461850106716156,
0.27033737301826477,
0.06996570527553558,
-0.2763252258300781,
-0.5747488737106323,
0.2591281235218048,
0.07776159048080444,
0.1652207374572754,
0.17558950185775757,
0.4997539520263672,
-0.537509560585022,
-0.0034644529223442078,
-0.1058504581451416,
0.6597522497177124,
0.008249981328845024,
-0.011442359536886215,
0.44478246569633484,
0.12513278424739838,
0.042960602790117264,
-0.26039937138557434,
0.22145287692546844,
-0.3191677927970886,
0.3256608545780182,
-0.007186625152826309,
-0.20415107905864716,
0.42592859268188477,
0.09770528972148895,
-0.1935219168663025,
0.07879804819822311,
-0.24238437414169312,
0.3315003514289856,
-0.1729859560728073,
0.10258569568395615,
-0.19999071955680847,
-0.2472861111164093,
-0.24985219538211823,
0.02434106171131134,
0.0809226855635643,
0.2744814157485962,
0.0736960619688034,
-0.17966710031032562,
-0.46974384784698486,
0.004298195242881775,
-0.3470064103603363,
-0.18696992099285126,
-0.33427101373672485,
0.04623105004429817,
0.4450490176677704,
-0.2566905915737152,
0.2278110682964325,
0.3138953447341919,
0.21417628228664398,
0.2971808910369873,
-0.298867791891098,
-0.0019970322027802467,
0.10727524757385254,
-0.06197584047913551,
-0.05334664136171341,
-0.2202964723110199,
0.012345032766461372,
-0.10516934096813202,
-0.2877810299396515,
-0.4521713852882385,
0.17473550140857697,
0.036997243762016296,
-0.19797435402870178,
-0.15013214945793152,
-0.06848625838756561,
-0.5332646369934082,
0.10897921025753021,
-0.016061168164014816,
0.3005496561527252,
-0.2110612392425537,
0.007487920578569174,
0.12470509856939316,
-0.10650094598531723,
0.13507726788520813,
0.0014027608558535576,
-0.017209358513355255,
-0.2975690960884094,
0.01097257062792778,
-0.1328297257423401,
-0.012447960674762726,
0.31523779034614563,
0.15595600008964539,
-0.21542400121688843,
-0.1440887153148651,
0.39409539103507996,
0.07797815650701523,
-0.4592673182487488,
0.041048821061849594,
0.0892135351896286,
-0.023735642433166504,
0.13843409717082977,
0.3118196725845337,
0.06465158611536026,
0.08284122496843338,
0.24156944453716278,
-0.5100560188293457,
-0.025535743683576584,
0.2507198750972748,
-0.14259770512580872,
0.09332175552845001,
-0.3030996024608612,
0.22849296033382416,
-0.09334579855203629,
0.15706707537174225,
-0.14623694121837616,
-0.015504945069551468,
-0.045904356986284256,
0.06536705046892166,
0.24323037266731262,
0.04582681506872177,
0.07188571989536285,
-0.2545103430747986,
0.09637425094842911,
-0.187944233417511,
-0.383944034576416,
-0.04068344086408615,
-0.22818933427333832,
0.21192166209220886,
-0.1449897736310959,
-0.0361129567027092,
0.1524059921503067,
-0.06813591718673706,
-0.23996534943580627,
-0.33613038063049316,
0.2576451003551483,
0.46877533197402954,
-0.15173210203647614,
-0.00006391480565071106,
0.11162931472063065,
-0.13966597616672516,
-0.3855096101760864,
0.016995204612612724,
0.01149199903011322,
0.10978955030441284,
0.005340699106454849,
0.044207822531461716,
-0.3209327757358551,
-0.01674789935350418,
-0.1433897167444229,
0.3203057646751404,
-0.0409604012966156,
0.005405493080615997,
0.4052155911922455,
-0.1764891892671585,
0.28681570291519165,
0.132247194647789,
0.46536409854888916,
0.37403276562690735,
-0.03939703479409218,
0.24802929162979126,
0.05615723505616188,
0.034620411694049835,
-0.14210236072540283,
0.07053501904010773,
0.43339207768440247,
-0.026709068566560745,
0.01621316373348236,
0.6859170794487,
0.3457982540130615,
-0.040041372179985046,
-0.21955624222755432,
0.026677601039409637,
0.47401660680770874,
0.005289418622851372,
0.4047010540962219,
0.6516878604888916,
-0.3753693103790283,
0.26988738775253296,
0.43163755536079407,
0.16263999044895172,
-0.13844069838523865,
0.2566397190093994,
-0.08295153826475143,
0.04210226237773895,
-0.11937977373600006,
0.05074373632669449,
0.1157253086566925,
-0.15493232011795044,
-0.06800218671560287,
-0.0687243640422821,
-0.0994419977068901,
-0.18418565392494202,
-0.3129444420337677,
0.546583890914917,
-0.052733056247234344,
0.03166088089346886,
-0.11316005140542984,
0.3235534429550171,
-0.04841350018978119,
-0.22903847694396973,
0.06362327933311462,
-0.42502841353416443,
-0.07641986012458801,
-0.15055173635482788,
-0.014472376555204391,
-0.3813847303390503,
0.4494393467903137,
-0.13362224400043488,
0.02922639064490795,
-0.2790755033493042,
0.563805878162384,
-0.008869215846061707,
0.10321009159088135,
-0.14478114247322083,
0.3415472209453583,
-0.06876415014266968,
-0.1781076192855835,
0.04092671349644661,
0.25997230410575867,
0.39409688115119934,
0.3097115159034729,
0.3024161159992218,
0.01403481513261795,
0.011681459844112396,
-0.09702137112617493,
0.016779176890850067,
0.3497735559940338,
0.030129877850413322,
-0.3352912664413452,
0.24718105792999268,
0.008720241487026215,
-0.037054695188999176,
-0.11277525126934052,
0.06594619154930115,
0.13530880212783813,
-0.22985146939754486,
0.3319050967693329,
-0.3511645197868347,
0.03397214412689209,
0.19145454466342926,
0.024220893159508705,
-0.15068328380584717,
-0.29936322569847107,
0.5735970735549927,
0.18979063630104065,
0.17061565816402435,
-0.17229947447776794,
0.00793071836233139,
0.11305849254131317,
0.3690081834793091,
-0.12090332806110382,
-0.2640268802642822,
-0.1315522938966751,
-0.04428177326917648,
-0.39980459213256836,
-0.2022283375263214,
-0.28458642959594727,
-0.2894582748413086,
-0.13822315633296967,
0.1544494926929474,
0.10694862902164459,
-0.07900001108646393,
0.1019401103258133,
-0.19819435477256775,
0.28439950942993164,
0.20510271191596985,
-0.14927254617214203,
-0.06933850049972534,
-0.0018241945654153824,
0.23059919476509094,
0.06342538446187973,
-0.20527836680412292,
0.14296649396419525,
-0.305308073759079,
-0.08179886639118195,
-0.03148259222507477,
0.48197340965270996,
0.41912925243377686,
-0.067275270819664,
-0.11407104879617691,
0.15111345052719116,
0.2859218716621399,
0.023140408098697662,
-0.13850097358226776,
-0.4151224195957184,
-0.32852357625961304,
-0.0778026357293129,
0.44730377197265625,
0.0017565814778208733,
0.05864807218313217,
-0.30393943190574646,
-0.48924267292022705,
-0.3709266185760498,
-0.008542347699403763,
0.1558101922273636,
-0.0066092349588871,
0.09575212001800537,
0.20597964525222778,
-0.09646442532539368,
-0.09242908656597137,
0.4100196659564972,
0.19197086989879608,
-0.24981823563575745,
0.11872449517250061,
-0.11431127786636353,
-0.5292173027992249,
0.3518679141998291,
-0.06883059442043304,
-0.1744200587272644,
0.08900656551122665,
0.0018710494041442871,
0.377095103263855,
-0.026074884459376335,
-0.40390241146087646,
-0.02688848227262497,
0.42777013778686523,
-0.21273306012153625,
-0.34763577580451965,
0.179313063621521,
0.11317691206932068,
-0.3811034560203552,
0.0527934730052948,
0.29133737087249756,
0.144460067152977,
-0.2104180008172989,
0.059806764125823975,
-0.04169332608580589
] |
https://github.com/huggingface/datasets/issues/6162 | Hi ! Feel free to open a discussion at https://huggingface.co/datasets/togethercomputer/RedPajama-Data-1T/discussions to ask the file to be fixed (or directly open a PR with the fixed file)
`datasets` expects all the examples to have the same fields | load_dataset('json',...) from togethercomputer/RedPajama-Data-1T errors when jsonl rows contains different data fields | ### Describe the bug
When loading some jsonl from redpajama-data-1T github source [togethercomputer/RedPajama-Data-1T](https://huggingface.co/datasets/togethercomputer/RedPajama-Data-1T) fails due to one row of the file containing an extra field called **symlink_target: string>**.
When deleting that line the loading is successful.
We also tried loading this file with the discrepancy using this function and it is successful
```python
os.environ["RED_PAJAMA_DATA_DIR"] ="/path_to_local_copy_of_RedPajama-Data-1T"
ds = load_dataset('togethercomputer/RedPajama-Data-1T', 'github',cache_dir="/path_to_folder_with_jsonl",streaming=True)['train']
```
### Steps to reproduce the bug
Steps to reproduce the behavior:
1. Load one jsonl from the redpajama-data-1T
```bash
wget https://data.together.xyz/redpajama-data-1T/v1.0.0/github/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl
```
2.Load dataset will give error:
```python
from datasets import load_dataset
ds = load_dataset('json', data_files='/path_to/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl')
```
_TypeError: Couldn't cast array of type
Struct
<content_hash: string,
timestamp: string,
source: string,
line_count: int64,
max_line_length: int64,
avg_line_length: double,
alnum_prop: double,
repo_name: string,
id: string,
size: string,
binary: bool,
copies: string,
ref: string,
path: string,
mode: string,
license: string,
language: list<item: struct<name: string, bytes: string>>, **symlink_target: string>**
to
{'content_hash': Value(dtype='string', id=None),
'timestamp': Value(dtype='string', id=None),
'source': Value(dtype='string', id=None),
'line_count': Value(dtype='int64', id=None),
'max_line_length': Value(dtype='int64', id=None),
'avg_line_length': Value(dtype='float64', id=None),
'alnum_prop': Value(dtype='float64', id=None),
'repo_name': Value(dtype='string', id=None),
'id': Value(dtype='string', id=None),
'size': Value(dtype='string', id=None),
'binary': Value(dtype='bool', id=None),
'copies': Value(dtype='string', id=None),
'ref': Value(dtype='string', id=None),
'path': Value(dtype='string', id=None),
'mode': Value(dtype='string', id=None),
'license': Value(dtype='string', id=None),
'language': [{'name': Value(dtype='string', id=None), 'bytes': Value(dtype='string', id=None)}]}_
3. To remove the line causing the problem that includes the **symlink_target: string>** do:
```bash
sed -i '112252d' filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl
```
4. Rerun the loading function now is succesful:
```python
from datasets import load_dataset
ds = load_dataset('json', data_files='/path_to/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl')
```
### Expected behavior
Have a clean dataset without discrepancies on the jsonl fields or have the load_dataset('json',...) method not error out.
### Environment info
- `datasets` version: 2.14.1
- Platform: Linux-4.18.0-425.13.1.el8_7.x86_64-x86_64-with-glibc2.28
- Python version: 3.9.17
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3 | 36 | load_dataset('json',...) from togethercomputer/RedPajama-Data-1T errors when jsonl rows contains different data fields
### Describe the bug
When loading some jsonl from redpajama-data-1T github source [togethercomputer/RedPajama-Data-1T](https://huggingface.co/datasets/togethercomputer/RedPajama-Data-1T) fails due to one row of the file containing an extra field called **symlink_target: string>**.
When deleting that line the loading is successful.
We also tried loading this file with the discrepancy using this function and it is successful
```python
os.environ["RED_PAJAMA_DATA_DIR"] ="/path_to_local_copy_of_RedPajama-Data-1T"
ds = load_dataset('togethercomputer/RedPajama-Data-1T', 'github',cache_dir="/path_to_folder_with_jsonl",streaming=True)['train']
```
### Steps to reproduce the bug
Steps to reproduce the behavior:
1. Load one jsonl from the redpajama-data-1T
```bash
wget https://data.together.xyz/redpajama-data-1T/v1.0.0/github/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl
```
2.Load dataset will give error:
```python
from datasets import load_dataset
ds = load_dataset('json', data_files='/path_to/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl')
```
_TypeError: Couldn't cast array of type
Struct
<content_hash: string,
timestamp: string,
source: string,
line_count: int64,
max_line_length: int64,
avg_line_length: double,
alnum_prop: double,
repo_name: string,
id: string,
size: string,
binary: bool,
copies: string,
ref: string,
path: string,
mode: string,
license: string,
language: list<item: struct<name: string, bytes: string>>, **symlink_target: string>**
to
{'content_hash': Value(dtype='string', id=None),
'timestamp': Value(dtype='string', id=None),
'source': Value(dtype='string', id=None),
'line_count': Value(dtype='int64', id=None),
'max_line_length': Value(dtype='int64', id=None),
'avg_line_length': Value(dtype='float64', id=None),
'alnum_prop': Value(dtype='float64', id=None),
'repo_name': Value(dtype='string', id=None),
'id': Value(dtype='string', id=None),
'size': Value(dtype='string', id=None),
'binary': Value(dtype='bool', id=None),
'copies': Value(dtype='string', id=None),
'ref': Value(dtype='string', id=None),
'path': Value(dtype='string', id=None),
'mode': Value(dtype='string', id=None),
'license': Value(dtype='string', id=None),
'language': [{'name': Value(dtype='string', id=None), 'bytes': Value(dtype='string', id=None)}]}_
3. To remove the line causing the problem that includes the **symlink_target: string>** do:
```bash
sed -i '112252d' filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl
```
4. Rerun the loading function now is succesful:
```python
from datasets import load_dataset
ds = load_dataset('json', data_files='/path_to/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl')
```
### Expected behavior
Have a clean dataset without discrepancies on the jsonl fields or have the load_dataset('json',...) method not error out.
### Environment info
- `datasets` version: 2.14.1
- Platform: Linux-4.18.0-425.13.1.el8_7.x86_64-x86_64-with-glibc2.28
- Python version: 3.9.17
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
Hi ! Feel free to open a discussion at https://huggingface.co/datasets/togethercomputer/RedPajama-Data-1T/discussions to ask the file to be fixed (or directly open a PR with the fixed file)
`datasets` expects all the examples to have the same fields | [
0.053559184074401855,
0.02824193239212036,
0.02102046087384224,
0.5469897985458374,
0.12235726416110992,
0.10428876429796219,
0.474545419216156,
0.38627463579177856,
0.14965155720710754,
-0.1371256709098816,
0.021165207028388977,
0.6087433099746704,
0.18107794225215912,
-0.24777689576148987,
-0.2074326127767563,
-0.013631806708872318,
0.10015188157558441,
0.050326716154813766,
-0.02499011904001236,
-0.024461813271045685,
-0.08282776921987534,
0.3754344582557678,
-0.13180632889270782,
-0.0873534306883812,
-0.1208791434764862,
0.19231049716472626,
0.032977499067783356,
0.1859338879585266,
0.024372193962335587,
-0.10310344398021698,
0.2778506278991699,
-0.17456355690956116,
-0.2496040165424347,
0.46575501561164856,
-0.00011697061563609168,
0.09018471091985703,
0.22897714376449585,
-0.12190631031990051,
-0.08727574348449707,
-0.4820258617401123,
-0.44684064388275146,
-0.17108657956123352,
0.28448641300201416,
-0.2218094766139984,
0.016168862581253052,
-0.05676005035638809,
-0.15601976215839386,
-0.15569105744361877,
0.39929646253585815,
0.32862454652786255,
0.14080676436424255,
0.09722264111042023,
0.0768299400806427,
0.04782324284315109,
0.6405129432678223,
0.33589133620262146,
-0.008584737777709961,
0.48493462800979614,
0.1343461573123932,
0.08311443775892258,
0.08095542341470718,
0.23717249929904938,
-0.2177594155073166,
-0.03057796135544777,
-0.05039246007800102,
0.08968377858400345,
-0.07177336513996124,
-0.06366090476512909,
0.1873084157705307,
0.18318966031074524,
0.24096275866031647,
-0.301982045173645,
-0.19818691909313202,
-0.2517545819282532,
0.10700823366641998,
0.09174972772598267,
0.3747793734073639,
0.3427373766899109,
-0.11087533831596375,
0.22497543692588806,
0.17133352160453796,
0.07846899330615997,
-0.1325281411409378,
0.16559597849845886,
0.0700310617685318,
0.03531361371278763,
0.05404135212302208,
0.28299951553344727,
-0.045249391347169876,
0.04931922256946564,
-0.03238898515701294,
-0.11811322718858719,
-0.042789094150066376,
0.08137752115726471,
-0.3676564395427704,
0.03393423557281494,
-0.34335094690322876,
-0.635187029838562,
0.16367782652378082,
0.029472071677446365,
0.6306318044662476,
0.015616510063409805,
0.2226051241159439,
0.49889087677001953,
0.42214298248291016,
0.05472726747393608,
-0.2040455937385559,
0.18057909607887268,
0.054753173142671585,
0.08553619682788849,
-0.2724500298500061,
0.04310928285121918,
0.08010510355234146,
-0.09184098243713379,
-0.04317319765686989,
-0.10710109025239944,
0.44493821263313293,
-0.15634344518184662,
-0.5367875099182129,
0.09472756087779999,
-0.3597877621650696,
-0.11784540861845016,
0.017903119325637817,
0.13741403818130493,
-0.015756402164697647,
0.303848534822464,
0.07673723250627518,
0.2830987274646759,
-0.06245472654700279,
-0.2006787657737732,
-0.04939629137516022,
0.22194921970367432,
-0.02320064604282379,
-0.1538212150335312,
0.3668636381626129,
-0.009613709524273872,
0.3546910583972931,
0.3222534954547882,
-0.20159359276294708,
-0.4368676543235779,
0.08795437961816788,
-0.30601221323013306,
-0.02077057957649231,
0.3180159032344818,
-0.16277068853378296,
0.152890145778656,
0.20122382044792175,
-0.04755288362503052,
-0.12030990421772003,
0.23518049716949463,
-0.4978462755680084,
0.020031630992889404,
0.15333764255046844,
0.16572999954223633,
-0.1650717854499817,
-0.03458387404680252,
-0.5144808292388916,
-0.015856198966503143,
-0.008181057870388031,
-0.37676799297332764,
0.11685246229171753,
-0.22823134064674377,
-0.060319364070892334,
-0.2307310849428177,
-0.04977869987487793,
0.21857890486717224,
-0.4609222412109375,
-0.0382038950920105,
0.1309524029493332,
-0.0979306697845459,
0.03721742704510689,
0.08452999591827393,
-0.2281585931777954,
0.22470277547836304,
-0.3320043087005615,
0.16554343700408936,
0.8003835082054138,
-0.648679256439209,
-0.4257955849170685,
0.4459165930747986,
-0.26551079750061035,
0.5284009575843811,
0.031139427796006203,
0.001333087682723999,
0.17999862134456635,
-0.009544499218463898,
0.22360751032829285,
0.2457641214132309,
0.07383493334054947,
0.12008646875619888,
-0.30611082911491394,
-0.3270408809185028,
-0.10615472495555878,
0.02081902325153351,
-0.2197653204202652,
0.0838237851858139,
0.2255823165178299,
-0.017742089927196503,
0.37314364314079285,
0.02002401277422905,
0.08510473370552063,
0.33103570342063904,
0.09093771874904633,
-0.24283000826835632,
0.15043894946575165,
-0.17353422939777374,
-0.5426609516143799,
0.1216859221458435,
0.097203329205513,
-0.16301409900188446,
-0.2582252323627472,
-0.015827029943466187,
-0.33896201848983765,
0.03430136293172836,
-0.14942604303359985,
-0.008956655859947205,
0.03810657933354378,
0.18723934888839722,
-0.04340106248855591,
-0.18287566304206848,
-0.14950993657112122,
0.33346039056777954,
0.10410498082637787,
0.273147851228714,
-0.16364102065563202,
0.26180243492126465,
-0.03958607465028763,
-0.05930854007601738,
0.02251940220594406,
0.10603630542755127,
0.21734091639518738,
-0.26077350974082947,
-0.39591091871261597,
0.3155685365200043,
0.41405612230300903,
0.2877558767795563,
-0.049826547503471375,
-0.07880222052335739,
-0.02316422015428543,
-0.14444459974765778,
-0.24422194063663483,
0.4660237729549408,
0.24550339579582214,
-0.10324886441230774,
-0.06099949777126312,
0.5095027685165405,
-0.2049858272075653,
0.2815602421760559,
0.07443836331367493,
-0.11463728547096252,
0.3836555480957031,
-0.09451039135456085,
0.00664876401424408,
-0.2729807496070862,
0.26541513204574585,
0.485606849193573,
0.12411811947822571,
0.16954511404037476,
-0.37696146965026855,
0.15529993176460266,
0.3946007490158081,
0.004776693880558014,
-0.017739146947860718,
0.2613026201725006,
-0.14759153127670288,
-0.15901702642440796,
-0.11971831321716309,
0.62922203540802,
0.6596606373786926,
0.03588831424713135,
-0.2480289191007614,
0.10971757769584656,
0.05251765623688698,
-0.20127443969249725,
0.32055121660232544,
0.04838208854198456,
0.41439998149871826,
0.5437895655632019,
0.44743117690086365,
0.19862385094165802,
-0.2594892084598541,
-0.18017274141311646,
0.13230273127555847,
0.12261489033699036,
-0.2715628445148468,
0.2235366702079773,
-0.25414371490478516,
-0.05845830589532852,
-0.5187341570854187,
-0.05292719602584839,
-0.11812058091163635,
-0.2090550661087036,
0.03817271068692207,
0.5303002595901489,
-0.31224530935287476,
-0.14033424854278564,
-0.10194911062717438,
0.19835230708122253,
-0.04296574741601944,
-0.46406444907188416,
-0.24615496397018433,
-0.11165221035480499,
-0.3306106925010681,
-0.018044669181108475,
0.3494723439216614,
0.17097046971321106,
0.13103613257408142,
-0.11735448241233826,
-0.12549135088920593,
-0.05954722315073013,
-0.3629556894302368,
0.036727748811244965,
-0.03174063563346863,
0.2197721302509308,
0.0757657140493393,
0.30164721608161926,
-0.06944315135478973,
-0.4720216989517212,
0.2582487165927887,
-0.16851019859313965,
-0.24797125160694122,
0.2161080539226532,
0.0601084940135479,
0.19889064133167267,
-0.14594396948814392,
-0.4137706756591797,
-0.06997602432966232,
-0.3621085286140442,
0.15361902117729187,
-0.0406392440199852,
0.2255445420742035,
-0.11914202570915222,
0.17202600836753845,
0.02690928429365158,
0.31287881731987,
0.2016083002090454,
-0.2553631067276001,
-0.10479643940925598,
0.04889094457030296,
-0.15610100328922272,
-0.5191733837127686,
0.16821104288101196,
0.08646930009126663,
0.13015098869800568,
0.1522429883480072,
-0.6692613959312439,
-0.21097536385059357,
0.29814624786376953,
-0.09899333119392395,
-0.20345348119735718,
-0.42814069986343384,
-0.006398249417543411,
0.18066777288913727,
0.0037250816822052,
-0.23000025749206543,
-0.21608301997184753,
0.07534228265285492,
0.0004132278263568878,
0.11691426485776901,
-0.042516663670539856,
0.2876985967159271,
-0.1860223412513733,
0.2296215295791626,
0.2152283489704132,
0.05610792711377144,
0.31349676847457886,
-0.05361559987068176,
0.011448944918811321,
-0.2026509940624237,
-0.2747012674808502,
-0.2736993730068207,
-0.047064363956451416,
0.031846560537815094,
0.3444666266441345,
-0.04269053414463997,
-0.15573471784591675,
-0.19447684288024902,
-0.15282469987869263,
-0.33055776357650757,
-0.39531993865966797,
0.22400067746639252,
-0.19839009642601013,
-0.16162154078483582,
0.055584728717803955,
-0.21204400062561035,
-0.11691145598888397,
-0.14306095242500305,
-0.2208174467086792,
0.2228916585445404,
-0.2972938120365143,
0.01385674998164177,
-0.3820156455039978,
-0.2897532880306244,
-0.03194766864180565,
0.26681798696517944,
0.22515109181404114,
0.5313531756401062,
0.17915484309196472,
-0.08011997491121292,
0.15930812060832977,
-0.08714281022548676,
0.6585025787353516,
-0.07978592067956924,
0.04911291226744652,
0.0775197371840477,
0.143390953540802,
-0.47961169481277466,
-0.1721053570508957,
-0.0693897157907486,
0.14525845646858215,
0.3938602805137634,
0.4276677966117859,
-0.3333643078804016,
-0.18054884672164917,
0.13778091967105865,
0.386824369430542,
-0.1105964258313179,
-0.190106600522995,
-0.17595285177230835,
-0.4357322156429291,
-0.3615017533302307,
-0.15636833012104034,
-0.16622035205364227,
0.42547351121902466,
-0.027819693088531494,
0.04316265881061554,
0.06729179620742798,
-0.14948557317256927,
-0.09734557569026947,
0.13390986621379852,
0.35451945662498474,
-0.28942859172821045,
0.19009071588516235,
0.055056650191545486,
0.38654786348342896,
0.47349265217781067,
0.7934794425964355,
-0.020332859829068184,
-0.12451893091201782,
0.04798154532909393,
-0.29775741696357727,
0.0039491914212703705,
0.30593422055244446,
-0.06676013767719269,
0.13150739669799805,
-0.33723384141921997,
-0.28521159291267395,
0.1231561228632927,
-0.10100295394659042,
0.35650578141212463,
0.04307284206151962,
-0.07941392809152603,
-0.3222171664237976,
0.24593614041805267,
0.10633992403745651,
-0.08251580595970154,
0.17157752811908722,
0.013219382613897324,
-0.3786398768424988,
0.7430249452590942,
-0.2556389272212982,
1.0368067026138306,
0.004456033930182457,
0.1331993192434311,
0.39942696690559387,
-0.34271299839019775,
0.4143582880496979,
-0.24390588700771332,
0.11179859936237335,
-0.3386250436306,
-0.09771686792373657,
0.019903801381587982,
-0.16440166532993317,
0.12555542588233948,
0.26948094367980957,
-0.09858667850494385,
0.08164266496896744,
0.05214540660381317,
0.21716950833797455,
0.03258981555700302,
0.27012401819229126,
0.2601199746131897,
0.12983252108097076,
-0.4012584388256073,
-0.005264509469270706,
0.02926676534116268,
-0.06807338446378708,
0.03514032065868378,
-0.08107481896877289,
-0.3397371768951416,
-0.5302044749259949,
-0.35073262453079224,
0.14143332839012146,
-0.1931920349597931,
0.14028522372245789,
0.12899357080459595,
-0.11051908135414124,
-0.04660838842391968,
0.11433593928813934,
-0.04692404344677925,
-0.13514776527881622,
-0.08743030577898026,
0.09012673795223236,
-0.02545372024178505,
0.31298574805259705,
-0.02461930550634861,
-0.06076765060424805,
0.3814358115196228,
-0.12717445194721222,
-0.10868094116449356,
0.07417366653680801,
-0.17105601727962494,
-0.31569212675094604,
0.16920511424541473,
0.18719197809696198,
-0.324892520904541,
-0.35906392335891724,
-0.39873674511909485,
-0.16056203842163086,
-0.15958230197429657,
-0.3032997250556946,
0.05166533216834068,
-0.04867015779018402,
-0.05785044655203819,
0.18613645434379578,
0.2312013804912567,
-0.4489627778530121,
-0.025992125272750854,
0.4248579740524292,
0.0928032398223877,
-0.06656302511692047,
0.5180467963218689,
-0.10347690433263779,
0.05756957083940506,
-0.28434616327285767,
0.02438656985759735,
0.13963046669960022,
-0.5100820660591125,
0.13508327305316925,
-0.26653018593788147,
0.134496808052063,
0.21202296018600464,
0.22330261766910553,
0.177329421043396,
0.4816284477710724,
0.17712122201919556,
-0.6883872747421265,
-0.08757632225751877,
0.2675863802433014,
0.25381916761398315,
-0.0020664953626692295,
0.020675018429756165,
0.07599048316478729,
-0.2551763653755188,
0.21066968142986298,
-0.2356049120426178,
0.31248995661735535,
-0.0592522993683815,
0.1713433861732483,
0.1074880063533783,
0.10531062632799149,
0.4985080063343048,
0.1183193027973175,
0.1273719072341919,
0.13983488082885742,
0.032506927847862244,
-0.1091327965259552,
-0.2248837798833847,
0.1681392341852188,
0.11273728311061859,
-0.05632386729121208,
-0.3406289219856262,
-0.09112594276666641,
0.2655707001686096,
-0.10681004077196121,
-0.04723668470978737,
-0.05679114907979965,
-0.07740072160959244,
-0.01303582638502121,
0.07182230800390244,
0.13755527138710022,
-0.21550197899341583,
0.07547321915626526,
-0.2941284775733948,
0.30555260181427,
0.08535479009151459,
0.2171875387430191,
-0.07820621877908707,
-0.008733659982681274,
-0.26135724782943726,
-0.02713189274072647,
0.13271871209144592,
0.19059433043003082,
0.3487906754016876,
-0.26034480333328247,
0.10500296205282211,
-0.10342562198638916,
0.17348000407218933,
0.36122962832450867,
-0.37612465023994446,
-0.08597840368747711,
-0.1833878457546234,
0.13008147478103638,
-0.2672957181930542,
-0.10385827720165253,
0.5432297587394714,
-0.3188050389289856,
-0.053539834916591644,
0.28478527069091797,
0.3223743736743927,
-0.1659020483493805,
-0.17136207222938538,
0.04349842667579651,
0.61893630027771,
0.09631054103374481,
0.21764057874679565,
0.3427690267562866,
-0.03752531856298447,
0.12732896208763123,
-0.08614924550056458,
0.17812776565551758,
0.20069874823093414,
0.18392497301101685,
-0.38545697927474976,
-0.015567276626825333,
0.12802734971046448,
-0.20693586766719818,
-0.039740823209285736,
-0.30059167742729187,
0.3493437170982361,
0.5023258924484253,
-0.03877415135502815,
0.041395243257284164,
-0.03911930322647095,
0.11384624242782593,
-0.09307849407196045,
0.11672006547451019,
0.0768255740404129,
0.1694260686635971,
-0.02125636860728264,
-0.13288931548595428,
-0.032346274703741074,
-0.325337290763855,
-0.3297603726387024,
-0.09056416153907776,
-0.138467937707901,
0.09511709213256836,
0.3174440264701843,
0.14153525233268738,
-0.1604049950838089,
-0.39265501499176025,
0.2680951654911041,
-0.06593365967273712,
0.021603431552648544,
-0.43814021348953247,
0.30132821202278137,
0.03046766109764576,
-0.2516081631183624,
0.4023534059524536,
-0.04873741418123245,
0.4072360396385193,
0.3832011818885803,
0.10976839810609818,
-0.12773801386356354,
-0.3201674222946167,
-0.13908913731575012,
-0.13356070220470428,
0.3059421181678772,
0.04344815015792847,
-0.3885597288608551,
0.20770776271820068,
0.07506640255451202,
-0.032308101654052734,
0.32007819414138794,
0.2924835979938507,
0.10098181664943695,
-0.1815299540758133,
0.29305529594421387,
-0.2649337947368622,
-0.2425040304660797,
-0.1817508339881897,
0.0106734037399292,
-0.059292491525411606,
-0.25086408853530884,
0.35613226890563965,
-0.0792829692363739,
0.30835098028182983,
0.03144233673810959,
0.05872783809900284,
0.08452889323234558,
0.4669100046157837,
0.24165168404579163,
-0.2032032608985901,
-0.2557709813117981,
-0.057624317705631256,
-0.4559786021709442,
0.394247829914093,
-0.1726692169904709,
0.06142578274011612,
0.09042114019393921,
0.12396648526191711,
-0.03243808075785637,
0.01986098662018776,
0.18308545649051666,
0.020220067352056503,
-0.038338083773851395,
0.18408730626106262,
-0.3519144356250763,
-0.28630349040031433,
0.11309381574392319,
0.07932489365339279,
0.06053741276264191,
-0.29971373081207275,
0.30877625942230225,
-0.17730093002319336,
0.04474031180143356,
-0.2316371351480484,
-0.08147358894348145,
0.1843792200088501,
-0.25560519099235535,
0.06595662981271744,
0.017918748781085014,
0.38962092995643616,
-0.12530988454818726,
-0.5042928457260132,
-0.17851069569587708,
-0.35246098041534424,
-0.28110548853874207,
0.5366905927658081,
0.1248292624950409,
0.3189523220062256,
-0.02666211500763893,
0.00964544340968132,
-0.1598462164402008,
0.005758702754974365,
-0.35633915662765503,
-0.38758087158203125,
-0.16918188333511353,
0.016773030161857605,
-0.07085084915161133,
0.25542423129081726,
-0.14620628952980042,
0.1754981428384781,
0.04146329313516617,
0.3886832594871521,
-0.39578521251678467,
-0.360149085521698,
0.276049941778183,
-0.5024653077125549,
-0.13441155850887299,
0.14312812685966492,
0.3050159811973572,
-0.21690785884857178,
0.03420326113700867,
-0.5682093501091003,
0.003696814179420471,
0.5053195953369141,
0.0468362458050251,
-0.24200740456581116,
0.09934410452842712,
0.005938272923231125,
-0.015348285436630249,
0.026318706572055817,
0.018902933225035667,
0.273620069026947,
-0.25859832763671875,
0.17888614535331726,
-0.1267915666103363
] |
https://github.com/huggingface/datasets/issues/6162 | @lhoestq I think the problem is caused by the fact that hugging face datasets writes a copy of data to the local cache using pyarrow. And the data scheme is inferred from the first few data blocks as can be seen [here](https://github.com/huggingface/datasets/blob/main/src/datasets/arrow_writer.py#L570). Maybe setting `streaming=True` can workaround this problem. Would you agree with my statement? | load_dataset('json',...) from togethercomputer/RedPajama-Data-1T errors when jsonl rows contains different data fields | ### Describe the bug
When loading some jsonl from redpajama-data-1T github source [togethercomputer/RedPajama-Data-1T](https://huggingface.co/datasets/togethercomputer/RedPajama-Data-1T) fails due to one row of the file containing an extra field called **symlink_target: string>**.
When deleting that line the loading is successful.
We also tried loading this file with the discrepancy using this function and it is successful
```python
os.environ["RED_PAJAMA_DATA_DIR"] ="/path_to_local_copy_of_RedPajama-Data-1T"
ds = load_dataset('togethercomputer/RedPajama-Data-1T', 'github',cache_dir="/path_to_folder_with_jsonl",streaming=True)['train']
```
### Steps to reproduce the bug
Steps to reproduce the behavior:
1. Load one jsonl from the redpajama-data-1T
```bash
wget https://data.together.xyz/redpajama-data-1T/v1.0.0/github/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl
```
2.Load dataset will give error:
```python
from datasets import load_dataset
ds = load_dataset('json', data_files='/path_to/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl')
```
_TypeError: Couldn't cast array of type
Struct
<content_hash: string,
timestamp: string,
source: string,
line_count: int64,
max_line_length: int64,
avg_line_length: double,
alnum_prop: double,
repo_name: string,
id: string,
size: string,
binary: bool,
copies: string,
ref: string,
path: string,
mode: string,
license: string,
language: list<item: struct<name: string, bytes: string>>, **symlink_target: string>**
to
{'content_hash': Value(dtype='string', id=None),
'timestamp': Value(dtype='string', id=None),
'source': Value(dtype='string', id=None),
'line_count': Value(dtype='int64', id=None),
'max_line_length': Value(dtype='int64', id=None),
'avg_line_length': Value(dtype='float64', id=None),
'alnum_prop': Value(dtype='float64', id=None),
'repo_name': Value(dtype='string', id=None),
'id': Value(dtype='string', id=None),
'size': Value(dtype='string', id=None),
'binary': Value(dtype='bool', id=None),
'copies': Value(dtype='string', id=None),
'ref': Value(dtype='string', id=None),
'path': Value(dtype='string', id=None),
'mode': Value(dtype='string', id=None),
'license': Value(dtype='string', id=None),
'language': [{'name': Value(dtype='string', id=None), 'bytes': Value(dtype='string', id=None)}]}_
3. To remove the line causing the problem that includes the **symlink_target: string>** do:
```bash
sed -i '112252d' filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl
```
4. Rerun the loading function now is succesful:
```python
from datasets import load_dataset
ds = load_dataset('json', data_files='/path_to/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl')
```
### Expected behavior
Have a clean dataset without discrepancies on the jsonl fields or have the load_dataset('json',...) method not error out.
### Environment info
- `datasets` version: 2.14.1
- Platform: Linux-4.18.0-425.13.1.el8_7.x86_64-x86_64-with-glibc2.28
- Python version: 3.9.17
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3 | 55 | load_dataset('json',...) from togethercomputer/RedPajama-Data-1T errors when jsonl rows contains different data fields
### Describe the bug
When loading some jsonl from redpajama-data-1T github source [togethercomputer/RedPajama-Data-1T](https://huggingface.co/datasets/togethercomputer/RedPajama-Data-1T) fails due to one row of the file containing an extra field called **symlink_target: string>**.
When deleting that line the loading is successful.
We also tried loading this file with the discrepancy using this function and it is successful
```python
os.environ["RED_PAJAMA_DATA_DIR"] ="/path_to_local_copy_of_RedPajama-Data-1T"
ds = load_dataset('togethercomputer/RedPajama-Data-1T', 'github',cache_dir="/path_to_folder_with_jsonl",streaming=True)['train']
```
### Steps to reproduce the bug
Steps to reproduce the behavior:
1. Load one jsonl from the redpajama-data-1T
```bash
wget https://data.together.xyz/redpajama-data-1T/v1.0.0/github/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl
```
2.Load dataset will give error:
```python
from datasets import load_dataset
ds = load_dataset('json', data_files='/path_to/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl')
```
_TypeError: Couldn't cast array of type
Struct
<content_hash: string,
timestamp: string,
source: string,
line_count: int64,
max_line_length: int64,
avg_line_length: double,
alnum_prop: double,
repo_name: string,
id: string,
size: string,
binary: bool,
copies: string,
ref: string,
path: string,
mode: string,
license: string,
language: list<item: struct<name: string, bytes: string>>, **symlink_target: string>**
to
{'content_hash': Value(dtype='string', id=None),
'timestamp': Value(dtype='string', id=None),
'source': Value(dtype='string', id=None),
'line_count': Value(dtype='int64', id=None),
'max_line_length': Value(dtype='int64', id=None),
'avg_line_length': Value(dtype='float64', id=None),
'alnum_prop': Value(dtype='float64', id=None),
'repo_name': Value(dtype='string', id=None),
'id': Value(dtype='string', id=None),
'size': Value(dtype='string', id=None),
'binary': Value(dtype='bool', id=None),
'copies': Value(dtype='string', id=None),
'ref': Value(dtype='string', id=None),
'path': Value(dtype='string', id=None),
'mode': Value(dtype='string', id=None),
'license': Value(dtype='string', id=None),
'language': [{'name': Value(dtype='string', id=None), 'bytes': Value(dtype='string', id=None)}]}_
3. To remove the line causing the problem that includes the **symlink_target: string>** do:
```bash
sed -i '112252d' filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl
```
4. Rerun the loading function now is succesful:
```python
from datasets import load_dataset
ds = load_dataset('json', data_files='/path_to/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl')
```
### Expected behavior
Have a clean dataset without discrepancies on the jsonl fields or have the load_dataset('json',...) method not error out.
### Environment info
- `datasets` version: 2.14.1
- Platform: Linux-4.18.0-425.13.1.el8_7.x86_64-x86_64-with-glibc2.28
- Python version: 3.9.17
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
@lhoestq I think the problem is caused by the fact that hugging face datasets writes a copy of data to the local cache using pyarrow. And the data scheme is inferred from the first few data blocks as can be seen [here](https://github.com/huggingface/datasets/blob/main/src/datasets/arrow_writer.py#L570). Maybe setting `streaming=True` can workaround this problem. Would you agree with my statement? | [
0.053559184074401855,
0.02824193239212036,
0.02102046087384224,
0.5469897985458374,
0.12235726416110992,
0.10428876429796219,
0.474545419216156,
0.38627463579177856,
0.14965155720710754,
-0.1371256709098816,
0.021165207028388977,
0.6087433099746704,
0.18107794225215912,
-0.24777689576148987,
-0.2074326127767563,
-0.013631806708872318,
0.10015188157558441,
0.050326716154813766,
-0.02499011904001236,
-0.024461813271045685,
-0.08282776921987534,
0.3754344582557678,
-0.13180632889270782,
-0.0873534306883812,
-0.1208791434764862,
0.19231049716472626,
0.032977499067783356,
0.1859338879585266,
0.024372193962335587,
-0.10310344398021698,
0.2778506278991699,
-0.17456355690956116,
-0.2496040165424347,
0.46575501561164856,
-0.00011697061563609168,
0.09018471091985703,
0.22897714376449585,
-0.12190631031990051,
-0.08727574348449707,
-0.4820258617401123,
-0.44684064388275146,
-0.17108657956123352,
0.28448641300201416,
-0.2218094766139984,
0.016168862581253052,
-0.05676005035638809,
-0.15601976215839386,
-0.15569105744361877,
0.39929646253585815,
0.32862454652786255,
0.14080676436424255,
0.09722264111042023,
0.0768299400806427,
0.04782324284315109,
0.6405129432678223,
0.33589133620262146,
-0.008584737777709961,
0.48493462800979614,
0.1343461573123932,
0.08311443775892258,
0.08095542341470718,
0.23717249929904938,
-0.2177594155073166,
-0.03057796135544777,
-0.05039246007800102,
0.08968377858400345,
-0.07177336513996124,
-0.06366090476512909,
0.1873084157705307,
0.18318966031074524,
0.24096275866031647,
-0.301982045173645,
-0.19818691909313202,
-0.2517545819282532,
0.10700823366641998,
0.09174972772598267,
0.3747793734073639,
0.3427373766899109,
-0.11087533831596375,
0.22497543692588806,
0.17133352160453796,
0.07846899330615997,
-0.1325281411409378,
0.16559597849845886,
0.0700310617685318,
0.03531361371278763,
0.05404135212302208,
0.28299951553344727,
-0.045249391347169876,
0.04931922256946564,
-0.03238898515701294,
-0.11811322718858719,
-0.042789094150066376,
0.08137752115726471,
-0.3676564395427704,
0.03393423557281494,
-0.34335094690322876,
-0.635187029838562,
0.16367782652378082,
0.029472071677446365,
0.6306318044662476,
0.015616510063409805,
0.2226051241159439,
0.49889087677001953,
0.42214298248291016,
0.05472726747393608,
-0.2040455937385559,
0.18057909607887268,
0.054753173142671585,
0.08553619682788849,
-0.2724500298500061,
0.04310928285121918,
0.08010510355234146,
-0.09184098243713379,
-0.04317319765686989,
-0.10710109025239944,
0.44493821263313293,
-0.15634344518184662,
-0.5367875099182129,
0.09472756087779999,
-0.3597877621650696,
-0.11784540861845016,
0.017903119325637817,
0.13741403818130493,
-0.015756402164697647,
0.303848534822464,
0.07673723250627518,
0.2830987274646759,
-0.06245472654700279,
-0.2006787657737732,
-0.04939629137516022,
0.22194921970367432,
-0.02320064604282379,
-0.1538212150335312,
0.3668636381626129,
-0.009613709524273872,
0.3546910583972931,
0.3222534954547882,
-0.20159359276294708,
-0.4368676543235779,
0.08795437961816788,
-0.30601221323013306,
-0.02077057957649231,
0.3180159032344818,
-0.16277068853378296,
0.152890145778656,
0.20122382044792175,
-0.04755288362503052,
-0.12030990421772003,
0.23518049716949463,
-0.4978462755680084,
0.020031630992889404,
0.15333764255046844,
0.16572999954223633,
-0.1650717854499817,
-0.03458387404680252,
-0.5144808292388916,
-0.015856198966503143,
-0.008181057870388031,
-0.37676799297332764,
0.11685246229171753,
-0.22823134064674377,
-0.060319364070892334,
-0.2307310849428177,
-0.04977869987487793,
0.21857890486717224,
-0.4609222412109375,
-0.0382038950920105,
0.1309524029493332,
-0.0979306697845459,
0.03721742704510689,
0.08452999591827393,
-0.2281585931777954,
0.22470277547836304,
-0.3320043087005615,
0.16554343700408936,
0.8003835082054138,
-0.648679256439209,
-0.4257955849170685,
0.4459165930747986,
-0.26551079750061035,
0.5284009575843811,
0.031139427796006203,
0.001333087682723999,
0.17999862134456635,
-0.009544499218463898,
0.22360751032829285,
0.2457641214132309,
0.07383493334054947,
0.12008646875619888,
-0.30611082911491394,
-0.3270408809185028,
-0.10615472495555878,
0.02081902325153351,
-0.2197653204202652,
0.0838237851858139,
0.2255823165178299,
-0.017742089927196503,
0.37314364314079285,
0.02002401277422905,
0.08510473370552063,
0.33103570342063904,
0.09093771874904633,
-0.24283000826835632,
0.15043894946575165,
-0.17353422939777374,
-0.5426609516143799,
0.1216859221458435,
0.097203329205513,
-0.16301409900188446,
-0.2582252323627472,
-0.015827029943466187,
-0.33896201848983765,
0.03430136293172836,
-0.14942604303359985,
-0.008956655859947205,
0.03810657933354378,
0.18723934888839722,
-0.04340106248855591,
-0.18287566304206848,
-0.14950993657112122,
0.33346039056777954,
0.10410498082637787,
0.273147851228714,
-0.16364102065563202,
0.26180243492126465,
-0.03958607465028763,
-0.05930854007601738,
0.02251940220594406,
0.10603630542755127,
0.21734091639518738,
-0.26077350974082947,
-0.39591091871261597,
0.3155685365200043,
0.41405612230300903,
0.2877558767795563,
-0.049826547503471375,
-0.07880222052335739,
-0.02316422015428543,
-0.14444459974765778,
-0.24422194063663483,
0.4660237729549408,
0.24550339579582214,
-0.10324886441230774,
-0.06099949777126312,
0.5095027685165405,
-0.2049858272075653,
0.2815602421760559,
0.07443836331367493,
-0.11463728547096252,
0.3836555480957031,
-0.09451039135456085,
0.00664876401424408,
-0.2729807496070862,
0.26541513204574585,
0.485606849193573,
0.12411811947822571,
0.16954511404037476,
-0.37696146965026855,
0.15529993176460266,
0.3946007490158081,
0.004776693880558014,
-0.017739146947860718,
0.2613026201725006,
-0.14759153127670288,
-0.15901702642440796,
-0.11971831321716309,
0.62922203540802,
0.6596606373786926,
0.03588831424713135,
-0.2480289191007614,
0.10971757769584656,
0.05251765623688698,
-0.20127443969249725,
0.32055121660232544,
0.04838208854198456,
0.41439998149871826,
0.5437895655632019,
0.44743117690086365,
0.19862385094165802,
-0.2594892084598541,
-0.18017274141311646,
0.13230273127555847,
0.12261489033699036,
-0.2715628445148468,
0.2235366702079773,
-0.25414371490478516,
-0.05845830589532852,
-0.5187341570854187,
-0.05292719602584839,
-0.11812058091163635,
-0.2090550661087036,
0.03817271068692207,
0.5303002595901489,
-0.31224530935287476,
-0.14033424854278564,
-0.10194911062717438,
0.19835230708122253,
-0.04296574741601944,
-0.46406444907188416,
-0.24615496397018433,
-0.11165221035480499,
-0.3306106925010681,
-0.018044669181108475,
0.3494723439216614,
0.17097046971321106,
0.13103613257408142,
-0.11735448241233826,
-0.12549135088920593,
-0.05954722315073013,
-0.3629556894302368,
0.036727748811244965,
-0.03174063563346863,
0.2197721302509308,
0.0757657140493393,
0.30164721608161926,
-0.06944315135478973,
-0.4720216989517212,
0.2582487165927887,
-0.16851019859313965,
-0.24797125160694122,
0.2161080539226532,
0.0601084940135479,
0.19889064133167267,
-0.14594396948814392,
-0.4137706756591797,
-0.06997602432966232,
-0.3621085286140442,
0.15361902117729187,
-0.0406392440199852,
0.2255445420742035,
-0.11914202570915222,
0.17202600836753845,
0.02690928429365158,
0.31287881731987,
0.2016083002090454,
-0.2553631067276001,
-0.10479643940925598,
0.04889094457030296,
-0.15610100328922272,
-0.5191733837127686,
0.16821104288101196,
0.08646930009126663,
0.13015098869800568,
0.1522429883480072,
-0.6692613959312439,
-0.21097536385059357,
0.29814624786376953,
-0.09899333119392395,
-0.20345348119735718,
-0.42814069986343384,
-0.006398249417543411,
0.18066777288913727,
0.0037250816822052,
-0.23000025749206543,
-0.21608301997184753,
0.07534228265285492,
0.0004132278263568878,
0.11691426485776901,
-0.042516663670539856,
0.2876985967159271,
-0.1860223412513733,
0.2296215295791626,
0.2152283489704132,
0.05610792711377144,
0.31349676847457886,
-0.05361559987068176,
0.011448944918811321,
-0.2026509940624237,
-0.2747012674808502,
-0.2736993730068207,
-0.047064363956451416,
0.031846560537815094,
0.3444666266441345,
-0.04269053414463997,
-0.15573471784591675,
-0.19447684288024902,
-0.15282469987869263,
-0.33055776357650757,
-0.39531993865966797,
0.22400067746639252,
-0.19839009642601013,
-0.16162154078483582,
0.055584728717803955,
-0.21204400062561035,
-0.11691145598888397,
-0.14306095242500305,
-0.2208174467086792,
0.2228916585445404,
-0.2972938120365143,
0.01385674998164177,
-0.3820156455039978,
-0.2897532880306244,
-0.03194766864180565,
0.26681798696517944,
0.22515109181404114,
0.5313531756401062,
0.17915484309196472,
-0.08011997491121292,
0.15930812060832977,
-0.08714281022548676,
0.6585025787353516,
-0.07978592067956924,
0.04911291226744652,
0.0775197371840477,
0.143390953540802,
-0.47961169481277466,
-0.1721053570508957,
-0.0693897157907486,
0.14525845646858215,
0.3938602805137634,
0.4276677966117859,
-0.3333643078804016,
-0.18054884672164917,
0.13778091967105865,
0.386824369430542,
-0.1105964258313179,
-0.190106600522995,
-0.17595285177230835,
-0.4357322156429291,
-0.3615017533302307,
-0.15636833012104034,
-0.16622035205364227,
0.42547351121902466,
-0.027819693088531494,
0.04316265881061554,
0.06729179620742798,
-0.14948557317256927,
-0.09734557569026947,
0.13390986621379852,
0.35451945662498474,
-0.28942859172821045,
0.19009071588516235,
0.055056650191545486,
0.38654786348342896,
0.47349265217781067,
0.7934794425964355,
-0.020332859829068184,
-0.12451893091201782,
0.04798154532909393,
-0.29775741696357727,
0.0039491914212703705,
0.30593422055244446,
-0.06676013767719269,
0.13150739669799805,
-0.33723384141921997,
-0.28521159291267395,
0.1231561228632927,
-0.10100295394659042,
0.35650578141212463,
0.04307284206151962,
-0.07941392809152603,
-0.3222171664237976,
0.24593614041805267,
0.10633992403745651,
-0.08251580595970154,
0.17157752811908722,
0.013219382613897324,
-0.3786398768424988,
0.7430249452590942,
-0.2556389272212982,
1.0368067026138306,
0.004456033930182457,
0.1331993192434311,
0.39942696690559387,
-0.34271299839019775,
0.4143582880496979,
-0.24390588700771332,
0.11179859936237335,
-0.3386250436306,
-0.09771686792373657,
0.019903801381587982,
-0.16440166532993317,
0.12555542588233948,
0.26948094367980957,
-0.09858667850494385,
0.08164266496896744,
0.05214540660381317,
0.21716950833797455,
0.03258981555700302,
0.27012401819229126,
0.2601199746131897,
0.12983252108097076,
-0.4012584388256073,
-0.005264509469270706,
0.02926676534116268,
-0.06807338446378708,
0.03514032065868378,
-0.08107481896877289,
-0.3397371768951416,
-0.5302044749259949,
-0.35073262453079224,
0.14143332839012146,
-0.1931920349597931,
0.14028522372245789,
0.12899357080459595,
-0.11051908135414124,
-0.04660838842391968,
0.11433593928813934,
-0.04692404344677925,
-0.13514776527881622,
-0.08743030577898026,
0.09012673795223236,
-0.02545372024178505,
0.31298574805259705,
-0.02461930550634861,
-0.06076765060424805,
0.3814358115196228,
-0.12717445194721222,
-0.10868094116449356,
0.07417366653680801,
-0.17105601727962494,
-0.31569212675094604,
0.16920511424541473,
0.18719197809696198,
-0.324892520904541,
-0.35906392335891724,
-0.39873674511909485,
-0.16056203842163086,
-0.15958230197429657,
-0.3032997250556946,
0.05166533216834068,
-0.04867015779018402,
-0.05785044655203819,
0.18613645434379578,
0.2312013804912567,
-0.4489627778530121,
-0.025992125272750854,
0.4248579740524292,
0.0928032398223877,
-0.06656302511692047,
0.5180467963218689,
-0.10347690433263779,
0.05756957083940506,
-0.28434616327285767,
0.02438656985759735,
0.13963046669960022,
-0.5100820660591125,
0.13508327305316925,
-0.26653018593788147,
0.134496808052063,
0.21202296018600464,
0.22330261766910553,
0.177329421043396,
0.4816284477710724,
0.17712122201919556,
-0.6883872747421265,
-0.08757632225751877,
0.2675863802433014,
0.25381916761398315,
-0.0020664953626692295,
0.020675018429756165,
0.07599048316478729,
-0.2551763653755188,
0.21066968142986298,
-0.2356049120426178,
0.31248995661735535,
-0.0592522993683815,
0.1713433861732483,
0.1074880063533783,
0.10531062632799149,
0.4985080063343048,
0.1183193027973175,
0.1273719072341919,
0.13983488082885742,
0.032506927847862244,
-0.1091327965259552,
-0.2248837798833847,
0.1681392341852188,
0.11273728311061859,
-0.05632386729121208,
-0.3406289219856262,
-0.09112594276666641,
0.2655707001686096,
-0.10681004077196121,
-0.04723668470978737,
-0.05679114907979965,
-0.07740072160959244,
-0.01303582638502121,
0.07182230800390244,
0.13755527138710022,
-0.21550197899341583,
0.07547321915626526,
-0.2941284775733948,
0.30555260181427,
0.08535479009151459,
0.2171875387430191,
-0.07820621877908707,
-0.008733659982681274,
-0.26135724782943726,
-0.02713189274072647,
0.13271871209144592,
0.19059433043003082,
0.3487906754016876,
-0.26034480333328247,
0.10500296205282211,
-0.10342562198638916,
0.17348000407218933,
0.36122962832450867,
-0.37612465023994446,
-0.08597840368747711,
-0.1833878457546234,
0.13008147478103638,
-0.2672957181930542,
-0.10385827720165253,
0.5432297587394714,
-0.3188050389289856,
-0.053539834916591644,
0.28478527069091797,
0.3223743736743927,
-0.1659020483493805,
-0.17136207222938538,
0.04349842667579651,
0.61893630027771,
0.09631054103374481,
0.21764057874679565,
0.3427690267562866,
-0.03752531856298447,
0.12732896208763123,
-0.08614924550056458,
0.17812776565551758,
0.20069874823093414,
0.18392497301101685,
-0.38545697927474976,
-0.015567276626825333,
0.12802734971046448,
-0.20693586766719818,
-0.039740823209285736,
-0.30059167742729187,
0.3493437170982361,
0.5023258924484253,
-0.03877415135502815,
0.041395243257284164,
-0.03911930322647095,
0.11384624242782593,
-0.09307849407196045,
0.11672006547451019,
0.0768255740404129,
0.1694260686635971,
-0.02125636860728264,
-0.13288931548595428,
-0.032346274703741074,
-0.325337290763855,
-0.3297603726387024,
-0.09056416153907776,
-0.138467937707901,
0.09511709213256836,
0.3174440264701843,
0.14153525233268738,
-0.1604049950838089,
-0.39265501499176025,
0.2680951654911041,
-0.06593365967273712,
0.021603431552648544,
-0.43814021348953247,
0.30132821202278137,
0.03046766109764576,
-0.2516081631183624,
0.4023534059524536,
-0.04873741418123245,
0.4072360396385193,
0.3832011818885803,
0.10976839810609818,
-0.12773801386356354,
-0.3201674222946167,
-0.13908913731575012,
-0.13356070220470428,
0.3059421181678772,
0.04344815015792847,
-0.3885597288608551,
0.20770776271820068,
0.07506640255451202,
-0.032308101654052734,
0.32007819414138794,
0.2924835979938507,
0.10098181664943695,
-0.1815299540758133,
0.29305529594421387,
-0.2649337947368622,
-0.2425040304660797,
-0.1817508339881897,
0.0106734037399292,
-0.059292491525411606,
-0.25086408853530884,
0.35613226890563965,
-0.0792829692363739,
0.30835098028182983,
0.03144233673810959,
0.05872783809900284,
0.08452889323234558,
0.4669100046157837,
0.24165168404579163,
-0.2032032608985901,
-0.2557709813117981,
-0.057624317705631256,
-0.4559786021709442,
0.394247829914093,
-0.1726692169904709,
0.06142578274011612,
0.09042114019393921,
0.12396648526191711,
-0.03243808075785637,
0.01986098662018776,
0.18308545649051666,
0.020220067352056503,
-0.038338083773851395,
0.18408730626106262,
-0.3519144356250763,
-0.28630349040031433,
0.11309381574392319,
0.07932489365339279,
0.06053741276264191,
-0.29971373081207275,
0.30877625942230225,
-0.17730093002319336,
0.04474031180143356,
-0.2316371351480484,
-0.08147358894348145,
0.1843792200088501,
-0.25560519099235535,
0.06595662981271744,
0.017918748781085014,
0.38962092995643616,
-0.12530988454818726,
-0.5042928457260132,
-0.17851069569587708,
-0.35246098041534424,
-0.28110548853874207,
0.5366905927658081,
0.1248292624950409,
0.3189523220062256,
-0.02666211500763893,
0.00964544340968132,
-0.1598462164402008,
0.005758702754974365,
-0.35633915662765503,
-0.38758087158203125,
-0.16918188333511353,
0.016773030161857605,
-0.07085084915161133,
0.25542423129081726,
-0.14620628952980042,
0.1754981428384781,
0.04146329313516617,
0.3886832594871521,
-0.39578521251678467,
-0.360149085521698,
0.276049941778183,
-0.5024653077125549,
-0.13441155850887299,
0.14312812685966492,
0.3050159811973572,
-0.21690785884857178,
0.03420326113700867,
-0.5682093501091003,
0.003696814179420471,
0.5053195953369141,
0.0468362458050251,
-0.24200740456581116,
0.09934410452842712,
0.005938272923231125,
-0.015348285436630249,
0.026318706572055817,
0.018902933225035667,
0.273620069026947,
-0.25859832763671875,
0.17888614535331726,
-0.1267915666103363
] |
https://github.com/huggingface/datasets/issues/6162 | > @lhoestq I think the problem is caused by the fact that hugging face datasets writes a copy of data to the local cache using pyarrow. And the data scheme is inferred from the first few data blocks as can be seen [here](https://github.com/huggingface/datasets/blob/main/src/datasets/arrow_writer.py#L570).
Correct. Therefore any example that doesn't follow the inferred schema will make the code fail.
> Maybe setting streaming=True can workaround this problem. Would you agree with my statement?
You'll meet the same problem but later - when streaming and arriving at the problematic example | load_dataset('json',...) from togethercomputer/RedPajama-Data-1T errors when jsonl rows contains different data fields | ### Describe the bug
When loading some jsonl from redpajama-data-1T github source [togethercomputer/RedPajama-Data-1T](https://huggingface.co/datasets/togethercomputer/RedPajama-Data-1T) fails due to one row of the file containing an extra field called **symlink_target: string>**.
When deleting that line the loading is successful.
We also tried loading this file with the discrepancy using this function and it is successful
```python
os.environ["RED_PAJAMA_DATA_DIR"] ="/path_to_local_copy_of_RedPajama-Data-1T"
ds = load_dataset('togethercomputer/RedPajama-Data-1T', 'github',cache_dir="/path_to_folder_with_jsonl",streaming=True)['train']
```
### Steps to reproduce the bug
Steps to reproduce the behavior:
1. Load one jsonl from the redpajama-data-1T
```bash
wget https://data.together.xyz/redpajama-data-1T/v1.0.0/github/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl
```
2.Load dataset will give error:
```python
from datasets import load_dataset
ds = load_dataset('json', data_files='/path_to/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl')
```
_TypeError: Couldn't cast array of type
Struct
<content_hash: string,
timestamp: string,
source: string,
line_count: int64,
max_line_length: int64,
avg_line_length: double,
alnum_prop: double,
repo_name: string,
id: string,
size: string,
binary: bool,
copies: string,
ref: string,
path: string,
mode: string,
license: string,
language: list<item: struct<name: string, bytes: string>>, **symlink_target: string>**
to
{'content_hash': Value(dtype='string', id=None),
'timestamp': Value(dtype='string', id=None),
'source': Value(dtype='string', id=None),
'line_count': Value(dtype='int64', id=None),
'max_line_length': Value(dtype='int64', id=None),
'avg_line_length': Value(dtype='float64', id=None),
'alnum_prop': Value(dtype='float64', id=None),
'repo_name': Value(dtype='string', id=None),
'id': Value(dtype='string', id=None),
'size': Value(dtype='string', id=None),
'binary': Value(dtype='bool', id=None),
'copies': Value(dtype='string', id=None),
'ref': Value(dtype='string', id=None),
'path': Value(dtype='string', id=None),
'mode': Value(dtype='string', id=None),
'license': Value(dtype='string', id=None),
'language': [{'name': Value(dtype='string', id=None), 'bytes': Value(dtype='string', id=None)}]}_
3. To remove the line causing the problem that includes the **symlink_target: string>** do:
```bash
sed -i '112252d' filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl
```
4. Rerun the loading function now is succesful:
```python
from datasets import load_dataset
ds = load_dataset('json', data_files='/path_to/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl')
```
### Expected behavior
Have a clean dataset without discrepancies on the jsonl fields or have the load_dataset('json',...) method not error out.
### Environment info
- `datasets` version: 2.14.1
- Platform: Linux-4.18.0-425.13.1.el8_7.x86_64-x86_64-with-glibc2.28
- Python version: 3.9.17
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3 | 88 | load_dataset('json',...) from togethercomputer/RedPajama-Data-1T errors when jsonl rows contains different data fields
### Describe the bug
When loading some jsonl from redpajama-data-1T github source [togethercomputer/RedPajama-Data-1T](https://huggingface.co/datasets/togethercomputer/RedPajama-Data-1T) fails due to one row of the file containing an extra field called **symlink_target: string>**.
When deleting that line the loading is successful.
We also tried loading this file with the discrepancy using this function and it is successful
```python
os.environ["RED_PAJAMA_DATA_DIR"] ="/path_to_local_copy_of_RedPajama-Data-1T"
ds = load_dataset('togethercomputer/RedPajama-Data-1T', 'github',cache_dir="/path_to_folder_with_jsonl",streaming=True)['train']
```
### Steps to reproduce the bug
Steps to reproduce the behavior:
1. Load one jsonl from the redpajama-data-1T
```bash
wget https://data.together.xyz/redpajama-data-1T/v1.0.0/github/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl
```
2.Load dataset will give error:
```python
from datasets import load_dataset
ds = load_dataset('json', data_files='/path_to/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl')
```
_TypeError: Couldn't cast array of type
Struct
<content_hash: string,
timestamp: string,
source: string,
line_count: int64,
max_line_length: int64,
avg_line_length: double,
alnum_prop: double,
repo_name: string,
id: string,
size: string,
binary: bool,
copies: string,
ref: string,
path: string,
mode: string,
license: string,
language: list<item: struct<name: string, bytes: string>>, **symlink_target: string>**
to
{'content_hash': Value(dtype='string', id=None),
'timestamp': Value(dtype='string', id=None),
'source': Value(dtype='string', id=None),
'line_count': Value(dtype='int64', id=None),
'max_line_length': Value(dtype='int64', id=None),
'avg_line_length': Value(dtype='float64', id=None),
'alnum_prop': Value(dtype='float64', id=None),
'repo_name': Value(dtype='string', id=None),
'id': Value(dtype='string', id=None),
'size': Value(dtype='string', id=None),
'binary': Value(dtype='bool', id=None),
'copies': Value(dtype='string', id=None),
'ref': Value(dtype='string', id=None),
'path': Value(dtype='string', id=None),
'mode': Value(dtype='string', id=None),
'license': Value(dtype='string', id=None),
'language': [{'name': Value(dtype='string', id=None), 'bytes': Value(dtype='string', id=None)}]}_
3. To remove the line causing the problem that includes the **symlink_target: string>** do:
```bash
sed -i '112252d' filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl
```
4. Rerun the loading function now is succesful:
```python
from datasets import load_dataset
ds = load_dataset('json', data_files='/path_to/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl')
```
### Expected behavior
Have a clean dataset without discrepancies on the jsonl fields or have the load_dataset('json',...) method not error out.
### Environment info
- `datasets` version: 2.14.1
- Platform: Linux-4.18.0-425.13.1.el8_7.x86_64-x86_64-with-glibc2.28
- Python version: 3.9.17
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
> @lhoestq I think the problem is caused by the fact that hugging face datasets writes a copy of data to the local cache using pyarrow. And the data scheme is inferred from the first few data blocks as can be seen [here](https://github.com/huggingface/datasets/blob/main/src/datasets/arrow_writer.py#L570).
Correct. Therefore any example that doesn't follow the inferred schema will make the code fail.
> Maybe setting streaming=True can workaround this problem. Would you agree with my statement?
You'll meet the same problem but later - when streaming and arriving at the problematic example | [
0.053559184074401855,
0.02824193239212036,
0.02102046087384224,
0.5469897985458374,
0.12235726416110992,
0.10428876429796219,
0.474545419216156,
0.38627463579177856,
0.14965155720710754,
-0.1371256709098816,
0.021165207028388977,
0.6087433099746704,
0.18107794225215912,
-0.24777689576148987,
-0.2074326127767563,
-0.013631806708872318,
0.10015188157558441,
0.050326716154813766,
-0.02499011904001236,
-0.024461813271045685,
-0.08282776921987534,
0.3754344582557678,
-0.13180632889270782,
-0.0873534306883812,
-0.1208791434764862,
0.19231049716472626,
0.032977499067783356,
0.1859338879585266,
0.024372193962335587,
-0.10310344398021698,
0.2778506278991699,
-0.17456355690956116,
-0.2496040165424347,
0.46575501561164856,
-0.00011697061563609168,
0.09018471091985703,
0.22897714376449585,
-0.12190631031990051,
-0.08727574348449707,
-0.4820258617401123,
-0.44684064388275146,
-0.17108657956123352,
0.28448641300201416,
-0.2218094766139984,
0.016168862581253052,
-0.05676005035638809,
-0.15601976215839386,
-0.15569105744361877,
0.39929646253585815,
0.32862454652786255,
0.14080676436424255,
0.09722264111042023,
0.0768299400806427,
0.04782324284315109,
0.6405129432678223,
0.33589133620262146,
-0.008584737777709961,
0.48493462800979614,
0.1343461573123932,
0.08311443775892258,
0.08095542341470718,
0.23717249929904938,
-0.2177594155073166,
-0.03057796135544777,
-0.05039246007800102,
0.08968377858400345,
-0.07177336513996124,
-0.06366090476512909,
0.1873084157705307,
0.18318966031074524,
0.24096275866031647,
-0.301982045173645,
-0.19818691909313202,
-0.2517545819282532,
0.10700823366641998,
0.09174972772598267,
0.3747793734073639,
0.3427373766899109,
-0.11087533831596375,
0.22497543692588806,
0.17133352160453796,
0.07846899330615997,
-0.1325281411409378,
0.16559597849845886,
0.0700310617685318,
0.03531361371278763,
0.05404135212302208,
0.28299951553344727,
-0.045249391347169876,
0.04931922256946564,
-0.03238898515701294,
-0.11811322718858719,
-0.042789094150066376,
0.08137752115726471,
-0.3676564395427704,
0.03393423557281494,
-0.34335094690322876,
-0.635187029838562,
0.16367782652378082,
0.029472071677446365,
0.6306318044662476,
0.015616510063409805,
0.2226051241159439,
0.49889087677001953,
0.42214298248291016,
0.05472726747393608,
-0.2040455937385559,
0.18057909607887268,
0.054753173142671585,
0.08553619682788849,
-0.2724500298500061,
0.04310928285121918,
0.08010510355234146,
-0.09184098243713379,
-0.04317319765686989,
-0.10710109025239944,
0.44493821263313293,
-0.15634344518184662,
-0.5367875099182129,
0.09472756087779999,
-0.3597877621650696,
-0.11784540861845016,
0.017903119325637817,
0.13741403818130493,
-0.015756402164697647,
0.303848534822464,
0.07673723250627518,
0.2830987274646759,
-0.06245472654700279,
-0.2006787657737732,
-0.04939629137516022,
0.22194921970367432,
-0.02320064604282379,
-0.1538212150335312,
0.3668636381626129,
-0.009613709524273872,
0.3546910583972931,
0.3222534954547882,
-0.20159359276294708,
-0.4368676543235779,
0.08795437961816788,
-0.30601221323013306,
-0.02077057957649231,
0.3180159032344818,
-0.16277068853378296,
0.152890145778656,
0.20122382044792175,
-0.04755288362503052,
-0.12030990421772003,
0.23518049716949463,
-0.4978462755680084,
0.020031630992889404,
0.15333764255046844,
0.16572999954223633,
-0.1650717854499817,
-0.03458387404680252,
-0.5144808292388916,
-0.015856198966503143,
-0.008181057870388031,
-0.37676799297332764,
0.11685246229171753,
-0.22823134064674377,
-0.060319364070892334,
-0.2307310849428177,
-0.04977869987487793,
0.21857890486717224,
-0.4609222412109375,
-0.0382038950920105,
0.1309524029493332,
-0.0979306697845459,
0.03721742704510689,
0.08452999591827393,
-0.2281585931777954,
0.22470277547836304,
-0.3320043087005615,
0.16554343700408936,
0.8003835082054138,
-0.648679256439209,
-0.4257955849170685,
0.4459165930747986,
-0.26551079750061035,
0.5284009575843811,
0.031139427796006203,
0.001333087682723999,
0.17999862134456635,
-0.009544499218463898,
0.22360751032829285,
0.2457641214132309,
0.07383493334054947,
0.12008646875619888,
-0.30611082911491394,
-0.3270408809185028,
-0.10615472495555878,
0.02081902325153351,
-0.2197653204202652,
0.0838237851858139,
0.2255823165178299,
-0.017742089927196503,
0.37314364314079285,
0.02002401277422905,
0.08510473370552063,
0.33103570342063904,
0.09093771874904633,
-0.24283000826835632,
0.15043894946575165,
-0.17353422939777374,
-0.5426609516143799,
0.1216859221458435,
0.097203329205513,
-0.16301409900188446,
-0.2582252323627472,
-0.015827029943466187,
-0.33896201848983765,
0.03430136293172836,
-0.14942604303359985,
-0.008956655859947205,
0.03810657933354378,
0.18723934888839722,
-0.04340106248855591,
-0.18287566304206848,
-0.14950993657112122,
0.33346039056777954,
0.10410498082637787,
0.273147851228714,
-0.16364102065563202,
0.26180243492126465,
-0.03958607465028763,
-0.05930854007601738,
0.02251940220594406,
0.10603630542755127,
0.21734091639518738,
-0.26077350974082947,
-0.39591091871261597,
0.3155685365200043,
0.41405612230300903,
0.2877558767795563,
-0.049826547503471375,
-0.07880222052335739,
-0.02316422015428543,
-0.14444459974765778,
-0.24422194063663483,
0.4660237729549408,
0.24550339579582214,
-0.10324886441230774,
-0.06099949777126312,
0.5095027685165405,
-0.2049858272075653,
0.2815602421760559,
0.07443836331367493,
-0.11463728547096252,
0.3836555480957031,
-0.09451039135456085,
0.00664876401424408,
-0.2729807496070862,
0.26541513204574585,
0.485606849193573,
0.12411811947822571,
0.16954511404037476,
-0.37696146965026855,
0.15529993176460266,
0.3946007490158081,
0.004776693880558014,
-0.017739146947860718,
0.2613026201725006,
-0.14759153127670288,
-0.15901702642440796,
-0.11971831321716309,
0.62922203540802,
0.6596606373786926,
0.03588831424713135,
-0.2480289191007614,
0.10971757769584656,
0.05251765623688698,
-0.20127443969249725,
0.32055121660232544,
0.04838208854198456,
0.41439998149871826,
0.5437895655632019,
0.44743117690086365,
0.19862385094165802,
-0.2594892084598541,
-0.18017274141311646,
0.13230273127555847,
0.12261489033699036,
-0.2715628445148468,
0.2235366702079773,
-0.25414371490478516,
-0.05845830589532852,
-0.5187341570854187,
-0.05292719602584839,
-0.11812058091163635,
-0.2090550661087036,
0.03817271068692207,
0.5303002595901489,
-0.31224530935287476,
-0.14033424854278564,
-0.10194911062717438,
0.19835230708122253,
-0.04296574741601944,
-0.46406444907188416,
-0.24615496397018433,
-0.11165221035480499,
-0.3306106925010681,
-0.018044669181108475,
0.3494723439216614,
0.17097046971321106,
0.13103613257408142,
-0.11735448241233826,
-0.12549135088920593,
-0.05954722315073013,
-0.3629556894302368,
0.036727748811244965,
-0.03174063563346863,
0.2197721302509308,
0.0757657140493393,
0.30164721608161926,
-0.06944315135478973,
-0.4720216989517212,
0.2582487165927887,
-0.16851019859313965,
-0.24797125160694122,
0.2161080539226532,
0.0601084940135479,
0.19889064133167267,
-0.14594396948814392,
-0.4137706756591797,
-0.06997602432966232,
-0.3621085286140442,
0.15361902117729187,
-0.0406392440199852,
0.2255445420742035,
-0.11914202570915222,
0.17202600836753845,
0.02690928429365158,
0.31287881731987,
0.2016083002090454,
-0.2553631067276001,
-0.10479643940925598,
0.04889094457030296,
-0.15610100328922272,
-0.5191733837127686,
0.16821104288101196,
0.08646930009126663,
0.13015098869800568,
0.1522429883480072,
-0.6692613959312439,
-0.21097536385059357,
0.29814624786376953,
-0.09899333119392395,
-0.20345348119735718,
-0.42814069986343384,
-0.006398249417543411,
0.18066777288913727,
0.0037250816822052,
-0.23000025749206543,
-0.21608301997184753,
0.07534228265285492,
0.0004132278263568878,
0.11691426485776901,
-0.042516663670539856,
0.2876985967159271,
-0.1860223412513733,
0.2296215295791626,
0.2152283489704132,
0.05610792711377144,
0.31349676847457886,
-0.05361559987068176,
0.011448944918811321,
-0.2026509940624237,
-0.2747012674808502,
-0.2736993730068207,
-0.047064363956451416,
0.031846560537815094,
0.3444666266441345,
-0.04269053414463997,
-0.15573471784591675,
-0.19447684288024902,
-0.15282469987869263,
-0.33055776357650757,
-0.39531993865966797,
0.22400067746639252,
-0.19839009642601013,
-0.16162154078483582,
0.055584728717803955,
-0.21204400062561035,
-0.11691145598888397,
-0.14306095242500305,
-0.2208174467086792,
0.2228916585445404,
-0.2972938120365143,
0.01385674998164177,
-0.3820156455039978,
-0.2897532880306244,
-0.03194766864180565,
0.26681798696517944,
0.22515109181404114,
0.5313531756401062,
0.17915484309196472,
-0.08011997491121292,
0.15930812060832977,
-0.08714281022548676,
0.6585025787353516,
-0.07978592067956924,
0.04911291226744652,
0.0775197371840477,
0.143390953540802,
-0.47961169481277466,
-0.1721053570508957,
-0.0693897157907486,
0.14525845646858215,
0.3938602805137634,
0.4276677966117859,
-0.3333643078804016,
-0.18054884672164917,
0.13778091967105865,
0.386824369430542,
-0.1105964258313179,
-0.190106600522995,
-0.17595285177230835,
-0.4357322156429291,
-0.3615017533302307,
-0.15636833012104034,
-0.16622035205364227,
0.42547351121902466,
-0.027819693088531494,
0.04316265881061554,
0.06729179620742798,
-0.14948557317256927,
-0.09734557569026947,
0.13390986621379852,
0.35451945662498474,
-0.28942859172821045,
0.19009071588516235,
0.055056650191545486,
0.38654786348342896,
0.47349265217781067,
0.7934794425964355,
-0.020332859829068184,
-0.12451893091201782,
0.04798154532909393,
-0.29775741696357727,
0.0039491914212703705,
0.30593422055244446,
-0.06676013767719269,
0.13150739669799805,
-0.33723384141921997,
-0.28521159291267395,
0.1231561228632927,
-0.10100295394659042,
0.35650578141212463,
0.04307284206151962,
-0.07941392809152603,
-0.3222171664237976,
0.24593614041805267,
0.10633992403745651,
-0.08251580595970154,
0.17157752811908722,
0.013219382613897324,
-0.3786398768424988,
0.7430249452590942,
-0.2556389272212982,
1.0368067026138306,
0.004456033930182457,
0.1331993192434311,
0.39942696690559387,
-0.34271299839019775,
0.4143582880496979,
-0.24390588700771332,
0.11179859936237335,
-0.3386250436306,
-0.09771686792373657,
0.019903801381587982,
-0.16440166532993317,
0.12555542588233948,
0.26948094367980957,
-0.09858667850494385,
0.08164266496896744,
0.05214540660381317,
0.21716950833797455,
0.03258981555700302,
0.27012401819229126,
0.2601199746131897,
0.12983252108097076,
-0.4012584388256073,
-0.005264509469270706,
0.02926676534116268,
-0.06807338446378708,
0.03514032065868378,
-0.08107481896877289,
-0.3397371768951416,
-0.5302044749259949,
-0.35073262453079224,
0.14143332839012146,
-0.1931920349597931,
0.14028522372245789,
0.12899357080459595,
-0.11051908135414124,
-0.04660838842391968,
0.11433593928813934,
-0.04692404344677925,
-0.13514776527881622,
-0.08743030577898026,
0.09012673795223236,
-0.02545372024178505,
0.31298574805259705,
-0.02461930550634861,
-0.06076765060424805,
0.3814358115196228,
-0.12717445194721222,
-0.10868094116449356,
0.07417366653680801,
-0.17105601727962494,
-0.31569212675094604,
0.16920511424541473,
0.18719197809696198,
-0.324892520904541,
-0.35906392335891724,
-0.39873674511909485,
-0.16056203842163086,
-0.15958230197429657,
-0.3032997250556946,
0.05166533216834068,
-0.04867015779018402,
-0.05785044655203819,
0.18613645434379578,
0.2312013804912567,
-0.4489627778530121,
-0.025992125272750854,
0.4248579740524292,
0.0928032398223877,
-0.06656302511692047,
0.5180467963218689,
-0.10347690433263779,
0.05756957083940506,
-0.28434616327285767,
0.02438656985759735,
0.13963046669960022,
-0.5100820660591125,
0.13508327305316925,
-0.26653018593788147,
0.134496808052063,
0.21202296018600464,
0.22330261766910553,
0.177329421043396,
0.4816284477710724,
0.17712122201919556,
-0.6883872747421265,
-0.08757632225751877,
0.2675863802433014,
0.25381916761398315,
-0.0020664953626692295,
0.020675018429756165,
0.07599048316478729,
-0.2551763653755188,
0.21066968142986298,
-0.2356049120426178,
0.31248995661735535,
-0.0592522993683815,
0.1713433861732483,
0.1074880063533783,
0.10531062632799149,
0.4985080063343048,
0.1183193027973175,
0.1273719072341919,
0.13983488082885742,
0.032506927847862244,
-0.1091327965259552,
-0.2248837798833847,
0.1681392341852188,
0.11273728311061859,
-0.05632386729121208,
-0.3406289219856262,
-0.09112594276666641,
0.2655707001686096,
-0.10681004077196121,
-0.04723668470978737,
-0.05679114907979965,
-0.07740072160959244,
-0.01303582638502121,
0.07182230800390244,
0.13755527138710022,
-0.21550197899341583,
0.07547321915626526,
-0.2941284775733948,
0.30555260181427,
0.08535479009151459,
0.2171875387430191,
-0.07820621877908707,
-0.008733659982681274,
-0.26135724782943726,
-0.02713189274072647,
0.13271871209144592,
0.19059433043003082,
0.3487906754016876,
-0.26034480333328247,
0.10500296205282211,
-0.10342562198638916,
0.17348000407218933,
0.36122962832450867,
-0.37612465023994446,
-0.08597840368747711,
-0.1833878457546234,
0.13008147478103638,
-0.2672957181930542,
-0.10385827720165253,
0.5432297587394714,
-0.3188050389289856,
-0.053539834916591644,
0.28478527069091797,
0.3223743736743927,
-0.1659020483493805,
-0.17136207222938538,
0.04349842667579651,
0.61893630027771,
0.09631054103374481,
0.21764057874679565,
0.3427690267562866,
-0.03752531856298447,
0.12732896208763123,
-0.08614924550056458,
0.17812776565551758,
0.20069874823093414,
0.18392497301101685,
-0.38545697927474976,
-0.015567276626825333,
0.12802734971046448,
-0.20693586766719818,
-0.039740823209285736,
-0.30059167742729187,
0.3493437170982361,
0.5023258924484253,
-0.03877415135502815,
0.041395243257284164,
-0.03911930322647095,
0.11384624242782593,
-0.09307849407196045,
0.11672006547451019,
0.0768255740404129,
0.1694260686635971,
-0.02125636860728264,
-0.13288931548595428,
-0.032346274703741074,
-0.325337290763855,
-0.3297603726387024,
-0.09056416153907776,
-0.138467937707901,
0.09511709213256836,
0.3174440264701843,
0.14153525233268738,
-0.1604049950838089,
-0.39265501499176025,
0.2680951654911041,
-0.06593365967273712,
0.021603431552648544,
-0.43814021348953247,
0.30132821202278137,
0.03046766109764576,
-0.2516081631183624,
0.4023534059524536,
-0.04873741418123245,
0.4072360396385193,
0.3832011818885803,
0.10976839810609818,
-0.12773801386356354,
-0.3201674222946167,
-0.13908913731575012,
-0.13356070220470428,
0.3059421181678772,
0.04344815015792847,
-0.3885597288608551,
0.20770776271820068,
0.07506640255451202,
-0.032308101654052734,
0.32007819414138794,
0.2924835979938507,
0.10098181664943695,
-0.1815299540758133,
0.29305529594421387,
-0.2649337947368622,
-0.2425040304660797,
-0.1817508339881897,
0.0106734037399292,
-0.059292491525411606,
-0.25086408853530884,
0.35613226890563965,
-0.0792829692363739,
0.30835098028182983,
0.03144233673810959,
0.05872783809900284,
0.08452889323234558,
0.4669100046157837,
0.24165168404579163,
-0.2032032608985901,
-0.2557709813117981,
-0.057624317705631256,
-0.4559786021709442,
0.394247829914093,
-0.1726692169904709,
0.06142578274011612,
0.09042114019393921,
0.12396648526191711,
-0.03243808075785637,
0.01986098662018776,
0.18308545649051666,
0.020220067352056503,
-0.038338083773851395,
0.18408730626106262,
-0.3519144356250763,
-0.28630349040031433,
0.11309381574392319,
0.07932489365339279,
0.06053741276264191,
-0.29971373081207275,
0.30877625942230225,
-0.17730093002319336,
0.04474031180143356,
-0.2316371351480484,
-0.08147358894348145,
0.1843792200088501,
-0.25560519099235535,
0.06595662981271744,
0.017918748781085014,
0.38962092995643616,
-0.12530988454818726,
-0.5042928457260132,
-0.17851069569587708,
-0.35246098041534424,
-0.28110548853874207,
0.5366905927658081,
0.1248292624950409,
0.3189523220062256,
-0.02666211500763893,
0.00964544340968132,
-0.1598462164402008,
0.005758702754974365,
-0.35633915662765503,
-0.38758087158203125,
-0.16918188333511353,
0.016773030161857605,
-0.07085084915161133,
0.25542423129081726,
-0.14620628952980042,
0.1754981428384781,
0.04146329313516617,
0.3886832594871521,
-0.39578521251678467,
-0.360149085521698,
0.276049941778183,
-0.5024653077125549,
-0.13441155850887299,
0.14312812685966492,
0.3050159811973572,
-0.21690785884857178,
0.03420326113700867,
-0.5682093501091003,
0.003696814179420471,
0.5053195953369141,
0.0468362458050251,
-0.24200740456581116,
0.09934410452842712,
0.005938272923231125,
-0.015348285436630249,
0.026318706572055817,
0.018902933225035667,
0.273620069026947,
-0.25859832763671875,
0.17888614535331726,
-0.1267915666103363
] |
https://github.com/huggingface/datasets/issues/6162 | @lhoestq I just run below test with streaming=True and is not failing at the problematic example
```python
ds = load_dataset('json', data_files='/path_to_local_RedPajamaData/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl', streaming=True)
count = 0
for i in ds['train']:
count += 1
print(count)
```
and completes the 262241 samples successfully. It does error our when streaming is not used | load_dataset('json',...) from togethercomputer/RedPajama-Data-1T errors when jsonl rows contains different data fields | ### Describe the bug
When loading some jsonl from redpajama-data-1T github source [togethercomputer/RedPajama-Data-1T](https://huggingface.co/datasets/togethercomputer/RedPajama-Data-1T) fails due to one row of the file containing an extra field called **symlink_target: string>**.
When deleting that line the loading is successful.
We also tried loading this file with the discrepancy using this function and it is successful
```python
os.environ["RED_PAJAMA_DATA_DIR"] ="/path_to_local_copy_of_RedPajama-Data-1T"
ds = load_dataset('togethercomputer/RedPajama-Data-1T', 'github',cache_dir="/path_to_folder_with_jsonl",streaming=True)['train']
```
### Steps to reproduce the bug
Steps to reproduce the behavior:
1. Load one jsonl from the redpajama-data-1T
```bash
wget https://data.together.xyz/redpajama-data-1T/v1.0.0/github/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl
```
2.Load dataset will give error:
```python
from datasets import load_dataset
ds = load_dataset('json', data_files='/path_to/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl')
```
_TypeError: Couldn't cast array of type
Struct
<content_hash: string,
timestamp: string,
source: string,
line_count: int64,
max_line_length: int64,
avg_line_length: double,
alnum_prop: double,
repo_name: string,
id: string,
size: string,
binary: bool,
copies: string,
ref: string,
path: string,
mode: string,
license: string,
language: list<item: struct<name: string, bytes: string>>, **symlink_target: string>**
to
{'content_hash': Value(dtype='string', id=None),
'timestamp': Value(dtype='string', id=None),
'source': Value(dtype='string', id=None),
'line_count': Value(dtype='int64', id=None),
'max_line_length': Value(dtype='int64', id=None),
'avg_line_length': Value(dtype='float64', id=None),
'alnum_prop': Value(dtype='float64', id=None),
'repo_name': Value(dtype='string', id=None),
'id': Value(dtype='string', id=None),
'size': Value(dtype='string', id=None),
'binary': Value(dtype='bool', id=None),
'copies': Value(dtype='string', id=None),
'ref': Value(dtype='string', id=None),
'path': Value(dtype='string', id=None),
'mode': Value(dtype='string', id=None),
'license': Value(dtype='string', id=None),
'language': [{'name': Value(dtype='string', id=None), 'bytes': Value(dtype='string', id=None)}]}_
3. To remove the line causing the problem that includes the **symlink_target: string>** do:
```bash
sed -i '112252d' filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl
```
4. Rerun the loading function now is succesful:
```python
from datasets import load_dataset
ds = load_dataset('json', data_files='/path_to/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl')
```
### Expected behavior
Have a clean dataset without discrepancies on the jsonl fields or have the load_dataset('json',...) method not error out.
### Environment info
- `datasets` version: 2.14.1
- Platform: Linux-4.18.0-425.13.1.el8_7.x86_64-x86_64-with-glibc2.28
- Python version: 3.9.17
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3 | 49 | load_dataset('json',...) from togethercomputer/RedPajama-Data-1T errors when jsonl rows contains different data fields
### Describe the bug
When loading some jsonl from redpajama-data-1T github source [togethercomputer/RedPajama-Data-1T](https://huggingface.co/datasets/togethercomputer/RedPajama-Data-1T) fails due to one row of the file containing an extra field called **symlink_target: string>**.
When deleting that line the loading is successful.
We also tried loading this file with the discrepancy using this function and it is successful
```python
os.environ["RED_PAJAMA_DATA_DIR"] ="/path_to_local_copy_of_RedPajama-Data-1T"
ds = load_dataset('togethercomputer/RedPajama-Data-1T', 'github',cache_dir="/path_to_folder_with_jsonl",streaming=True)['train']
```
### Steps to reproduce the bug
Steps to reproduce the behavior:
1. Load one jsonl from the redpajama-data-1T
```bash
wget https://data.together.xyz/redpajama-data-1T/v1.0.0/github/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl
```
2.Load dataset will give error:
```python
from datasets import load_dataset
ds = load_dataset('json', data_files='/path_to/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl')
```
_TypeError: Couldn't cast array of type
Struct
<content_hash: string,
timestamp: string,
source: string,
line_count: int64,
max_line_length: int64,
avg_line_length: double,
alnum_prop: double,
repo_name: string,
id: string,
size: string,
binary: bool,
copies: string,
ref: string,
path: string,
mode: string,
license: string,
language: list<item: struct<name: string, bytes: string>>, **symlink_target: string>**
to
{'content_hash': Value(dtype='string', id=None),
'timestamp': Value(dtype='string', id=None),
'source': Value(dtype='string', id=None),
'line_count': Value(dtype='int64', id=None),
'max_line_length': Value(dtype='int64', id=None),
'avg_line_length': Value(dtype='float64', id=None),
'alnum_prop': Value(dtype='float64', id=None),
'repo_name': Value(dtype='string', id=None),
'id': Value(dtype='string', id=None),
'size': Value(dtype='string', id=None),
'binary': Value(dtype='bool', id=None),
'copies': Value(dtype='string', id=None),
'ref': Value(dtype='string', id=None),
'path': Value(dtype='string', id=None),
'mode': Value(dtype='string', id=None),
'license': Value(dtype='string', id=None),
'language': [{'name': Value(dtype='string', id=None), 'bytes': Value(dtype='string', id=None)}]}_
3. To remove the line causing the problem that includes the **symlink_target: string>** do:
```bash
sed -i '112252d' filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl
```
4. Rerun the loading function now is succesful:
```python
from datasets import load_dataset
ds = load_dataset('json', data_files='/path_to/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl')
```
### Expected behavior
Have a clean dataset without discrepancies on the jsonl fields or have the load_dataset('json',...) method not error out.
### Environment info
- `datasets` version: 2.14.1
- Platform: Linux-4.18.0-425.13.1.el8_7.x86_64-x86_64-with-glibc2.28
- Python version: 3.9.17
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
@lhoestq I just run below test with streaming=True and is not failing at the problematic example
```python
ds = load_dataset('json', data_files='/path_to_local_RedPajamaData/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl', streaming=True)
count = 0
for i in ds['train']:
count += 1
print(count)
```
and completes the 262241 samples successfully. It does error our when streaming is not used | [
0.053559184074401855,
0.02824193239212036,
0.02102046087384224,
0.5469897985458374,
0.12235726416110992,
0.10428876429796219,
0.474545419216156,
0.38627463579177856,
0.14965155720710754,
-0.1371256709098816,
0.021165207028388977,
0.6087433099746704,
0.18107794225215912,
-0.24777689576148987,
-0.2074326127767563,
-0.013631806708872318,
0.10015188157558441,
0.050326716154813766,
-0.02499011904001236,
-0.024461813271045685,
-0.08282776921987534,
0.3754344582557678,
-0.13180632889270782,
-0.0873534306883812,
-0.1208791434764862,
0.19231049716472626,
0.032977499067783356,
0.1859338879585266,
0.024372193962335587,
-0.10310344398021698,
0.2778506278991699,
-0.17456355690956116,
-0.2496040165424347,
0.46575501561164856,
-0.00011697061563609168,
0.09018471091985703,
0.22897714376449585,
-0.12190631031990051,
-0.08727574348449707,
-0.4820258617401123,
-0.44684064388275146,
-0.17108657956123352,
0.28448641300201416,
-0.2218094766139984,
0.016168862581253052,
-0.05676005035638809,
-0.15601976215839386,
-0.15569105744361877,
0.39929646253585815,
0.32862454652786255,
0.14080676436424255,
0.09722264111042023,
0.0768299400806427,
0.04782324284315109,
0.6405129432678223,
0.33589133620262146,
-0.008584737777709961,
0.48493462800979614,
0.1343461573123932,
0.08311443775892258,
0.08095542341470718,
0.23717249929904938,
-0.2177594155073166,
-0.03057796135544777,
-0.05039246007800102,
0.08968377858400345,
-0.07177336513996124,
-0.06366090476512909,
0.1873084157705307,
0.18318966031074524,
0.24096275866031647,
-0.301982045173645,
-0.19818691909313202,
-0.2517545819282532,
0.10700823366641998,
0.09174972772598267,
0.3747793734073639,
0.3427373766899109,
-0.11087533831596375,
0.22497543692588806,
0.17133352160453796,
0.07846899330615997,
-0.1325281411409378,
0.16559597849845886,
0.0700310617685318,
0.03531361371278763,
0.05404135212302208,
0.28299951553344727,
-0.045249391347169876,
0.04931922256946564,
-0.03238898515701294,
-0.11811322718858719,
-0.042789094150066376,
0.08137752115726471,
-0.3676564395427704,
0.03393423557281494,
-0.34335094690322876,
-0.635187029838562,
0.16367782652378082,
0.029472071677446365,
0.6306318044662476,
0.015616510063409805,
0.2226051241159439,
0.49889087677001953,
0.42214298248291016,
0.05472726747393608,
-0.2040455937385559,
0.18057909607887268,
0.054753173142671585,
0.08553619682788849,
-0.2724500298500061,
0.04310928285121918,
0.08010510355234146,
-0.09184098243713379,
-0.04317319765686989,
-0.10710109025239944,
0.44493821263313293,
-0.15634344518184662,
-0.5367875099182129,
0.09472756087779999,
-0.3597877621650696,
-0.11784540861845016,
0.017903119325637817,
0.13741403818130493,
-0.015756402164697647,
0.303848534822464,
0.07673723250627518,
0.2830987274646759,
-0.06245472654700279,
-0.2006787657737732,
-0.04939629137516022,
0.22194921970367432,
-0.02320064604282379,
-0.1538212150335312,
0.3668636381626129,
-0.009613709524273872,
0.3546910583972931,
0.3222534954547882,
-0.20159359276294708,
-0.4368676543235779,
0.08795437961816788,
-0.30601221323013306,
-0.02077057957649231,
0.3180159032344818,
-0.16277068853378296,
0.152890145778656,
0.20122382044792175,
-0.04755288362503052,
-0.12030990421772003,
0.23518049716949463,
-0.4978462755680084,
0.020031630992889404,
0.15333764255046844,
0.16572999954223633,
-0.1650717854499817,
-0.03458387404680252,
-0.5144808292388916,
-0.015856198966503143,
-0.008181057870388031,
-0.37676799297332764,
0.11685246229171753,
-0.22823134064674377,
-0.060319364070892334,
-0.2307310849428177,
-0.04977869987487793,
0.21857890486717224,
-0.4609222412109375,
-0.0382038950920105,
0.1309524029493332,
-0.0979306697845459,
0.03721742704510689,
0.08452999591827393,
-0.2281585931777954,
0.22470277547836304,
-0.3320043087005615,
0.16554343700408936,
0.8003835082054138,
-0.648679256439209,
-0.4257955849170685,
0.4459165930747986,
-0.26551079750061035,
0.5284009575843811,
0.031139427796006203,
0.001333087682723999,
0.17999862134456635,
-0.009544499218463898,
0.22360751032829285,
0.2457641214132309,
0.07383493334054947,
0.12008646875619888,
-0.30611082911491394,
-0.3270408809185028,
-0.10615472495555878,
0.02081902325153351,
-0.2197653204202652,
0.0838237851858139,
0.2255823165178299,
-0.017742089927196503,
0.37314364314079285,
0.02002401277422905,
0.08510473370552063,
0.33103570342063904,
0.09093771874904633,
-0.24283000826835632,
0.15043894946575165,
-0.17353422939777374,
-0.5426609516143799,
0.1216859221458435,
0.097203329205513,
-0.16301409900188446,
-0.2582252323627472,
-0.015827029943466187,
-0.33896201848983765,
0.03430136293172836,
-0.14942604303359985,
-0.008956655859947205,
0.03810657933354378,
0.18723934888839722,
-0.04340106248855591,
-0.18287566304206848,
-0.14950993657112122,
0.33346039056777954,
0.10410498082637787,
0.273147851228714,
-0.16364102065563202,
0.26180243492126465,
-0.03958607465028763,
-0.05930854007601738,
0.02251940220594406,
0.10603630542755127,
0.21734091639518738,
-0.26077350974082947,
-0.39591091871261597,
0.3155685365200043,
0.41405612230300903,
0.2877558767795563,
-0.049826547503471375,
-0.07880222052335739,
-0.02316422015428543,
-0.14444459974765778,
-0.24422194063663483,
0.4660237729549408,
0.24550339579582214,
-0.10324886441230774,
-0.06099949777126312,
0.5095027685165405,
-0.2049858272075653,
0.2815602421760559,
0.07443836331367493,
-0.11463728547096252,
0.3836555480957031,
-0.09451039135456085,
0.00664876401424408,
-0.2729807496070862,
0.26541513204574585,
0.485606849193573,
0.12411811947822571,
0.16954511404037476,
-0.37696146965026855,
0.15529993176460266,
0.3946007490158081,
0.004776693880558014,
-0.017739146947860718,
0.2613026201725006,
-0.14759153127670288,
-0.15901702642440796,
-0.11971831321716309,
0.62922203540802,
0.6596606373786926,
0.03588831424713135,
-0.2480289191007614,
0.10971757769584656,
0.05251765623688698,
-0.20127443969249725,
0.32055121660232544,
0.04838208854198456,
0.41439998149871826,
0.5437895655632019,
0.44743117690086365,
0.19862385094165802,
-0.2594892084598541,
-0.18017274141311646,
0.13230273127555847,
0.12261489033699036,
-0.2715628445148468,
0.2235366702079773,
-0.25414371490478516,
-0.05845830589532852,
-0.5187341570854187,
-0.05292719602584839,
-0.11812058091163635,
-0.2090550661087036,
0.03817271068692207,
0.5303002595901489,
-0.31224530935287476,
-0.14033424854278564,
-0.10194911062717438,
0.19835230708122253,
-0.04296574741601944,
-0.46406444907188416,
-0.24615496397018433,
-0.11165221035480499,
-0.3306106925010681,
-0.018044669181108475,
0.3494723439216614,
0.17097046971321106,
0.13103613257408142,
-0.11735448241233826,
-0.12549135088920593,
-0.05954722315073013,
-0.3629556894302368,
0.036727748811244965,
-0.03174063563346863,
0.2197721302509308,
0.0757657140493393,
0.30164721608161926,
-0.06944315135478973,
-0.4720216989517212,
0.2582487165927887,
-0.16851019859313965,
-0.24797125160694122,
0.2161080539226532,
0.0601084940135479,
0.19889064133167267,
-0.14594396948814392,
-0.4137706756591797,
-0.06997602432966232,
-0.3621085286140442,
0.15361902117729187,
-0.0406392440199852,
0.2255445420742035,
-0.11914202570915222,
0.17202600836753845,
0.02690928429365158,
0.31287881731987,
0.2016083002090454,
-0.2553631067276001,
-0.10479643940925598,
0.04889094457030296,
-0.15610100328922272,
-0.5191733837127686,
0.16821104288101196,
0.08646930009126663,
0.13015098869800568,
0.1522429883480072,
-0.6692613959312439,
-0.21097536385059357,
0.29814624786376953,
-0.09899333119392395,
-0.20345348119735718,
-0.42814069986343384,
-0.006398249417543411,
0.18066777288913727,
0.0037250816822052,
-0.23000025749206543,
-0.21608301997184753,
0.07534228265285492,
0.0004132278263568878,
0.11691426485776901,
-0.042516663670539856,
0.2876985967159271,
-0.1860223412513733,
0.2296215295791626,
0.2152283489704132,
0.05610792711377144,
0.31349676847457886,
-0.05361559987068176,
0.011448944918811321,
-0.2026509940624237,
-0.2747012674808502,
-0.2736993730068207,
-0.047064363956451416,
0.031846560537815094,
0.3444666266441345,
-0.04269053414463997,
-0.15573471784591675,
-0.19447684288024902,
-0.15282469987869263,
-0.33055776357650757,
-0.39531993865966797,
0.22400067746639252,
-0.19839009642601013,
-0.16162154078483582,
0.055584728717803955,
-0.21204400062561035,
-0.11691145598888397,
-0.14306095242500305,
-0.2208174467086792,
0.2228916585445404,
-0.2972938120365143,
0.01385674998164177,
-0.3820156455039978,
-0.2897532880306244,
-0.03194766864180565,
0.26681798696517944,
0.22515109181404114,
0.5313531756401062,
0.17915484309196472,
-0.08011997491121292,
0.15930812060832977,
-0.08714281022548676,
0.6585025787353516,
-0.07978592067956924,
0.04911291226744652,
0.0775197371840477,
0.143390953540802,
-0.47961169481277466,
-0.1721053570508957,
-0.0693897157907486,
0.14525845646858215,
0.3938602805137634,
0.4276677966117859,
-0.3333643078804016,
-0.18054884672164917,
0.13778091967105865,
0.386824369430542,
-0.1105964258313179,
-0.190106600522995,
-0.17595285177230835,
-0.4357322156429291,
-0.3615017533302307,
-0.15636833012104034,
-0.16622035205364227,
0.42547351121902466,
-0.027819693088531494,
0.04316265881061554,
0.06729179620742798,
-0.14948557317256927,
-0.09734557569026947,
0.13390986621379852,
0.35451945662498474,
-0.28942859172821045,
0.19009071588516235,
0.055056650191545486,
0.38654786348342896,
0.47349265217781067,
0.7934794425964355,
-0.020332859829068184,
-0.12451893091201782,
0.04798154532909393,
-0.29775741696357727,
0.0039491914212703705,
0.30593422055244446,
-0.06676013767719269,
0.13150739669799805,
-0.33723384141921997,
-0.28521159291267395,
0.1231561228632927,
-0.10100295394659042,
0.35650578141212463,
0.04307284206151962,
-0.07941392809152603,
-0.3222171664237976,
0.24593614041805267,
0.10633992403745651,
-0.08251580595970154,
0.17157752811908722,
0.013219382613897324,
-0.3786398768424988,
0.7430249452590942,
-0.2556389272212982,
1.0368067026138306,
0.004456033930182457,
0.1331993192434311,
0.39942696690559387,
-0.34271299839019775,
0.4143582880496979,
-0.24390588700771332,
0.11179859936237335,
-0.3386250436306,
-0.09771686792373657,
0.019903801381587982,
-0.16440166532993317,
0.12555542588233948,
0.26948094367980957,
-0.09858667850494385,
0.08164266496896744,
0.05214540660381317,
0.21716950833797455,
0.03258981555700302,
0.27012401819229126,
0.2601199746131897,
0.12983252108097076,
-0.4012584388256073,
-0.005264509469270706,
0.02926676534116268,
-0.06807338446378708,
0.03514032065868378,
-0.08107481896877289,
-0.3397371768951416,
-0.5302044749259949,
-0.35073262453079224,
0.14143332839012146,
-0.1931920349597931,
0.14028522372245789,
0.12899357080459595,
-0.11051908135414124,
-0.04660838842391968,
0.11433593928813934,
-0.04692404344677925,
-0.13514776527881622,
-0.08743030577898026,
0.09012673795223236,
-0.02545372024178505,
0.31298574805259705,
-0.02461930550634861,
-0.06076765060424805,
0.3814358115196228,
-0.12717445194721222,
-0.10868094116449356,
0.07417366653680801,
-0.17105601727962494,
-0.31569212675094604,
0.16920511424541473,
0.18719197809696198,
-0.324892520904541,
-0.35906392335891724,
-0.39873674511909485,
-0.16056203842163086,
-0.15958230197429657,
-0.3032997250556946,
0.05166533216834068,
-0.04867015779018402,
-0.05785044655203819,
0.18613645434379578,
0.2312013804912567,
-0.4489627778530121,
-0.025992125272750854,
0.4248579740524292,
0.0928032398223877,
-0.06656302511692047,
0.5180467963218689,
-0.10347690433263779,
0.05756957083940506,
-0.28434616327285767,
0.02438656985759735,
0.13963046669960022,
-0.5100820660591125,
0.13508327305316925,
-0.26653018593788147,
0.134496808052063,
0.21202296018600464,
0.22330261766910553,
0.177329421043396,
0.4816284477710724,
0.17712122201919556,
-0.6883872747421265,
-0.08757632225751877,
0.2675863802433014,
0.25381916761398315,
-0.0020664953626692295,
0.020675018429756165,
0.07599048316478729,
-0.2551763653755188,
0.21066968142986298,
-0.2356049120426178,
0.31248995661735535,
-0.0592522993683815,
0.1713433861732483,
0.1074880063533783,
0.10531062632799149,
0.4985080063343048,
0.1183193027973175,
0.1273719072341919,
0.13983488082885742,
0.032506927847862244,
-0.1091327965259552,
-0.2248837798833847,
0.1681392341852188,
0.11273728311061859,
-0.05632386729121208,
-0.3406289219856262,
-0.09112594276666641,
0.2655707001686096,
-0.10681004077196121,
-0.04723668470978737,
-0.05679114907979965,
-0.07740072160959244,
-0.01303582638502121,
0.07182230800390244,
0.13755527138710022,
-0.21550197899341583,
0.07547321915626526,
-0.2941284775733948,
0.30555260181427,
0.08535479009151459,
0.2171875387430191,
-0.07820621877908707,
-0.008733659982681274,
-0.26135724782943726,
-0.02713189274072647,
0.13271871209144592,
0.19059433043003082,
0.3487906754016876,
-0.26034480333328247,
0.10500296205282211,
-0.10342562198638916,
0.17348000407218933,
0.36122962832450867,
-0.37612465023994446,
-0.08597840368747711,
-0.1833878457546234,
0.13008147478103638,
-0.2672957181930542,
-0.10385827720165253,
0.5432297587394714,
-0.3188050389289856,
-0.053539834916591644,
0.28478527069091797,
0.3223743736743927,
-0.1659020483493805,
-0.17136207222938538,
0.04349842667579651,
0.61893630027771,
0.09631054103374481,
0.21764057874679565,
0.3427690267562866,
-0.03752531856298447,
0.12732896208763123,
-0.08614924550056458,
0.17812776565551758,
0.20069874823093414,
0.18392497301101685,
-0.38545697927474976,
-0.015567276626825333,
0.12802734971046448,
-0.20693586766719818,
-0.039740823209285736,
-0.30059167742729187,
0.3493437170982361,
0.5023258924484253,
-0.03877415135502815,
0.041395243257284164,
-0.03911930322647095,
0.11384624242782593,
-0.09307849407196045,
0.11672006547451019,
0.0768255740404129,
0.1694260686635971,
-0.02125636860728264,
-0.13288931548595428,
-0.032346274703741074,
-0.325337290763855,
-0.3297603726387024,
-0.09056416153907776,
-0.138467937707901,
0.09511709213256836,
0.3174440264701843,
0.14153525233268738,
-0.1604049950838089,
-0.39265501499176025,
0.2680951654911041,
-0.06593365967273712,
0.021603431552648544,
-0.43814021348953247,
0.30132821202278137,
0.03046766109764576,
-0.2516081631183624,
0.4023534059524536,
-0.04873741418123245,
0.4072360396385193,
0.3832011818885803,
0.10976839810609818,
-0.12773801386356354,
-0.3201674222946167,
-0.13908913731575012,
-0.13356070220470428,
0.3059421181678772,
0.04344815015792847,
-0.3885597288608551,
0.20770776271820068,
0.07506640255451202,
-0.032308101654052734,
0.32007819414138794,
0.2924835979938507,
0.10098181664943695,
-0.1815299540758133,
0.29305529594421387,
-0.2649337947368622,
-0.2425040304660797,
-0.1817508339881897,
0.0106734037399292,
-0.059292491525411606,
-0.25086408853530884,
0.35613226890563965,
-0.0792829692363739,
0.30835098028182983,
0.03144233673810959,
0.05872783809900284,
0.08452889323234558,
0.4669100046157837,
0.24165168404579163,
-0.2032032608985901,
-0.2557709813117981,
-0.057624317705631256,
-0.4559786021709442,
0.394247829914093,
-0.1726692169904709,
0.06142578274011612,
0.09042114019393921,
0.12396648526191711,
-0.03243808075785637,
0.01986098662018776,
0.18308545649051666,
0.020220067352056503,
-0.038338083773851395,
0.18408730626106262,
-0.3519144356250763,
-0.28630349040031433,
0.11309381574392319,
0.07932489365339279,
0.06053741276264191,
-0.29971373081207275,
0.30877625942230225,
-0.17730093002319336,
0.04474031180143356,
-0.2316371351480484,
-0.08147358894348145,
0.1843792200088501,
-0.25560519099235535,
0.06595662981271744,
0.017918748781085014,
0.38962092995643616,
-0.12530988454818726,
-0.5042928457260132,
-0.17851069569587708,
-0.35246098041534424,
-0.28110548853874207,
0.5366905927658081,
0.1248292624950409,
0.3189523220062256,
-0.02666211500763893,
0.00964544340968132,
-0.1598462164402008,
0.005758702754974365,
-0.35633915662765503,
-0.38758087158203125,
-0.16918188333511353,
0.016773030161857605,
-0.07085084915161133,
0.25542423129081726,
-0.14620628952980042,
0.1754981428384781,
0.04146329313516617,
0.3886832594871521,
-0.39578521251678467,
-0.360149085521698,
0.276049941778183,
-0.5024653077125549,
-0.13441155850887299,
0.14312812685966492,
0.3050159811973572,
-0.21690785884857178,
0.03420326113700867,
-0.5682093501091003,
0.003696814179420471,
0.5053195953369141,
0.0468362458050251,
-0.24200740456581116,
0.09934410452842712,
0.005938272923231125,
-0.015348285436630249,
0.026318706572055817,
0.018902933225035667,
0.273620069026947,
-0.25859832763671875,
0.17888614535331726,
-0.1267915666103363
] |
https://github.com/huggingface/datasets/issues/6157 | Thanks for reporting, but we can only fix this issue if you can provide a reproducer that consistently reproduces it. | DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding' | ### Describe the bug
When I was in load_dataset, it said "DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'". The second time I ran it, there was no error and the dataset object worked
```python
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[3], line 1
----> 1 dataset = load_dataset(
2 "/home/aihao/workspace/DeepLearningContent/datasets/manga",
3 data_dir="/home/aihao/workspace/DeepLearningContent/datasets/manga",
4 split="train",
5 )
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146), in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2142 # Build dataset for splits
2143 keep_in_memory = (
2144 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
2145 )
-> 2146 ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
2147 # Rename and cast features to match task schema
2148 if task is not None:
2149 # To avoid issuing the same warning twice
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190), in DatasetBuilder.as_dataset(self, split, run_post_process, verification_mode, ignore_verifications, in_memory)
1187 verification_mode = VerificationMode(verification_mode or VerificationMode.BASIC_CHECKS)
1189 # Create a dataset for each of the given splits
-> 1190 datasets = map_nested(
1191 partial(
1192 self._build_single_dataset,
...
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379), in DatasetInfo.copy(self)
378 def copy(self) -> "DatasetInfo":
--> 379 return self.__class__(**{k: copy.deepcopy(v) for k, v in self.__dict__.items()})
TypeError: DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'
```
### Steps to reproduce the bug
/home/aihao/workspace/DeepLearningContent/datasets/images/images.py
```python
from logging import config
import datasets
import os
from PIL import Image
import csv
import json
class ImagesConfig(datasets.BuilderConfig):
def __init__(self, **kwargs):
super(ImagesConfig, self).__init__(**kwargs)
class Images(datasets.GeneratorBasedBuilder):
def _split_generators(self, dl_manager: datasets.DownloadManager):
return [
datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={"split": datasets.Split.TRAIN},
)
]
BUILDER_CONFIGS = [
ImagesConfig(
name="similar_pairs",
description="simliar pair dataset,item is a pair of similar images",
),
ImagesConfig(
name="image_prompt_pairs",
description="image prompt pairs",
),
]
def _info(self):
if self.config.name == "similar_pairs":
return datasets.Features(
{
"image1": datasets.features.Image(),
"image2": datasets.features.Image(),
"similarity": datasets.Value("float32"),
}
)
elif self.config.name == "image_prompt_pairs":
return datasets.Features(
{"image": datasets.features.Image(), "prompt": datasets.Value("string")}
)
def _generate_examples(self, split):
data_path = os.path.join(self.config.data_dir, "data")
if self.config.name == "similar_pairs":
prompts = {}
with open(os.path.join(data_path ,"prompts.json"), "r") as f:
prompts = json.load(f)
with open(os.path.join(data_path, "similar_pairs.csv"), "r") as f:
reader = csv.reader(f)
for row in reader:
image1_path, image2_path, similarity = row
yield image1_path + ":" + image2_path + ":", {
"image1": Image.open(image1_path),
"prompt1": prompts[image1_path],
"image2": Image.open(image2_path),
"prompt2": prompts[image2_path],
"similarity": float(similarity),
}
```
Code that indicates an error:
```python
from datasets import load_dataset
import json
import csv
import ast
import torch
data_dir = "/home/aihao/workspace/DeepLearningContent/datasets/images"
dataset = load_dataset(data_dir, data_dir=data_dir, name="similar_pairs")
```
### Expected behavior
The first execution gives an error, but it works fine
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-6.2.0-26-generic-x86_64-with-glibc2.35
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3 | 20 | DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'
### Describe the bug
When I was in load_dataset, it said "DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'". The second time I ran it, there was no error and the dataset object worked
```python
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[3], line 1
----> 1 dataset = load_dataset(
2 "/home/aihao/workspace/DeepLearningContent/datasets/manga",
3 data_dir="/home/aihao/workspace/DeepLearningContent/datasets/manga",
4 split="train",
5 )
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146), in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2142 # Build dataset for splits
2143 keep_in_memory = (
2144 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
2145 )
-> 2146 ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
2147 # Rename and cast features to match task schema
2148 if task is not None:
2149 # To avoid issuing the same warning twice
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190), in DatasetBuilder.as_dataset(self, split, run_post_process, verification_mode, ignore_verifications, in_memory)
1187 verification_mode = VerificationMode(verification_mode or VerificationMode.BASIC_CHECKS)
1189 # Create a dataset for each of the given splits
-> 1190 datasets = map_nested(
1191 partial(
1192 self._build_single_dataset,
...
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379), in DatasetInfo.copy(self)
378 def copy(self) -> "DatasetInfo":
--> 379 return self.__class__(**{k: copy.deepcopy(v) for k, v in self.__dict__.items()})
TypeError: DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'
```
### Steps to reproduce the bug
/home/aihao/workspace/DeepLearningContent/datasets/images/images.py
```python
from logging import config
import datasets
import os
from PIL import Image
import csv
import json
class ImagesConfig(datasets.BuilderConfig):
def __init__(self, **kwargs):
super(ImagesConfig, self).__init__(**kwargs)
class Images(datasets.GeneratorBasedBuilder):
def _split_generators(self, dl_manager: datasets.DownloadManager):
return [
datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={"split": datasets.Split.TRAIN},
)
]
BUILDER_CONFIGS = [
ImagesConfig(
name="similar_pairs",
description="simliar pair dataset,item is a pair of similar images",
),
ImagesConfig(
name="image_prompt_pairs",
description="image prompt pairs",
),
]
def _info(self):
if self.config.name == "similar_pairs":
return datasets.Features(
{
"image1": datasets.features.Image(),
"image2": datasets.features.Image(),
"similarity": datasets.Value("float32"),
}
)
elif self.config.name == "image_prompt_pairs":
return datasets.Features(
{"image": datasets.features.Image(), "prompt": datasets.Value("string")}
)
def _generate_examples(self, split):
data_path = os.path.join(self.config.data_dir, "data")
if self.config.name == "similar_pairs":
prompts = {}
with open(os.path.join(data_path ,"prompts.json"), "r") as f:
prompts = json.load(f)
with open(os.path.join(data_path, "similar_pairs.csv"), "r") as f:
reader = csv.reader(f)
for row in reader:
image1_path, image2_path, similarity = row
yield image1_path + ":" + image2_path + ":", {
"image1": Image.open(image1_path),
"prompt1": prompts[image1_path],
"image2": Image.open(image2_path),
"prompt2": prompts[image2_path],
"similarity": float(similarity),
}
```
Code that indicates an error:
```python
from datasets import load_dataset
import json
import csv
import ast
import torch
data_dir = "/home/aihao/workspace/DeepLearningContent/datasets/images"
dataset = load_dataset(data_dir, data_dir=data_dir, name="similar_pairs")
```
### Expected behavior
The first execution gives an error, but it works fine
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-6.2.0-26-generic-x86_64-with-glibc2.35
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
Thanks for reporting, but we can only fix this issue if you can provide a reproducer that consistently reproduces it. | [
-0.07070029526948929,
-0.11540171504020691,
0.006694383919239044,
0.35483965277671814,
0.5811512470245361,
0.26537662744522095,
0.13077785074710846,
0.37581178545951843,
-0.23715856671333313,
0.07963988929986954,
0.06881711632013321,
0.3887733519077301,
-0.0750109851360321,
0.3504210412502289,
0.010802865028381348,
-0.26599445939064026,
0.06241599842905998,
0.3554588556289673,
-0.27257367968559265,
0.07664310187101364,
-0.39239227771759033,
0.3850339949131012,
-0.5596711039543152,
-0.12456786632537842,
0.07355214655399323,
-0.08091731369495392,
-0.16728973388671875,
0.17824172973632812,
-0.17621755599975586,
-0.505584180355072,
0.24178168177604675,
-0.1263563185930252,
0.20765769481658936,
0.4656551778316498,
-0.00011479162640171126,
0.1300894320011139,
0.1693420261144638,
-0.191647469997406,
-0.4818935990333557,
-0.18278445303440094,
-0.42340999841690063,
-0.3686598837375641,
0.021593987941741943,
-0.32046544551849365,
-0.13756026327610016,
-0.2946101129055023,
-0.25731703639030457,
-0.6029804348945618,
0.3542990982532501,
0.4759308397769928,
0.19574692845344543,
0.27641841769218445,
0.016931340098381042,
-0.15270501375198364,
0.0443914458155632,
0.017476502805948257,
-0.26956260204315186,
0.11507286131381989,
-0.07260840386152267,
0.0773690864443779,
0.1556115746498108,
0.31896671652793884,
0.11369472742080688,
0.22951701283454895,
0.3821064233779907,
0.03631053864955902,
-0.006869908422231674,
-0.24498309195041656,
0.03581338748335838,
0.0314113013446331,
0.5522449016571045,
-0.24538227915763855,
-0.24418017268180847,
-0.1859855204820633,
-0.07566136121749878,
-0.3821980059146881,
0.24201373755931854,
0.01775040104985237,
-0.023735955357551575,
0.3677349090576172,
0.1424391269683838,
-0.0476306788623333,
-0.07556041330099106,
-0.041191838681697845,
-0.022481605410575867,
-0.1467212587594986,
-0.16477513313293457,
0.17058232426643372,
0.22174297273159027,
-0.01699879951775074,
0.0904935821890831,
0.0616423636674881,
-0.3246755599975586,
0.11866932362318039,
-0.3849504590034485,
-0.14327594637870789,
-0.029970496892929077,
0.06632857024669647,
0.19965142011642456,
-0.0635453462600708,
-0.26171964406967163,
-0.1442011594772339,
0.21022261679172516,
0.09406594187021255,
0.2270517796278,
0.15502209961414337,
0.12009094655513763,
0.2588718831539154,
-0.019052626565098763,
-0.2073211818933487,
-0.10736165940761566,
-0.16628998517990112,
-0.07147905975580215,
-0.05507403984665871,
0.346168577671051,
0.08931301534175873,
0.47108036279678345,
-0.14513638615608215,
-0.24749788641929626,
0.09681481868028641,
-0.17244768142700195,
-0.14148765802383423,
-0.09515707194805145,
0.3479653298854828,
0.3728860020637512,
0.3912353217601776,
0.20510205626487732,
0.2854972183704376,
0.04222942888736725,
-0.6152735948562622,
-0.21168331801891327,
0.04428761452436447,
-0.23029838502407074,
0.031123235821723938,
-0.005640037357807159,
0.03197161480784416,
0.07527164369821548,
0.18947070837020874,
-0.02635136991739273,
-0.2949342131614685,
0.11111520975828171,
-0.24708618223667145,
-0.0220322385430336,
0.02695191465318203,
-0.028744075447320938,
0.13847079873085022,
0.4819733500480652,
-0.10695802420377731,
-0.15624003112316132,
0.05717552453279495,
-0.33822667598724365,
-0.45749205350875854,
-0.42315182089805603,
0.19088250398635864,
0.0030022040009498596,
-0.0146616380661726,
-0.31331124901771545,
0.05377133563160896,
0.21132923662662506,
-0.20890586078166962,
-0.2293064147233963,
-0.3495498299598694,
-0.21973058581352234,
-0.17366652190685272,
0.18035949766635895,
0.36688488721847534,
-0.47540393471717834,
0.10643324255943298,
-0.09987999498844147,
-0.11037078499794006,
0.12210451811552048,
0.06272026896476746,
-0.35976362228393555,
0.42199277877807617,
-0.216512531042099,
-0.07360229641199112,
0.3589792847633362,
-0.38053494691848755,
-0.33264946937561035,
0.41926831007003784,
0.035168275237083435,
0.1236029714345932,
0.14745494723320007,
-0.03447813168168068,
0.12427615374326706,
-0.11320139467716217,
-0.004911784082651138,
0.19825726747512817,
-0.03752211108803749,
0.1764364391565323,
-0.17685580253601074,
-0.13858366012573242,
0.23645097017288208,
0.09743712842464447,
0.10850566625595093,
0.18798217177391052,
-0.06910140812397003,
0.10452422499656677,
0.1104094535112381,
-0.02690098062157631,
-0.12605063617229462,
0.23959806561470032,
-0.0011756508611142635,
0.10907405614852905,
0.26906442642211914,
-0.08181021362543106,
-0.4488169848918915,
0.2490074187517166,
0.31329038739204407,
0.07620657980442047,
-0.3418406546115875,
-0.18824872374534607,
-0.4166206419467926,
-0.004168964922428131,
-0.1973992884159088,
0.12320780754089355,
0.15305769443511963,
0.16185788810253143,
-0.18228040635585785,
0.003125719726085663,
-0.24914517998695374,
0.12847961485385895,
-0.19989418983459473,
-0.016030631959438324,
-0.025896381586790085,
0.12878161668777466,
-0.22603526711463928,
0.012772195041179657,
0.09077498316764832,
0.011567749083042145,
0.31025296449661255,
-0.15249766409397125,
-0.2585323750972748,
0.45949414372444153,
0.15624791383743286,
-0.04745873808860779,
-0.3295535445213318,
-0.13898614048957825,
-0.11819716542959213,
-0.2866854965686798,
-0.07870051264762878,
-0.18027031421661377,
0.4042471647262573,
-0.05839144065976143,
0.07256309688091278,
0.14941540360450745,
0.22447343170642853,
0.21048372983932495,
-0.039810601621866226,
-0.05240296199917793,
0.2763248085975647,
-0.13677871227264404,
-0.11171187460422516,
-0.43130767345428467,
0.1207641214132309,
-0.11179779469966888,
0.06629311293363571,
-0.011639437638223171,
-0.17027772963047028,
-0.14056657254695892,
0.5797865390777588,
0.13184458017349243,
0.1296686977148056,
0.030339621007442474,
-0.029596589505672455,
0.05540803074836731,
-0.11129982769489288,
0.2809083163738251,
0.6012133359909058,
0.02990793064236641,
-0.20613253116607666,
0.06977403163909912,
0.07402460277080536,
0.007573585957288742,
0.16458337008953094,
0.1323767453432083,
0.27220797538757324,
0.16514235734939575,
0.08789701759815216,
0.11491662263870239,
-0.2300560176372528,
0.022391825914382935,
0.32887569069862366,
0.3023911416530609,
-0.47253498435020447,
0.21670237183570862,
-0.39083683490753174,
-0.26406118273735046,
-0.11149963736534119,
0.04577723145484924,
0.26788902282714844,
-0.445814311504364,
-0.24836516380310059,
-0.16174378991127014,
0.06185130774974823,
0.24516364932060242,
-0.38238388299942017,
0.24038627743721008,
-0.09656307846307755,
-0.1587991714477539,
0.04962736368179321,
-0.24415330588817596,
-0.05627301335334778,
-0.006671518087387085,
0.2513587772846222,
-0.2507084608078003,
0.33967170119285583,
-0.26436764001846313,
-0.07759428024291992,
-0.11280127614736557,
-0.17989030480384827,
0.3131224811077118,
-0.2836134135723114,
0.354221373796463,
0.19339600205421448,
0.32849937677383423,
0.2471460998058319,
-0.19274649024009705,
0.4476488530635834,
0.15750476717948914,
0.00410827249288559,
0.20834192633628845,
0.05866518244147301,
-0.23808571696281433,
-0.19740277528762817,
-0.40303415060043335,
-0.11609335243701935,
-0.3366469144821167,
-0.1959540694952011,
-0.11199335753917694,
0.008076902478933334,
0.06271426379680634,
0.03884357959032059,
0.16209140419960022,
0.21492278575897217,
0.14923718571662903,
-0.2710900902748108,
-0.11182089149951935,
0.20159687101840973,
-0.06428411602973938,
-0.20425660908222198,
0.047712430357933044,
-0.043298106640577316,
0.2892319858074188,
-0.0035003162920475006,
-0.42780017852783203,
-0.026873789727687836,
-0.34967347979545593,
0.3373104929924011,
-0.2425673007965088,
-0.14801229536533356,
0.20214961469173431,
0.05149473249912262,
0.05539971962571144,
-0.19972437620162964,
-0.2828601598739624,
0.16345417499542236,
-0.024957187473773956,
0.19488584995269775,
0.1672276258468628,
0.8209006786346436,
-0.06943017244338989,
0.36995255947113037,
-0.020276691764593124,
-0.13649548590183258,
0.47261717915534973,
-0.23636703193187714,
0.32619524002075195,
-0.19011156260967255,
-0.2949039936065674,
-0.08874168246984482,
-0.23355881869792938,
-0.034699950367212296,
-0.0655050128698349,
-0.19649137556552887,
-0.2568719685077667,
-0.18467473983764648,
0.08116970211267471,
-0.40044963359832764,
-0.12933537364006042,
0.23510003089904785,
-0.36249738931655884,
0.11578776687383652,
-0.041706692427396774,
0.33364763855934143,
-0.12545114755630493,
0.18842390179634094,
-0.017640989273786545,
0.14875414967536926,
0.16230586171150208,
-0.04839974269270897,
-0.27833303809165955,
-0.14302203059196472,
-0.06564294546842575,
0.15890079736709595,
-0.06931918114423752,
0.46842116117477417,
-0.08550431579351425,
0.05284910649061203,
0.12530939280986786,
-0.03240267187356949,
0.5128427147865295,
-0.18287025392055511,
-0.01803828403353691,
0.14133647084236145,
0.22417137026786804,
-0.14485934376716614,
-0.19999417662620544,
-0.1718306839466095,
0.1590501219034195,
0.050198037177324295,
0.39346516132354736,
-0.28235098719596863,
-0.06802847236394882,
0.4073392450809479,
0.22992421686649323,
-0.246763214468956,
-0.11938850581645966,
-0.2965717911720276,
-0.6421763896942139,
-0.40441352128982544,
0.0018890872597694397,
0.2235005795955658,
0.17287775874137878,
0.10950702428817749,
0.3510645627975464,
-0.22674785554409027,
-0.17921701073646545,
0.15829673409461975,
0.18602029979228973,
0.27381935715675354,
-0.027625616639852524,
0.24644939601421356,
-0.036949217319488525,
0.06576648354530334,
0.21468393504619598,
0.6211022138595581,
-0.08652357757091522,
-0.4355189800262451,
-0.0780823677778244,
-0.2128516137599945,
0.4356660842895508,
0.10831031948328018,
-0.22959454357624054,
0.19099265336990356,
-0.1627090871334076,
0.015296390280127525,
-0.3176906406879425,
-0.01063762977719307,
0.654777467250824,
-0.12235639989376068,
-0.4831167757511139,
-0.6786954402923584,
0.5413047671318054,
-0.03537043184041977,
-0.09980350732803345,
0.34746548533439636,
0.46791866421699524,
-0.23933938145637512,
0.47865691781044006,
-0.1178295761346817,
0.8088359236717224,
0.28793269395828247,
-0.09152112901210785,
0.41694676876068115,
-0.05191541835665703,
0.10770296305418015,
0.08281609416007996,
0.20265257358551025,
-0.26450687646865845,
-0.31520354747772217,
-0.08112920820713043,
-0.06290368735790253,
0.1904078722000122,
-0.1486048847436905,
-0.5318316221237183,
0.10642368346452713,
-0.382985919713974,
0.15747657418251038,
-0.0034655481576919556,
0.13590414822101593,
-0.19743233919143677,
-0.011521434411406517,
-0.05286763608455658,
0.1661379635334015,
-0.04875881224870682,
0.12037627398967743,
0.04363381862640381,
-0.119090735912323,
0.05861520767211914,
-0.30178725719451904,
-0.414497971534729,
0.16163773834705353,
-0.07467249035835266,
0.31625205278396606,
-0.130738765001297,
-0.1273917853832245,
0.43506693840026855,
0.33925458788871765,
0.27436038851737976,
0.11674563586711884,
-0.0022079795598983765,
0.2940897047519684,
0.15158268809318542,
-0.06335994601249695,
-0.018206171691417694,
0.014717113226652145,
0.21847468614578247,
0.07488002628087997,
-0.24165096879005432,
0.3551171123981476,
-0.1638389527797699,
-0.20990778505802155,
-0.1419745236635208,
-0.052132848650217056,
0.06241951137781143,
-0.539549708366394,
-0.317965030670166,
0.041460100561380386,
0.06274150311946869,
-0.15285730361938477,
0.13728678226470947,
-0.14475221931934357,
0.022631525993347168,
0.2404552698135376,
-0.22819757461547852,
-0.27345404028892517,
0.058191195130348206,
0.10372811555862427,
0.17803117632865906,
0.2572677731513977,
0.781903088092804,
0.21465091407299042,
-0.05973692983388901,
-0.24066300690174103,
0.4480476975440979,
0.003064848482608795,
-0.17765556275844574,
0.269491046667099,
0.08581310510635376,
0.15662066638469696,
0.10284744948148727,
0.277896910905838,
0.07699079811573029,
-0.10394886136054993,
-0.06549680233001709,
-0.23677216470241547,
0.030925758183002472,
0.09168069064617157,
-0.08804009854793549,
0.061151549220085144,
-0.06734275817871094,
0.15448759496212006,
-0.0034667998552322388,
0.21343038976192474,
-0.30256205797195435,
0.046452321112155914,
-0.19562649726867676,
0.08149453997612,
0.31722885370254517,
0.23556804656982422,
0.22187194228172302,
-0.17591232061386108,
0.08482512831687927,
0.19861827790737152,
-0.022389456629753113,
-0.12799492478370667,
-0.28608253598213196,
0.139133021235466,
-0.03188733756542206,
0.10402894765138626,
-0.111893430352211,
-0.21487170457839966,
-0.10717341303825378,
-0.06573796272277832,
0.06661426275968552,
0.07707783579826355,
-0.028671953827142715,
0.43537604808807373,
0.046277809888124466,
0.1470007449388504,
-0.10099510848522186,
0.13415497541427612,
-0.11098631471395493,
0.26883214712142944,
0.07439690828323364,
0.12718740105628967,
0.09815986454486847,
0.05583948642015457,
-0.44027072191238403,
0.18544456362724304,
-0.13028644025325775,
0.0069730766117572784,
0.31674543023109436,
-0.2733885943889618,
0.2023896723985672,
0.032999876886606216,
0.029223397374153137,
0.3066404461860657,
-0.41146793961524963,
0.08539064973592758,
-0.10291978716850281,
0.16471554338932037,
-0.23669591546058655,
-0.03969055414199829,
-0.20071321725845337,
-0.08292719721794128,
0.0947810485959053,
0.2829931080341339,
-0.03365757316350937,
0.050606563687324524,
-0.3422643542289734,
-0.16419300436973572,
0.6340544819831848,
-0.058073464781045914,
0.25241005420684814,
0.5857937335968018,
-0.035386793315410614,
-0.06319401413202286,
0.3330034017562866,
0.1837904453277588,
0.12923119962215424,
0.4995455741882324,
-0.2970971465110779,
0.11500553041696548,
0.19895535707473755,
0.2540436089038849,
-0.09150370955467224,
-0.1165090799331665,
0.3329847455024719,
0.41502511501312256,
-0.1082146018743515,
-0.012223485857248306,
-0.07103541493415833,
0.03989537060260773,
-0.3586527705192566,
-0.07570657879114151,
-0.3971538543701172,
0.010438567027449608,
-0.15887048840522766,
-0.005254045128822327,
-0.2990977168083191,
-0.17625343799591064,
-0.4160192608833313,
-0.046858493238687515,
-0.11094720661640167,
-0.07780630886554718,
0.27775856852531433,
0.08117733895778656,
0.05737565830349922,
-0.06308840215206146,
0.05163354054093361,
0.2166464626789093,
0.16213393211364746,
-0.5012911558151245,
0.40576139092445374,
0.3028249442577362,
0.11382725834846497,
0.3755130469799042,
0.19796724617481232,
0.5795485377311707,
0.5169925689697266,
-0.029978904873132706,
-0.19756492972373962,
0.00230368971824646,
-0.262483149766922,
0.12255019694566727,
0.27535563707351685,
-0.2812947928905487,
0.5639821290969849,
0.33594486117362976,
0.1880238950252533,
-0.15815600752830505,
0.013485528528690338,
0.2036563903093338,
0.3686160743236542,
-0.4007744789123535,
0.5033644437789917,
-0.24769876897335052,
-0.06420111656188965,
-0.1305515319108963,
0.06017602980136871,
-0.2144031524658203,
-0.046546898782253265,
0.31180593371391296,
0.11506509780883789,
0.11171726882457733,
0.09560948610305786,
0.0906086191534996,
0.14745628833770752,
0.458395779132843,
0.2515981197357178,
-0.13788653910160065,
-0.48336729407310486,
-0.20708006620407104,
-0.6902254819869995,
-0.0814477950334549,
-0.24450592696666718,
-0.49004969000816345,
0.1218118816614151,
0.1752672791481018,
0.35737138986587524,
0.34270837903022766,
-0.0001067817211151123,
0.30345073342323303,
-0.2355589121580124,
0.054484955966472626,
-0.30625438690185547,
-0.3532562553882599,
0.04249349236488342,
0.06738003343343735,
-0.1603924036026001,
-0.3568378686904907,
0.14241786301136017,
0.2410283237695694,
0.06858707219362259,
-0.18605543673038483,
-0.1491060107946396,
0.19588790833950043,
-0.42789191007614136,
0.43579062819480896,
0.07753989845514297,
0.5311054587364197,
-0.07475375384092331,
-0.23476797342300415,
0.016203058883547783,
-0.5138431787490845,
-0.3377377390861511,
0.021064529195427895,
0.17035722732543945,
0.28367459774017334,
-0.08696964383125305,
0.07213275134563446,
-0.2623671293258667,
0.0792887806892395,
-0.03222059831023216,
0.1206437200307846,
-0.3665316104888916,
0.2208767831325531,
-0.03919346630573273,
-0.0007525719702243805,
0.08671741187572479,
0.14793655276298523,
0.062093812972307205,
0.30313485860824585,
-0.1354074478149414,
-0.3530300259590149,
0.41311872005462646,
-0.09793254733085632,
-0.2819955050945282,
0.03156706690788269,
0.07113666832447052,
-0.07734885066747665,
0.10277733206748962,
-0.5570218563079834,
-0.014322400093078613,
0.3744313418865204,
-0.057601120322942734,
-0.09791050851345062,
0.3266601860523224,
0.272071897983551,
0.10237859934568405,
-0.004661343991756439,
0.14781683683395386,
-0.07056959718465805,
-0.18000271916389465,
-0.019132502377033234,
-0.01366957277059555
] |
https://github.com/huggingface/datasets/issues/6157 | Does this error occur even if you change the cache directory (the `cache_dir` parameter in `load_dataset`)? | DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding' | ### Describe the bug
When I was in load_dataset, it said "DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'". The second time I ran it, there was no error and the dataset object worked
```python
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[3], line 1
----> 1 dataset = load_dataset(
2 "/home/aihao/workspace/DeepLearningContent/datasets/manga",
3 data_dir="/home/aihao/workspace/DeepLearningContent/datasets/manga",
4 split="train",
5 )
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146), in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2142 # Build dataset for splits
2143 keep_in_memory = (
2144 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
2145 )
-> 2146 ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
2147 # Rename and cast features to match task schema
2148 if task is not None:
2149 # To avoid issuing the same warning twice
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190), in DatasetBuilder.as_dataset(self, split, run_post_process, verification_mode, ignore_verifications, in_memory)
1187 verification_mode = VerificationMode(verification_mode or VerificationMode.BASIC_CHECKS)
1189 # Create a dataset for each of the given splits
-> 1190 datasets = map_nested(
1191 partial(
1192 self._build_single_dataset,
...
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379), in DatasetInfo.copy(self)
378 def copy(self) -> "DatasetInfo":
--> 379 return self.__class__(**{k: copy.deepcopy(v) for k, v in self.__dict__.items()})
TypeError: DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'
```
### Steps to reproduce the bug
/home/aihao/workspace/DeepLearningContent/datasets/images/images.py
```python
from logging import config
import datasets
import os
from PIL import Image
import csv
import json
class ImagesConfig(datasets.BuilderConfig):
def __init__(self, **kwargs):
super(ImagesConfig, self).__init__(**kwargs)
class Images(datasets.GeneratorBasedBuilder):
def _split_generators(self, dl_manager: datasets.DownloadManager):
return [
datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={"split": datasets.Split.TRAIN},
)
]
BUILDER_CONFIGS = [
ImagesConfig(
name="similar_pairs",
description="simliar pair dataset,item is a pair of similar images",
),
ImagesConfig(
name="image_prompt_pairs",
description="image prompt pairs",
),
]
def _info(self):
if self.config.name == "similar_pairs":
return datasets.Features(
{
"image1": datasets.features.Image(),
"image2": datasets.features.Image(),
"similarity": datasets.Value("float32"),
}
)
elif self.config.name == "image_prompt_pairs":
return datasets.Features(
{"image": datasets.features.Image(), "prompt": datasets.Value("string")}
)
def _generate_examples(self, split):
data_path = os.path.join(self.config.data_dir, "data")
if self.config.name == "similar_pairs":
prompts = {}
with open(os.path.join(data_path ,"prompts.json"), "r") as f:
prompts = json.load(f)
with open(os.path.join(data_path, "similar_pairs.csv"), "r") as f:
reader = csv.reader(f)
for row in reader:
image1_path, image2_path, similarity = row
yield image1_path + ":" + image2_path + ":", {
"image1": Image.open(image1_path),
"prompt1": prompts[image1_path],
"image2": Image.open(image2_path),
"prompt2": prompts[image2_path],
"similarity": float(similarity),
}
```
Code that indicates an error:
```python
from datasets import load_dataset
import json
import csv
import ast
import torch
data_dir = "/home/aihao/workspace/DeepLearningContent/datasets/images"
dataset = load_dataset(data_dir, data_dir=data_dir, name="similar_pairs")
```
### Expected behavior
The first execution gives an error, but it works fine
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-6.2.0-26-generic-x86_64-with-glibc2.35
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3 | 16 | DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'
### Describe the bug
When I was in load_dataset, it said "DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'". The second time I ran it, there was no error and the dataset object worked
```python
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[3], line 1
----> 1 dataset = load_dataset(
2 "/home/aihao/workspace/DeepLearningContent/datasets/manga",
3 data_dir="/home/aihao/workspace/DeepLearningContent/datasets/manga",
4 split="train",
5 )
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146), in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2142 # Build dataset for splits
2143 keep_in_memory = (
2144 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
2145 )
-> 2146 ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
2147 # Rename and cast features to match task schema
2148 if task is not None:
2149 # To avoid issuing the same warning twice
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190), in DatasetBuilder.as_dataset(self, split, run_post_process, verification_mode, ignore_verifications, in_memory)
1187 verification_mode = VerificationMode(verification_mode or VerificationMode.BASIC_CHECKS)
1189 # Create a dataset for each of the given splits
-> 1190 datasets = map_nested(
1191 partial(
1192 self._build_single_dataset,
...
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379), in DatasetInfo.copy(self)
378 def copy(self) -> "DatasetInfo":
--> 379 return self.__class__(**{k: copy.deepcopy(v) for k, v in self.__dict__.items()})
TypeError: DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'
```
### Steps to reproduce the bug
/home/aihao/workspace/DeepLearningContent/datasets/images/images.py
```python
from logging import config
import datasets
import os
from PIL import Image
import csv
import json
class ImagesConfig(datasets.BuilderConfig):
def __init__(self, **kwargs):
super(ImagesConfig, self).__init__(**kwargs)
class Images(datasets.GeneratorBasedBuilder):
def _split_generators(self, dl_manager: datasets.DownloadManager):
return [
datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={"split": datasets.Split.TRAIN},
)
]
BUILDER_CONFIGS = [
ImagesConfig(
name="similar_pairs",
description="simliar pair dataset,item is a pair of similar images",
),
ImagesConfig(
name="image_prompt_pairs",
description="image prompt pairs",
),
]
def _info(self):
if self.config.name == "similar_pairs":
return datasets.Features(
{
"image1": datasets.features.Image(),
"image2": datasets.features.Image(),
"similarity": datasets.Value("float32"),
}
)
elif self.config.name == "image_prompt_pairs":
return datasets.Features(
{"image": datasets.features.Image(), "prompt": datasets.Value("string")}
)
def _generate_examples(self, split):
data_path = os.path.join(self.config.data_dir, "data")
if self.config.name == "similar_pairs":
prompts = {}
with open(os.path.join(data_path ,"prompts.json"), "r") as f:
prompts = json.load(f)
with open(os.path.join(data_path, "similar_pairs.csv"), "r") as f:
reader = csv.reader(f)
for row in reader:
image1_path, image2_path, similarity = row
yield image1_path + ":" + image2_path + ":", {
"image1": Image.open(image1_path),
"prompt1": prompts[image1_path],
"image2": Image.open(image2_path),
"prompt2": prompts[image2_path],
"similarity": float(similarity),
}
```
Code that indicates an error:
```python
from datasets import load_dataset
import json
import csv
import ast
import torch
data_dir = "/home/aihao/workspace/DeepLearningContent/datasets/images"
dataset = load_dataset(data_dir, data_dir=data_dir, name="similar_pairs")
```
### Expected behavior
The first execution gives an error, but it works fine
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-6.2.0-26-generic-x86_64-with-glibc2.35
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
Does this error occur even if you change the cache directory (the `cache_dir` parameter in `load_dataset`)? | [
-0.07070029526948929,
-0.11540171504020691,
0.006694383919239044,
0.35483965277671814,
0.5811512470245361,
0.26537662744522095,
0.13077785074710846,
0.37581178545951843,
-0.23715856671333313,
0.07963988929986954,
0.06881711632013321,
0.3887733519077301,
-0.0750109851360321,
0.3504210412502289,
0.010802865028381348,
-0.26599445939064026,
0.06241599842905998,
0.3554588556289673,
-0.27257367968559265,
0.07664310187101364,
-0.39239227771759033,
0.3850339949131012,
-0.5596711039543152,
-0.12456786632537842,
0.07355214655399323,
-0.08091731369495392,
-0.16728973388671875,
0.17824172973632812,
-0.17621755599975586,
-0.505584180355072,
0.24178168177604675,
-0.1263563185930252,
0.20765769481658936,
0.4656551778316498,
-0.00011479162640171126,
0.1300894320011139,
0.1693420261144638,
-0.191647469997406,
-0.4818935990333557,
-0.18278445303440094,
-0.42340999841690063,
-0.3686598837375641,
0.021593987941741943,
-0.32046544551849365,
-0.13756026327610016,
-0.2946101129055023,
-0.25731703639030457,
-0.6029804348945618,
0.3542990982532501,
0.4759308397769928,
0.19574692845344543,
0.27641841769218445,
0.016931340098381042,
-0.15270501375198364,
0.0443914458155632,
0.017476502805948257,
-0.26956260204315186,
0.11507286131381989,
-0.07260840386152267,
0.0773690864443779,
0.1556115746498108,
0.31896671652793884,
0.11369472742080688,
0.22951701283454895,
0.3821064233779907,
0.03631053864955902,
-0.006869908422231674,
-0.24498309195041656,
0.03581338748335838,
0.0314113013446331,
0.5522449016571045,
-0.24538227915763855,
-0.24418017268180847,
-0.1859855204820633,
-0.07566136121749878,
-0.3821980059146881,
0.24201373755931854,
0.01775040104985237,
-0.023735955357551575,
0.3677349090576172,
0.1424391269683838,
-0.0476306788623333,
-0.07556041330099106,
-0.041191838681697845,
-0.022481605410575867,
-0.1467212587594986,
-0.16477513313293457,
0.17058232426643372,
0.22174297273159027,
-0.01699879951775074,
0.0904935821890831,
0.0616423636674881,
-0.3246755599975586,
0.11866932362318039,
-0.3849504590034485,
-0.14327594637870789,
-0.029970496892929077,
0.06632857024669647,
0.19965142011642456,
-0.0635453462600708,
-0.26171964406967163,
-0.1442011594772339,
0.21022261679172516,
0.09406594187021255,
0.2270517796278,
0.15502209961414337,
0.12009094655513763,
0.2588718831539154,
-0.019052626565098763,
-0.2073211818933487,
-0.10736165940761566,
-0.16628998517990112,
-0.07147905975580215,
-0.05507403984665871,
0.346168577671051,
0.08931301534175873,
0.47108036279678345,
-0.14513638615608215,
-0.24749788641929626,
0.09681481868028641,
-0.17244768142700195,
-0.14148765802383423,
-0.09515707194805145,
0.3479653298854828,
0.3728860020637512,
0.3912353217601776,
0.20510205626487732,
0.2854972183704376,
0.04222942888736725,
-0.6152735948562622,
-0.21168331801891327,
0.04428761452436447,
-0.23029838502407074,
0.031123235821723938,
-0.005640037357807159,
0.03197161480784416,
0.07527164369821548,
0.18947070837020874,
-0.02635136991739273,
-0.2949342131614685,
0.11111520975828171,
-0.24708618223667145,
-0.0220322385430336,
0.02695191465318203,
-0.028744075447320938,
0.13847079873085022,
0.4819733500480652,
-0.10695802420377731,
-0.15624003112316132,
0.05717552453279495,
-0.33822667598724365,
-0.45749205350875854,
-0.42315182089805603,
0.19088250398635864,
0.0030022040009498596,
-0.0146616380661726,
-0.31331124901771545,
0.05377133563160896,
0.21132923662662506,
-0.20890586078166962,
-0.2293064147233963,
-0.3495498299598694,
-0.21973058581352234,
-0.17366652190685272,
0.18035949766635895,
0.36688488721847534,
-0.47540393471717834,
0.10643324255943298,
-0.09987999498844147,
-0.11037078499794006,
0.12210451811552048,
0.06272026896476746,
-0.35976362228393555,
0.42199277877807617,
-0.216512531042099,
-0.07360229641199112,
0.3589792847633362,
-0.38053494691848755,
-0.33264946937561035,
0.41926831007003784,
0.035168275237083435,
0.1236029714345932,
0.14745494723320007,
-0.03447813168168068,
0.12427615374326706,
-0.11320139467716217,
-0.004911784082651138,
0.19825726747512817,
-0.03752211108803749,
0.1764364391565323,
-0.17685580253601074,
-0.13858366012573242,
0.23645097017288208,
0.09743712842464447,
0.10850566625595093,
0.18798217177391052,
-0.06910140812397003,
0.10452422499656677,
0.1104094535112381,
-0.02690098062157631,
-0.12605063617229462,
0.23959806561470032,
-0.0011756508611142635,
0.10907405614852905,
0.26906442642211914,
-0.08181021362543106,
-0.4488169848918915,
0.2490074187517166,
0.31329038739204407,
0.07620657980442047,
-0.3418406546115875,
-0.18824872374534607,
-0.4166206419467926,
-0.004168964922428131,
-0.1973992884159088,
0.12320780754089355,
0.15305769443511963,
0.16185788810253143,
-0.18228040635585785,
0.003125719726085663,
-0.24914517998695374,
0.12847961485385895,
-0.19989418983459473,
-0.016030631959438324,
-0.025896381586790085,
0.12878161668777466,
-0.22603526711463928,
0.012772195041179657,
0.09077498316764832,
0.011567749083042145,
0.31025296449661255,
-0.15249766409397125,
-0.2585323750972748,
0.45949414372444153,
0.15624791383743286,
-0.04745873808860779,
-0.3295535445213318,
-0.13898614048957825,
-0.11819716542959213,
-0.2866854965686798,
-0.07870051264762878,
-0.18027031421661377,
0.4042471647262573,
-0.05839144065976143,
0.07256309688091278,
0.14941540360450745,
0.22447343170642853,
0.21048372983932495,
-0.039810601621866226,
-0.05240296199917793,
0.2763248085975647,
-0.13677871227264404,
-0.11171187460422516,
-0.43130767345428467,
0.1207641214132309,
-0.11179779469966888,
0.06629311293363571,
-0.011639437638223171,
-0.17027772963047028,
-0.14056657254695892,
0.5797865390777588,
0.13184458017349243,
0.1296686977148056,
0.030339621007442474,
-0.029596589505672455,
0.05540803074836731,
-0.11129982769489288,
0.2809083163738251,
0.6012133359909058,
0.02990793064236641,
-0.20613253116607666,
0.06977403163909912,
0.07402460277080536,
0.007573585957288742,
0.16458337008953094,
0.1323767453432083,
0.27220797538757324,
0.16514235734939575,
0.08789701759815216,
0.11491662263870239,
-0.2300560176372528,
0.022391825914382935,
0.32887569069862366,
0.3023911416530609,
-0.47253498435020447,
0.21670237183570862,
-0.39083683490753174,
-0.26406118273735046,
-0.11149963736534119,
0.04577723145484924,
0.26788902282714844,
-0.445814311504364,
-0.24836516380310059,
-0.16174378991127014,
0.06185130774974823,
0.24516364932060242,
-0.38238388299942017,
0.24038627743721008,
-0.09656307846307755,
-0.1587991714477539,
0.04962736368179321,
-0.24415330588817596,
-0.05627301335334778,
-0.006671518087387085,
0.2513587772846222,
-0.2507084608078003,
0.33967170119285583,
-0.26436764001846313,
-0.07759428024291992,
-0.11280127614736557,
-0.17989030480384827,
0.3131224811077118,
-0.2836134135723114,
0.354221373796463,
0.19339600205421448,
0.32849937677383423,
0.2471460998058319,
-0.19274649024009705,
0.4476488530635834,
0.15750476717948914,
0.00410827249288559,
0.20834192633628845,
0.05866518244147301,
-0.23808571696281433,
-0.19740277528762817,
-0.40303415060043335,
-0.11609335243701935,
-0.3366469144821167,
-0.1959540694952011,
-0.11199335753917694,
0.008076902478933334,
0.06271426379680634,
0.03884357959032059,
0.16209140419960022,
0.21492278575897217,
0.14923718571662903,
-0.2710900902748108,
-0.11182089149951935,
0.20159687101840973,
-0.06428411602973938,
-0.20425660908222198,
0.047712430357933044,
-0.043298106640577316,
0.2892319858074188,
-0.0035003162920475006,
-0.42780017852783203,
-0.026873789727687836,
-0.34967347979545593,
0.3373104929924011,
-0.2425673007965088,
-0.14801229536533356,
0.20214961469173431,
0.05149473249912262,
0.05539971962571144,
-0.19972437620162964,
-0.2828601598739624,
0.16345417499542236,
-0.024957187473773956,
0.19488584995269775,
0.1672276258468628,
0.8209006786346436,
-0.06943017244338989,
0.36995255947113037,
-0.020276691764593124,
-0.13649548590183258,
0.47261717915534973,
-0.23636703193187714,
0.32619524002075195,
-0.19011156260967255,
-0.2949039936065674,
-0.08874168246984482,
-0.23355881869792938,
-0.034699950367212296,
-0.0655050128698349,
-0.19649137556552887,
-0.2568719685077667,
-0.18467473983764648,
0.08116970211267471,
-0.40044963359832764,
-0.12933537364006042,
0.23510003089904785,
-0.36249738931655884,
0.11578776687383652,
-0.041706692427396774,
0.33364763855934143,
-0.12545114755630493,
0.18842390179634094,
-0.017640989273786545,
0.14875414967536926,
0.16230586171150208,
-0.04839974269270897,
-0.27833303809165955,
-0.14302203059196472,
-0.06564294546842575,
0.15890079736709595,
-0.06931918114423752,
0.46842116117477417,
-0.08550431579351425,
0.05284910649061203,
0.12530939280986786,
-0.03240267187356949,
0.5128427147865295,
-0.18287025392055511,
-0.01803828403353691,
0.14133647084236145,
0.22417137026786804,
-0.14485934376716614,
-0.19999417662620544,
-0.1718306839466095,
0.1590501219034195,
0.050198037177324295,
0.39346516132354736,
-0.28235098719596863,
-0.06802847236394882,
0.4073392450809479,
0.22992421686649323,
-0.246763214468956,
-0.11938850581645966,
-0.2965717911720276,
-0.6421763896942139,
-0.40441352128982544,
0.0018890872597694397,
0.2235005795955658,
0.17287775874137878,
0.10950702428817749,
0.3510645627975464,
-0.22674785554409027,
-0.17921701073646545,
0.15829673409461975,
0.18602029979228973,
0.27381935715675354,
-0.027625616639852524,
0.24644939601421356,
-0.036949217319488525,
0.06576648354530334,
0.21468393504619598,
0.6211022138595581,
-0.08652357757091522,
-0.4355189800262451,
-0.0780823677778244,
-0.2128516137599945,
0.4356660842895508,
0.10831031948328018,
-0.22959454357624054,
0.19099265336990356,
-0.1627090871334076,
0.015296390280127525,
-0.3176906406879425,
-0.01063762977719307,
0.654777467250824,
-0.12235639989376068,
-0.4831167757511139,
-0.6786954402923584,
0.5413047671318054,
-0.03537043184041977,
-0.09980350732803345,
0.34746548533439636,
0.46791866421699524,
-0.23933938145637512,
0.47865691781044006,
-0.1178295761346817,
0.8088359236717224,
0.28793269395828247,
-0.09152112901210785,
0.41694676876068115,
-0.05191541835665703,
0.10770296305418015,
0.08281609416007996,
0.20265257358551025,
-0.26450687646865845,
-0.31520354747772217,
-0.08112920820713043,
-0.06290368735790253,
0.1904078722000122,
-0.1486048847436905,
-0.5318316221237183,
0.10642368346452713,
-0.382985919713974,
0.15747657418251038,
-0.0034655481576919556,
0.13590414822101593,
-0.19743233919143677,
-0.011521434411406517,
-0.05286763608455658,
0.1661379635334015,
-0.04875881224870682,
0.12037627398967743,
0.04363381862640381,
-0.119090735912323,
0.05861520767211914,
-0.30178725719451904,
-0.414497971534729,
0.16163773834705353,
-0.07467249035835266,
0.31625205278396606,
-0.130738765001297,
-0.1273917853832245,
0.43506693840026855,
0.33925458788871765,
0.27436038851737976,
0.11674563586711884,
-0.0022079795598983765,
0.2940897047519684,
0.15158268809318542,
-0.06335994601249695,
-0.018206171691417694,
0.014717113226652145,
0.21847468614578247,
0.07488002628087997,
-0.24165096879005432,
0.3551171123981476,
-0.1638389527797699,
-0.20990778505802155,
-0.1419745236635208,
-0.052132848650217056,
0.06241951137781143,
-0.539549708366394,
-0.317965030670166,
0.041460100561380386,
0.06274150311946869,
-0.15285730361938477,
0.13728678226470947,
-0.14475221931934357,
0.022631525993347168,
0.2404552698135376,
-0.22819757461547852,
-0.27345404028892517,
0.058191195130348206,
0.10372811555862427,
0.17803117632865906,
0.2572677731513977,
0.781903088092804,
0.21465091407299042,
-0.05973692983388901,
-0.24066300690174103,
0.4480476975440979,
0.003064848482608795,
-0.17765556275844574,
0.269491046667099,
0.08581310510635376,
0.15662066638469696,
0.10284744948148727,
0.277896910905838,
0.07699079811573029,
-0.10394886136054993,
-0.06549680233001709,
-0.23677216470241547,
0.030925758183002472,
0.09168069064617157,
-0.08804009854793549,
0.061151549220085144,
-0.06734275817871094,
0.15448759496212006,
-0.0034667998552322388,
0.21343038976192474,
-0.30256205797195435,
0.046452321112155914,
-0.19562649726867676,
0.08149453997612,
0.31722885370254517,
0.23556804656982422,
0.22187194228172302,
-0.17591232061386108,
0.08482512831687927,
0.19861827790737152,
-0.022389456629753113,
-0.12799492478370667,
-0.28608253598213196,
0.139133021235466,
-0.03188733756542206,
0.10402894765138626,
-0.111893430352211,
-0.21487170457839966,
-0.10717341303825378,
-0.06573796272277832,
0.06661426275968552,
0.07707783579826355,
-0.028671953827142715,
0.43537604808807373,
0.046277809888124466,
0.1470007449388504,
-0.10099510848522186,
0.13415497541427612,
-0.11098631471395493,
0.26883214712142944,
0.07439690828323364,
0.12718740105628967,
0.09815986454486847,
0.05583948642015457,
-0.44027072191238403,
0.18544456362724304,
-0.13028644025325775,
0.0069730766117572784,
0.31674543023109436,
-0.2733885943889618,
0.2023896723985672,
0.032999876886606216,
0.029223397374153137,
0.3066404461860657,
-0.41146793961524963,
0.08539064973592758,
-0.10291978716850281,
0.16471554338932037,
-0.23669591546058655,
-0.03969055414199829,
-0.20071321725845337,
-0.08292719721794128,
0.0947810485959053,
0.2829931080341339,
-0.03365757316350937,
0.050606563687324524,
-0.3422643542289734,
-0.16419300436973572,
0.6340544819831848,
-0.058073464781045914,
0.25241005420684814,
0.5857937335968018,
-0.035386793315410614,
-0.06319401413202286,
0.3330034017562866,
0.1837904453277588,
0.12923119962215424,
0.4995455741882324,
-0.2970971465110779,
0.11500553041696548,
0.19895535707473755,
0.2540436089038849,
-0.09150370955467224,
-0.1165090799331665,
0.3329847455024719,
0.41502511501312256,
-0.1082146018743515,
-0.012223485857248306,
-0.07103541493415833,
0.03989537060260773,
-0.3586527705192566,
-0.07570657879114151,
-0.3971538543701172,
0.010438567027449608,
-0.15887048840522766,
-0.005254045128822327,
-0.2990977168083191,
-0.17625343799591064,
-0.4160192608833313,
-0.046858493238687515,
-0.11094720661640167,
-0.07780630886554718,
0.27775856852531433,
0.08117733895778656,
0.05737565830349922,
-0.06308840215206146,
0.05163354054093361,
0.2166464626789093,
0.16213393211364746,
-0.5012911558151245,
0.40576139092445374,
0.3028249442577362,
0.11382725834846497,
0.3755130469799042,
0.19796724617481232,
0.5795485377311707,
0.5169925689697266,
-0.029978904873132706,
-0.19756492972373962,
0.00230368971824646,
-0.262483149766922,
0.12255019694566727,
0.27535563707351685,
-0.2812947928905487,
0.5639821290969849,
0.33594486117362976,
0.1880238950252533,
-0.15815600752830505,
0.013485528528690338,
0.2036563903093338,
0.3686160743236542,
-0.4007744789123535,
0.5033644437789917,
-0.24769876897335052,
-0.06420111656188965,
-0.1305515319108963,
0.06017602980136871,
-0.2144031524658203,
-0.046546898782253265,
0.31180593371391296,
0.11506509780883789,
0.11171726882457733,
0.09560948610305786,
0.0906086191534996,
0.14745628833770752,
0.458395779132843,
0.2515981197357178,
-0.13788653910160065,
-0.48336729407310486,
-0.20708006620407104,
-0.6902254819869995,
-0.0814477950334549,
-0.24450592696666718,
-0.49004969000816345,
0.1218118816614151,
0.1752672791481018,
0.35737138986587524,
0.34270837903022766,
-0.0001067817211151123,
0.30345073342323303,
-0.2355589121580124,
0.054484955966472626,
-0.30625438690185547,
-0.3532562553882599,
0.04249349236488342,
0.06738003343343735,
-0.1603924036026001,
-0.3568378686904907,
0.14241786301136017,
0.2410283237695694,
0.06858707219362259,
-0.18605543673038483,
-0.1491060107946396,
0.19588790833950043,
-0.42789191007614136,
0.43579062819480896,
0.07753989845514297,
0.5311054587364197,
-0.07475375384092331,
-0.23476797342300415,
0.016203058883547783,
-0.5138431787490845,
-0.3377377390861511,
0.021064529195427895,
0.17035722732543945,
0.28367459774017334,
-0.08696964383125305,
0.07213275134563446,
-0.2623671293258667,
0.0792887806892395,
-0.03222059831023216,
0.1206437200307846,
-0.3665316104888916,
0.2208767831325531,
-0.03919346630573273,
-0.0007525719702243805,
0.08671741187572479,
0.14793655276298523,
0.062093812972307205,
0.30313485860824585,
-0.1354074478149414,
-0.3530300259590149,
0.41311872005462646,
-0.09793254733085632,
-0.2819955050945282,
0.03156706690788269,
0.07113666832447052,
-0.07734885066747665,
0.10277733206748962,
-0.5570218563079834,
-0.014322400093078613,
0.3744313418865204,
-0.057601120322942734,
-0.09791050851345062,
0.3266601860523224,
0.272071897983551,
0.10237859934568405,
-0.004661343991756439,
0.14781683683395386,
-0.07056959718465805,
-0.18000271916389465,
-0.019132502377033234,
-0.01366957277059555
] |
https://github.com/huggingface/datasets/issues/6157 | @mariosasko And I changed the data file, but executing load_dataset is always the previous result. I had to change something in images.py to use the new results. Using 'cleanup_cache_files' is invalid! Help me. | DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding' | ### Describe the bug
When I was in load_dataset, it said "DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'". The second time I ran it, there was no error and the dataset object worked
```python
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[3], line 1
----> 1 dataset = load_dataset(
2 "/home/aihao/workspace/DeepLearningContent/datasets/manga",
3 data_dir="/home/aihao/workspace/DeepLearningContent/datasets/manga",
4 split="train",
5 )
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146), in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2142 # Build dataset for splits
2143 keep_in_memory = (
2144 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
2145 )
-> 2146 ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
2147 # Rename and cast features to match task schema
2148 if task is not None:
2149 # To avoid issuing the same warning twice
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190), in DatasetBuilder.as_dataset(self, split, run_post_process, verification_mode, ignore_verifications, in_memory)
1187 verification_mode = VerificationMode(verification_mode or VerificationMode.BASIC_CHECKS)
1189 # Create a dataset for each of the given splits
-> 1190 datasets = map_nested(
1191 partial(
1192 self._build_single_dataset,
...
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379), in DatasetInfo.copy(self)
378 def copy(self) -> "DatasetInfo":
--> 379 return self.__class__(**{k: copy.deepcopy(v) for k, v in self.__dict__.items()})
TypeError: DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'
```
### Steps to reproduce the bug
/home/aihao/workspace/DeepLearningContent/datasets/images/images.py
```python
from logging import config
import datasets
import os
from PIL import Image
import csv
import json
class ImagesConfig(datasets.BuilderConfig):
def __init__(self, **kwargs):
super(ImagesConfig, self).__init__(**kwargs)
class Images(datasets.GeneratorBasedBuilder):
def _split_generators(self, dl_manager: datasets.DownloadManager):
return [
datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={"split": datasets.Split.TRAIN},
)
]
BUILDER_CONFIGS = [
ImagesConfig(
name="similar_pairs",
description="simliar pair dataset,item is a pair of similar images",
),
ImagesConfig(
name="image_prompt_pairs",
description="image prompt pairs",
),
]
def _info(self):
if self.config.name == "similar_pairs":
return datasets.Features(
{
"image1": datasets.features.Image(),
"image2": datasets.features.Image(),
"similarity": datasets.Value("float32"),
}
)
elif self.config.name == "image_prompt_pairs":
return datasets.Features(
{"image": datasets.features.Image(), "prompt": datasets.Value("string")}
)
def _generate_examples(self, split):
data_path = os.path.join(self.config.data_dir, "data")
if self.config.name == "similar_pairs":
prompts = {}
with open(os.path.join(data_path ,"prompts.json"), "r") as f:
prompts = json.load(f)
with open(os.path.join(data_path, "similar_pairs.csv"), "r") as f:
reader = csv.reader(f)
for row in reader:
image1_path, image2_path, similarity = row
yield image1_path + ":" + image2_path + ":", {
"image1": Image.open(image1_path),
"prompt1": prompts[image1_path],
"image2": Image.open(image2_path),
"prompt2": prompts[image2_path],
"similarity": float(similarity),
}
```
Code that indicates an error:
```python
from datasets import load_dataset
import json
import csv
import ast
import torch
data_dir = "/home/aihao/workspace/DeepLearningContent/datasets/images"
dataset = load_dataset(data_dir, data_dir=data_dir, name="similar_pairs")
```
### Expected behavior
The first execution gives an error, but it works fine
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-6.2.0-26-generic-x86_64-with-glibc2.35
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3 | 33 | DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'
### Describe the bug
When I was in load_dataset, it said "DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'". The second time I ran it, there was no error and the dataset object worked
```python
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[3], line 1
----> 1 dataset = load_dataset(
2 "/home/aihao/workspace/DeepLearningContent/datasets/manga",
3 data_dir="/home/aihao/workspace/DeepLearningContent/datasets/manga",
4 split="train",
5 )
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146), in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2142 # Build dataset for splits
2143 keep_in_memory = (
2144 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
2145 )
-> 2146 ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
2147 # Rename and cast features to match task schema
2148 if task is not None:
2149 # To avoid issuing the same warning twice
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190), in DatasetBuilder.as_dataset(self, split, run_post_process, verification_mode, ignore_verifications, in_memory)
1187 verification_mode = VerificationMode(verification_mode or VerificationMode.BASIC_CHECKS)
1189 # Create a dataset for each of the given splits
-> 1190 datasets = map_nested(
1191 partial(
1192 self._build_single_dataset,
...
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379), in DatasetInfo.copy(self)
378 def copy(self) -> "DatasetInfo":
--> 379 return self.__class__(**{k: copy.deepcopy(v) for k, v in self.__dict__.items()})
TypeError: DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'
```
### Steps to reproduce the bug
/home/aihao/workspace/DeepLearningContent/datasets/images/images.py
```python
from logging import config
import datasets
import os
from PIL import Image
import csv
import json
class ImagesConfig(datasets.BuilderConfig):
def __init__(self, **kwargs):
super(ImagesConfig, self).__init__(**kwargs)
class Images(datasets.GeneratorBasedBuilder):
def _split_generators(self, dl_manager: datasets.DownloadManager):
return [
datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={"split": datasets.Split.TRAIN},
)
]
BUILDER_CONFIGS = [
ImagesConfig(
name="similar_pairs",
description="simliar pair dataset,item is a pair of similar images",
),
ImagesConfig(
name="image_prompt_pairs",
description="image prompt pairs",
),
]
def _info(self):
if self.config.name == "similar_pairs":
return datasets.Features(
{
"image1": datasets.features.Image(),
"image2": datasets.features.Image(),
"similarity": datasets.Value("float32"),
}
)
elif self.config.name == "image_prompt_pairs":
return datasets.Features(
{"image": datasets.features.Image(), "prompt": datasets.Value("string")}
)
def _generate_examples(self, split):
data_path = os.path.join(self.config.data_dir, "data")
if self.config.name == "similar_pairs":
prompts = {}
with open(os.path.join(data_path ,"prompts.json"), "r") as f:
prompts = json.load(f)
with open(os.path.join(data_path, "similar_pairs.csv"), "r") as f:
reader = csv.reader(f)
for row in reader:
image1_path, image2_path, similarity = row
yield image1_path + ":" + image2_path + ":", {
"image1": Image.open(image1_path),
"prompt1": prompts[image1_path],
"image2": Image.open(image2_path),
"prompt2": prompts[image2_path],
"similarity": float(similarity),
}
```
Code that indicates an error:
```python
from datasets import load_dataset
import json
import csv
import ast
import torch
data_dir = "/home/aihao/workspace/DeepLearningContent/datasets/images"
dataset = load_dataset(data_dir, data_dir=data_dir, name="similar_pairs")
```
### Expected behavior
The first execution gives an error, but it works fine
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-6.2.0-26-generic-x86_64-with-glibc2.35
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
@mariosasko And I changed the data file, but executing load_dataset is always the previous result. I had to change something in images.py to use the new results. Using 'cleanup_cache_files' is invalid! Help me. | [
-0.07070029526948929,
-0.11540171504020691,
0.006694383919239044,
0.35483965277671814,
0.5811512470245361,
0.26537662744522095,
0.13077785074710846,
0.37581178545951843,
-0.23715856671333313,
0.07963988929986954,
0.06881711632013321,
0.3887733519077301,
-0.0750109851360321,
0.3504210412502289,
0.010802865028381348,
-0.26599445939064026,
0.06241599842905998,
0.3554588556289673,
-0.27257367968559265,
0.07664310187101364,
-0.39239227771759033,
0.3850339949131012,
-0.5596711039543152,
-0.12456786632537842,
0.07355214655399323,
-0.08091731369495392,
-0.16728973388671875,
0.17824172973632812,
-0.17621755599975586,
-0.505584180355072,
0.24178168177604675,
-0.1263563185930252,
0.20765769481658936,
0.4656551778316498,
-0.00011479162640171126,
0.1300894320011139,
0.1693420261144638,
-0.191647469997406,
-0.4818935990333557,
-0.18278445303440094,
-0.42340999841690063,
-0.3686598837375641,
0.021593987941741943,
-0.32046544551849365,
-0.13756026327610016,
-0.2946101129055023,
-0.25731703639030457,
-0.6029804348945618,
0.3542990982532501,
0.4759308397769928,
0.19574692845344543,
0.27641841769218445,
0.016931340098381042,
-0.15270501375198364,
0.0443914458155632,
0.017476502805948257,
-0.26956260204315186,
0.11507286131381989,
-0.07260840386152267,
0.0773690864443779,
0.1556115746498108,
0.31896671652793884,
0.11369472742080688,
0.22951701283454895,
0.3821064233779907,
0.03631053864955902,
-0.006869908422231674,
-0.24498309195041656,
0.03581338748335838,
0.0314113013446331,
0.5522449016571045,
-0.24538227915763855,
-0.24418017268180847,
-0.1859855204820633,
-0.07566136121749878,
-0.3821980059146881,
0.24201373755931854,
0.01775040104985237,
-0.023735955357551575,
0.3677349090576172,
0.1424391269683838,
-0.0476306788623333,
-0.07556041330099106,
-0.041191838681697845,
-0.022481605410575867,
-0.1467212587594986,
-0.16477513313293457,
0.17058232426643372,
0.22174297273159027,
-0.01699879951775074,
0.0904935821890831,
0.0616423636674881,
-0.3246755599975586,
0.11866932362318039,
-0.3849504590034485,
-0.14327594637870789,
-0.029970496892929077,
0.06632857024669647,
0.19965142011642456,
-0.0635453462600708,
-0.26171964406967163,
-0.1442011594772339,
0.21022261679172516,
0.09406594187021255,
0.2270517796278,
0.15502209961414337,
0.12009094655513763,
0.2588718831539154,
-0.019052626565098763,
-0.2073211818933487,
-0.10736165940761566,
-0.16628998517990112,
-0.07147905975580215,
-0.05507403984665871,
0.346168577671051,
0.08931301534175873,
0.47108036279678345,
-0.14513638615608215,
-0.24749788641929626,
0.09681481868028641,
-0.17244768142700195,
-0.14148765802383423,
-0.09515707194805145,
0.3479653298854828,
0.3728860020637512,
0.3912353217601776,
0.20510205626487732,
0.2854972183704376,
0.04222942888736725,
-0.6152735948562622,
-0.21168331801891327,
0.04428761452436447,
-0.23029838502407074,
0.031123235821723938,
-0.005640037357807159,
0.03197161480784416,
0.07527164369821548,
0.18947070837020874,
-0.02635136991739273,
-0.2949342131614685,
0.11111520975828171,
-0.24708618223667145,
-0.0220322385430336,
0.02695191465318203,
-0.028744075447320938,
0.13847079873085022,
0.4819733500480652,
-0.10695802420377731,
-0.15624003112316132,
0.05717552453279495,
-0.33822667598724365,
-0.45749205350875854,
-0.42315182089805603,
0.19088250398635864,
0.0030022040009498596,
-0.0146616380661726,
-0.31331124901771545,
0.05377133563160896,
0.21132923662662506,
-0.20890586078166962,
-0.2293064147233963,
-0.3495498299598694,
-0.21973058581352234,
-0.17366652190685272,
0.18035949766635895,
0.36688488721847534,
-0.47540393471717834,
0.10643324255943298,
-0.09987999498844147,
-0.11037078499794006,
0.12210451811552048,
0.06272026896476746,
-0.35976362228393555,
0.42199277877807617,
-0.216512531042099,
-0.07360229641199112,
0.3589792847633362,
-0.38053494691848755,
-0.33264946937561035,
0.41926831007003784,
0.035168275237083435,
0.1236029714345932,
0.14745494723320007,
-0.03447813168168068,
0.12427615374326706,
-0.11320139467716217,
-0.004911784082651138,
0.19825726747512817,
-0.03752211108803749,
0.1764364391565323,
-0.17685580253601074,
-0.13858366012573242,
0.23645097017288208,
0.09743712842464447,
0.10850566625595093,
0.18798217177391052,
-0.06910140812397003,
0.10452422499656677,
0.1104094535112381,
-0.02690098062157631,
-0.12605063617229462,
0.23959806561470032,
-0.0011756508611142635,
0.10907405614852905,
0.26906442642211914,
-0.08181021362543106,
-0.4488169848918915,
0.2490074187517166,
0.31329038739204407,
0.07620657980442047,
-0.3418406546115875,
-0.18824872374534607,
-0.4166206419467926,
-0.004168964922428131,
-0.1973992884159088,
0.12320780754089355,
0.15305769443511963,
0.16185788810253143,
-0.18228040635585785,
0.003125719726085663,
-0.24914517998695374,
0.12847961485385895,
-0.19989418983459473,
-0.016030631959438324,
-0.025896381586790085,
0.12878161668777466,
-0.22603526711463928,
0.012772195041179657,
0.09077498316764832,
0.011567749083042145,
0.31025296449661255,
-0.15249766409397125,
-0.2585323750972748,
0.45949414372444153,
0.15624791383743286,
-0.04745873808860779,
-0.3295535445213318,
-0.13898614048957825,
-0.11819716542959213,
-0.2866854965686798,
-0.07870051264762878,
-0.18027031421661377,
0.4042471647262573,
-0.05839144065976143,
0.07256309688091278,
0.14941540360450745,
0.22447343170642853,
0.21048372983932495,
-0.039810601621866226,
-0.05240296199917793,
0.2763248085975647,
-0.13677871227264404,
-0.11171187460422516,
-0.43130767345428467,
0.1207641214132309,
-0.11179779469966888,
0.06629311293363571,
-0.011639437638223171,
-0.17027772963047028,
-0.14056657254695892,
0.5797865390777588,
0.13184458017349243,
0.1296686977148056,
0.030339621007442474,
-0.029596589505672455,
0.05540803074836731,
-0.11129982769489288,
0.2809083163738251,
0.6012133359909058,
0.02990793064236641,
-0.20613253116607666,
0.06977403163909912,
0.07402460277080536,
0.007573585957288742,
0.16458337008953094,
0.1323767453432083,
0.27220797538757324,
0.16514235734939575,
0.08789701759815216,
0.11491662263870239,
-0.2300560176372528,
0.022391825914382935,
0.32887569069862366,
0.3023911416530609,
-0.47253498435020447,
0.21670237183570862,
-0.39083683490753174,
-0.26406118273735046,
-0.11149963736534119,
0.04577723145484924,
0.26788902282714844,
-0.445814311504364,
-0.24836516380310059,
-0.16174378991127014,
0.06185130774974823,
0.24516364932060242,
-0.38238388299942017,
0.24038627743721008,
-0.09656307846307755,
-0.1587991714477539,
0.04962736368179321,
-0.24415330588817596,
-0.05627301335334778,
-0.006671518087387085,
0.2513587772846222,
-0.2507084608078003,
0.33967170119285583,
-0.26436764001846313,
-0.07759428024291992,
-0.11280127614736557,
-0.17989030480384827,
0.3131224811077118,
-0.2836134135723114,
0.354221373796463,
0.19339600205421448,
0.32849937677383423,
0.2471460998058319,
-0.19274649024009705,
0.4476488530635834,
0.15750476717948914,
0.00410827249288559,
0.20834192633628845,
0.05866518244147301,
-0.23808571696281433,
-0.19740277528762817,
-0.40303415060043335,
-0.11609335243701935,
-0.3366469144821167,
-0.1959540694952011,
-0.11199335753917694,
0.008076902478933334,
0.06271426379680634,
0.03884357959032059,
0.16209140419960022,
0.21492278575897217,
0.14923718571662903,
-0.2710900902748108,
-0.11182089149951935,
0.20159687101840973,
-0.06428411602973938,
-0.20425660908222198,
0.047712430357933044,
-0.043298106640577316,
0.2892319858074188,
-0.0035003162920475006,
-0.42780017852783203,
-0.026873789727687836,
-0.34967347979545593,
0.3373104929924011,
-0.2425673007965088,
-0.14801229536533356,
0.20214961469173431,
0.05149473249912262,
0.05539971962571144,
-0.19972437620162964,
-0.2828601598739624,
0.16345417499542236,
-0.024957187473773956,
0.19488584995269775,
0.1672276258468628,
0.8209006786346436,
-0.06943017244338989,
0.36995255947113037,
-0.020276691764593124,
-0.13649548590183258,
0.47261717915534973,
-0.23636703193187714,
0.32619524002075195,
-0.19011156260967255,
-0.2949039936065674,
-0.08874168246984482,
-0.23355881869792938,
-0.034699950367212296,
-0.0655050128698349,
-0.19649137556552887,
-0.2568719685077667,
-0.18467473983764648,
0.08116970211267471,
-0.40044963359832764,
-0.12933537364006042,
0.23510003089904785,
-0.36249738931655884,
0.11578776687383652,
-0.041706692427396774,
0.33364763855934143,
-0.12545114755630493,
0.18842390179634094,
-0.017640989273786545,
0.14875414967536926,
0.16230586171150208,
-0.04839974269270897,
-0.27833303809165955,
-0.14302203059196472,
-0.06564294546842575,
0.15890079736709595,
-0.06931918114423752,
0.46842116117477417,
-0.08550431579351425,
0.05284910649061203,
0.12530939280986786,
-0.03240267187356949,
0.5128427147865295,
-0.18287025392055511,
-0.01803828403353691,
0.14133647084236145,
0.22417137026786804,
-0.14485934376716614,
-0.19999417662620544,
-0.1718306839466095,
0.1590501219034195,
0.050198037177324295,
0.39346516132354736,
-0.28235098719596863,
-0.06802847236394882,
0.4073392450809479,
0.22992421686649323,
-0.246763214468956,
-0.11938850581645966,
-0.2965717911720276,
-0.6421763896942139,
-0.40441352128982544,
0.0018890872597694397,
0.2235005795955658,
0.17287775874137878,
0.10950702428817749,
0.3510645627975464,
-0.22674785554409027,
-0.17921701073646545,
0.15829673409461975,
0.18602029979228973,
0.27381935715675354,
-0.027625616639852524,
0.24644939601421356,
-0.036949217319488525,
0.06576648354530334,
0.21468393504619598,
0.6211022138595581,
-0.08652357757091522,
-0.4355189800262451,
-0.0780823677778244,
-0.2128516137599945,
0.4356660842895508,
0.10831031948328018,
-0.22959454357624054,
0.19099265336990356,
-0.1627090871334076,
0.015296390280127525,
-0.3176906406879425,
-0.01063762977719307,
0.654777467250824,
-0.12235639989376068,
-0.4831167757511139,
-0.6786954402923584,
0.5413047671318054,
-0.03537043184041977,
-0.09980350732803345,
0.34746548533439636,
0.46791866421699524,
-0.23933938145637512,
0.47865691781044006,
-0.1178295761346817,
0.8088359236717224,
0.28793269395828247,
-0.09152112901210785,
0.41694676876068115,
-0.05191541835665703,
0.10770296305418015,
0.08281609416007996,
0.20265257358551025,
-0.26450687646865845,
-0.31520354747772217,
-0.08112920820713043,
-0.06290368735790253,
0.1904078722000122,
-0.1486048847436905,
-0.5318316221237183,
0.10642368346452713,
-0.382985919713974,
0.15747657418251038,
-0.0034655481576919556,
0.13590414822101593,
-0.19743233919143677,
-0.011521434411406517,
-0.05286763608455658,
0.1661379635334015,
-0.04875881224870682,
0.12037627398967743,
0.04363381862640381,
-0.119090735912323,
0.05861520767211914,
-0.30178725719451904,
-0.414497971534729,
0.16163773834705353,
-0.07467249035835266,
0.31625205278396606,
-0.130738765001297,
-0.1273917853832245,
0.43506693840026855,
0.33925458788871765,
0.27436038851737976,
0.11674563586711884,
-0.0022079795598983765,
0.2940897047519684,
0.15158268809318542,
-0.06335994601249695,
-0.018206171691417694,
0.014717113226652145,
0.21847468614578247,
0.07488002628087997,
-0.24165096879005432,
0.3551171123981476,
-0.1638389527797699,
-0.20990778505802155,
-0.1419745236635208,
-0.052132848650217056,
0.06241951137781143,
-0.539549708366394,
-0.317965030670166,
0.041460100561380386,
0.06274150311946869,
-0.15285730361938477,
0.13728678226470947,
-0.14475221931934357,
0.022631525993347168,
0.2404552698135376,
-0.22819757461547852,
-0.27345404028892517,
0.058191195130348206,
0.10372811555862427,
0.17803117632865906,
0.2572677731513977,
0.781903088092804,
0.21465091407299042,
-0.05973692983388901,
-0.24066300690174103,
0.4480476975440979,
0.003064848482608795,
-0.17765556275844574,
0.269491046667099,
0.08581310510635376,
0.15662066638469696,
0.10284744948148727,
0.277896910905838,
0.07699079811573029,
-0.10394886136054993,
-0.06549680233001709,
-0.23677216470241547,
0.030925758183002472,
0.09168069064617157,
-0.08804009854793549,
0.061151549220085144,
-0.06734275817871094,
0.15448759496212006,
-0.0034667998552322388,
0.21343038976192474,
-0.30256205797195435,
0.046452321112155914,
-0.19562649726867676,
0.08149453997612,
0.31722885370254517,
0.23556804656982422,
0.22187194228172302,
-0.17591232061386108,
0.08482512831687927,
0.19861827790737152,
-0.022389456629753113,
-0.12799492478370667,
-0.28608253598213196,
0.139133021235466,
-0.03188733756542206,
0.10402894765138626,
-0.111893430352211,
-0.21487170457839966,
-0.10717341303825378,
-0.06573796272277832,
0.06661426275968552,
0.07707783579826355,
-0.028671953827142715,
0.43537604808807373,
0.046277809888124466,
0.1470007449388504,
-0.10099510848522186,
0.13415497541427612,
-0.11098631471395493,
0.26883214712142944,
0.07439690828323364,
0.12718740105628967,
0.09815986454486847,
0.05583948642015457,
-0.44027072191238403,
0.18544456362724304,
-0.13028644025325775,
0.0069730766117572784,
0.31674543023109436,
-0.2733885943889618,
0.2023896723985672,
0.032999876886606216,
0.029223397374153137,
0.3066404461860657,
-0.41146793961524963,
0.08539064973592758,
-0.10291978716850281,
0.16471554338932037,
-0.23669591546058655,
-0.03969055414199829,
-0.20071321725845337,
-0.08292719721794128,
0.0947810485959053,
0.2829931080341339,
-0.03365757316350937,
0.050606563687324524,
-0.3422643542289734,
-0.16419300436973572,
0.6340544819831848,
-0.058073464781045914,
0.25241005420684814,
0.5857937335968018,
-0.035386793315410614,
-0.06319401413202286,
0.3330034017562866,
0.1837904453277588,
0.12923119962215424,
0.4995455741882324,
-0.2970971465110779,
0.11500553041696548,
0.19895535707473755,
0.2540436089038849,
-0.09150370955467224,
-0.1165090799331665,
0.3329847455024719,
0.41502511501312256,
-0.1082146018743515,
-0.012223485857248306,
-0.07103541493415833,
0.03989537060260773,
-0.3586527705192566,
-0.07570657879114151,
-0.3971538543701172,
0.010438567027449608,
-0.15887048840522766,
-0.005254045128822327,
-0.2990977168083191,
-0.17625343799591064,
-0.4160192608833313,
-0.046858493238687515,
-0.11094720661640167,
-0.07780630886554718,
0.27775856852531433,
0.08117733895778656,
0.05737565830349922,
-0.06308840215206146,
0.05163354054093361,
0.2166464626789093,
0.16213393211364746,
-0.5012911558151245,
0.40576139092445374,
0.3028249442577362,
0.11382725834846497,
0.3755130469799042,
0.19796724617481232,
0.5795485377311707,
0.5169925689697266,
-0.029978904873132706,
-0.19756492972373962,
0.00230368971824646,
-0.262483149766922,
0.12255019694566727,
0.27535563707351685,
-0.2812947928905487,
0.5639821290969849,
0.33594486117362976,
0.1880238950252533,
-0.15815600752830505,
0.013485528528690338,
0.2036563903093338,
0.3686160743236542,
-0.4007744789123535,
0.5033644437789917,
-0.24769876897335052,
-0.06420111656188965,
-0.1305515319108963,
0.06017602980136871,
-0.2144031524658203,
-0.046546898782253265,
0.31180593371391296,
0.11506509780883789,
0.11171726882457733,
0.09560948610305786,
0.0906086191534996,
0.14745628833770752,
0.458395779132843,
0.2515981197357178,
-0.13788653910160065,
-0.48336729407310486,
-0.20708006620407104,
-0.6902254819869995,
-0.0814477950334549,
-0.24450592696666718,
-0.49004969000816345,
0.1218118816614151,
0.1752672791481018,
0.35737138986587524,
0.34270837903022766,
-0.0001067817211151123,
0.30345073342323303,
-0.2355589121580124,
0.054484955966472626,
-0.30625438690185547,
-0.3532562553882599,
0.04249349236488342,
0.06738003343343735,
-0.1603924036026001,
-0.3568378686904907,
0.14241786301136017,
0.2410283237695694,
0.06858707219362259,
-0.18605543673038483,
-0.1491060107946396,
0.19588790833950043,
-0.42789191007614136,
0.43579062819480896,
0.07753989845514297,
0.5311054587364197,
-0.07475375384092331,
-0.23476797342300415,
0.016203058883547783,
-0.5138431787490845,
-0.3377377390861511,
0.021064529195427895,
0.17035722732543945,
0.28367459774017334,
-0.08696964383125305,
0.07213275134563446,
-0.2623671293258667,
0.0792887806892395,
-0.03222059831023216,
0.1206437200307846,
-0.3665316104888916,
0.2208767831325531,
-0.03919346630573273,
-0.0007525719702243805,
0.08671741187572479,
0.14793655276298523,
0.062093812972307205,
0.30313485860824585,
-0.1354074478149414,
-0.3530300259590149,
0.41311872005462646,
-0.09793254733085632,
-0.2819955050945282,
0.03156706690788269,
0.07113666832447052,
-0.07734885066747665,
0.10277733206748962,
-0.5570218563079834,
-0.014322400093078613,
0.3744313418865204,
-0.057601120322942734,
-0.09791050851345062,
0.3266601860523224,
0.272071897983551,
0.10237859934568405,
-0.004661343991756439,
0.14781683683395386,
-0.07056959718465805,
-0.18000271916389465,
-0.019132502377033234,
-0.01366957277059555
] |
https://github.com/huggingface/datasets/issues/6157 | @mariosasko I added a comprehensive error message. Check that _column_requires_decoding is being passed where it shouldn't be. DatasetInfo.__init__() Whether this parameter is required | DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding' | ### Describe the bug
When I was in load_dataset, it said "DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'". The second time I ran it, there was no error and the dataset object worked
```python
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[3], line 1
----> 1 dataset = load_dataset(
2 "/home/aihao/workspace/DeepLearningContent/datasets/manga",
3 data_dir="/home/aihao/workspace/DeepLearningContent/datasets/manga",
4 split="train",
5 )
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146), in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2142 # Build dataset for splits
2143 keep_in_memory = (
2144 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
2145 )
-> 2146 ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
2147 # Rename and cast features to match task schema
2148 if task is not None:
2149 # To avoid issuing the same warning twice
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190), in DatasetBuilder.as_dataset(self, split, run_post_process, verification_mode, ignore_verifications, in_memory)
1187 verification_mode = VerificationMode(verification_mode or VerificationMode.BASIC_CHECKS)
1189 # Create a dataset for each of the given splits
-> 1190 datasets = map_nested(
1191 partial(
1192 self._build_single_dataset,
...
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379), in DatasetInfo.copy(self)
378 def copy(self) -> "DatasetInfo":
--> 379 return self.__class__(**{k: copy.deepcopy(v) for k, v in self.__dict__.items()})
TypeError: DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'
```
### Steps to reproduce the bug
/home/aihao/workspace/DeepLearningContent/datasets/images/images.py
```python
from logging import config
import datasets
import os
from PIL import Image
import csv
import json
class ImagesConfig(datasets.BuilderConfig):
def __init__(self, **kwargs):
super(ImagesConfig, self).__init__(**kwargs)
class Images(datasets.GeneratorBasedBuilder):
def _split_generators(self, dl_manager: datasets.DownloadManager):
return [
datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={"split": datasets.Split.TRAIN},
)
]
BUILDER_CONFIGS = [
ImagesConfig(
name="similar_pairs",
description="simliar pair dataset,item is a pair of similar images",
),
ImagesConfig(
name="image_prompt_pairs",
description="image prompt pairs",
),
]
def _info(self):
if self.config.name == "similar_pairs":
return datasets.Features(
{
"image1": datasets.features.Image(),
"image2": datasets.features.Image(),
"similarity": datasets.Value("float32"),
}
)
elif self.config.name == "image_prompt_pairs":
return datasets.Features(
{"image": datasets.features.Image(), "prompt": datasets.Value("string")}
)
def _generate_examples(self, split):
data_path = os.path.join(self.config.data_dir, "data")
if self.config.name == "similar_pairs":
prompts = {}
with open(os.path.join(data_path ,"prompts.json"), "r") as f:
prompts = json.load(f)
with open(os.path.join(data_path, "similar_pairs.csv"), "r") as f:
reader = csv.reader(f)
for row in reader:
image1_path, image2_path, similarity = row
yield image1_path + ":" + image2_path + ":", {
"image1": Image.open(image1_path),
"prompt1": prompts[image1_path],
"image2": Image.open(image2_path),
"prompt2": prompts[image2_path],
"similarity": float(similarity),
}
```
Code that indicates an error:
```python
from datasets import load_dataset
import json
import csv
import ast
import torch
data_dir = "/home/aihao/workspace/DeepLearningContent/datasets/images"
dataset = load_dataset(data_dir, data_dir=data_dir, name="similar_pairs")
```
### Expected behavior
The first execution gives an error, but it works fine
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-6.2.0-26-generic-x86_64-with-glibc2.35
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3 | 23 | DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'
### Describe the bug
When I was in load_dataset, it said "DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'". The second time I ran it, there was no error and the dataset object worked
```python
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[3], line 1
----> 1 dataset = load_dataset(
2 "/home/aihao/workspace/DeepLearningContent/datasets/manga",
3 data_dir="/home/aihao/workspace/DeepLearningContent/datasets/manga",
4 split="train",
5 )
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146), in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2142 # Build dataset for splits
2143 keep_in_memory = (
2144 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
2145 )
-> 2146 ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
2147 # Rename and cast features to match task schema
2148 if task is not None:
2149 # To avoid issuing the same warning twice
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190), in DatasetBuilder.as_dataset(self, split, run_post_process, verification_mode, ignore_verifications, in_memory)
1187 verification_mode = VerificationMode(verification_mode or VerificationMode.BASIC_CHECKS)
1189 # Create a dataset for each of the given splits
-> 1190 datasets = map_nested(
1191 partial(
1192 self._build_single_dataset,
...
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379), in DatasetInfo.copy(self)
378 def copy(self) -> "DatasetInfo":
--> 379 return self.__class__(**{k: copy.deepcopy(v) for k, v in self.__dict__.items()})
TypeError: DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'
```
### Steps to reproduce the bug
/home/aihao/workspace/DeepLearningContent/datasets/images/images.py
```python
from logging import config
import datasets
import os
from PIL import Image
import csv
import json
class ImagesConfig(datasets.BuilderConfig):
def __init__(self, **kwargs):
super(ImagesConfig, self).__init__(**kwargs)
class Images(datasets.GeneratorBasedBuilder):
def _split_generators(self, dl_manager: datasets.DownloadManager):
return [
datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={"split": datasets.Split.TRAIN},
)
]
BUILDER_CONFIGS = [
ImagesConfig(
name="similar_pairs",
description="simliar pair dataset,item is a pair of similar images",
),
ImagesConfig(
name="image_prompt_pairs",
description="image prompt pairs",
),
]
def _info(self):
if self.config.name == "similar_pairs":
return datasets.Features(
{
"image1": datasets.features.Image(),
"image2": datasets.features.Image(),
"similarity": datasets.Value("float32"),
}
)
elif self.config.name == "image_prompt_pairs":
return datasets.Features(
{"image": datasets.features.Image(), "prompt": datasets.Value("string")}
)
def _generate_examples(self, split):
data_path = os.path.join(self.config.data_dir, "data")
if self.config.name == "similar_pairs":
prompts = {}
with open(os.path.join(data_path ,"prompts.json"), "r") as f:
prompts = json.load(f)
with open(os.path.join(data_path, "similar_pairs.csv"), "r") as f:
reader = csv.reader(f)
for row in reader:
image1_path, image2_path, similarity = row
yield image1_path + ":" + image2_path + ":", {
"image1": Image.open(image1_path),
"prompt1": prompts[image1_path],
"image2": Image.open(image2_path),
"prompt2": prompts[image2_path],
"similarity": float(similarity),
}
```
Code that indicates an error:
```python
from datasets import load_dataset
import json
import csv
import ast
import torch
data_dir = "/home/aihao/workspace/DeepLearningContent/datasets/images"
dataset = load_dataset(data_dir, data_dir=data_dir, name="similar_pairs")
```
### Expected behavior
The first execution gives an error, but it works fine
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-6.2.0-26-generic-x86_64-with-glibc2.35
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
@mariosasko I added a comprehensive error message. Check that _column_requires_decoding is being passed where it shouldn't be. DatasetInfo.__init__() Whether this parameter is required | [
-0.07070029526948929,
-0.11540171504020691,
0.006694383919239044,
0.35483965277671814,
0.5811512470245361,
0.26537662744522095,
0.13077785074710846,
0.37581178545951843,
-0.23715856671333313,
0.07963988929986954,
0.06881711632013321,
0.3887733519077301,
-0.0750109851360321,
0.3504210412502289,
0.010802865028381348,
-0.26599445939064026,
0.06241599842905998,
0.3554588556289673,
-0.27257367968559265,
0.07664310187101364,
-0.39239227771759033,
0.3850339949131012,
-0.5596711039543152,
-0.12456786632537842,
0.07355214655399323,
-0.08091731369495392,
-0.16728973388671875,
0.17824172973632812,
-0.17621755599975586,
-0.505584180355072,
0.24178168177604675,
-0.1263563185930252,
0.20765769481658936,
0.4656551778316498,
-0.00011479162640171126,
0.1300894320011139,
0.1693420261144638,
-0.191647469997406,
-0.4818935990333557,
-0.18278445303440094,
-0.42340999841690063,
-0.3686598837375641,
0.021593987941741943,
-0.32046544551849365,
-0.13756026327610016,
-0.2946101129055023,
-0.25731703639030457,
-0.6029804348945618,
0.3542990982532501,
0.4759308397769928,
0.19574692845344543,
0.27641841769218445,
0.016931340098381042,
-0.15270501375198364,
0.0443914458155632,
0.017476502805948257,
-0.26956260204315186,
0.11507286131381989,
-0.07260840386152267,
0.0773690864443779,
0.1556115746498108,
0.31896671652793884,
0.11369472742080688,
0.22951701283454895,
0.3821064233779907,
0.03631053864955902,
-0.006869908422231674,
-0.24498309195041656,
0.03581338748335838,
0.0314113013446331,
0.5522449016571045,
-0.24538227915763855,
-0.24418017268180847,
-0.1859855204820633,
-0.07566136121749878,
-0.3821980059146881,
0.24201373755931854,
0.01775040104985237,
-0.023735955357551575,
0.3677349090576172,
0.1424391269683838,
-0.0476306788623333,
-0.07556041330099106,
-0.041191838681697845,
-0.022481605410575867,
-0.1467212587594986,
-0.16477513313293457,
0.17058232426643372,
0.22174297273159027,
-0.01699879951775074,
0.0904935821890831,
0.0616423636674881,
-0.3246755599975586,
0.11866932362318039,
-0.3849504590034485,
-0.14327594637870789,
-0.029970496892929077,
0.06632857024669647,
0.19965142011642456,
-0.0635453462600708,
-0.26171964406967163,
-0.1442011594772339,
0.21022261679172516,
0.09406594187021255,
0.2270517796278,
0.15502209961414337,
0.12009094655513763,
0.2588718831539154,
-0.019052626565098763,
-0.2073211818933487,
-0.10736165940761566,
-0.16628998517990112,
-0.07147905975580215,
-0.05507403984665871,
0.346168577671051,
0.08931301534175873,
0.47108036279678345,
-0.14513638615608215,
-0.24749788641929626,
0.09681481868028641,
-0.17244768142700195,
-0.14148765802383423,
-0.09515707194805145,
0.3479653298854828,
0.3728860020637512,
0.3912353217601776,
0.20510205626487732,
0.2854972183704376,
0.04222942888736725,
-0.6152735948562622,
-0.21168331801891327,
0.04428761452436447,
-0.23029838502407074,
0.031123235821723938,
-0.005640037357807159,
0.03197161480784416,
0.07527164369821548,
0.18947070837020874,
-0.02635136991739273,
-0.2949342131614685,
0.11111520975828171,
-0.24708618223667145,
-0.0220322385430336,
0.02695191465318203,
-0.028744075447320938,
0.13847079873085022,
0.4819733500480652,
-0.10695802420377731,
-0.15624003112316132,
0.05717552453279495,
-0.33822667598724365,
-0.45749205350875854,
-0.42315182089805603,
0.19088250398635864,
0.0030022040009498596,
-0.0146616380661726,
-0.31331124901771545,
0.05377133563160896,
0.21132923662662506,
-0.20890586078166962,
-0.2293064147233963,
-0.3495498299598694,
-0.21973058581352234,
-0.17366652190685272,
0.18035949766635895,
0.36688488721847534,
-0.47540393471717834,
0.10643324255943298,
-0.09987999498844147,
-0.11037078499794006,
0.12210451811552048,
0.06272026896476746,
-0.35976362228393555,
0.42199277877807617,
-0.216512531042099,
-0.07360229641199112,
0.3589792847633362,
-0.38053494691848755,
-0.33264946937561035,
0.41926831007003784,
0.035168275237083435,
0.1236029714345932,
0.14745494723320007,
-0.03447813168168068,
0.12427615374326706,
-0.11320139467716217,
-0.004911784082651138,
0.19825726747512817,
-0.03752211108803749,
0.1764364391565323,
-0.17685580253601074,
-0.13858366012573242,
0.23645097017288208,
0.09743712842464447,
0.10850566625595093,
0.18798217177391052,
-0.06910140812397003,
0.10452422499656677,
0.1104094535112381,
-0.02690098062157631,
-0.12605063617229462,
0.23959806561470032,
-0.0011756508611142635,
0.10907405614852905,
0.26906442642211914,
-0.08181021362543106,
-0.4488169848918915,
0.2490074187517166,
0.31329038739204407,
0.07620657980442047,
-0.3418406546115875,
-0.18824872374534607,
-0.4166206419467926,
-0.004168964922428131,
-0.1973992884159088,
0.12320780754089355,
0.15305769443511963,
0.16185788810253143,
-0.18228040635585785,
0.003125719726085663,
-0.24914517998695374,
0.12847961485385895,
-0.19989418983459473,
-0.016030631959438324,
-0.025896381586790085,
0.12878161668777466,
-0.22603526711463928,
0.012772195041179657,
0.09077498316764832,
0.011567749083042145,
0.31025296449661255,
-0.15249766409397125,
-0.2585323750972748,
0.45949414372444153,
0.15624791383743286,
-0.04745873808860779,
-0.3295535445213318,
-0.13898614048957825,
-0.11819716542959213,
-0.2866854965686798,
-0.07870051264762878,
-0.18027031421661377,
0.4042471647262573,
-0.05839144065976143,
0.07256309688091278,
0.14941540360450745,
0.22447343170642853,
0.21048372983932495,
-0.039810601621866226,
-0.05240296199917793,
0.2763248085975647,
-0.13677871227264404,
-0.11171187460422516,
-0.43130767345428467,
0.1207641214132309,
-0.11179779469966888,
0.06629311293363571,
-0.011639437638223171,
-0.17027772963047028,
-0.14056657254695892,
0.5797865390777588,
0.13184458017349243,
0.1296686977148056,
0.030339621007442474,
-0.029596589505672455,
0.05540803074836731,
-0.11129982769489288,
0.2809083163738251,
0.6012133359909058,
0.02990793064236641,
-0.20613253116607666,
0.06977403163909912,
0.07402460277080536,
0.007573585957288742,
0.16458337008953094,
0.1323767453432083,
0.27220797538757324,
0.16514235734939575,
0.08789701759815216,
0.11491662263870239,
-0.2300560176372528,
0.022391825914382935,
0.32887569069862366,
0.3023911416530609,
-0.47253498435020447,
0.21670237183570862,
-0.39083683490753174,
-0.26406118273735046,
-0.11149963736534119,
0.04577723145484924,
0.26788902282714844,
-0.445814311504364,
-0.24836516380310059,
-0.16174378991127014,
0.06185130774974823,
0.24516364932060242,
-0.38238388299942017,
0.24038627743721008,
-0.09656307846307755,
-0.1587991714477539,
0.04962736368179321,
-0.24415330588817596,
-0.05627301335334778,
-0.006671518087387085,
0.2513587772846222,
-0.2507084608078003,
0.33967170119285583,
-0.26436764001846313,
-0.07759428024291992,
-0.11280127614736557,
-0.17989030480384827,
0.3131224811077118,
-0.2836134135723114,
0.354221373796463,
0.19339600205421448,
0.32849937677383423,
0.2471460998058319,
-0.19274649024009705,
0.4476488530635834,
0.15750476717948914,
0.00410827249288559,
0.20834192633628845,
0.05866518244147301,
-0.23808571696281433,
-0.19740277528762817,
-0.40303415060043335,
-0.11609335243701935,
-0.3366469144821167,
-0.1959540694952011,
-0.11199335753917694,
0.008076902478933334,
0.06271426379680634,
0.03884357959032059,
0.16209140419960022,
0.21492278575897217,
0.14923718571662903,
-0.2710900902748108,
-0.11182089149951935,
0.20159687101840973,
-0.06428411602973938,
-0.20425660908222198,
0.047712430357933044,
-0.043298106640577316,
0.2892319858074188,
-0.0035003162920475006,
-0.42780017852783203,
-0.026873789727687836,
-0.34967347979545593,
0.3373104929924011,
-0.2425673007965088,
-0.14801229536533356,
0.20214961469173431,
0.05149473249912262,
0.05539971962571144,
-0.19972437620162964,
-0.2828601598739624,
0.16345417499542236,
-0.024957187473773956,
0.19488584995269775,
0.1672276258468628,
0.8209006786346436,
-0.06943017244338989,
0.36995255947113037,
-0.020276691764593124,
-0.13649548590183258,
0.47261717915534973,
-0.23636703193187714,
0.32619524002075195,
-0.19011156260967255,
-0.2949039936065674,
-0.08874168246984482,
-0.23355881869792938,
-0.034699950367212296,
-0.0655050128698349,
-0.19649137556552887,
-0.2568719685077667,
-0.18467473983764648,
0.08116970211267471,
-0.40044963359832764,
-0.12933537364006042,
0.23510003089904785,
-0.36249738931655884,
0.11578776687383652,
-0.041706692427396774,
0.33364763855934143,
-0.12545114755630493,
0.18842390179634094,
-0.017640989273786545,
0.14875414967536926,
0.16230586171150208,
-0.04839974269270897,
-0.27833303809165955,
-0.14302203059196472,
-0.06564294546842575,
0.15890079736709595,
-0.06931918114423752,
0.46842116117477417,
-0.08550431579351425,
0.05284910649061203,
0.12530939280986786,
-0.03240267187356949,
0.5128427147865295,
-0.18287025392055511,
-0.01803828403353691,
0.14133647084236145,
0.22417137026786804,
-0.14485934376716614,
-0.19999417662620544,
-0.1718306839466095,
0.1590501219034195,
0.050198037177324295,
0.39346516132354736,
-0.28235098719596863,
-0.06802847236394882,
0.4073392450809479,
0.22992421686649323,
-0.246763214468956,
-0.11938850581645966,
-0.2965717911720276,
-0.6421763896942139,
-0.40441352128982544,
0.0018890872597694397,
0.2235005795955658,
0.17287775874137878,
0.10950702428817749,
0.3510645627975464,
-0.22674785554409027,
-0.17921701073646545,
0.15829673409461975,
0.18602029979228973,
0.27381935715675354,
-0.027625616639852524,
0.24644939601421356,
-0.036949217319488525,
0.06576648354530334,
0.21468393504619598,
0.6211022138595581,
-0.08652357757091522,
-0.4355189800262451,
-0.0780823677778244,
-0.2128516137599945,
0.4356660842895508,
0.10831031948328018,
-0.22959454357624054,
0.19099265336990356,
-0.1627090871334076,
0.015296390280127525,
-0.3176906406879425,
-0.01063762977719307,
0.654777467250824,
-0.12235639989376068,
-0.4831167757511139,
-0.6786954402923584,
0.5413047671318054,
-0.03537043184041977,
-0.09980350732803345,
0.34746548533439636,
0.46791866421699524,
-0.23933938145637512,
0.47865691781044006,
-0.1178295761346817,
0.8088359236717224,
0.28793269395828247,
-0.09152112901210785,
0.41694676876068115,
-0.05191541835665703,
0.10770296305418015,
0.08281609416007996,
0.20265257358551025,
-0.26450687646865845,
-0.31520354747772217,
-0.08112920820713043,
-0.06290368735790253,
0.1904078722000122,
-0.1486048847436905,
-0.5318316221237183,
0.10642368346452713,
-0.382985919713974,
0.15747657418251038,
-0.0034655481576919556,
0.13590414822101593,
-0.19743233919143677,
-0.011521434411406517,
-0.05286763608455658,
0.1661379635334015,
-0.04875881224870682,
0.12037627398967743,
0.04363381862640381,
-0.119090735912323,
0.05861520767211914,
-0.30178725719451904,
-0.414497971534729,
0.16163773834705353,
-0.07467249035835266,
0.31625205278396606,
-0.130738765001297,
-0.1273917853832245,
0.43506693840026855,
0.33925458788871765,
0.27436038851737976,
0.11674563586711884,
-0.0022079795598983765,
0.2940897047519684,
0.15158268809318542,
-0.06335994601249695,
-0.018206171691417694,
0.014717113226652145,
0.21847468614578247,
0.07488002628087997,
-0.24165096879005432,
0.3551171123981476,
-0.1638389527797699,
-0.20990778505802155,
-0.1419745236635208,
-0.052132848650217056,
0.06241951137781143,
-0.539549708366394,
-0.317965030670166,
0.041460100561380386,
0.06274150311946869,
-0.15285730361938477,
0.13728678226470947,
-0.14475221931934357,
0.022631525993347168,
0.2404552698135376,
-0.22819757461547852,
-0.27345404028892517,
0.058191195130348206,
0.10372811555862427,
0.17803117632865906,
0.2572677731513977,
0.781903088092804,
0.21465091407299042,
-0.05973692983388901,
-0.24066300690174103,
0.4480476975440979,
0.003064848482608795,
-0.17765556275844574,
0.269491046667099,
0.08581310510635376,
0.15662066638469696,
0.10284744948148727,
0.277896910905838,
0.07699079811573029,
-0.10394886136054993,
-0.06549680233001709,
-0.23677216470241547,
0.030925758183002472,
0.09168069064617157,
-0.08804009854793549,
0.061151549220085144,
-0.06734275817871094,
0.15448759496212006,
-0.0034667998552322388,
0.21343038976192474,
-0.30256205797195435,
0.046452321112155914,
-0.19562649726867676,
0.08149453997612,
0.31722885370254517,
0.23556804656982422,
0.22187194228172302,
-0.17591232061386108,
0.08482512831687927,
0.19861827790737152,
-0.022389456629753113,
-0.12799492478370667,
-0.28608253598213196,
0.139133021235466,
-0.03188733756542206,
0.10402894765138626,
-0.111893430352211,
-0.21487170457839966,
-0.10717341303825378,
-0.06573796272277832,
0.06661426275968552,
0.07707783579826355,
-0.028671953827142715,
0.43537604808807373,
0.046277809888124466,
0.1470007449388504,
-0.10099510848522186,
0.13415497541427612,
-0.11098631471395493,
0.26883214712142944,
0.07439690828323364,
0.12718740105628967,
0.09815986454486847,
0.05583948642015457,
-0.44027072191238403,
0.18544456362724304,
-0.13028644025325775,
0.0069730766117572784,
0.31674543023109436,
-0.2733885943889618,
0.2023896723985672,
0.032999876886606216,
0.029223397374153137,
0.3066404461860657,
-0.41146793961524963,
0.08539064973592758,
-0.10291978716850281,
0.16471554338932037,
-0.23669591546058655,
-0.03969055414199829,
-0.20071321725845337,
-0.08292719721794128,
0.0947810485959053,
0.2829931080341339,
-0.03365757316350937,
0.050606563687324524,
-0.3422643542289734,
-0.16419300436973572,
0.6340544819831848,
-0.058073464781045914,
0.25241005420684814,
0.5857937335968018,
-0.035386793315410614,
-0.06319401413202286,
0.3330034017562866,
0.1837904453277588,
0.12923119962215424,
0.4995455741882324,
-0.2970971465110779,
0.11500553041696548,
0.19895535707473755,
0.2540436089038849,
-0.09150370955467224,
-0.1165090799331665,
0.3329847455024719,
0.41502511501312256,
-0.1082146018743515,
-0.012223485857248306,
-0.07103541493415833,
0.03989537060260773,
-0.3586527705192566,
-0.07570657879114151,
-0.3971538543701172,
0.010438567027449608,
-0.15887048840522766,
-0.005254045128822327,
-0.2990977168083191,
-0.17625343799591064,
-0.4160192608833313,
-0.046858493238687515,
-0.11094720661640167,
-0.07780630886554718,
0.27775856852531433,
0.08117733895778656,
0.05737565830349922,
-0.06308840215206146,
0.05163354054093361,
0.2166464626789093,
0.16213393211364746,
-0.5012911558151245,
0.40576139092445374,
0.3028249442577362,
0.11382725834846497,
0.3755130469799042,
0.19796724617481232,
0.5795485377311707,
0.5169925689697266,
-0.029978904873132706,
-0.19756492972373962,
0.00230368971824646,
-0.262483149766922,
0.12255019694566727,
0.27535563707351685,
-0.2812947928905487,
0.5639821290969849,
0.33594486117362976,
0.1880238950252533,
-0.15815600752830505,
0.013485528528690338,
0.2036563903093338,
0.3686160743236542,
-0.4007744789123535,
0.5033644437789917,
-0.24769876897335052,
-0.06420111656188965,
-0.1305515319108963,
0.06017602980136871,
-0.2144031524658203,
-0.046546898782253265,
0.31180593371391296,
0.11506509780883789,
0.11171726882457733,
0.09560948610305786,
0.0906086191534996,
0.14745628833770752,
0.458395779132843,
0.2515981197357178,
-0.13788653910160065,
-0.48336729407310486,
-0.20708006620407104,
-0.6902254819869995,
-0.0814477950334549,
-0.24450592696666718,
-0.49004969000816345,
0.1218118816614151,
0.1752672791481018,
0.35737138986587524,
0.34270837903022766,
-0.0001067817211151123,
0.30345073342323303,
-0.2355589121580124,
0.054484955966472626,
-0.30625438690185547,
-0.3532562553882599,
0.04249349236488342,
0.06738003343343735,
-0.1603924036026001,
-0.3568378686904907,
0.14241786301136017,
0.2410283237695694,
0.06858707219362259,
-0.18605543673038483,
-0.1491060107946396,
0.19588790833950043,
-0.42789191007614136,
0.43579062819480896,
0.07753989845514297,
0.5311054587364197,
-0.07475375384092331,
-0.23476797342300415,
0.016203058883547783,
-0.5138431787490845,
-0.3377377390861511,
0.021064529195427895,
0.17035722732543945,
0.28367459774017334,
-0.08696964383125305,
0.07213275134563446,
-0.2623671293258667,
0.0792887806892395,
-0.03222059831023216,
0.1206437200307846,
-0.3665316104888916,
0.2208767831325531,
-0.03919346630573273,
-0.0007525719702243805,
0.08671741187572479,
0.14793655276298523,
0.062093812972307205,
0.30313485860824585,
-0.1354074478149414,
-0.3530300259590149,
0.41311872005462646,
-0.09793254733085632,
-0.2819955050945282,
0.03156706690788269,
0.07113666832447052,
-0.07734885066747665,
0.10277733206748962,
-0.5570218563079834,
-0.014322400093078613,
0.3744313418865204,
-0.057601120322942734,
-0.09791050851345062,
0.3266601860523224,
0.272071897983551,
0.10237859934568405,
-0.004661343991756439,
0.14781683683395386,
-0.07056959718465805,
-0.18000271916389465,
-0.019132502377033234,
-0.01366957277059555
] |
https://github.com/huggingface/datasets/issues/6157 | I can see the issue now...
You can fix it by returning a `DatasetInfo` object in the `_info` method as follows:
```python
def _info(self):
if self.config.name == "similar_pairs":
features = datasets.Features(
{
"image1": datasets.features.Image(),
"prompt1": datasets.Value("string"),
"image2": datasets.features.Image(),
"prompt2": datasets.Value("string"),
"similarity": datasets.Value("float32"),
}
)
elif self.config.name == "image_prompt_pairs":
features = datasets.Features(
{"image": datasets.features.Image(), "prompt": datasets.Value("string")}
)
return datasets.DatasetInfo(features=features)
``` | DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding' | ### Describe the bug
When I was in load_dataset, it said "DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'". The second time I ran it, there was no error and the dataset object worked
```python
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[3], line 1
----> 1 dataset = load_dataset(
2 "/home/aihao/workspace/DeepLearningContent/datasets/manga",
3 data_dir="/home/aihao/workspace/DeepLearningContent/datasets/manga",
4 split="train",
5 )
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146), in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2142 # Build dataset for splits
2143 keep_in_memory = (
2144 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
2145 )
-> 2146 ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
2147 # Rename and cast features to match task schema
2148 if task is not None:
2149 # To avoid issuing the same warning twice
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190), in DatasetBuilder.as_dataset(self, split, run_post_process, verification_mode, ignore_verifications, in_memory)
1187 verification_mode = VerificationMode(verification_mode or VerificationMode.BASIC_CHECKS)
1189 # Create a dataset for each of the given splits
-> 1190 datasets = map_nested(
1191 partial(
1192 self._build_single_dataset,
...
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379), in DatasetInfo.copy(self)
378 def copy(self) -> "DatasetInfo":
--> 379 return self.__class__(**{k: copy.deepcopy(v) for k, v in self.__dict__.items()})
TypeError: DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'
```
### Steps to reproduce the bug
/home/aihao/workspace/DeepLearningContent/datasets/images/images.py
```python
from logging import config
import datasets
import os
from PIL import Image
import csv
import json
class ImagesConfig(datasets.BuilderConfig):
def __init__(self, **kwargs):
super(ImagesConfig, self).__init__(**kwargs)
class Images(datasets.GeneratorBasedBuilder):
def _split_generators(self, dl_manager: datasets.DownloadManager):
return [
datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={"split": datasets.Split.TRAIN},
)
]
BUILDER_CONFIGS = [
ImagesConfig(
name="similar_pairs",
description="simliar pair dataset,item is a pair of similar images",
),
ImagesConfig(
name="image_prompt_pairs",
description="image prompt pairs",
),
]
def _info(self):
if self.config.name == "similar_pairs":
return datasets.Features(
{
"image1": datasets.features.Image(),
"image2": datasets.features.Image(),
"similarity": datasets.Value("float32"),
}
)
elif self.config.name == "image_prompt_pairs":
return datasets.Features(
{"image": datasets.features.Image(), "prompt": datasets.Value("string")}
)
def _generate_examples(self, split):
data_path = os.path.join(self.config.data_dir, "data")
if self.config.name == "similar_pairs":
prompts = {}
with open(os.path.join(data_path ,"prompts.json"), "r") as f:
prompts = json.load(f)
with open(os.path.join(data_path, "similar_pairs.csv"), "r") as f:
reader = csv.reader(f)
for row in reader:
image1_path, image2_path, similarity = row
yield image1_path + ":" + image2_path + ":", {
"image1": Image.open(image1_path),
"prompt1": prompts[image1_path],
"image2": Image.open(image2_path),
"prompt2": prompts[image2_path],
"similarity": float(similarity),
}
```
Code that indicates an error:
```python
from datasets import load_dataset
import json
import csv
import ast
import torch
data_dir = "/home/aihao/workspace/DeepLearningContent/datasets/images"
dataset = load_dataset(data_dir, data_dir=data_dir, name="similar_pairs")
```
### Expected behavior
The first execution gives an error, but it works fine
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-6.2.0-26-generic-x86_64-with-glibc2.35
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3 | 59 | DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'
### Describe the bug
When I was in load_dataset, it said "DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'". The second time I ran it, there was no error and the dataset object worked
```python
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[3], line 1
----> 1 dataset = load_dataset(
2 "/home/aihao/workspace/DeepLearningContent/datasets/manga",
3 data_dir="/home/aihao/workspace/DeepLearningContent/datasets/manga",
4 split="train",
5 )
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146), in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2142 # Build dataset for splits
2143 keep_in_memory = (
2144 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
2145 )
-> 2146 ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
2147 # Rename and cast features to match task schema
2148 if task is not None:
2149 # To avoid issuing the same warning twice
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190), in DatasetBuilder.as_dataset(self, split, run_post_process, verification_mode, ignore_verifications, in_memory)
1187 verification_mode = VerificationMode(verification_mode or VerificationMode.BASIC_CHECKS)
1189 # Create a dataset for each of the given splits
-> 1190 datasets = map_nested(
1191 partial(
1192 self._build_single_dataset,
...
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379), in DatasetInfo.copy(self)
378 def copy(self) -> "DatasetInfo":
--> 379 return self.__class__(**{k: copy.deepcopy(v) for k, v in self.__dict__.items()})
TypeError: DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'
```
### Steps to reproduce the bug
/home/aihao/workspace/DeepLearningContent/datasets/images/images.py
```python
from logging import config
import datasets
import os
from PIL import Image
import csv
import json
class ImagesConfig(datasets.BuilderConfig):
def __init__(self, **kwargs):
super(ImagesConfig, self).__init__(**kwargs)
class Images(datasets.GeneratorBasedBuilder):
def _split_generators(self, dl_manager: datasets.DownloadManager):
return [
datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={"split": datasets.Split.TRAIN},
)
]
BUILDER_CONFIGS = [
ImagesConfig(
name="similar_pairs",
description="simliar pair dataset,item is a pair of similar images",
),
ImagesConfig(
name="image_prompt_pairs",
description="image prompt pairs",
),
]
def _info(self):
if self.config.name == "similar_pairs":
return datasets.Features(
{
"image1": datasets.features.Image(),
"image2": datasets.features.Image(),
"similarity": datasets.Value("float32"),
}
)
elif self.config.name == "image_prompt_pairs":
return datasets.Features(
{"image": datasets.features.Image(), "prompt": datasets.Value("string")}
)
def _generate_examples(self, split):
data_path = os.path.join(self.config.data_dir, "data")
if self.config.name == "similar_pairs":
prompts = {}
with open(os.path.join(data_path ,"prompts.json"), "r") as f:
prompts = json.load(f)
with open(os.path.join(data_path, "similar_pairs.csv"), "r") as f:
reader = csv.reader(f)
for row in reader:
image1_path, image2_path, similarity = row
yield image1_path + ":" + image2_path + ":", {
"image1": Image.open(image1_path),
"prompt1": prompts[image1_path],
"image2": Image.open(image2_path),
"prompt2": prompts[image2_path],
"similarity": float(similarity),
}
```
Code that indicates an error:
```python
from datasets import load_dataset
import json
import csv
import ast
import torch
data_dir = "/home/aihao/workspace/DeepLearningContent/datasets/images"
dataset = load_dataset(data_dir, data_dir=data_dir, name="similar_pairs")
```
### Expected behavior
The first execution gives an error, but it works fine
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-6.2.0-26-generic-x86_64-with-glibc2.35
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
I can see the issue now...
You can fix it by returning a `DatasetInfo` object in the `_info` method as follows:
```python
def _info(self):
if self.config.name == "similar_pairs":
features = datasets.Features(
{
"image1": datasets.features.Image(),
"prompt1": datasets.Value("string"),
"image2": datasets.features.Image(),
"prompt2": datasets.Value("string"),
"similarity": datasets.Value("float32"),
}
)
elif self.config.name == "image_prompt_pairs":
features = datasets.Features(
{"image": datasets.features.Image(), "prompt": datasets.Value("string")}
)
return datasets.DatasetInfo(features=features)
``` | [
-0.07070029526948929,
-0.11540171504020691,
0.006694383919239044,
0.35483965277671814,
0.5811512470245361,
0.26537662744522095,
0.13077785074710846,
0.37581178545951843,
-0.23715856671333313,
0.07963988929986954,
0.06881711632013321,
0.3887733519077301,
-0.0750109851360321,
0.3504210412502289,
0.010802865028381348,
-0.26599445939064026,
0.06241599842905998,
0.3554588556289673,
-0.27257367968559265,
0.07664310187101364,
-0.39239227771759033,
0.3850339949131012,
-0.5596711039543152,
-0.12456786632537842,
0.07355214655399323,
-0.08091731369495392,
-0.16728973388671875,
0.17824172973632812,
-0.17621755599975586,
-0.505584180355072,
0.24178168177604675,
-0.1263563185930252,
0.20765769481658936,
0.4656551778316498,
-0.00011479162640171126,
0.1300894320011139,
0.1693420261144638,
-0.191647469997406,
-0.4818935990333557,
-0.18278445303440094,
-0.42340999841690063,
-0.3686598837375641,
0.021593987941741943,
-0.32046544551849365,
-0.13756026327610016,
-0.2946101129055023,
-0.25731703639030457,
-0.6029804348945618,
0.3542990982532501,
0.4759308397769928,
0.19574692845344543,
0.27641841769218445,
0.016931340098381042,
-0.15270501375198364,
0.0443914458155632,
0.017476502805948257,
-0.26956260204315186,
0.11507286131381989,
-0.07260840386152267,
0.0773690864443779,
0.1556115746498108,
0.31896671652793884,
0.11369472742080688,
0.22951701283454895,
0.3821064233779907,
0.03631053864955902,
-0.006869908422231674,
-0.24498309195041656,
0.03581338748335838,
0.0314113013446331,
0.5522449016571045,
-0.24538227915763855,
-0.24418017268180847,
-0.1859855204820633,
-0.07566136121749878,
-0.3821980059146881,
0.24201373755931854,
0.01775040104985237,
-0.023735955357551575,
0.3677349090576172,
0.1424391269683838,
-0.0476306788623333,
-0.07556041330099106,
-0.041191838681697845,
-0.022481605410575867,
-0.1467212587594986,
-0.16477513313293457,
0.17058232426643372,
0.22174297273159027,
-0.01699879951775074,
0.0904935821890831,
0.0616423636674881,
-0.3246755599975586,
0.11866932362318039,
-0.3849504590034485,
-0.14327594637870789,
-0.029970496892929077,
0.06632857024669647,
0.19965142011642456,
-0.0635453462600708,
-0.26171964406967163,
-0.1442011594772339,
0.21022261679172516,
0.09406594187021255,
0.2270517796278,
0.15502209961414337,
0.12009094655513763,
0.2588718831539154,
-0.019052626565098763,
-0.2073211818933487,
-0.10736165940761566,
-0.16628998517990112,
-0.07147905975580215,
-0.05507403984665871,
0.346168577671051,
0.08931301534175873,
0.47108036279678345,
-0.14513638615608215,
-0.24749788641929626,
0.09681481868028641,
-0.17244768142700195,
-0.14148765802383423,
-0.09515707194805145,
0.3479653298854828,
0.3728860020637512,
0.3912353217601776,
0.20510205626487732,
0.2854972183704376,
0.04222942888736725,
-0.6152735948562622,
-0.21168331801891327,
0.04428761452436447,
-0.23029838502407074,
0.031123235821723938,
-0.005640037357807159,
0.03197161480784416,
0.07527164369821548,
0.18947070837020874,
-0.02635136991739273,
-0.2949342131614685,
0.11111520975828171,
-0.24708618223667145,
-0.0220322385430336,
0.02695191465318203,
-0.028744075447320938,
0.13847079873085022,
0.4819733500480652,
-0.10695802420377731,
-0.15624003112316132,
0.05717552453279495,
-0.33822667598724365,
-0.45749205350875854,
-0.42315182089805603,
0.19088250398635864,
0.0030022040009498596,
-0.0146616380661726,
-0.31331124901771545,
0.05377133563160896,
0.21132923662662506,
-0.20890586078166962,
-0.2293064147233963,
-0.3495498299598694,
-0.21973058581352234,
-0.17366652190685272,
0.18035949766635895,
0.36688488721847534,
-0.47540393471717834,
0.10643324255943298,
-0.09987999498844147,
-0.11037078499794006,
0.12210451811552048,
0.06272026896476746,
-0.35976362228393555,
0.42199277877807617,
-0.216512531042099,
-0.07360229641199112,
0.3589792847633362,
-0.38053494691848755,
-0.33264946937561035,
0.41926831007003784,
0.035168275237083435,
0.1236029714345932,
0.14745494723320007,
-0.03447813168168068,
0.12427615374326706,
-0.11320139467716217,
-0.004911784082651138,
0.19825726747512817,
-0.03752211108803749,
0.1764364391565323,
-0.17685580253601074,
-0.13858366012573242,
0.23645097017288208,
0.09743712842464447,
0.10850566625595093,
0.18798217177391052,
-0.06910140812397003,
0.10452422499656677,
0.1104094535112381,
-0.02690098062157631,
-0.12605063617229462,
0.23959806561470032,
-0.0011756508611142635,
0.10907405614852905,
0.26906442642211914,
-0.08181021362543106,
-0.4488169848918915,
0.2490074187517166,
0.31329038739204407,
0.07620657980442047,
-0.3418406546115875,
-0.18824872374534607,
-0.4166206419467926,
-0.004168964922428131,
-0.1973992884159088,
0.12320780754089355,
0.15305769443511963,
0.16185788810253143,
-0.18228040635585785,
0.003125719726085663,
-0.24914517998695374,
0.12847961485385895,
-0.19989418983459473,
-0.016030631959438324,
-0.025896381586790085,
0.12878161668777466,
-0.22603526711463928,
0.012772195041179657,
0.09077498316764832,
0.011567749083042145,
0.31025296449661255,
-0.15249766409397125,
-0.2585323750972748,
0.45949414372444153,
0.15624791383743286,
-0.04745873808860779,
-0.3295535445213318,
-0.13898614048957825,
-0.11819716542959213,
-0.2866854965686798,
-0.07870051264762878,
-0.18027031421661377,
0.4042471647262573,
-0.05839144065976143,
0.07256309688091278,
0.14941540360450745,
0.22447343170642853,
0.21048372983932495,
-0.039810601621866226,
-0.05240296199917793,
0.2763248085975647,
-0.13677871227264404,
-0.11171187460422516,
-0.43130767345428467,
0.1207641214132309,
-0.11179779469966888,
0.06629311293363571,
-0.011639437638223171,
-0.17027772963047028,
-0.14056657254695892,
0.5797865390777588,
0.13184458017349243,
0.1296686977148056,
0.030339621007442474,
-0.029596589505672455,
0.05540803074836731,
-0.11129982769489288,
0.2809083163738251,
0.6012133359909058,
0.02990793064236641,
-0.20613253116607666,
0.06977403163909912,
0.07402460277080536,
0.007573585957288742,
0.16458337008953094,
0.1323767453432083,
0.27220797538757324,
0.16514235734939575,
0.08789701759815216,
0.11491662263870239,
-0.2300560176372528,
0.022391825914382935,
0.32887569069862366,
0.3023911416530609,
-0.47253498435020447,
0.21670237183570862,
-0.39083683490753174,
-0.26406118273735046,
-0.11149963736534119,
0.04577723145484924,
0.26788902282714844,
-0.445814311504364,
-0.24836516380310059,
-0.16174378991127014,
0.06185130774974823,
0.24516364932060242,
-0.38238388299942017,
0.24038627743721008,
-0.09656307846307755,
-0.1587991714477539,
0.04962736368179321,
-0.24415330588817596,
-0.05627301335334778,
-0.006671518087387085,
0.2513587772846222,
-0.2507084608078003,
0.33967170119285583,
-0.26436764001846313,
-0.07759428024291992,
-0.11280127614736557,
-0.17989030480384827,
0.3131224811077118,
-0.2836134135723114,
0.354221373796463,
0.19339600205421448,
0.32849937677383423,
0.2471460998058319,
-0.19274649024009705,
0.4476488530635834,
0.15750476717948914,
0.00410827249288559,
0.20834192633628845,
0.05866518244147301,
-0.23808571696281433,
-0.19740277528762817,
-0.40303415060043335,
-0.11609335243701935,
-0.3366469144821167,
-0.1959540694952011,
-0.11199335753917694,
0.008076902478933334,
0.06271426379680634,
0.03884357959032059,
0.16209140419960022,
0.21492278575897217,
0.14923718571662903,
-0.2710900902748108,
-0.11182089149951935,
0.20159687101840973,
-0.06428411602973938,
-0.20425660908222198,
0.047712430357933044,
-0.043298106640577316,
0.2892319858074188,
-0.0035003162920475006,
-0.42780017852783203,
-0.026873789727687836,
-0.34967347979545593,
0.3373104929924011,
-0.2425673007965088,
-0.14801229536533356,
0.20214961469173431,
0.05149473249912262,
0.05539971962571144,
-0.19972437620162964,
-0.2828601598739624,
0.16345417499542236,
-0.024957187473773956,
0.19488584995269775,
0.1672276258468628,
0.8209006786346436,
-0.06943017244338989,
0.36995255947113037,
-0.020276691764593124,
-0.13649548590183258,
0.47261717915534973,
-0.23636703193187714,
0.32619524002075195,
-0.19011156260967255,
-0.2949039936065674,
-0.08874168246984482,
-0.23355881869792938,
-0.034699950367212296,
-0.0655050128698349,
-0.19649137556552887,
-0.2568719685077667,
-0.18467473983764648,
0.08116970211267471,
-0.40044963359832764,
-0.12933537364006042,
0.23510003089904785,
-0.36249738931655884,
0.11578776687383652,
-0.041706692427396774,
0.33364763855934143,
-0.12545114755630493,
0.18842390179634094,
-0.017640989273786545,
0.14875414967536926,
0.16230586171150208,
-0.04839974269270897,
-0.27833303809165955,
-0.14302203059196472,
-0.06564294546842575,
0.15890079736709595,
-0.06931918114423752,
0.46842116117477417,
-0.08550431579351425,
0.05284910649061203,
0.12530939280986786,
-0.03240267187356949,
0.5128427147865295,
-0.18287025392055511,
-0.01803828403353691,
0.14133647084236145,
0.22417137026786804,
-0.14485934376716614,
-0.19999417662620544,
-0.1718306839466095,
0.1590501219034195,
0.050198037177324295,
0.39346516132354736,
-0.28235098719596863,
-0.06802847236394882,
0.4073392450809479,
0.22992421686649323,
-0.246763214468956,
-0.11938850581645966,
-0.2965717911720276,
-0.6421763896942139,
-0.40441352128982544,
0.0018890872597694397,
0.2235005795955658,
0.17287775874137878,
0.10950702428817749,
0.3510645627975464,
-0.22674785554409027,
-0.17921701073646545,
0.15829673409461975,
0.18602029979228973,
0.27381935715675354,
-0.027625616639852524,
0.24644939601421356,
-0.036949217319488525,
0.06576648354530334,
0.21468393504619598,
0.6211022138595581,
-0.08652357757091522,
-0.4355189800262451,
-0.0780823677778244,
-0.2128516137599945,
0.4356660842895508,
0.10831031948328018,
-0.22959454357624054,
0.19099265336990356,
-0.1627090871334076,
0.015296390280127525,
-0.3176906406879425,
-0.01063762977719307,
0.654777467250824,
-0.12235639989376068,
-0.4831167757511139,
-0.6786954402923584,
0.5413047671318054,
-0.03537043184041977,
-0.09980350732803345,
0.34746548533439636,
0.46791866421699524,
-0.23933938145637512,
0.47865691781044006,
-0.1178295761346817,
0.8088359236717224,
0.28793269395828247,
-0.09152112901210785,
0.41694676876068115,
-0.05191541835665703,
0.10770296305418015,
0.08281609416007996,
0.20265257358551025,
-0.26450687646865845,
-0.31520354747772217,
-0.08112920820713043,
-0.06290368735790253,
0.1904078722000122,
-0.1486048847436905,
-0.5318316221237183,
0.10642368346452713,
-0.382985919713974,
0.15747657418251038,
-0.0034655481576919556,
0.13590414822101593,
-0.19743233919143677,
-0.011521434411406517,
-0.05286763608455658,
0.1661379635334015,
-0.04875881224870682,
0.12037627398967743,
0.04363381862640381,
-0.119090735912323,
0.05861520767211914,
-0.30178725719451904,
-0.414497971534729,
0.16163773834705353,
-0.07467249035835266,
0.31625205278396606,
-0.130738765001297,
-0.1273917853832245,
0.43506693840026855,
0.33925458788871765,
0.27436038851737976,
0.11674563586711884,
-0.0022079795598983765,
0.2940897047519684,
0.15158268809318542,
-0.06335994601249695,
-0.018206171691417694,
0.014717113226652145,
0.21847468614578247,
0.07488002628087997,
-0.24165096879005432,
0.3551171123981476,
-0.1638389527797699,
-0.20990778505802155,
-0.1419745236635208,
-0.052132848650217056,
0.06241951137781143,
-0.539549708366394,
-0.317965030670166,
0.041460100561380386,
0.06274150311946869,
-0.15285730361938477,
0.13728678226470947,
-0.14475221931934357,
0.022631525993347168,
0.2404552698135376,
-0.22819757461547852,
-0.27345404028892517,
0.058191195130348206,
0.10372811555862427,
0.17803117632865906,
0.2572677731513977,
0.781903088092804,
0.21465091407299042,
-0.05973692983388901,
-0.24066300690174103,
0.4480476975440979,
0.003064848482608795,
-0.17765556275844574,
0.269491046667099,
0.08581310510635376,
0.15662066638469696,
0.10284744948148727,
0.277896910905838,
0.07699079811573029,
-0.10394886136054993,
-0.06549680233001709,
-0.23677216470241547,
0.030925758183002472,
0.09168069064617157,
-0.08804009854793549,
0.061151549220085144,
-0.06734275817871094,
0.15448759496212006,
-0.0034667998552322388,
0.21343038976192474,
-0.30256205797195435,
0.046452321112155914,
-0.19562649726867676,
0.08149453997612,
0.31722885370254517,
0.23556804656982422,
0.22187194228172302,
-0.17591232061386108,
0.08482512831687927,
0.19861827790737152,
-0.022389456629753113,
-0.12799492478370667,
-0.28608253598213196,
0.139133021235466,
-0.03188733756542206,
0.10402894765138626,
-0.111893430352211,
-0.21487170457839966,
-0.10717341303825378,
-0.06573796272277832,
0.06661426275968552,
0.07707783579826355,
-0.028671953827142715,
0.43537604808807373,
0.046277809888124466,
0.1470007449388504,
-0.10099510848522186,
0.13415497541427612,
-0.11098631471395493,
0.26883214712142944,
0.07439690828323364,
0.12718740105628967,
0.09815986454486847,
0.05583948642015457,
-0.44027072191238403,
0.18544456362724304,
-0.13028644025325775,
0.0069730766117572784,
0.31674543023109436,
-0.2733885943889618,
0.2023896723985672,
0.032999876886606216,
0.029223397374153137,
0.3066404461860657,
-0.41146793961524963,
0.08539064973592758,
-0.10291978716850281,
0.16471554338932037,
-0.23669591546058655,
-0.03969055414199829,
-0.20071321725845337,
-0.08292719721794128,
0.0947810485959053,
0.2829931080341339,
-0.03365757316350937,
0.050606563687324524,
-0.3422643542289734,
-0.16419300436973572,
0.6340544819831848,
-0.058073464781045914,
0.25241005420684814,
0.5857937335968018,
-0.035386793315410614,
-0.06319401413202286,
0.3330034017562866,
0.1837904453277588,
0.12923119962215424,
0.4995455741882324,
-0.2970971465110779,
0.11500553041696548,
0.19895535707473755,
0.2540436089038849,
-0.09150370955467224,
-0.1165090799331665,
0.3329847455024719,
0.41502511501312256,
-0.1082146018743515,
-0.012223485857248306,
-0.07103541493415833,
0.03989537060260773,
-0.3586527705192566,
-0.07570657879114151,
-0.3971538543701172,
0.010438567027449608,
-0.15887048840522766,
-0.005254045128822327,
-0.2990977168083191,
-0.17625343799591064,
-0.4160192608833313,
-0.046858493238687515,
-0.11094720661640167,
-0.07780630886554718,
0.27775856852531433,
0.08117733895778656,
0.05737565830349922,
-0.06308840215206146,
0.05163354054093361,
0.2166464626789093,
0.16213393211364746,
-0.5012911558151245,
0.40576139092445374,
0.3028249442577362,
0.11382725834846497,
0.3755130469799042,
0.19796724617481232,
0.5795485377311707,
0.5169925689697266,
-0.029978904873132706,
-0.19756492972373962,
0.00230368971824646,
-0.262483149766922,
0.12255019694566727,
0.27535563707351685,
-0.2812947928905487,
0.5639821290969849,
0.33594486117362976,
0.1880238950252533,
-0.15815600752830505,
0.013485528528690338,
0.2036563903093338,
0.3686160743236542,
-0.4007744789123535,
0.5033644437789917,
-0.24769876897335052,
-0.06420111656188965,
-0.1305515319108963,
0.06017602980136871,
-0.2144031524658203,
-0.046546898782253265,
0.31180593371391296,
0.11506509780883789,
0.11171726882457733,
0.09560948610305786,
0.0906086191534996,
0.14745628833770752,
0.458395779132843,
0.2515981197357178,
-0.13788653910160065,
-0.48336729407310486,
-0.20708006620407104,
-0.6902254819869995,
-0.0814477950334549,
-0.24450592696666718,
-0.49004969000816345,
0.1218118816614151,
0.1752672791481018,
0.35737138986587524,
0.34270837903022766,
-0.0001067817211151123,
0.30345073342323303,
-0.2355589121580124,
0.054484955966472626,
-0.30625438690185547,
-0.3532562553882599,
0.04249349236488342,
0.06738003343343735,
-0.1603924036026001,
-0.3568378686904907,
0.14241786301136017,
0.2410283237695694,
0.06858707219362259,
-0.18605543673038483,
-0.1491060107946396,
0.19588790833950043,
-0.42789191007614136,
0.43579062819480896,
0.07753989845514297,
0.5311054587364197,
-0.07475375384092331,
-0.23476797342300415,
0.016203058883547783,
-0.5138431787490845,
-0.3377377390861511,
0.021064529195427895,
0.17035722732543945,
0.28367459774017334,
-0.08696964383125305,
0.07213275134563446,
-0.2623671293258667,
0.0792887806892395,
-0.03222059831023216,
0.1206437200307846,
-0.3665316104888916,
0.2208767831325531,
-0.03919346630573273,
-0.0007525719702243805,
0.08671741187572479,
0.14793655276298523,
0.062093812972307205,
0.30313485860824585,
-0.1354074478149414,
-0.3530300259590149,
0.41311872005462646,
-0.09793254733085632,
-0.2819955050945282,
0.03156706690788269,
0.07113666832447052,
-0.07734885066747665,
0.10277733206748962,
-0.5570218563079834,
-0.014322400093078613,
0.3744313418865204,
-0.057601120322942734,
-0.09791050851345062,
0.3266601860523224,
0.272071897983551,
0.10237859934568405,
-0.004661343991756439,
0.14781683683395386,
-0.07056959718465805,
-0.18000271916389465,
-0.019132502377033234,
-0.01366957277059555
] |
https://github.com/huggingface/datasets/issues/6157 | @mariosasko Oh, that's the problem. Thank you very much. Returned the wrong object and it actually works? I've been training with it for a long time | DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding' | ### Describe the bug
When I was in load_dataset, it said "DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'". The second time I ran it, there was no error and the dataset object worked
```python
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[3], line 1
----> 1 dataset = load_dataset(
2 "/home/aihao/workspace/DeepLearningContent/datasets/manga",
3 data_dir="/home/aihao/workspace/DeepLearningContent/datasets/manga",
4 split="train",
5 )
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146), in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2142 # Build dataset for splits
2143 keep_in_memory = (
2144 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
2145 )
-> 2146 ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
2147 # Rename and cast features to match task schema
2148 if task is not None:
2149 # To avoid issuing the same warning twice
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190), in DatasetBuilder.as_dataset(self, split, run_post_process, verification_mode, ignore_verifications, in_memory)
1187 verification_mode = VerificationMode(verification_mode or VerificationMode.BASIC_CHECKS)
1189 # Create a dataset for each of the given splits
-> 1190 datasets = map_nested(
1191 partial(
1192 self._build_single_dataset,
...
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379), in DatasetInfo.copy(self)
378 def copy(self) -> "DatasetInfo":
--> 379 return self.__class__(**{k: copy.deepcopy(v) for k, v in self.__dict__.items()})
TypeError: DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'
```
### Steps to reproduce the bug
/home/aihao/workspace/DeepLearningContent/datasets/images/images.py
```python
from logging import config
import datasets
import os
from PIL import Image
import csv
import json
class ImagesConfig(datasets.BuilderConfig):
def __init__(self, **kwargs):
super(ImagesConfig, self).__init__(**kwargs)
class Images(datasets.GeneratorBasedBuilder):
def _split_generators(self, dl_manager: datasets.DownloadManager):
return [
datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={"split": datasets.Split.TRAIN},
)
]
BUILDER_CONFIGS = [
ImagesConfig(
name="similar_pairs",
description="simliar pair dataset,item is a pair of similar images",
),
ImagesConfig(
name="image_prompt_pairs",
description="image prompt pairs",
),
]
def _info(self):
if self.config.name == "similar_pairs":
return datasets.Features(
{
"image1": datasets.features.Image(),
"image2": datasets.features.Image(),
"similarity": datasets.Value("float32"),
}
)
elif self.config.name == "image_prompt_pairs":
return datasets.Features(
{"image": datasets.features.Image(), "prompt": datasets.Value("string")}
)
def _generate_examples(self, split):
data_path = os.path.join(self.config.data_dir, "data")
if self.config.name == "similar_pairs":
prompts = {}
with open(os.path.join(data_path ,"prompts.json"), "r") as f:
prompts = json.load(f)
with open(os.path.join(data_path, "similar_pairs.csv"), "r") as f:
reader = csv.reader(f)
for row in reader:
image1_path, image2_path, similarity = row
yield image1_path + ":" + image2_path + ":", {
"image1": Image.open(image1_path),
"prompt1": prompts[image1_path],
"image2": Image.open(image2_path),
"prompt2": prompts[image2_path],
"similarity": float(similarity),
}
```
Code that indicates an error:
```python
from datasets import load_dataset
import json
import csv
import ast
import torch
data_dir = "/home/aihao/workspace/DeepLearningContent/datasets/images"
dataset = load_dataset(data_dir, data_dir=data_dir, name="similar_pairs")
```
### Expected behavior
The first execution gives an error, but it works fine
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-6.2.0-26-generic-x86_64-with-glibc2.35
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3 | 26 | DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'
### Describe the bug
When I was in load_dataset, it said "DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'". The second time I ran it, there was no error and the dataset object worked
```python
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[3], line 1
----> 1 dataset = load_dataset(
2 "/home/aihao/workspace/DeepLearningContent/datasets/manga",
3 data_dir="/home/aihao/workspace/DeepLearningContent/datasets/manga",
4 split="train",
5 )
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146), in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2142 # Build dataset for splits
2143 keep_in_memory = (
2144 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
2145 )
-> 2146 ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
2147 # Rename and cast features to match task schema
2148 if task is not None:
2149 # To avoid issuing the same warning twice
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190), in DatasetBuilder.as_dataset(self, split, run_post_process, verification_mode, ignore_verifications, in_memory)
1187 verification_mode = VerificationMode(verification_mode or VerificationMode.BASIC_CHECKS)
1189 # Create a dataset for each of the given splits
-> 1190 datasets = map_nested(
1191 partial(
1192 self._build_single_dataset,
...
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379), in DatasetInfo.copy(self)
378 def copy(self) -> "DatasetInfo":
--> 379 return self.__class__(**{k: copy.deepcopy(v) for k, v in self.__dict__.items()})
TypeError: DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'
```
### Steps to reproduce the bug
/home/aihao/workspace/DeepLearningContent/datasets/images/images.py
```python
from logging import config
import datasets
import os
from PIL import Image
import csv
import json
class ImagesConfig(datasets.BuilderConfig):
def __init__(self, **kwargs):
super(ImagesConfig, self).__init__(**kwargs)
class Images(datasets.GeneratorBasedBuilder):
def _split_generators(self, dl_manager: datasets.DownloadManager):
return [
datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={"split": datasets.Split.TRAIN},
)
]
BUILDER_CONFIGS = [
ImagesConfig(
name="similar_pairs",
description="simliar pair dataset,item is a pair of similar images",
),
ImagesConfig(
name="image_prompt_pairs",
description="image prompt pairs",
),
]
def _info(self):
if self.config.name == "similar_pairs":
return datasets.Features(
{
"image1": datasets.features.Image(),
"image2": datasets.features.Image(),
"similarity": datasets.Value("float32"),
}
)
elif self.config.name == "image_prompt_pairs":
return datasets.Features(
{"image": datasets.features.Image(), "prompt": datasets.Value("string")}
)
def _generate_examples(self, split):
data_path = os.path.join(self.config.data_dir, "data")
if self.config.name == "similar_pairs":
prompts = {}
with open(os.path.join(data_path ,"prompts.json"), "r") as f:
prompts = json.load(f)
with open(os.path.join(data_path, "similar_pairs.csv"), "r") as f:
reader = csv.reader(f)
for row in reader:
image1_path, image2_path, similarity = row
yield image1_path + ":" + image2_path + ":", {
"image1": Image.open(image1_path),
"prompt1": prompts[image1_path],
"image2": Image.open(image2_path),
"prompt2": prompts[image2_path],
"similarity": float(similarity),
}
```
Code that indicates an error:
```python
from datasets import load_dataset
import json
import csv
import ast
import torch
data_dir = "/home/aihao/workspace/DeepLearningContent/datasets/images"
dataset = load_dataset(data_dir, data_dir=data_dir, name="similar_pairs")
```
### Expected behavior
The first execution gives an error, but it works fine
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-6.2.0-26-generic-x86_64-with-glibc2.35
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
@mariosasko Oh, that's the problem. Thank you very much. Returned the wrong object and it actually works? I've been training with it for a long time | [
-0.07070029526948929,
-0.11540171504020691,
0.006694383919239044,
0.35483965277671814,
0.5811512470245361,
0.26537662744522095,
0.13077785074710846,
0.37581178545951843,
-0.23715856671333313,
0.07963988929986954,
0.06881711632013321,
0.3887733519077301,
-0.0750109851360321,
0.3504210412502289,
0.010802865028381348,
-0.26599445939064026,
0.06241599842905998,
0.3554588556289673,
-0.27257367968559265,
0.07664310187101364,
-0.39239227771759033,
0.3850339949131012,
-0.5596711039543152,
-0.12456786632537842,
0.07355214655399323,
-0.08091731369495392,
-0.16728973388671875,
0.17824172973632812,
-0.17621755599975586,
-0.505584180355072,
0.24178168177604675,
-0.1263563185930252,
0.20765769481658936,
0.4656551778316498,
-0.00011479162640171126,
0.1300894320011139,
0.1693420261144638,
-0.191647469997406,
-0.4818935990333557,
-0.18278445303440094,
-0.42340999841690063,
-0.3686598837375641,
0.021593987941741943,
-0.32046544551849365,
-0.13756026327610016,
-0.2946101129055023,
-0.25731703639030457,
-0.6029804348945618,
0.3542990982532501,
0.4759308397769928,
0.19574692845344543,
0.27641841769218445,
0.016931340098381042,
-0.15270501375198364,
0.0443914458155632,
0.017476502805948257,
-0.26956260204315186,
0.11507286131381989,
-0.07260840386152267,
0.0773690864443779,
0.1556115746498108,
0.31896671652793884,
0.11369472742080688,
0.22951701283454895,
0.3821064233779907,
0.03631053864955902,
-0.006869908422231674,
-0.24498309195041656,
0.03581338748335838,
0.0314113013446331,
0.5522449016571045,
-0.24538227915763855,
-0.24418017268180847,
-0.1859855204820633,
-0.07566136121749878,
-0.3821980059146881,
0.24201373755931854,
0.01775040104985237,
-0.023735955357551575,
0.3677349090576172,
0.1424391269683838,
-0.0476306788623333,
-0.07556041330099106,
-0.041191838681697845,
-0.022481605410575867,
-0.1467212587594986,
-0.16477513313293457,
0.17058232426643372,
0.22174297273159027,
-0.01699879951775074,
0.0904935821890831,
0.0616423636674881,
-0.3246755599975586,
0.11866932362318039,
-0.3849504590034485,
-0.14327594637870789,
-0.029970496892929077,
0.06632857024669647,
0.19965142011642456,
-0.0635453462600708,
-0.26171964406967163,
-0.1442011594772339,
0.21022261679172516,
0.09406594187021255,
0.2270517796278,
0.15502209961414337,
0.12009094655513763,
0.2588718831539154,
-0.019052626565098763,
-0.2073211818933487,
-0.10736165940761566,
-0.16628998517990112,
-0.07147905975580215,
-0.05507403984665871,
0.346168577671051,
0.08931301534175873,
0.47108036279678345,
-0.14513638615608215,
-0.24749788641929626,
0.09681481868028641,
-0.17244768142700195,
-0.14148765802383423,
-0.09515707194805145,
0.3479653298854828,
0.3728860020637512,
0.3912353217601776,
0.20510205626487732,
0.2854972183704376,
0.04222942888736725,
-0.6152735948562622,
-0.21168331801891327,
0.04428761452436447,
-0.23029838502407074,
0.031123235821723938,
-0.005640037357807159,
0.03197161480784416,
0.07527164369821548,
0.18947070837020874,
-0.02635136991739273,
-0.2949342131614685,
0.11111520975828171,
-0.24708618223667145,
-0.0220322385430336,
0.02695191465318203,
-0.028744075447320938,
0.13847079873085022,
0.4819733500480652,
-0.10695802420377731,
-0.15624003112316132,
0.05717552453279495,
-0.33822667598724365,
-0.45749205350875854,
-0.42315182089805603,
0.19088250398635864,
0.0030022040009498596,
-0.0146616380661726,
-0.31331124901771545,
0.05377133563160896,
0.21132923662662506,
-0.20890586078166962,
-0.2293064147233963,
-0.3495498299598694,
-0.21973058581352234,
-0.17366652190685272,
0.18035949766635895,
0.36688488721847534,
-0.47540393471717834,
0.10643324255943298,
-0.09987999498844147,
-0.11037078499794006,
0.12210451811552048,
0.06272026896476746,
-0.35976362228393555,
0.42199277877807617,
-0.216512531042099,
-0.07360229641199112,
0.3589792847633362,
-0.38053494691848755,
-0.33264946937561035,
0.41926831007003784,
0.035168275237083435,
0.1236029714345932,
0.14745494723320007,
-0.03447813168168068,
0.12427615374326706,
-0.11320139467716217,
-0.004911784082651138,
0.19825726747512817,
-0.03752211108803749,
0.1764364391565323,
-0.17685580253601074,
-0.13858366012573242,
0.23645097017288208,
0.09743712842464447,
0.10850566625595093,
0.18798217177391052,
-0.06910140812397003,
0.10452422499656677,
0.1104094535112381,
-0.02690098062157631,
-0.12605063617229462,
0.23959806561470032,
-0.0011756508611142635,
0.10907405614852905,
0.26906442642211914,
-0.08181021362543106,
-0.4488169848918915,
0.2490074187517166,
0.31329038739204407,
0.07620657980442047,
-0.3418406546115875,
-0.18824872374534607,
-0.4166206419467926,
-0.004168964922428131,
-0.1973992884159088,
0.12320780754089355,
0.15305769443511963,
0.16185788810253143,
-0.18228040635585785,
0.003125719726085663,
-0.24914517998695374,
0.12847961485385895,
-0.19989418983459473,
-0.016030631959438324,
-0.025896381586790085,
0.12878161668777466,
-0.22603526711463928,
0.012772195041179657,
0.09077498316764832,
0.011567749083042145,
0.31025296449661255,
-0.15249766409397125,
-0.2585323750972748,
0.45949414372444153,
0.15624791383743286,
-0.04745873808860779,
-0.3295535445213318,
-0.13898614048957825,
-0.11819716542959213,
-0.2866854965686798,
-0.07870051264762878,
-0.18027031421661377,
0.4042471647262573,
-0.05839144065976143,
0.07256309688091278,
0.14941540360450745,
0.22447343170642853,
0.21048372983932495,
-0.039810601621866226,
-0.05240296199917793,
0.2763248085975647,
-0.13677871227264404,
-0.11171187460422516,
-0.43130767345428467,
0.1207641214132309,
-0.11179779469966888,
0.06629311293363571,
-0.011639437638223171,
-0.17027772963047028,
-0.14056657254695892,
0.5797865390777588,
0.13184458017349243,
0.1296686977148056,
0.030339621007442474,
-0.029596589505672455,
0.05540803074836731,
-0.11129982769489288,
0.2809083163738251,
0.6012133359909058,
0.02990793064236641,
-0.20613253116607666,
0.06977403163909912,
0.07402460277080536,
0.007573585957288742,
0.16458337008953094,
0.1323767453432083,
0.27220797538757324,
0.16514235734939575,
0.08789701759815216,
0.11491662263870239,
-0.2300560176372528,
0.022391825914382935,
0.32887569069862366,
0.3023911416530609,
-0.47253498435020447,
0.21670237183570862,
-0.39083683490753174,
-0.26406118273735046,
-0.11149963736534119,
0.04577723145484924,
0.26788902282714844,
-0.445814311504364,
-0.24836516380310059,
-0.16174378991127014,
0.06185130774974823,
0.24516364932060242,
-0.38238388299942017,
0.24038627743721008,
-0.09656307846307755,
-0.1587991714477539,
0.04962736368179321,
-0.24415330588817596,
-0.05627301335334778,
-0.006671518087387085,
0.2513587772846222,
-0.2507084608078003,
0.33967170119285583,
-0.26436764001846313,
-0.07759428024291992,
-0.11280127614736557,
-0.17989030480384827,
0.3131224811077118,
-0.2836134135723114,
0.354221373796463,
0.19339600205421448,
0.32849937677383423,
0.2471460998058319,
-0.19274649024009705,
0.4476488530635834,
0.15750476717948914,
0.00410827249288559,
0.20834192633628845,
0.05866518244147301,
-0.23808571696281433,
-0.19740277528762817,
-0.40303415060043335,
-0.11609335243701935,
-0.3366469144821167,
-0.1959540694952011,
-0.11199335753917694,
0.008076902478933334,
0.06271426379680634,
0.03884357959032059,
0.16209140419960022,
0.21492278575897217,
0.14923718571662903,
-0.2710900902748108,
-0.11182089149951935,
0.20159687101840973,
-0.06428411602973938,
-0.20425660908222198,
0.047712430357933044,
-0.043298106640577316,
0.2892319858074188,
-0.0035003162920475006,
-0.42780017852783203,
-0.026873789727687836,
-0.34967347979545593,
0.3373104929924011,
-0.2425673007965088,
-0.14801229536533356,
0.20214961469173431,
0.05149473249912262,
0.05539971962571144,
-0.19972437620162964,
-0.2828601598739624,
0.16345417499542236,
-0.024957187473773956,
0.19488584995269775,
0.1672276258468628,
0.8209006786346436,
-0.06943017244338989,
0.36995255947113037,
-0.020276691764593124,
-0.13649548590183258,
0.47261717915534973,
-0.23636703193187714,
0.32619524002075195,
-0.19011156260967255,
-0.2949039936065674,
-0.08874168246984482,
-0.23355881869792938,
-0.034699950367212296,
-0.0655050128698349,
-0.19649137556552887,
-0.2568719685077667,
-0.18467473983764648,
0.08116970211267471,
-0.40044963359832764,
-0.12933537364006042,
0.23510003089904785,
-0.36249738931655884,
0.11578776687383652,
-0.041706692427396774,
0.33364763855934143,
-0.12545114755630493,
0.18842390179634094,
-0.017640989273786545,
0.14875414967536926,
0.16230586171150208,
-0.04839974269270897,
-0.27833303809165955,
-0.14302203059196472,
-0.06564294546842575,
0.15890079736709595,
-0.06931918114423752,
0.46842116117477417,
-0.08550431579351425,
0.05284910649061203,
0.12530939280986786,
-0.03240267187356949,
0.5128427147865295,
-0.18287025392055511,
-0.01803828403353691,
0.14133647084236145,
0.22417137026786804,
-0.14485934376716614,
-0.19999417662620544,
-0.1718306839466095,
0.1590501219034195,
0.050198037177324295,
0.39346516132354736,
-0.28235098719596863,
-0.06802847236394882,
0.4073392450809479,
0.22992421686649323,
-0.246763214468956,
-0.11938850581645966,
-0.2965717911720276,
-0.6421763896942139,
-0.40441352128982544,
0.0018890872597694397,
0.2235005795955658,
0.17287775874137878,
0.10950702428817749,
0.3510645627975464,
-0.22674785554409027,
-0.17921701073646545,
0.15829673409461975,
0.18602029979228973,
0.27381935715675354,
-0.027625616639852524,
0.24644939601421356,
-0.036949217319488525,
0.06576648354530334,
0.21468393504619598,
0.6211022138595581,
-0.08652357757091522,
-0.4355189800262451,
-0.0780823677778244,
-0.2128516137599945,
0.4356660842895508,
0.10831031948328018,
-0.22959454357624054,
0.19099265336990356,
-0.1627090871334076,
0.015296390280127525,
-0.3176906406879425,
-0.01063762977719307,
0.654777467250824,
-0.12235639989376068,
-0.4831167757511139,
-0.6786954402923584,
0.5413047671318054,
-0.03537043184041977,
-0.09980350732803345,
0.34746548533439636,
0.46791866421699524,
-0.23933938145637512,
0.47865691781044006,
-0.1178295761346817,
0.8088359236717224,
0.28793269395828247,
-0.09152112901210785,
0.41694676876068115,
-0.05191541835665703,
0.10770296305418015,
0.08281609416007996,
0.20265257358551025,
-0.26450687646865845,
-0.31520354747772217,
-0.08112920820713043,
-0.06290368735790253,
0.1904078722000122,
-0.1486048847436905,
-0.5318316221237183,
0.10642368346452713,
-0.382985919713974,
0.15747657418251038,
-0.0034655481576919556,
0.13590414822101593,
-0.19743233919143677,
-0.011521434411406517,
-0.05286763608455658,
0.1661379635334015,
-0.04875881224870682,
0.12037627398967743,
0.04363381862640381,
-0.119090735912323,
0.05861520767211914,
-0.30178725719451904,
-0.414497971534729,
0.16163773834705353,
-0.07467249035835266,
0.31625205278396606,
-0.130738765001297,
-0.1273917853832245,
0.43506693840026855,
0.33925458788871765,
0.27436038851737976,
0.11674563586711884,
-0.0022079795598983765,
0.2940897047519684,
0.15158268809318542,
-0.06335994601249695,
-0.018206171691417694,
0.014717113226652145,
0.21847468614578247,
0.07488002628087997,
-0.24165096879005432,
0.3551171123981476,
-0.1638389527797699,
-0.20990778505802155,
-0.1419745236635208,
-0.052132848650217056,
0.06241951137781143,
-0.539549708366394,
-0.317965030670166,
0.041460100561380386,
0.06274150311946869,
-0.15285730361938477,
0.13728678226470947,
-0.14475221931934357,
0.022631525993347168,
0.2404552698135376,
-0.22819757461547852,
-0.27345404028892517,
0.058191195130348206,
0.10372811555862427,
0.17803117632865906,
0.2572677731513977,
0.781903088092804,
0.21465091407299042,
-0.05973692983388901,
-0.24066300690174103,
0.4480476975440979,
0.003064848482608795,
-0.17765556275844574,
0.269491046667099,
0.08581310510635376,
0.15662066638469696,
0.10284744948148727,
0.277896910905838,
0.07699079811573029,
-0.10394886136054993,
-0.06549680233001709,
-0.23677216470241547,
0.030925758183002472,
0.09168069064617157,
-0.08804009854793549,
0.061151549220085144,
-0.06734275817871094,
0.15448759496212006,
-0.0034667998552322388,
0.21343038976192474,
-0.30256205797195435,
0.046452321112155914,
-0.19562649726867676,
0.08149453997612,
0.31722885370254517,
0.23556804656982422,
0.22187194228172302,
-0.17591232061386108,
0.08482512831687927,
0.19861827790737152,
-0.022389456629753113,
-0.12799492478370667,
-0.28608253598213196,
0.139133021235466,
-0.03188733756542206,
0.10402894765138626,
-0.111893430352211,
-0.21487170457839966,
-0.10717341303825378,
-0.06573796272277832,
0.06661426275968552,
0.07707783579826355,
-0.028671953827142715,
0.43537604808807373,
0.046277809888124466,
0.1470007449388504,
-0.10099510848522186,
0.13415497541427612,
-0.11098631471395493,
0.26883214712142944,
0.07439690828323364,
0.12718740105628967,
0.09815986454486847,
0.05583948642015457,
-0.44027072191238403,
0.18544456362724304,
-0.13028644025325775,
0.0069730766117572784,
0.31674543023109436,
-0.2733885943889618,
0.2023896723985672,
0.032999876886606216,
0.029223397374153137,
0.3066404461860657,
-0.41146793961524963,
0.08539064973592758,
-0.10291978716850281,
0.16471554338932037,
-0.23669591546058655,
-0.03969055414199829,
-0.20071321725845337,
-0.08292719721794128,
0.0947810485959053,
0.2829931080341339,
-0.03365757316350937,
0.050606563687324524,
-0.3422643542289734,
-0.16419300436973572,
0.6340544819831848,
-0.058073464781045914,
0.25241005420684814,
0.5857937335968018,
-0.035386793315410614,
-0.06319401413202286,
0.3330034017562866,
0.1837904453277588,
0.12923119962215424,
0.4995455741882324,
-0.2970971465110779,
0.11500553041696548,
0.19895535707473755,
0.2540436089038849,
-0.09150370955467224,
-0.1165090799331665,
0.3329847455024719,
0.41502511501312256,
-0.1082146018743515,
-0.012223485857248306,
-0.07103541493415833,
0.03989537060260773,
-0.3586527705192566,
-0.07570657879114151,
-0.3971538543701172,
0.010438567027449608,
-0.15887048840522766,
-0.005254045128822327,
-0.2990977168083191,
-0.17625343799591064,
-0.4160192608833313,
-0.046858493238687515,
-0.11094720661640167,
-0.07780630886554718,
0.27775856852531433,
0.08117733895778656,
0.05737565830349922,
-0.06308840215206146,
0.05163354054093361,
0.2166464626789093,
0.16213393211364746,
-0.5012911558151245,
0.40576139092445374,
0.3028249442577362,
0.11382725834846497,
0.3755130469799042,
0.19796724617481232,
0.5795485377311707,
0.5169925689697266,
-0.029978904873132706,
-0.19756492972373962,
0.00230368971824646,
-0.262483149766922,
0.12255019694566727,
0.27535563707351685,
-0.2812947928905487,
0.5639821290969849,
0.33594486117362976,
0.1880238950252533,
-0.15815600752830505,
0.013485528528690338,
0.2036563903093338,
0.3686160743236542,
-0.4007744789123535,
0.5033644437789917,
-0.24769876897335052,
-0.06420111656188965,
-0.1305515319108963,
0.06017602980136871,
-0.2144031524658203,
-0.046546898782253265,
0.31180593371391296,
0.11506509780883789,
0.11171726882457733,
0.09560948610305786,
0.0906086191534996,
0.14745628833770752,
0.458395779132843,
0.2515981197357178,
-0.13788653910160065,
-0.48336729407310486,
-0.20708006620407104,
-0.6902254819869995,
-0.0814477950334549,
-0.24450592696666718,
-0.49004969000816345,
0.1218118816614151,
0.1752672791481018,
0.35737138986587524,
0.34270837903022766,
-0.0001067817211151123,
0.30345073342323303,
-0.2355589121580124,
0.054484955966472626,
-0.30625438690185547,
-0.3532562553882599,
0.04249349236488342,
0.06738003343343735,
-0.1603924036026001,
-0.3568378686904907,
0.14241786301136017,
0.2410283237695694,
0.06858707219362259,
-0.18605543673038483,
-0.1491060107946396,
0.19588790833950043,
-0.42789191007614136,
0.43579062819480896,
0.07753989845514297,
0.5311054587364197,
-0.07475375384092331,
-0.23476797342300415,
0.016203058883547783,
-0.5138431787490845,
-0.3377377390861511,
0.021064529195427895,
0.17035722732543945,
0.28367459774017334,
-0.08696964383125305,
0.07213275134563446,
-0.2623671293258667,
0.0792887806892395,
-0.03222059831023216,
0.1206437200307846,
-0.3665316104888916,
0.2208767831325531,
-0.03919346630573273,
-0.0007525719702243805,
0.08671741187572479,
0.14793655276298523,
0.062093812972307205,
0.30313485860824585,
-0.1354074478149414,
-0.3530300259590149,
0.41311872005462646,
-0.09793254733085632,
-0.2819955050945282,
0.03156706690788269,
0.07113666832447052,
-0.07734885066747665,
0.10277733206748962,
-0.5570218563079834,
-0.014322400093078613,
0.3744313418865204,
-0.057601120322942734,
-0.09791050851345062,
0.3266601860523224,
0.272071897983551,
0.10237859934568405,
-0.004661343991756439,
0.14781683683395386,
-0.07056959718465805,
-0.18000271916389465,
-0.019132502377033234,
-0.01366957277059555
] |
https://github.com/huggingface/datasets/issues/6157 | @mariosasko The original code can still see progress. emmm, I can't see how many examples is generated so far, so I don't know if we should wait | DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding' | ### Describe the bug
When I was in load_dataset, it said "DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'". The second time I ran it, there was no error and the dataset object worked
```python
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[3], line 1
----> 1 dataset = load_dataset(
2 "/home/aihao/workspace/DeepLearningContent/datasets/manga",
3 data_dir="/home/aihao/workspace/DeepLearningContent/datasets/manga",
4 split="train",
5 )
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146), in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2142 # Build dataset for splits
2143 keep_in_memory = (
2144 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
2145 )
-> 2146 ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
2147 # Rename and cast features to match task schema
2148 if task is not None:
2149 # To avoid issuing the same warning twice
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190), in DatasetBuilder.as_dataset(self, split, run_post_process, verification_mode, ignore_verifications, in_memory)
1187 verification_mode = VerificationMode(verification_mode or VerificationMode.BASIC_CHECKS)
1189 # Create a dataset for each of the given splits
-> 1190 datasets = map_nested(
1191 partial(
1192 self._build_single_dataset,
...
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379), in DatasetInfo.copy(self)
378 def copy(self) -> "DatasetInfo":
--> 379 return self.__class__(**{k: copy.deepcopy(v) for k, v in self.__dict__.items()})
TypeError: DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'
```
### Steps to reproduce the bug
/home/aihao/workspace/DeepLearningContent/datasets/images/images.py
```python
from logging import config
import datasets
import os
from PIL import Image
import csv
import json
class ImagesConfig(datasets.BuilderConfig):
def __init__(self, **kwargs):
super(ImagesConfig, self).__init__(**kwargs)
class Images(datasets.GeneratorBasedBuilder):
def _split_generators(self, dl_manager: datasets.DownloadManager):
return [
datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={"split": datasets.Split.TRAIN},
)
]
BUILDER_CONFIGS = [
ImagesConfig(
name="similar_pairs",
description="simliar pair dataset,item is a pair of similar images",
),
ImagesConfig(
name="image_prompt_pairs",
description="image prompt pairs",
),
]
def _info(self):
if self.config.name == "similar_pairs":
return datasets.Features(
{
"image1": datasets.features.Image(),
"image2": datasets.features.Image(),
"similarity": datasets.Value("float32"),
}
)
elif self.config.name == "image_prompt_pairs":
return datasets.Features(
{"image": datasets.features.Image(), "prompt": datasets.Value("string")}
)
def _generate_examples(self, split):
data_path = os.path.join(self.config.data_dir, "data")
if self.config.name == "similar_pairs":
prompts = {}
with open(os.path.join(data_path ,"prompts.json"), "r") as f:
prompts = json.load(f)
with open(os.path.join(data_path, "similar_pairs.csv"), "r") as f:
reader = csv.reader(f)
for row in reader:
image1_path, image2_path, similarity = row
yield image1_path + ":" + image2_path + ":", {
"image1": Image.open(image1_path),
"prompt1": prompts[image1_path],
"image2": Image.open(image2_path),
"prompt2": prompts[image2_path],
"similarity": float(similarity),
}
```
Code that indicates an error:
```python
from datasets import load_dataset
import json
import csv
import ast
import torch
data_dir = "/home/aihao/workspace/DeepLearningContent/datasets/images"
dataset = load_dataset(data_dir, data_dir=data_dir, name="similar_pairs")
```
### Expected behavior
The first execution gives an error, but it works fine
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-6.2.0-26-generic-x86_64-with-glibc2.35
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3 | 27 | DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'
### Describe the bug
When I was in load_dataset, it said "DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'". The second time I ran it, there was no error and the dataset object worked
```python
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[3], line 1
----> 1 dataset = load_dataset(
2 "/home/aihao/workspace/DeepLearningContent/datasets/manga",
3 data_dir="/home/aihao/workspace/DeepLearningContent/datasets/manga",
4 split="train",
5 )
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146), in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2142 # Build dataset for splits
2143 keep_in_memory = (
2144 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
2145 )
-> 2146 ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
2147 # Rename and cast features to match task schema
2148 if task is not None:
2149 # To avoid issuing the same warning twice
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190), in DatasetBuilder.as_dataset(self, split, run_post_process, verification_mode, ignore_verifications, in_memory)
1187 verification_mode = VerificationMode(verification_mode or VerificationMode.BASIC_CHECKS)
1189 # Create a dataset for each of the given splits
-> 1190 datasets = map_nested(
1191 partial(
1192 self._build_single_dataset,
...
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379), in DatasetInfo.copy(self)
378 def copy(self) -> "DatasetInfo":
--> 379 return self.__class__(**{k: copy.deepcopy(v) for k, v in self.__dict__.items()})
TypeError: DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'
```
### Steps to reproduce the bug
/home/aihao/workspace/DeepLearningContent/datasets/images/images.py
```python
from logging import config
import datasets
import os
from PIL import Image
import csv
import json
class ImagesConfig(datasets.BuilderConfig):
def __init__(self, **kwargs):
super(ImagesConfig, self).__init__(**kwargs)
class Images(datasets.GeneratorBasedBuilder):
def _split_generators(self, dl_manager: datasets.DownloadManager):
return [
datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={"split": datasets.Split.TRAIN},
)
]
BUILDER_CONFIGS = [
ImagesConfig(
name="similar_pairs",
description="simliar pair dataset,item is a pair of similar images",
),
ImagesConfig(
name="image_prompt_pairs",
description="image prompt pairs",
),
]
def _info(self):
if self.config.name == "similar_pairs":
return datasets.Features(
{
"image1": datasets.features.Image(),
"image2": datasets.features.Image(),
"similarity": datasets.Value("float32"),
}
)
elif self.config.name == "image_prompt_pairs":
return datasets.Features(
{"image": datasets.features.Image(), "prompt": datasets.Value("string")}
)
def _generate_examples(self, split):
data_path = os.path.join(self.config.data_dir, "data")
if self.config.name == "similar_pairs":
prompts = {}
with open(os.path.join(data_path ,"prompts.json"), "r") as f:
prompts = json.load(f)
with open(os.path.join(data_path, "similar_pairs.csv"), "r") as f:
reader = csv.reader(f)
for row in reader:
image1_path, image2_path, similarity = row
yield image1_path + ":" + image2_path + ":", {
"image1": Image.open(image1_path),
"prompt1": prompts[image1_path],
"image2": Image.open(image2_path),
"prompt2": prompts[image2_path],
"similarity": float(similarity),
}
```
Code that indicates an error:
```python
from datasets import load_dataset
import json
import csv
import ast
import torch
data_dir = "/home/aihao/workspace/DeepLearningContent/datasets/images"
dataset = load_dataset(data_dir, data_dir=data_dir, name="similar_pairs")
```
### Expected behavior
The first execution gives an error, but it works fine
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-6.2.0-26-generic-x86_64-with-glibc2.35
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
@mariosasko The original code can still see progress. emmm, I can't see how many examples is generated so far, so I don't know if we should wait | [
-0.07070029526948929,
-0.11540171504020691,
0.006694383919239044,
0.35483965277671814,
0.5811512470245361,
0.26537662744522095,
0.13077785074710846,
0.37581178545951843,
-0.23715856671333313,
0.07963988929986954,
0.06881711632013321,
0.3887733519077301,
-0.0750109851360321,
0.3504210412502289,
0.010802865028381348,
-0.26599445939064026,
0.06241599842905998,
0.3554588556289673,
-0.27257367968559265,
0.07664310187101364,
-0.39239227771759033,
0.3850339949131012,
-0.5596711039543152,
-0.12456786632537842,
0.07355214655399323,
-0.08091731369495392,
-0.16728973388671875,
0.17824172973632812,
-0.17621755599975586,
-0.505584180355072,
0.24178168177604675,
-0.1263563185930252,
0.20765769481658936,
0.4656551778316498,
-0.00011479162640171126,
0.1300894320011139,
0.1693420261144638,
-0.191647469997406,
-0.4818935990333557,
-0.18278445303440094,
-0.42340999841690063,
-0.3686598837375641,
0.021593987941741943,
-0.32046544551849365,
-0.13756026327610016,
-0.2946101129055023,
-0.25731703639030457,
-0.6029804348945618,
0.3542990982532501,
0.4759308397769928,
0.19574692845344543,
0.27641841769218445,
0.016931340098381042,
-0.15270501375198364,
0.0443914458155632,
0.017476502805948257,
-0.26956260204315186,
0.11507286131381989,
-0.07260840386152267,
0.0773690864443779,
0.1556115746498108,
0.31896671652793884,
0.11369472742080688,
0.22951701283454895,
0.3821064233779907,
0.03631053864955902,
-0.006869908422231674,
-0.24498309195041656,
0.03581338748335838,
0.0314113013446331,
0.5522449016571045,
-0.24538227915763855,
-0.24418017268180847,
-0.1859855204820633,
-0.07566136121749878,
-0.3821980059146881,
0.24201373755931854,
0.01775040104985237,
-0.023735955357551575,
0.3677349090576172,
0.1424391269683838,
-0.0476306788623333,
-0.07556041330099106,
-0.041191838681697845,
-0.022481605410575867,
-0.1467212587594986,
-0.16477513313293457,
0.17058232426643372,
0.22174297273159027,
-0.01699879951775074,
0.0904935821890831,
0.0616423636674881,
-0.3246755599975586,
0.11866932362318039,
-0.3849504590034485,
-0.14327594637870789,
-0.029970496892929077,
0.06632857024669647,
0.19965142011642456,
-0.0635453462600708,
-0.26171964406967163,
-0.1442011594772339,
0.21022261679172516,
0.09406594187021255,
0.2270517796278,
0.15502209961414337,
0.12009094655513763,
0.2588718831539154,
-0.019052626565098763,
-0.2073211818933487,
-0.10736165940761566,
-0.16628998517990112,
-0.07147905975580215,
-0.05507403984665871,
0.346168577671051,
0.08931301534175873,
0.47108036279678345,
-0.14513638615608215,
-0.24749788641929626,
0.09681481868028641,
-0.17244768142700195,
-0.14148765802383423,
-0.09515707194805145,
0.3479653298854828,
0.3728860020637512,
0.3912353217601776,
0.20510205626487732,
0.2854972183704376,
0.04222942888736725,
-0.6152735948562622,
-0.21168331801891327,
0.04428761452436447,
-0.23029838502407074,
0.031123235821723938,
-0.005640037357807159,
0.03197161480784416,
0.07527164369821548,
0.18947070837020874,
-0.02635136991739273,
-0.2949342131614685,
0.11111520975828171,
-0.24708618223667145,
-0.0220322385430336,
0.02695191465318203,
-0.028744075447320938,
0.13847079873085022,
0.4819733500480652,
-0.10695802420377731,
-0.15624003112316132,
0.05717552453279495,
-0.33822667598724365,
-0.45749205350875854,
-0.42315182089805603,
0.19088250398635864,
0.0030022040009498596,
-0.0146616380661726,
-0.31331124901771545,
0.05377133563160896,
0.21132923662662506,
-0.20890586078166962,
-0.2293064147233963,
-0.3495498299598694,
-0.21973058581352234,
-0.17366652190685272,
0.18035949766635895,
0.36688488721847534,
-0.47540393471717834,
0.10643324255943298,
-0.09987999498844147,
-0.11037078499794006,
0.12210451811552048,
0.06272026896476746,
-0.35976362228393555,
0.42199277877807617,
-0.216512531042099,
-0.07360229641199112,
0.3589792847633362,
-0.38053494691848755,
-0.33264946937561035,
0.41926831007003784,
0.035168275237083435,
0.1236029714345932,
0.14745494723320007,
-0.03447813168168068,
0.12427615374326706,
-0.11320139467716217,
-0.004911784082651138,
0.19825726747512817,
-0.03752211108803749,
0.1764364391565323,
-0.17685580253601074,
-0.13858366012573242,
0.23645097017288208,
0.09743712842464447,
0.10850566625595093,
0.18798217177391052,
-0.06910140812397003,
0.10452422499656677,
0.1104094535112381,
-0.02690098062157631,
-0.12605063617229462,
0.23959806561470032,
-0.0011756508611142635,
0.10907405614852905,
0.26906442642211914,
-0.08181021362543106,
-0.4488169848918915,
0.2490074187517166,
0.31329038739204407,
0.07620657980442047,
-0.3418406546115875,
-0.18824872374534607,
-0.4166206419467926,
-0.004168964922428131,
-0.1973992884159088,
0.12320780754089355,
0.15305769443511963,
0.16185788810253143,
-0.18228040635585785,
0.003125719726085663,
-0.24914517998695374,
0.12847961485385895,
-0.19989418983459473,
-0.016030631959438324,
-0.025896381586790085,
0.12878161668777466,
-0.22603526711463928,
0.012772195041179657,
0.09077498316764832,
0.011567749083042145,
0.31025296449661255,
-0.15249766409397125,
-0.2585323750972748,
0.45949414372444153,
0.15624791383743286,
-0.04745873808860779,
-0.3295535445213318,
-0.13898614048957825,
-0.11819716542959213,
-0.2866854965686798,
-0.07870051264762878,
-0.18027031421661377,
0.4042471647262573,
-0.05839144065976143,
0.07256309688091278,
0.14941540360450745,
0.22447343170642853,
0.21048372983932495,
-0.039810601621866226,
-0.05240296199917793,
0.2763248085975647,
-0.13677871227264404,
-0.11171187460422516,
-0.43130767345428467,
0.1207641214132309,
-0.11179779469966888,
0.06629311293363571,
-0.011639437638223171,
-0.17027772963047028,
-0.14056657254695892,
0.5797865390777588,
0.13184458017349243,
0.1296686977148056,
0.030339621007442474,
-0.029596589505672455,
0.05540803074836731,
-0.11129982769489288,
0.2809083163738251,
0.6012133359909058,
0.02990793064236641,
-0.20613253116607666,
0.06977403163909912,
0.07402460277080536,
0.007573585957288742,
0.16458337008953094,
0.1323767453432083,
0.27220797538757324,
0.16514235734939575,
0.08789701759815216,
0.11491662263870239,
-0.2300560176372528,
0.022391825914382935,
0.32887569069862366,
0.3023911416530609,
-0.47253498435020447,
0.21670237183570862,
-0.39083683490753174,
-0.26406118273735046,
-0.11149963736534119,
0.04577723145484924,
0.26788902282714844,
-0.445814311504364,
-0.24836516380310059,
-0.16174378991127014,
0.06185130774974823,
0.24516364932060242,
-0.38238388299942017,
0.24038627743721008,
-0.09656307846307755,
-0.1587991714477539,
0.04962736368179321,
-0.24415330588817596,
-0.05627301335334778,
-0.006671518087387085,
0.2513587772846222,
-0.2507084608078003,
0.33967170119285583,
-0.26436764001846313,
-0.07759428024291992,
-0.11280127614736557,
-0.17989030480384827,
0.3131224811077118,
-0.2836134135723114,
0.354221373796463,
0.19339600205421448,
0.32849937677383423,
0.2471460998058319,
-0.19274649024009705,
0.4476488530635834,
0.15750476717948914,
0.00410827249288559,
0.20834192633628845,
0.05866518244147301,
-0.23808571696281433,
-0.19740277528762817,
-0.40303415060043335,
-0.11609335243701935,
-0.3366469144821167,
-0.1959540694952011,
-0.11199335753917694,
0.008076902478933334,
0.06271426379680634,
0.03884357959032059,
0.16209140419960022,
0.21492278575897217,
0.14923718571662903,
-0.2710900902748108,
-0.11182089149951935,
0.20159687101840973,
-0.06428411602973938,
-0.20425660908222198,
0.047712430357933044,
-0.043298106640577316,
0.2892319858074188,
-0.0035003162920475006,
-0.42780017852783203,
-0.026873789727687836,
-0.34967347979545593,
0.3373104929924011,
-0.2425673007965088,
-0.14801229536533356,
0.20214961469173431,
0.05149473249912262,
0.05539971962571144,
-0.19972437620162964,
-0.2828601598739624,
0.16345417499542236,
-0.024957187473773956,
0.19488584995269775,
0.1672276258468628,
0.8209006786346436,
-0.06943017244338989,
0.36995255947113037,
-0.020276691764593124,
-0.13649548590183258,
0.47261717915534973,
-0.23636703193187714,
0.32619524002075195,
-0.19011156260967255,
-0.2949039936065674,
-0.08874168246984482,
-0.23355881869792938,
-0.034699950367212296,
-0.0655050128698349,
-0.19649137556552887,
-0.2568719685077667,
-0.18467473983764648,
0.08116970211267471,
-0.40044963359832764,
-0.12933537364006042,
0.23510003089904785,
-0.36249738931655884,
0.11578776687383652,
-0.041706692427396774,
0.33364763855934143,
-0.12545114755630493,
0.18842390179634094,
-0.017640989273786545,
0.14875414967536926,
0.16230586171150208,
-0.04839974269270897,
-0.27833303809165955,
-0.14302203059196472,
-0.06564294546842575,
0.15890079736709595,
-0.06931918114423752,
0.46842116117477417,
-0.08550431579351425,
0.05284910649061203,
0.12530939280986786,
-0.03240267187356949,
0.5128427147865295,
-0.18287025392055511,
-0.01803828403353691,
0.14133647084236145,
0.22417137026786804,
-0.14485934376716614,
-0.19999417662620544,
-0.1718306839466095,
0.1590501219034195,
0.050198037177324295,
0.39346516132354736,
-0.28235098719596863,
-0.06802847236394882,
0.4073392450809479,
0.22992421686649323,
-0.246763214468956,
-0.11938850581645966,
-0.2965717911720276,
-0.6421763896942139,
-0.40441352128982544,
0.0018890872597694397,
0.2235005795955658,
0.17287775874137878,
0.10950702428817749,
0.3510645627975464,
-0.22674785554409027,
-0.17921701073646545,
0.15829673409461975,
0.18602029979228973,
0.27381935715675354,
-0.027625616639852524,
0.24644939601421356,
-0.036949217319488525,
0.06576648354530334,
0.21468393504619598,
0.6211022138595581,
-0.08652357757091522,
-0.4355189800262451,
-0.0780823677778244,
-0.2128516137599945,
0.4356660842895508,
0.10831031948328018,
-0.22959454357624054,
0.19099265336990356,
-0.1627090871334076,
0.015296390280127525,
-0.3176906406879425,
-0.01063762977719307,
0.654777467250824,
-0.12235639989376068,
-0.4831167757511139,
-0.6786954402923584,
0.5413047671318054,
-0.03537043184041977,
-0.09980350732803345,
0.34746548533439636,
0.46791866421699524,
-0.23933938145637512,
0.47865691781044006,
-0.1178295761346817,
0.8088359236717224,
0.28793269395828247,
-0.09152112901210785,
0.41694676876068115,
-0.05191541835665703,
0.10770296305418015,
0.08281609416007996,
0.20265257358551025,
-0.26450687646865845,
-0.31520354747772217,
-0.08112920820713043,
-0.06290368735790253,
0.1904078722000122,
-0.1486048847436905,
-0.5318316221237183,
0.10642368346452713,
-0.382985919713974,
0.15747657418251038,
-0.0034655481576919556,
0.13590414822101593,
-0.19743233919143677,
-0.011521434411406517,
-0.05286763608455658,
0.1661379635334015,
-0.04875881224870682,
0.12037627398967743,
0.04363381862640381,
-0.119090735912323,
0.05861520767211914,
-0.30178725719451904,
-0.414497971534729,
0.16163773834705353,
-0.07467249035835266,
0.31625205278396606,
-0.130738765001297,
-0.1273917853832245,
0.43506693840026855,
0.33925458788871765,
0.27436038851737976,
0.11674563586711884,
-0.0022079795598983765,
0.2940897047519684,
0.15158268809318542,
-0.06335994601249695,
-0.018206171691417694,
0.014717113226652145,
0.21847468614578247,
0.07488002628087997,
-0.24165096879005432,
0.3551171123981476,
-0.1638389527797699,
-0.20990778505802155,
-0.1419745236635208,
-0.052132848650217056,
0.06241951137781143,
-0.539549708366394,
-0.317965030670166,
0.041460100561380386,
0.06274150311946869,
-0.15285730361938477,
0.13728678226470947,
-0.14475221931934357,
0.022631525993347168,
0.2404552698135376,
-0.22819757461547852,
-0.27345404028892517,
0.058191195130348206,
0.10372811555862427,
0.17803117632865906,
0.2572677731513977,
0.781903088092804,
0.21465091407299042,
-0.05973692983388901,
-0.24066300690174103,
0.4480476975440979,
0.003064848482608795,
-0.17765556275844574,
0.269491046667099,
0.08581310510635376,
0.15662066638469696,
0.10284744948148727,
0.277896910905838,
0.07699079811573029,
-0.10394886136054993,
-0.06549680233001709,
-0.23677216470241547,
0.030925758183002472,
0.09168069064617157,
-0.08804009854793549,
0.061151549220085144,
-0.06734275817871094,
0.15448759496212006,
-0.0034667998552322388,
0.21343038976192474,
-0.30256205797195435,
0.046452321112155914,
-0.19562649726867676,
0.08149453997612,
0.31722885370254517,
0.23556804656982422,
0.22187194228172302,
-0.17591232061386108,
0.08482512831687927,
0.19861827790737152,
-0.022389456629753113,
-0.12799492478370667,
-0.28608253598213196,
0.139133021235466,
-0.03188733756542206,
0.10402894765138626,
-0.111893430352211,
-0.21487170457839966,
-0.10717341303825378,
-0.06573796272277832,
0.06661426275968552,
0.07707783579826355,
-0.028671953827142715,
0.43537604808807373,
0.046277809888124466,
0.1470007449388504,
-0.10099510848522186,
0.13415497541427612,
-0.11098631471395493,
0.26883214712142944,
0.07439690828323364,
0.12718740105628967,
0.09815986454486847,
0.05583948642015457,
-0.44027072191238403,
0.18544456362724304,
-0.13028644025325775,
0.0069730766117572784,
0.31674543023109436,
-0.2733885943889618,
0.2023896723985672,
0.032999876886606216,
0.029223397374153137,
0.3066404461860657,
-0.41146793961524963,
0.08539064973592758,
-0.10291978716850281,
0.16471554338932037,
-0.23669591546058655,
-0.03969055414199829,
-0.20071321725845337,
-0.08292719721794128,
0.0947810485959053,
0.2829931080341339,
-0.03365757316350937,
0.050606563687324524,
-0.3422643542289734,
-0.16419300436973572,
0.6340544819831848,
-0.058073464781045914,
0.25241005420684814,
0.5857937335968018,
-0.035386793315410614,
-0.06319401413202286,
0.3330034017562866,
0.1837904453277588,
0.12923119962215424,
0.4995455741882324,
-0.2970971465110779,
0.11500553041696548,
0.19895535707473755,
0.2540436089038849,
-0.09150370955467224,
-0.1165090799331665,
0.3329847455024719,
0.41502511501312256,
-0.1082146018743515,
-0.012223485857248306,
-0.07103541493415833,
0.03989537060260773,
-0.3586527705192566,
-0.07570657879114151,
-0.3971538543701172,
0.010438567027449608,
-0.15887048840522766,
-0.005254045128822327,
-0.2990977168083191,
-0.17625343799591064,
-0.4160192608833313,
-0.046858493238687515,
-0.11094720661640167,
-0.07780630886554718,
0.27775856852531433,
0.08117733895778656,
0.05737565830349922,
-0.06308840215206146,
0.05163354054093361,
0.2166464626789093,
0.16213393211364746,
-0.5012911558151245,
0.40576139092445374,
0.3028249442577362,
0.11382725834846497,
0.3755130469799042,
0.19796724617481232,
0.5795485377311707,
0.5169925689697266,
-0.029978904873132706,
-0.19756492972373962,
0.00230368971824646,
-0.262483149766922,
0.12255019694566727,
0.27535563707351685,
-0.2812947928905487,
0.5639821290969849,
0.33594486117362976,
0.1880238950252533,
-0.15815600752830505,
0.013485528528690338,
0.2036563903093338,
0.3686160743236542,
-0.4007744789123535,
0.5033644437789917,
-0.24769876897335052,
-0.06420111656188965,
-0.1305515319108963,
0.06017602980136871,
-0.2144031524658203,
-0.046546898782253265,
0.31180593371391296,
0.11506509780883789,
0.11171726882457733,
0.09560948610305786,
0.0906086191534996,
0.14745628833770752,
0.458395779132843,
0.2515981197357178,
-0.13788653910160065,
-0.48336729407310486,
-0.20708006620407104,
-0.6902254819869995,
-0.0814477950334549,
-0.24450592696666718,
-0.49004969000816345,
0.1218118816614151,
0.1752672791481018,
0.35737138986587524,
0.34270837903022766,
-0.0001067817211151123,
0.30345073342323303,
-0.2355589121580124,
0.054484955966472626,
-0.30625438690185547,
-0.3532562553882599,
0.04249349236488342,
0.06738003343343735,
-0.1603924036026001,
-0.3568378686904907,
0.14241786301136017,
0.2410283237695694,
0.06858707219362259,
-0.18605543673038483,
-0.1491060107946396,
0.19588790833950043,
-0.42789191007614136,
0.43579062819480896,
0.07753989845514297,
0.5311054587364197,
-0.07475375384092331,
-0.23476797342300415,
0.016203058883547783,
-0.5138431787490845,
-0.3377377390861511,
0.021064529195427895,
0.17035722732543945,
0.28367459774017334,
-0.08696964383125305,
0.07213275134563446,
-0.2623671293258667,
0.0792887806892395,
-0.03222059831023216,
0.1206437200307846,
-0.3665316104888916,
0.2208767831325531,
-0.03919346630573273,
-0.0007525719702243805,
0.08671741187572479,
0.14793655276298523,
0.062093812972307205,
0.30313485860824585,
-0.1354074478149414,
-0.3530300259590149,
0.41311872005462646,
-0.09793254733085632,
-0.2819955050945282,
0.03156706690788269,
0.07113666832447052,
-0.07734885066747665,
0.10277733206748962,
-0.5570218563079834,
-0.014322400093078613,
0.3744313418865204,
-0.057601120322942734,
-0.09791050851345062,
0.3266601860523224,
0.272071897983551,
0.10237859934568405,
-0.004661343991756439,
0.14781683683395386,
-0.07056959718465805,
-0.18000271916389465,
-0.019132502377033234,
-0.01366957277059555
] |
https://github.com/huggingface/datasets/issues/6157 | The original issue has been addressed, so I'm closing it.
Please open a new issue if you encounter more errors. | DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding' | ### Describe the bug
When I was in load_dataset, it said "DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'". The second time I ran it, there was no error and the dataset object worked
```python
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[3], line 1
----> 1 dataset = load_dataset(
2 "/home/aihao/workspace/DeepLearningContent/datasets/manga",
3 data_dir="/home/aihao/workspace/DeepLearningContent/datasets/manga",
4 split="train",
5 )
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146), in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2142 # Build dataset for splits
2143 keep_in_memory = (
2144 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
2145 )
-> 2146 ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
2147 # Rename and cast features to match task schema
2148 if task is not None:
2149 # To avoid issuing the same warning twice
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190), in DatasetBuilder.as_dataset(self, split, run_post_process, verification_mode, ignore_verifications, in_memory)
1187 verification_mode = VerificationMode(verification_mode or VerificationMode.BASIC_CHECKS)
1189 # Create a dataset for each of the given splits
-> 1190 datasets = map_nested(
1191 partial(
1192 self._build_single_dataset,
...
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379), in DatasetInfo.copy(self)
378 def copy(self) -> "DatasetInfo":
--> 379 return self.__class__(**{k: copy.deepcopy(v) for k, v in self.__dict__.items()})
TypeError: DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'
```
### Steps to reproduce the bug
/home/aihao/workspace/DeepLearningContent/datasets/images/images.py
```python
from logging import config
import datasets
import os
from PIL import Image
import csv
import json
class ImagesConfig(datasets.BuilderConfig):
def __init__(self, **kwargs):
super(ImagesConfig, self).__init__(**kwargs)
class Images(datasets.GeneratorBasedBuilder):
def _split_generators(self, dl_manager: datasets.DownloadManager):
return [
datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={"split": datasets.Split.TRAIN},
)
]
BUILDER_CONFIGS = [
ImagesConfig(
name="similar_pairs",
description="simliar pair dataset,item is a pair of similar images",
),
ImagesConfig(
name="image_prompt_pairs",
description="image prompt pairs",
),
]
def _info(self):
if self.config.name == "similar_pairs":
return datasets.Features(
{
"image1": datasets.features.Image(),
"image2": datasets.features.Image(),
"similarity": datasets.Value("float32"),
}
)
elif self.config.name == "image_prompt_pairs":
return datasets.Features(
{"image": datasets.features.Image(), "prompt": datasets.Value("string")}
)
def _generate_examples(self, split):
data_path = os.path.join(self.config.data_dir, "data")
if self.config.name == "similar_pairs":
prompts = {}
with open(os.path.join(data_path ,"prompts.json"), "r") as f:
prompts = json.load(f)
with open(os.path.join(data_path, "similar_pairs.csv"), "r") as f:
reader = csv.reader(f)
for row in reader:
image1_path, image2_path, similarity = row
yield image1_path + ":" + image2_path + ":", {
"image1": Image.open(image1_path),
"prompt1": prompts[image1_path],
"image2": Image.open(image2_path),
"prompt2": prompts[image2_path],
"similarity": float(similarity),
}
```
Code that indicates an error:
```python
from datasets import load_dataset
import json
import csv
import ast
import torch
data_dir = "/home/aihao/workspace/DeepLearningContent/datasets/images"
dataset = load_dataset(data_dir, data_dir=data_dir, name="similar_pairs")
```
### Expected behavior
The first execution gives an error, but it works fine
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-6.2.0-26-generic-x86_64-with-glibc2.35
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3 | 20 | DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'
### Describe the bug
When I was in load_dataset, it said "DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'". The second time I ran it, there was no error and the dataset object worked
```python
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[3], line 1
----> 1 dataset = load_dataset(
2 "/home/aihao/workspace/DeepLearningContent/datasets/manga",
3 data_dir="/home/aihao/workspace/DeepLearningContent/datasets/manga",
4 split="train",
5 )
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146), in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2142 # Build dataset for splits
2143 keep_in_memory = (
2144 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
2145 )
-> 2146 ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
2147 # Rename and cast features to match task schema
2148 if task is not None:
2149 # To avoid issuing the same warning twice
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190), in DatasetBuilder.as_dataset(self, split, run_post_process, verification_mode, ignore_verifications, in_memory)
1187 verification_mode = VerificationMode(verification_mode or VerificationMode.BASIC_CHECKS)
1189 # Create a dataset for each of the given splits
-> 1190 datasets = map_nested(
1191 partial(
1192 self._build_single_dataset,
...
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379), in DatasetInfo.copy(self)
378 def copy(self) -> "DatasetInfo":
--> 379 return self.__class__(**{k: copy.deepcopy(v) for k, v in self.__dict__.items()})
TypeError: DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'
```
### Steps to reproduce the bug
/home/aihao/workspace/DeepLearningContent/datasets/images/images.py
```python
from logging import config
import datasets
import os
from PIL import Image
import csv
import json
class ImagesConfig(datasets.BuilderConfig):
def __init__(self, **kwargs):
super(ImagesConfig, self).__init__(**kwargs)
class Images(datasets.GeneratorBasedBuilder):
def _split_generators(self, dl_manager: datasets.DownloadManager):
return [
datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={"split": datasets.Split.TRAIN},
)
]
BUILDER_CONFIGS = [
ImagesConfig(
name="similar_pairs",
description="simliar pair dataset,item is a pair of similar images",
),
ImagesConfig(
name="image_prompt_pairs",
description="image prompt pairs",
),
]
def _info(self):
if self.config.name == "similar_pairs":
return datasets.Features(
{
"image1": datasets.features.Image(),
"image2": datasets.features.Image(),
"similarity": datasets.Value("float32"),
}
)
elif self.config.name == "image_prompt_pairs":
return datasets.Features(
{"image": datasets.features.Image(), "prompt": datasets.Value("string")}
)
def _generate_examples(self, split):
data_path = os.path.join(self.config.data_dir, "data")
if self.config.name == "similar_pairs":
prompts = {}
with open(os.path.join(data_path ,"prompts.json"), "r") as f:
prompts = json.load(f)
with open(os.path.join(data_path, "similar_pairs.csv"), "r") as f:
reader = csv.reader(f)
for row in reader:
image1_path, image2_path, similarity = row
yield image1_path + ":" + image2_path + ":", {
"image1": Image.open(image1_path),
"prompt1": prompts[image1_path],
"image2": Image.open(image2_path),
"prompt2": prompts[image2_path],
"similarity": float(similarity),
}
```
Code that indicates an error:
```python
from datasets import load_dataset
import json
import csv
import ast
import torch
data_dir = "/home/aihao/workspace/DeepLearningContent/datasets/images"
dataset = load_dataset(data_dir, data_dir=data_dir, name="similar_pairs")
```
### Expected behavior
The first execution gives an error, but it works fine
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-6.2.0-26-generic-x86_64-with-glibc2.35
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
The original issue has been addressed, so I'm closing it.
Please open a new issue if you encounter more errors. | [
-0.07070029526948929,
-0.11540171504020691,
0.006694383919239044,
0.35483965277671814,
0.5811512470245361,
0.26537662744522095,
0.13077785074710846,
0.37581178545951843,
-0.23715856671333313,
0.07963988929986954,
0.06881711632013321,
0.3887733519077301,
-0.0750109851360321,
0.3504210412502289,
0.010802865028381348,
-0.26599445939064026,
0.06241599842905998,
0.3554588556289673,
-0.27257367968559265,
0.07664310187101364,
-0.39239227771759033,
0.3850339949131012,
-0.5596711039543152,
-0.12456786632537842,
0.07355214655399323,
-0.08091731369495392,
-0.16728973388671875,
0.17824172973632812,
-0.17621755599975586,
-0.505584180355072,
0.24178168177604675,
-0.1263563185930252,
0.20765769481658936,
0.4656551778316498,
-0.00011479162640171126,
0.1300894320011139,
0.1693420261144638,
-0.191647469997406,
-0.4818935990333557,
-0.18278445303440094,
-0.42340999841690063,
-0.3686598837375641,
0.021593987941741943,
-0.32046544551849365,
-0.13756026327610016,
-0.2946101129055023,
-0.25731703639030457,
-0.6029804348945618,
0.3542990982532501,
0.4759308397769928,
0.19574692845344543,
0.27641841769218445,
0.016931340098381042,
-0.15270501375198364,
0.0443914458155632,
0.017476502805948257,
-0.26956260204315186,
0.11507286131381989,
-0.07260840386152267,
0.0773690864443779,
0.1556115746498108,
0.31896671652793884,
0.11369472742080688,
0.22951701283454895,
0.3821064233779907,
0.03631053864955902,
-0.006869908422231674,
-0.24498309195041656,
0.03581338748335838,
0.0314113013446331,
0.5522449016571045,
-0.24538227915763855,
-0.24418017268180847,
-0.1859855204820633,
-0.07566136121749878,
-0.3821980059146881,
0.24201373755931854,
0.01775040104985237,
-0.023735955357551575,
0.3677349090576172,
0.1424391269683838,
-0.0476306788623333,
-0.07556041330099106,
-0.041191838681697845,
-0.022481605410575867,
-0.1467212587594986,
-0.16477513313293457,
0.17058232426643372,
0.22174297273159027,
-0.01699879951775074,
0.0904935821890831,
0.0616423636674881,
-0.3246755599975586,
0.11866932362318039,
-0.3849504590034485,
-0.14327594637870789,
-0.029970496892929077,
0.06632857024669647,
0.19965142011642456,
-0.0635453462600708,
-0.26171964406967163,
-0.1442011594772339,
0.21022261679172516,
0.09406594187021255,
0.2270517796278,
0.15502209961414337,
0.12009094655513763,
0.2588718831539154,
-0.019052626565098763,
-0.2073211818933487,
-0.10736165940761566,
-0.16628998517990112,
-0.07147905975580215,
-0.05507403984665871,
0.346168577671051,
0.08931301534175873,
0.47108036279678345,
-0.14513638615608215,
-0.24749788641929626,
0.09681481868028641,
-0.17244768142700195,
-0.14148765802383423,
-0.09515707194805145,
0.3479653298854828,
0.3728860020637512,
0.3912353217601776,
0.20510205626487732,
0.2854972183704376,
0.04222942888736725,
-0.6152735948562622,
-0.21168331801891327,
0.04428761452436447,
-0.23029838502407074,
0.031123235821723938,
-0.005640037357807159,
0.03197161480784416,
0.07527164369821548,
0.18947070837020874,
-0.02635136991739273,
-0.2949342131614685,
0.11111520975828171,
-0.24708618223667145,
-0.0220322385430336,
0.02695191465318203,
-0.028744075447320938,
0.13847079873085022,
0.4819733500480652,
-0.10695802420377731,
-0.15624003112316132,
0.05717552453279495,
-0.33822667598724365,
-0.45749205350875854,
-0.42315182089805603,
0.19088250398635864,
0.0030022040009498596,
-0.0146616380661726,
-0.31331124901771545,
0.05377133563160896,
0.21132923662662506,
-0.20890586078166962,
-0.2293064147233963,
-0.3495498299598694,
-0.21973058581352234,
-0.17366652190685272,
0.18035949766635895,
0.36688488721847534,
-0.47540393471717834,
0.10643324255943298,
-0.09987999498844147,
-0.11037078499794006,
0.12210451811552048,
0.06272026896476746,
-0.35976362228393555,
0.42199277877807617,
-0.216512531042099,
-0.07360229641199112,
0.3589792847633362,
-0.38053494691848755,
-0.33264946937561035,
0.41926831007003784,
0.035168275237083435,
0.1236029714345932,
0.14745494723320007,
-0.03447813168168068,
0.12427615374326706,
-0.11320139467716217,
-0.004911784082651138,
0.19825726747512817,
-0.03752211108803749,
0.1764364391565323,
-0.17685580253601074,
-0.13858366012573242,
0.23645097017288208,
0.09743712842464447,
0.10850566625595093,
0.18798217177391052,
-0.06910140812397003,
0.10452422499656677,
0.1104094535112381,
-0.02690098062157631,
-0.12605063617229462,
0.23959806561470032,
-0.0011756508611142635,
0.10907405614852905,
0.26906442642211914,
-0.08181021362543106,
-0.4488169848918915,
0.2490074187517166,
0.31329038739204407,
0.07620657980442047,
-0.3418406546115875,
-0.18824872374534607,
-0.4166206419467926,
-0.004168964922428131,
-0.1973992884159088,
0.12320780754089355,
0.15305769443511963,
0.16185788810253143,
-0.18228040635585785,
0.003125719726085663,
-0.24914517998695374,
0.12847961485385895,
-0.19989418983459473,
-0.016030631959438324,
-0.025896381586790085,
0.12878161668777466,
-0.22603526711463928,
0.012772195041179657,
0.09077498316764832,
0.011567749083042145,
0.31025296449661255,
-0.15249766409397125,
-0.2585323750972748,
0.45949414372444153,
0.15624791383743286,
-0.04745873808860779,
-0.3295535445213318,
-0.13898614048957825,
-0.11819716542959213,
-0.2866854965686798,
-0.07870051264762878,
-0.18027031421661377,
0.4042471647262573,
-0.05839144065976143,
0.07256309688091278,
0.14941540360450745,
0.22447343170642853,
0.21048372983932495,
-0.039810601621866226,
-0.05240296199917793,
0.2763248085975647,
-0.13677871227264404,
-0.11171187460422516,
-0.43130767345428467,
0.1207641214132309,
-0.11179779469966888,
0.06629311293363571,
-0.011639437638223171,
-0.17027772963047028,
-0.14056657254695892,
0.5797865390777588,
0.13184458017349243,
0.1296686977148056,
0.030339621007442474,
-0.029596589505672455,
0.05540803074836731,
-0.11129982769489288,
0.2809083163738251,
0.6012133359909058,
0.02990793064236641,
-0.20613253116607666,
0.06977403163909912,
0.07402460277080536,
0.007573585957288742,
0.16458337008953094,
0.1323767453432083,
0.27220797538757324,
0.16514235734939575,
0.08789701759815216,
0.11491662263870239,
-0.2300560176372528,
0.022391825914382935,
0.32887569069862366,
0.3023911416530609,
-0.47253498435020447,
0.21670237183570862,
-0.39083683490753174,
-0.26406118273735046,
-0.11149963736534119,
0.04577723145484924,
0.26788902282714844,
-0.445814311504364,
-0.24836516380310059,
-0.16174378991127014,
0.06185130774974823,
0.24516364932060242,
-0.38238388299942017,
0.24038627743721008,
-0.09656307846307755,
-0.1587991714477539,
0.04962736368179321,
-0.24415330588817596,
-0.05627301335334778,
-0.006671518087387085,
0.2513587772846222,
-0.2507084608078003,
0.33967170119285583,
-0.26436764001846313,
-0.07759428024291992,
-0.11280127614736557,
-0.17989030480384827,
0.3131224811077118,
-0.2836134135723114,
0.354221373796463,
0.19339600205421448,
0.32849937677383423,
0.2471460998058319,
-0.19274649024009705,
0.4476488530635834,
0.15750476717948914,
0.00410827249288559,
0.20834192633628845,
0.05866518244147301,
-0.23808571696281433,
-0.19740277528762817,
-0.40303415060043335,
-0.11609335243701935,
-0.3366469144821167,
-0.1959540694952011,
-0.11199335753917694,
0.008076902478933334,
0.06271426379680634,
0.03884357959032059,
0.16209140419960022,
0.21492278575897217,
0.14923718571662903,
-0.2710900902748108,
-0.11182089149951935,
0.20159687101840973,
-0.06428411602973938,
-0.20425660908222198,
0.047712430357933044,
-0.043298106640577316,
0.2892319858074188,
-0.0035003162920475006,
-0.42780017852783203,
-0.026873789727687836,
-0.34967347979545593,
0.3373104929924011,
-0.2425673007965088,
-0.14801229536533356,
0.20214961469173431,
0.05149473249912262,
0.05539971962571144,
-0.19972437620162964,
-0.2828601598739624,
0.16345417499542236,
-0.024957187473773956,
0.19488584995269775,
0.1672276258468628,
0.8209006786346436,
-0.06943017244338989,
0.36995255947113037,
-0.020276691764593124,
-0.13649548590183258,
0.47261717915534973,
-0.23636703193187714,
0.32619524002075195,
-0.19011156260967255,
-0.2949039936065674,
-0.08874168246984482,
-0.23355881869792938,
-0.034699950367212296,
-0.0655050128698349,
-0.19649137556552887,
-0.2568719685077667,
-0.18467473983764648,
0.08116970211267471,
-0.40044963359832764,
-0.12933537364006042,
0.23510003089904785,
-0.36249738931655884,
0.11578776687383652,
-0.041706692427396774,
0.33364763855934143,
-0.12545114755630493,
0.18842390179634094,
-0.017640989273786545,
0.14875414967536926,
0.16230586171150208,
-0.04839974269270897,
-0.27833303809165955,
-0.14302203059196472,
-0.06564294546842575,
0.15890079736709595,
-0.06931918114423752,
0.46842116117477417,
-0.08550431579351425,
0.05284910649061203,
0.12530939280986786,
-0.03240267187356949,
0.5128427147865295,
-0.18287025392055511,
-0.01803828403353691,
0.14133647084236145,
0.22417137026786804,
-0.14485934376716614,
-0.19999417662620544,
-0.1718306839466095,
0.1590501219034195,
0.050198037177324295,
0.39346516132354736,
-0.28235098719596863,
-0.06802847236394882,
0.4073392450809479,
0.22992421686649323,
-0.246763214468956,
-0.11938850581645966,
-0.2965717911720276,
-0.6421763896942139,
-0.40441352128982544,
0.0018890872597694397,
0.2235005795955658,
0.17287775874137878,
0.10950702428817749,
0.3510645627975464,
-0.22674785554409027,
-0.17921701073646545,
0.15829673409461975,
0.18602029979228973,
0.27381935715675354,
-0.027625616639852524,
0.24644939601421356,
-0.036949217319488525,
0.06576648354530334,
0.21468393504619598,
0.6211022138595581,
-0.08652357757091522,
-0.4355189800262451,
-0.0780823677778244,
-0.2128516137599945,
0.4356660842895508,
0.10831031948328018,
-0.22959454357624054,
0.19099265336990356,
-0.1627090871334076,
0.015296390280127525,
-0.3176906406879425,
-0.01063762977719307,
0.654777467250824,
-0.12235639989376068,
-0.4831167757511139,
-0.6786954402923584,
0.5413047671318054,
-0.03537043184041977,
-0.09980350732803345,
0.34746548533439636,
0.46791866421699524,
-0.23933938145637512,
0.47865691781044006,
-0.1178295761346817,
0.8088359236717224,
0.28793269395828247,
-0.09152112901210785,
0.41694676876068115,
-0.05191541835665703,
0.10770296305418015,
0.08281609416007996,
0.20265257358551025,
-0.26450687646865845,
-0.31520354747772217,
-0.08112920820713043,
-0.06290368735790253,
0.1904078722000122,
-0.1486048847436905,
-0.5318316221237183,
0.10642368346452713,
-0.382985919713974,
0.15747657418251038,
-0.0034655481576919556,
0.13590414822101593,
-0.19743233919143677,
-0.011521434411406517,
-0.05286763608455658,
0.1661379635334015,
-0.04875881224870682,
0.12037627398967743,
0.04363381862640381,
-0.119090735912323,
0.05861520767211914,
-0.30178725719451904,
-0.414497971534729,
0.16163773834705353,
-0.07467249035835266,
0.31625205278396606,
-0.130738765001297,
-0.1273917853832245,
0.43506693840026855,
0.33925458788871765,
0.27436038851737976,
0.11674563586711884,
-0.0022079795598983765,
0.2940897047519684,
0.15158268809318542,
-0.06335994601249695,
-0.018206171691417694,
0.014717113226652145,
0.21847468614578247,
0.07488002628087997,
-0.24165096879005432,
0.3551171123981476,
-0.1638389527797699,
-0.20990778505802155,
-0.1419745236635208,
-0.052132848650217056,
0.06241951137781143,
-0.539549708366394,
-0.317965030670166,
0.041460100561380386,
0.06274150311946869,
-0.15285730361938477,
0.13728678226470947,
-0.14475221931934357,
0.022631525993347168,
0.2404552698135376,
-0.22819757461547852,
-0.27345404028892517,
0.058191195130348206,
0.10372811555862427,
0.17803117632865906,
0.2572677731513977,
0.781903088092804,
0.21465091407299042,
-0.05973692983388901,
-0.24066300690174103,
0.4480476975440979,
0.003064848482608795,
-0.17765556275844574,
0.269491046667099,
0.08581310510635376,
0.15662066638469696,
0.10284744948148727,
0.277896910905838,
0.07699079811573029,
-0.10394886136054993,
-0.06549680233001709,
-0.23677216470241547,
0.030925758183002472,
0.09168069064617157,
-0.08804009854793549,
0.061151549220085144,
-0.06734275817871094,
0.15448759496212006,
-0.0034667998552322388,
0.21343038976192474,
-0.30256205797195435,
0.046452321112155914,
-0.19562649726867676,
0.08149453997612,
0.31722885370254517,
0.23556804656982422,
0.22187194228172302,
-0.17591232061386108,
0.08482512831687927,
0.19861827790737152,
-0.022389456629753113,
-0.12799492478370667,
-0.28608253598213196,
0.139133021235466,
-0.03188733756542206,
0.10402894765138626,
-0.111893430352211,
-0.21487170457839966,
-0.10717341303825378,
-0.06573796272277832,
0.06661426275968552,
0.07707783579826355,
-0.028671953827142715,
0.43537604808807373,
0.046277809888124466,
0.1470007449388504,
-0.10099510848522186,
0.13415497541427612,
-0.11098631471395493,
0.26883214712142944,
0.07439690828323364,
0.12718740105628967,
0.09815986454486847,
0.05583948642015457,
-0.44027072191238403,
0.18544456362724304,
-0.13028644025325775,
0.0069730766117572784,
0.31674543023109436,
-0.2733885943889618,
0.2023896723985672,
0.032999876886606216,
0.029223397374153137,
0.3066404461860657,
-0.41146793961524963,
0.08539064973592758,
-0.10291978716850281,
0.16471554338932037,
-0.23669591546058655,
-0.03969055414199829,
-0.20071321725845337,
-0.08292719721794128,
0.0947810485959053,
0.2829931080341339,
-0.03365757316350937,
0.050606563687324524,
-0.3422643542289734,
-0.16419300436973572,
0.6340544819831848,
-0.058073464781045914,
0.25241005420684814,
0.5857937335968018,
-0.035386793315410614,
-0.06319401413202286,
0.3330034017562866,
0.1837904453277588,
0.12923119962215424,
0.4995455741882324,
-0.2970971465110779,
0.11500553041696548,
0.19895535707473755,
0.2540436089038849,
-0.09150370955467224,
-0.1165090799331665,
0.3329847455024719,
0.41502511501312256,
-0.1082146018743515,
-0.012223485857248306,
-0.07103541493415833,
0.03989537060260773,
-0.3586527705192566,
-0.07570657879114151,
-0.3971538543701172,
0.010438567027449608,
-0.15887048840522766,
-0.005254045128822327,
-0.2990977168083191,
-0.17625343799591064,
-0.4160192608833313,
-0.046858493238687515,
-0.11094720661640167,
-0.07780630886554718,
0.27775856852531433,
0.08117733895778656,
0.05737565830349922,
-0.06308840215206146,
0.05163354054093361,
0.2166464626789093,
0.16213393211364746,
-0.5012911558151245,
0.40576139092445374,
0.3028249442577362,
0.11382725834846497,
0.3755130469799042,
0.19796724617481232,
0.5795485377311707,
0.5169925689697266,
-0.029978904873132706,
-0.19756492972373962,
0.00230368971824646,
-0.262483149766922,
0.12255019694566727,
0.27535563707351685,
-0.2812947928905487,
0.5639821290969849,
0.33594486117362976,
0.1880238950252533,
-0.15815600752830505,
0.013485528528690338,
0.2036563903093338,
0.3686160743236542,
-0.4007744789123535,
0.5033644437789917,
-0.24769876897335052,
-0.06420111656188965,
-0.1305515319108963,
0.06017602980136871,
-0.2144031524658203,
-0.046546898782253265,
0.31180593371391296,
0.11506509780883789,
0.11171726882457733,
0.09560948610305786,
0.0906086191534996,
0.14745628833770752,
0.458395779132843,
0.2515981197357178,
-0.13788653910160065,
-0.48336729407310486,
-0.20708006620407104,
-0.6902254819869995,
-0.0814477950334549,
-0.24450592696666718,
-0.49004969000816345,
0.1218118816614151,
0.1752672791481018,
0.35737138986587524,
0.34270837903022766,
-0.0001067817211151123,
0.30345073342323303,
-0.2355589121580124,
0.054484955966472626,
-0.30625438690185547,
-0.3532562553882599,
0.04249349236488342,
0.06738003343343735,
-0.1603924036026001,
-0.3568378686904907,
0.14241786301136017,
0.2410283237695694,
0.06858707219362259,
-0.18605543673038483,
-0.1491060107946396,
0.19588790833950043,
-0.42789191007614136,
0.43579062819480896,
0.07753989845514297,
0.5311054587364197,
-0.07475375384092331,
-0.23476797342300415,
0.016203058883547783,
-0.5138431787490845,
-0.3377377390861511,
0.021064529195427895,
0.17035722732543945,
0.28367459774017334,
-0.08696964383125305,
0.07213275134563446,
-0.2623671293258667,
0.0792887806892395,
-0.03222059831023216,
0.1206437200307846,
-0.3665316104888916,
0.2208767831325531,
-0.03919346630573273,
-0.0007525719702243805,
0.08671741187572479,
0.14793655276298523,
0.062093812972307205,
0.30313485860824585,
-0.1354074478149414,
-0.3530300259590149,
0.41311872005462646,
-0.09793254733085632,
-0.2819955050945282,
0.03156706690788269,
0.07113666832447052,
-0.07734885066747665,
0.10277733206748962,
-0.5570218563079834,
-0.014322400093078613,
0.3744313418865204,
-0.057601120322942734,
-0.09791050851345062,
0.3266601860523224,
0.272071897983551,
0.10237859934568405,
-0.004661343991756439,
0.14781683683395386,
-0.07056959718465805,
-0.18000271916389465,
-0.019132502377033234,
-0.01366957277059555
] |
https://github.com/huggingface/datasets/issues/6156 | `_effective_generator` returns a RNG that takes into account `self._epoch` and the current dataset's base shuffling RNG (which can be set by specifying `seed=` in `.shuffle() for example`).
To fix your error you can pass `seed=` to `.shuffle()`. And the shuffling will depend on both this seed and `self._epoch` | Why not use self._epoch as seed to shuffle in distributed training with IterableDataset | ### Describe the bug
Currently, distributed training with `IterableDataset` needs to pass fixed seed to shuffle to keep each node use the same seed to avoid overlapping.
https://github.com/huggingface/datasets/blob/a7f8d9019e7cb104eac4106bdc6ec0292f0dc61a/src/datasets/iterable_dataset.py#L1174-L1177
My question is why not directly use `self._epoch` which is set by `set_epoch` as seed? It's almost the same across nodes.
https://github.com/huggingface/datasets/blob/a7f8d9019e7cb104eac4106bdc6ec0292f0dc61a/src/datasets/iterable_dataset.py#L1790-L1801
If not using `self._epoch` as shuffling seed, what does this method do to prepare an epoch seeded generator?
https://github.com/huggingface/datasets/blob/a7f8d9019e7cb104eac4106bdc6ec0292f0dc61a/src/datasets/iterable_dataset.py#L1206
### Steps to reproduce the bug
As mentioned above.
### Expected behavior
As mentioned above.
### Environment info
Not related | 48 | Why not use self._epoch as seed to shuffle in distributed training with IterableDataset
### Describe the bug
Currently, distributed training with `IterableDataset` needs to pass fixed seed to shuffle to keep each node use the same seed to avoid overlapping.
https://github.com/huggingface/datasets/blob/a7f8d9019e7cb104eac4106bdc6ec0292f0dc61a/src/datasets/iterable_dataset.py#L1174-L1177
My question is why not directly use `self._epoch` which is set by `set_epoch` as seed? It's almost the same across nodes.
https://github.com/huggingface/datasets/blob/a7f8d9019e7cb104eac4106bdc6ec0292f0dc61a/src/datasets/iterable_dataset.py#L1790-L1801
If not using `self._epoch` as shuffling seed, what does this method do to prepare an epoch seeded generator?
https://github.com/huggingface/datasets/blob/a7f8d9019e7cb104eac4106bdc6ec0292f0dc61a/src/datasets/iterable_dataset.py#L1206
### Steps to reproduce the bug
As mentioned above.
### Expected behavior
As mentioned above.
### Environment info
Not related
`_effective_generator` returns a RNG that takes into account `self._epoch` and the current dataset's base shuffling RNG (which can be set by specifying `seed=` in `.shuffle() for example`).
To fix your error you can pass `seed=` to `.shuffle()`. And the shuffling will depend on both this seed and `self._epoch` | [
-0.09083998948335648,
-0.44738781452178955,
0.10200133919715881,
-0.05467989295721054,
0.3809796869754791,
-0.15323251485824585,
0.5157515406608582,
0.006217509508132935,
-0.24342955648899078,
0.49071937799453735,
0.10161998122930527,
0.34502965211868286,
-0.2855296730995178,
-0.14750298857688904,
0.0007243826985359192,
0.11133554577827454,
0.2850605249404907,
-0.04905656725168228,
-0.014216724783182144,
-0.15763428807258606,
-0.4370293617248535,
-0.09994679689407349,
-0.16406530141830444,
-0.13942086696624756,
-0.30983084440231323,
0.13679352402687073,
-0.14536680281162262,
0.40782326459884644,
-0.08367004990577698,
-0.11862310767173767,
0.14011931419372559,
0.2397155463695526,
0.045413538813591,
0.40581485629081726,
-0.00011723888746928424,
0.04737967997789383,
0.37964051961898804,
-0.17218270897865295,
-0.2726464867591858,
0.15660560131072998,
0.0030423402786254883,
0.7088298797607422,
-0.4007178843021393,
-0.242998868227005,
-0.09222471714019775,
-0.2570132315158844,
0.17760443687438965,
-0.24734744429588318,
0.04462022706866264,
-0.1382378190755844,
0.12129589915275574,
0.21994851529598236,
-0.0842057541012764,
-0.17226924002170563,
-0.0662849023938179,
0.12027187645435333,
0.00611722469329834,
0.34723585844039917,
0.19930538535118103,
0.37105637788772583,
0.007223237305879593,
0.04387131705880165,
0.11114749312400818,
0.012622848153114319,
0.6747767329216003,
-0.04377477616071701,
-0.1514994353055954,
-0.05237584933638573,
-0.13205969333648682,
-0.05324734374880791,
0.39664891362190247,
-0.17364788055419922,
-0.19314731657505035,
-0.25124627351760864,
0.06017116829752922,
-0.25215455889701843,
0.11154357343912125,
0.10178367793560028,
-0.08231465518474579,
0.12213101983070374,
-0.1983051598072052,
0.15568101406097412,
-0.26352375745773315,
-0.07344439625740051,
0.4031422436237335,
0.4513131082057953,
-0.09108832478523254,
0.3896137773990631,
0.3070320188999176,
0.2516089379787445,
0.12435917556285858,
0.005480319261550903,
0.1122681275010109,
0.15535494685173035,
-0.03484231233596802,
-0.301239550113678,
-0.1384718418121338,
0.49168142676353455,
0.1743970811367035,
0.2855392098426819,
0.008122425526380539,
-0.05984023958444595,
0.21731187403202057,
-0.022587571293115616,
0.14837978780269623,
0.2412767857313156,
-0.09380246698856354,
0.42643409967422485,
-0.04218091070652008,
-0.014591723680496216,
0.024907059967517853,
-0.12132240831851959,
0.007204078137874603,
-0.1525832861661911,
0.44768619537353516,
0.09462475776672363,
-0.2093922197818756,
0.07100564241409302,
0.022668734192848206,
-0.4113048315048218,
-0.23530398309230804,
-0.2516547739505768,
-0.024243582040071487,
0.15189386904239655,
0.02929423749446869,
-0.06336767971515656,
-0.2954343557357788,
0.14243252575397491,
0.0701596736907959,
-0.24020470678806305,
-0.29102814197540283,
0.0019270200282335281,
-0.0985153540968895,
0.28476616740226746,
-0.20061466097831726,
-0.4696589410305023,
0.5617304444313049,
0.1107790395617485,
0.19534611701965332,
0.202571302652359,
-0.278079092502594,
0.1000709980726242,
0.1498052030801773,
0.02424510009586811,
-0.23223964869976044,
0.037144631147384644,
0.09654621034860611,
0.10589063167572021,
0.02214936912059784,
0.12588828802108765,
-0.1409880667924881,
-0.6534913778305054,
0.25749772787094116,
0.09609269350767136,
-0.009963583201169968,
0.047861456871032715,
-0.3714338541030884,
0.0994328036904335,
0.3315037190914154,
-0.14146122336387634,
0.2638709247112274,
-0.11027080565690994,
-0.4671993553638458,
-0.27379652857780457,
0.12264692038297653,
0.020874954760074615,
0.25429391860961914,
-0.1329784393310547,
0.004938509315252304,
0.07158689200878143,
0.4091658890247345,
0.41998618841171265,
-0.06294997036457062,
0.13744565844535828,
-0.14522835612297058,
-0.0742189809679985,
-0.04964850842952728,
-0.06833694130182266,
-0.343203604221344,
-0.12220615148544312,
-0.06313583254814148,
0.22272446751594543,
0.12541073560714722,
0.05863818898797035,
-0.019397208467125893,
-0.5522971153259277,
0.25624629855155945,
0.062235549092292786,
-0.417906790971756,
-0.16835790872573853,
-0.4987667500972748,
0.008952215313911438,
-0.10033340752124786,
0.23769624531269073,
-0.3113662302494049,
0.37454700469970703,
0.048518262803554535,
0.06381858885288239,
0.20671159029006958,
-0.12311851978302002,
0.11356408149003983,
-0.10727560520172119,
-0.08872371166944504,
-0.05808514356613159,
0.20763848721981049,
-0.051892079412937164,
-0.07058307528495789,
0.1947973668575287,
0.15687765181064606,
0.06399888545274734,
0.20907019078731537,
-0.24279604852199554,
-0.23238961398601532,
-0.135695219039917,
-0.2631765604019165,
-0.43578997254371643,
-0.10532699525356293,
0.010328499600291252,
0.5007947683334351,
0.04662799835205078,
-0.35078805685043335,
-0.21961811184883118,
-0.5819286108016968,
-0.10475069284439087,
-0.4834277629852295,
-0.09222200512886047,
0.07692723721265793,
0.09739790856838226,
-0.18744802474975586,
0.15929751098155975,
-0.04463936388492584,
-0.1886293590068817,
-0.11862626671791077,
0.44091367721557617,
-0.37774500250816345,
0.15262584388256073,
-0.3507058918476105,
0.24318179488182068,
0.17598943412303925,
0.0008451864123344421,
-0.11369854211807251,
0.026055388152599335,
0.21297010779380798,
-0.2887354791164398,
0.15177784860134125,
0.22840121388435364,
-0.46000733971595764,
-0.0375690720975399,
-0.15099361538887024,
-0.21979758143424988,
-0.18281999230384827,
0.20677149295806885,
-0.39320212602615356,
0.03502070903778076,
0.09524312615394592,
-0.01202498096972704,
0.26575931906700134,
0.07559022307395935,
-0.5587824583053589,
0.18828833103179932,
0.43672889471054077,
-0.09851159900426865,
-0.34435465931892395,
-0.04094725474715233,
0.053460828959941864,
-0.2182290107011795,
-0.26421481370925903,
0.29560405015945435,
0.5413879156112671,
0.07322712987661362,
0.10337156057357788,
0.32729092240333557,
0.12030662596225739,
-0.26306989789009094,
0.09158484637737274,
0.07435750961303711,
0.5338268280029297,
-0.03424873948097229,
-0.13833707571029663,
0.10911047458648682,
-0.0978885218501091,
-0.2640461325645447,
-0.1323651373386383,
0.37150341272354126,
-0.1162555143237114,
-0.042673297226428986,
-0.1866380274295807,
-0.24169647693634033,
-0.27407220005989075,
-0.14475217461585999,
-0.06695358455181122,
-0.014349780976772308,
-0.06507221609354019,
0.49744346737861633,
-0.16114123165607452,
0.13963329792022705,
0.2985944449901581,
0.39793044328689575,
-0.0006031766533851624,
0.4294855296611786,
-0.2505449056625366,
0.04756186529994011,
-0.04768470674753189,
0.016397446393966675,
0.09076668322086334,
-0.2657310962677002,
0.0924721360206604,
-0.050908301025629044,
-0.484133780002594,
-0.0829535722732544,
0.07936245948076248,
0.02144991047680378,
-0.24233564734458923,
0.15942861139774323,
0.09918991476297379,
-0.05094822496175766,
-0.17758680880069733,
-0.03960912674665451,
0.31086620688438416,
-0.5187879204750061,
-0.08498521894216537,
-0.1674904227256775,
0.05098474398255348,
-0.14619408547878265,
-0.2479049563407898,
0.0022751279175281525,
-0.19897909462451935,
-0.2235405594110489,
0.20954851806163788,
-0.005330309271812439,
0.08697684109210968,
0.44545143842697144,
-0.17231518030166626,
-0.253335177898407,
0.20799295604228973,
-0.2355175018310547,
-0.2566673755645752,
-0.846795380115509,
0.2342759370803833,
-0.17819279432296753,
-0.2917240858078003,
-0.33902668952941895,
-0.12909170985221863,
0.0722348690032959,
0.43126699328422546,
0.10536028444766998,
-0.16467943787574768,
0.11344864219427109,
-0.23864439129829407,
0.04329868033528328,
-0.0057601891458034515,
0.3361983895301819,
-0.17972591519355774,
0.10920204222202301,
-0.06157473474740982,
0.08513955771923065,
0.4389563202857971,
0.18010467290878296,
0.001216929405927658,
0.564109206199646,
0.4874436855316162,
0.15708792209625244,
1.0708316564559937,
0.3186494708061218,
0.2723405361175537,
0.12825891375541687,
0.021522359922528267,
0.046872690320014954,
-0.416641503572464,
-0.06461694091558456,
0.5248789191246033,
0.23043450713157654,
-0.24971193075180054,
0.39733272790908813,
-0.012620894238352776,
0.0734562873840332,
-0.022218912839889526,
-0.22968214750289917,
0.2187804877758026,
-0.12050465494394302,
-0.09321045130491257,
-0.023339305073022842,
0.16215765476226807,
0.09072897583246231,
0.08318047225475311,
0.12113846838474274,
-0.10136345773935318,
0.09133970737457275,
-0.021993488073349,
0.6036950349807739,
0.23809848725795746,
-0.4817650318145752,
-0.1507537066936493,
-0.49246078729629517,
0.03091517835855484,
0.24096818268299103,
0.21890363097190857,
0.02746175229549408,
-0.3161942660808563,
0.2913159728050232,
0.20345164835453033,
0.6506668329238892,
-0.20864491164684296,
0.049211286008358,
-0.25643813610076904,
-0.13804684579372406,
-0.3214796483516693,
-0.14262628555297852,
0.17518973350524902,
-0.11858649551868439,
-0.1815992146730423,
0.2662416994571686,
-0.2797855734825134,
-0.01475789025425911,
0.05767546966671944,
-0.042769644409418106,
-0.056636564433574677,
-0.3026774227619171,
-0.17526137828826904,
-0.2503594160079956,
-0.1548536717891693,
0.08861809968948364,
0.18481215834617615,
0.19110168516635895,
-0.09868668764829636,
0.3377484083175659,
0.06591008603572845,
0.2971285283565521,
-0.1189645379781723,
0.022387124598026276,
0.03402799740433693,
-0.04126173257827759,
0.22027714550495148,
0.4600223898887634,
-0.010946003720164299,
0.33185282349586487,
0.44989117980003357,
0.2286221981048584,
-0.10842083394527435,
-0.09160246700048447,
-0.22040440142154694,
0.14903020858764648,
0.21043790876865387,
-0.007170621305704117,
0.08005151152610779,
0.23712295293807983,
0.14669175446033478,
-0.4182949662208557,
-0.4029422700405121,
-0.07236191630363464,
-0.0737653598189354,
-0.4268123209476471,
-0.8429884314537048,
0.04902685433626175,
0.047342851758003235,
0.0730522871017456,
0.5718469619750977,
0.06197451055049896,
-0.07168591022491455,
0.24881118535995483,
-0.009331714361906052,
0.7297341227531433,
0.28173530101776123,
0.05280651897192001,
0.5883652567863464,
0.522787868976593,
-0.023070646449923515,
0.3812008500099182,
0.24959547817707062,
-0.27386319637298584,
-0.599638044834137,
-0.024323564022779465,
0.10051389038562775,
0.05463629215955734,
0.3907281160354614,
-0.07047994434833527,
0.3136574625968933,
0.23904532194137573,
-0.13369719684123993,
-0.0237377118319273,
0.0005434006452560425,
-0.23140861093997955,
-0.14017529785633087,
0.0665263682603836,
0.043559469282627106,
0.16863086819648743,
0.2986312508583069,
0.04164702072739601,
-0.008412713184952736,
0.001089148223400116,
-0.14577366411685944,
0.025821000337600708,
0.0501696839928627,
0.005984265357255936,
-0.158535897731781,
0.2200770229101181,
-0.07573849707841873,
0.23126454651355743,
0.055385444313287735,
0.5933375358581543,
-0.27012306451797485,
0.1026453748345375,
0.06436529755592346,
0.01633758842945099,
0.18986046314239502,
-0.10760511457920074,
-0.05710761249065399,
0.35836994647979736,
-0.1861717253923416,
-0.047927334904670715,
-0.17877960205078125,
0.018943987786769867,
-0.7807905673980713,
-0.599349856376648,
-0.12275369465351105,
0.19766531884670258,
0.15065568685531616,
-0.15246270596981049,
0.22216320037841797,
-0.07685207575559616,
-0.19947105646133423,
0.007915469817817211,
-0.06388731300830841,
-0.06568288803100586,
0.2635091543197632,
-0.2964370846748352,
-0.21176627278327942,
-0.23281334340572357,
0.2372167408466339,
0.00051158107817173,
0.3708634376525879,
0.38831067085266113,
-0.26625585556030273,
-0.02192336693406105,
0.09251026064157486,
-0.13371625542640686,
0.12497736513614655,
-0.4235742390155792,
0.261768102645874,
-0.23021717369556427,
0.4955791234970093,
0.10184168815612793,
0.2402913123369217,
0.059256937354803085,
0.07146568596363068,
-0.00657278299331665,
-0.21421900391578674,
-0.2475528120994568,
0.004222787916660309,
0.0686979591846466,
0.037226688116788864,
0.14432191848754883,
0.17316479980945587,
-0.08973018825054169,
-0.03664457052946091,
-0.23606723546981812,
-0.30287742614746094,
0.21176254749298096,
0.1550135761499405,
0.05574851110577583,
-0.11432706564664841,
0.18862393498420715,
0.07242859899997711,
-0.004366457462310791,
0.2289195954799652,
-0.15167132019996643,
-0.06868036091327667,
-0.15604479610919952,
0.12711918354034424,
0.0844472199678421,
-0.04235453903675079,
0.08324721455574036,
-0.1545959711074829,
-0.36512428522109985,
-0.13021418452262878,
0.2578943073749542,
0.30419445037841797,
0.11310365796089172,
-0.011561185121536255,
0.6921471357345581,
0.09723854064941406,
0.003806501626968384,
0.07141028344631195,
-0.014051295816898346,
-0.15957316756248474,
-0.19372321665287018,
0.13273093104362488,
-0.15791574120521545,
-0.24176964163780212,
-0.2950200140476227,
0.1076219379901886,
0.15820114314556122,
0.07963304221630096,
0.25297078490257263,
-0.023668132722377777,
0.15022669732570648,
0.02837691828608513,
0.4592820405960083,
0.20726759731769562,
-0.08674655854701996,
-0.33715251088142395,
0.3750530481338501,
0.06440969556570053,
0.08773176372051239,
0.06977243721485138,
-0.0644918903708458,
0.27108973264694214,
0.05411538481712341,
0.4971228241920471,
-0.08095444738864899,
-0.2756012976169586,
-0.24876339733600616,
0.0349520668387413,
0.45600301027297974,
-0.750636875629425,
0.0816761925816536,
0.0310678631067276,
0.010223597288131714,
0.13022643327713013,
0.36944854259490967,
0.05278276652097702,
0.20021070539951324,
0.15879982709884644,
0.05791144818067551,
0.3715495765209198,
0.33739790320396423,
-0.2155010998249054,
-0.026154816150665283,
-0.16338203847408295,
-0.23371845483779907,
0.47078216075897217,
-0.26507407426834106,
0.19460909068584442,
0.4263143241405487,
0.2196968048810959,
-0.17042836546897888,
-0.2547608017921448,
0.24057233333587646,
-0.0015764790587127209,
0.013433733955025673,
0.011032011359930038,
-0.27021878957748413,
-0.16587306559085846,
-0.1446254551410675,
0.18420222401618958,
-0.12020128965377808,
0.10646331310272217,
0.45513835549354553,
-0.12787805497646332,
-0.14400629699230194,
-0.30072304606437683,
-0.0126536525785923,
0.06947466731071472,
0.4925455152988434,
-0.08895005285739899,
-0.1215248554944992,
-0.0949542224407196,
-0.12441891431808472,
0.5401919484138489,
0.4146531820297241,
0.13382168114185333,
0.2850806713104248,
0.30368587374687195,
0.0738595575094223,
-0.08382781594991684,
0.037940651178359985,
-0.037097491323947906,
0.21559587121009827,
0.024128731340169907,
-0.38558831810951233,
0.06554214656352997,
-0.022389719262719154,
-0.04531118646264076,
0.005991983227431774,
0.15420258045196533,
0.593570351600647,
-0.2855008840560913,
0.2488742619752884,
-0.1251930594444275,
0.11066055297851562,
0.3619503378868103,
0.33274558186531067,
-0.2505990266799927,
0.310235857963562,
-0.47526004910469055,
-0.13677912950515747,
0.05037102848291397,
-0.26492342352867126,
0.041669122874736786,
0.00043773092329502106,
0.3553941249847412,
0.312787801027298,
-0.5264195203781128,
0.0008672438561916351,
-0.3823186159133911,
-0.27003923058509827,
0.07769176363945007,
0.16305610537528992,
0.29015016555786133,
0.008325040340423584,
0.08135981112718582,
-0.016464121639728546,
-0.14480522274971008,
0.0852864533662796,
-0.25175002217292786,
-0.3395848870277405,
0.7231212854385376,
0.1586121916770935,
-0.11649958789348602,
-0.24694958329200745,
-0.024953819811344147,
0.08416856080293655,
-0.2725257873535156,
0.10529689490795135,
-0.26040396094322205,
-0.014536678791046143,
0.1629386991262436,
0.1890181601047516,
-0.11618493497371674,
-0.17362892627716064,
-0.10428677499294281,
0.18039536476135254,
-0.23694175481796265,
-0.07856876403093338,
0.13129180669784546,
-0.24237234890460968,
0.09989149868488312,
-0.537128746509552,
0.31855329871177673,
-0.11511114239692688,
0.3330419063568115,
0.003227081149816513,
-0.24309255182743073,
-0.3303760290145874,
0.11358390748500824,
-0.041044075042009354,
0.26336413621902466,
-0.2672460079193115,
0.43837472796440125,
-0.2022981196641922,
0.09702099859714508,
0.1257854402065277,
0.11253396421670914,
0.11351291835308075,
-0.10897544026374817,
-0.27541178464889526,
-0.13517001271247864,
0.6596889495849609,
-0.3825235962867737,
-0.19827258586883545,
-0.09714122116565704,
-0.01411420851945877,
0.1044272780418396,
-0.3460267186164856,
-0.23531050980091095,
-0.1270318478345871,
0.10519598424434662,
-0.06872381269931793,
0.03644988685846329,
0.23933935165405273,
-0.2089543491601944,
-0.12119220197200775,
0.025242909789085388,
0.2829142212867737,
0.08681701868772507,
-0.5252567529678345,
0.45351311564445496,
-0.23980718851089478
] |
https://github.com/huggingface/datasets/issues/6152 | Makes sense, I guess this can be fixed in the load_dataset_builder method.
It concerns every packaged builder I think (see values in `_PACKAGED_DATASETS_MODULES`) | FolderBase Dataset automatically resolves under current directory when data_dir is not specified | ### Describe the bug
FolderBase Dataset automatically resolves under current directory when data_dir is not specified.
For example:
```
load_dataset("audiofolder")
```
takes long time to resolve and collect data_files from current directory. But I think it should reach out to this line for error handling https://github.com/huggingface/datasets/blob/cb8c5de5145c7e7eee65391cb7f4d92f0d565d62/src/datasets/packaged_modules/folder_based_builder/folder_based_builder.py#L58-L59
### Steps to reproduce the bug
```
load_dataset("audiofolder")
```
### Expected behavior
Error report
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-5.15.0-78-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3 | 23 | FolderBase Dataset automatically resolves under current directory when data_dir is not specified
### Describe the bug
FolderBase Dataset automatically resolves under current directory when data_dir is not specified.
For example:
```
load_dataset("audiofolder")
```
takes long time to resolve and collect data_files from current directory. But I think it should reach out to this line for error handling https://github.com/huggingface/datasets/blob/cb8c5de5145c7e7eee65391cb7f4d92f0d565d62/src/datasets/packaged_modules/folder_based_builder/folder_based_builder.py#L58-L59
### Steps to reproduce the bug
```
load_dataset("audiofolder")
```
### Expected behavior
Error report
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-5.15.0-78-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
Makes sense, I guess this can be fixed in the load_dataset_builder method.
It concerns every packaged builder I think (see values in `_PACKAGED_DATASETS_MODULES`) | [
-0.2735007405281067,
0.028854265809059143,
0.028967544436454773,
0.4166823625564575,
0.2547065317630768,
-0.014593467116355896,
0.27842482924461365,
0.05671973153948784,
-0.021877121180295944,
0.0357544980943203,
0.10410922020673752,
0.25342753529548645,
-0.042768917977809906,
0.04019048810005188,
-0.05806144326925278,
-0.09806661307811737,
-0.018088601529598236,
0.07056854665279388,
-0.31218084692955017,
-0.024087421596050262,
-0.488711416721344,
0.1872943788766861,
-0.23144644498825073,
0.14618827402591705,
-0.45639485120773315,
-0.12086815387010574,
-0.15301072597503662,
0.37546902894973755,
-0.3438218832015991,
-0.45811593532562256,
0.5504957437515259,
-0.0022136643528938293,
0.23578713834285736,
0.31259986758232117,
-0.00011708418605849147,
0.07299846410751343,
0.4578460156917572,
-0.2099178433418274,
-0.20160312950611115,
-0.23272597789764404,
-0.28436240553855896,
-0.0818987563252449,
0.11133796721696854,
-0.16055651009082794,
0.14015723764896393,
0.0029726922512054443,
0.12966041266918182,
-0.04668741673231125,
-0.004919644445180893,
0.24994924664497375,
0.19338631629943848,
0.06942830979824066,
0.005764394998550415,
-0.04910298436880112,
-0.14817704260349274,
0.3051050901412964,
0.041040532290935516,
0.5403980016708374,
0.04466443508863449,
-0.008056901395320892,
-0.29681605100631714,
0.23978416621685028,
0.029673852026462555,
0.02635638788342476,
0.5325042605400085,
0.08384597301483154,
0.021050656214356422,
-0.2149890661239624,
-0.2798854112625122,
-0.10307302325963974,
0.4431319534778595,
-0.368467777967453,
-0.28850212693214417,
-0.3800293803215027,
-0.12286346405744553,
-0.1666163206100464,
0.3842312693595886,
0.001475367695093155,
-0.3424281179904938,
0.2488926649093628,
-0.030769817531108856,
-0.2872830331325531,
-0.10275532305240631,
0.021624499931931496,
-0.18709823489189148,
0.16462163627147675,
-0.25659841299057007,
0.04412275552749634,
0.1665448546409607,
0.13109657168388367,
0.24203991889953613,
-0.266652375459671,
-0.06515192985534668,
0.1613706797361374,
-0.3185843527317047,
-0.021068476140499115,
0.2629168927669525,
0.6695444583892822,
0.12899139523506165,
0.15320207178592682,
0.017818935215473175,
-0.12853537499904633,
-0.229684978723526,
0.09757796674966812,
0.49462902545928955,
0.24950489401817322,
0.11966834962368011,
0.20641106367111206,
0.39380666613578796,
0.30812251567840576,
0.12564599514007568,
0.046751078218221664,
-0.082874596118927,
-0.33289241790771484,
-0.05277952551841736,
0.038218580186367035,
0.40126290917396545,
0.05745279788970947,
-0.30057477951049805,
0.07454600930213928,
0.00769602507352829,
-0.11696577072143555,
0.34869372844696045,
0.3339627981185913,
-0.0036644749343395233,
0.27909427881240845,
-0.11924150586128235,
0.10102321207523346,
0.015028633177280426,
0.3626168370246887,
-0.08066737651824951,
-0.07228238880634308,
-0.352780818939209,
-0.11334724724292755,
0.07939357310533524,
-0.42098164558410645,
0.14385876059532166,
0.22198954224586487,
0.08569842576980591,
-0.14774765074253082,
-0.2697708308696747,
-0.13374292850494385,
-0.029187612235546112,
0.24566882848739624,
-0.2122354805469513,
0.3769562244415283,
-0.08322935551404953,
0.11552219092845917,
-0.15141120553016663,
0.16926319897174835,
-0.47326111793518066,
-0.42360734939575195,
0.025121087208390236,
0.1363307386636734,
-0.20800064504146576,
0.1363917887210846,
-0.31944453716278076,
-0.09779702872037888,
-0.12397219985723495,
-0.17514964938163757,
0.260836660861969,
0.0053777750581502914,
-0.022159874439239502,
-0.19049488008022308,
0.18178503215312958,
0.4551280736923218,
-0.12101490795612335,
0.150941863656044,
-0.5835086703300476,
-0.17308253049850464,
0.0474356971681118,
0.1502811461687088,
-0.074522964656353,
0.5679343342781067,
-0.5641295313835144,
-0.0036635622382164,
0.3900952637195587,
-0.42453163862228394,
-0.5342527031898499,
0.19383838772773743,
-0.25330400466918945,
0.14049679040908813,
-0.09184157848358154,
0.13037189841270447,
-0.17156153917312622,
-0.1118340790271759,
0.20282478630542755,
0.340887188911438,
-0.06687615066766739,
0.10871502012014389,
-0.21073342859745026,
-0.16763238608837128,
-0.20632854104042053,
0.06449082493782043,
-0.16518110036849976,
0.218533456325531,
-0.15247420966625214,
0.15208974480628967,
0.2840977609157562,
-0.026160143315792084,
-0.07021331042051315,
0.2087520956993103,
0.41684556007385254,
-0.06442828476428986,
0.08284002542495728,
-0.24395427107810974,
-0.5291163921356201,
0.2216004580259323,
0.040594011545181274,
-0.008861862123012543,
-0.4449543356895447,
-0.19706222414970398,
-0.306854784488678,
0.061840519309043884,
-0.32780879735946655,
0.06768688559532166,
0.06573458015918732,
0.24793928861618042,
-0.04538246989250183,
-0.1824769675731659,
-0.38624152541160583,
0.37289562821388245,
-0.27527087926864624,
0.2667515277862549,
-0.044582124799489975,
0.25944948196411133,
-0.03832738846540451,
0.031333278864622116,
-0.059063639491796494,
0.06124568730592728,
0.12996330857276917,
-0.350159227848053,
0.15257760882377625,
0.4649237096309662,
0.057852938771247864,
0.31812092661857605,
0.02668781206011772,
-0.10068124532699585,
0.041702382266521454,
-0.1519138365983963,
-0.007129477337002754,
-0.008433865383267403,
0.13379409909248352,
0.16811057925224304,
-0.07361499965190887,
0.24030807614326477,
-0.2174573540687561,
0.24978935718536377,
0.024645209312438965,
-0.2005382776260376,
0.16862702369689941,
0.036357589066028595,
0.21399372816085815,
-0.24671058356761932,
0.11030345410108566,
0.3539598286151886,
0.45090073347091675,
0.4894410967826843,
-0.18908929824829102,
0.02273944951593876,
0.32957935333251953,
-0.191753089427948,
0.17612150311470032,
0.328117311000824,
0.09233465790748596,
-0.10413657873868942,
0.07761799544095993,
0.3491957187652588,
0.4794723689556122,
0.10436858981847763,
0.057097505778074265,
0.19316992163658142,
-0.13433773815631866,
-0.17039819061756134,
0.2003595530986786,
0.113657146692276,
-0.08588913083076477,
0.38264089822769165,
0.026697158813476562,
0.02645278349518776,
-0.44435781240463257,
0.007089070975780487,
-0.07985921204090118,
0.26837030053138733,
-0.3765520453453064,
-0.003894895315170288,
-0.3133285343647003,
-0.3003857135772705,
-0.24126869440078735,
-0.3202211856842041,
-0.31312817335128784,
-0.2875926196575165,
-0.07640990614891052,
0.06582462042570114,
-0.06078675389289856,
-0.07585173845291138,
0.026449404656887054,
0.5172668695449829,
-0.051539450883865356,
-0.18665993213653564,
-0.3030887246131897,
0.2120407223701477,
-0.07892735302448273,
-0.02281942032277584,
0.15974414348602295,
-0.04916476085782051,
0.07351654022932053,
-0.32920974493026733,
0.16533145308494568,
-0.34988492727279663,
-0.22007879614830017,
0.31250065565109253,
0.04698644578456879,
0.4546090364456177,
0.45347467064857483,
0.29243361949920654,
0.35235053300857544,
-0.38955438137054443,
0.13348360359668732,
0.2439456582069397,
-0.04942355677485466,
-0.2695121765136719,
0.29694557189941406,
0.4380609691143036,
-0.2642882764339447,
-0.1792576014995575,
-0.08919931203126907,
-0.47802624106407166,
0.1598091721534729,
-0.13299493491649628,
0.2530720829963684,
-0.033568110316991806,
-0.27234864234924316,
0.1555020809173584,
-0.425006628036499,
-0.09732455760240555,
-0.0017922520637512207,
-0.4946421980857849,
0.23672273755073547,
0.021563265472650528,
-0.01869480311870575,
-0.2829607129096985,
-0.14998283982276917,
0.21434840559959412,
-0.08852358162403107,
-0.2779013514518738,
-0.38135597109794617,
-0.1541709452867508,
0.22927840054035187,
0.10281191021203995,
0.20927859842777252,
0.21697035431861877,
0.16731059551239014,
0.007202014327049255,
-0.055436741560697556,
-0.12970438599586487,
0.09694292396306992,
0.13286690413951874,
0.18048986792564392,
0.25669005513191223,
0.26445862650871277,
-0.19219936430454254,
0.6403371691703796,
0.235162615776062,
-0.0024995780549943447,
0.5690145492553711,
0.009212294593453407,
0.5637957453727722,
-0.1316649317741394,
-0.223489910364151,
-0.059204719960689545,
0.1630745530128479,
-0.21060210466384888,
0.16288720071315765,
0.2795976400375366,
0.15772755444049835,
-0.03645152226090431,
-0.431746244430542,
-0.19994382560253143,
-0.37070953845977783,
0.05352974683046341,
-0.09161539375782013,
0.18048129975795746,
-0.11605412513017654,
0.011060848832130432,
0.07495076954364777,
0.0238187313079834,
0.1313752681016922,
0.3520662188529968,
0.25669631361961365,
0.06413138657808304,
0.11521820724010468,
-0.25562983751296997,
-0.19286444783210754,
0.07826656103134155,
0.1136799305677414,
0.30174174904823303,
-0.1754022091627121,
0.03699348866939545,
0.00033285096287727356,
-0.05010708421468735,
0.531891405582428,
-0.21416710317134857,
0.07827017456293106,
-0.36266273260116577,
0.12471023947000504,
-0.23415420949459076,
0.11513914912939072,
0.058800920844078064,
0.35499003529548645,
-0.15587502717971802,
0.5140746235847473,
-0.10156217217445374,
-0.26319432258605957,
0.3009989857673645,
0.11508022248744965,
-0.16608166694641113,
-0.2336980104446411,
-0.22275495529174805,
-0.27101433277130127,
0.009261421859264374,
0.17527315020561218,
0.20213599503040314,
0.05179150030016899,
0.16915437579154968,
-0.1474566012620926,
0.013202616944909096,
-0.0339575931429863,
0.006205517798662186,
-0.0912470817565918,
0.30217400193214417,
-0.20877599716186523,
-0.018362969160079956,
0.32088860869407654,
0.09771925956010818,
0.3409951329231262,
0.7094263434410095,
-0.20146197080612183,
-0.02467852458357811,
0.07046487927436829,
-0.019787192344665527,
0.5105619430541992,
0.4077633023262024,
-0.2362421452999115,
-0.11197654902935028,
-0.3158038854598999,
-0.0013670772314071655,
-0.6484411358833313,
0.084520623087883,
0.5549290776252747,
0.2540316879749298,
-0.24146400392055511,
-0.13545680046081543,
0.5996792316436768,
0.032041773200035095,
-0.16583779454231262,
0.5876601338386536,
0.592868447303772,
-0.3521999418735504,
0.0698104053735733,
-0.15388475358486176,
0.8291119933128357,
0.37546706199645996,
-0.04169773682951927,
0.18651777505874634,
-0.22637015581130981,
0.22497892379760742,
-0.1355624794960022,
0.13800261914730072,
-0.266924649477005,
-0.13641174137592316,
-0.13225850462913513,
-0.2396976798772812,
0.05394018441438675,
0.12652488052845,
-0.24015885591506958,
0.3125728368759155,
-0.4613122045993805,
-0.16934074461460114,
-0.0771017074584961,
0.14236155152320862,
-0.46048974990844727,
-0.06968630850315094,
-0.5198317766189575,
0.03711037337779999,
0.1553245633840561,
0.4357123076915741,
-0.21045851707458496,
0.017355460673570633,
0.2663612365722656,
-0.38770124316215515,
-0.2662559747695923,
-0.0828394815325737,
0.1630808264017105,
-0.3094910979270935,
0.07788505405187607,
0.10221442580223083,
0.1546325981616974,
0.16514165699481964,
0.08472737669944763,
0.0357755646109581,
-0.0685473158955574,
0.15449699759483337,
-0.27359211444854736,
0.37360164523124695,
0.23234137892723083,
-0.03803304582834244,
0.20928284525871277,
0.07048924267292023,
-0.1490432322025299,
-0.28403323888778687,
-0.31366756558418274,
-0.11516528576612473,
0.03406783938407898,
0.027764122933149338,
-0.14228154718875885,
-0.21270647644996643,
-0.22331447899341583,
-0.23256245255470276,
0.16837157309055328,
-0.02444411814212799,
0.10217103362083435,
0.12357699871063232,
0.029388628900051117,
0.09510347992181778,
-0.245779886841774,
-0.3111970126628876,
-0.0515914149582386,
0.2792539894580841,
-0.1624661684036255,
0.06852106750011444,
0.1920662820339203,
-0.13065391778945923,
-0.23697951436042786,
-0.10404329746961594,
0.2236935794353485,
0.32639631628990173,
-0.27228543162345886,
0.26928946375846863,
-0.04570373520255089,
0.004187628626823425,
-0.09883692860603333,
0.3686312139034271,
0.1734350472688675,
-0.2584936320781708,
-0.6493479013442993,
-0.4603849947452545,
-0.23531371355056763,
0.3267855644226074,
-0.22436970472335815,
0.1990194022655487,
0.09076899290084839,
-0.0820675939321518,
0.5103858113288879,
-0.25069230794906616,
-0.26231980323791504,
-0.0952397882938385,
-0.4000285267829895,
0.09241601824760437,
-0.024167167022824287,
0.13565248250961304,
0.2599376440048218,
-0.09614574164152145,
0.0784200131893158,
-0.002849133685231209,
-0.12713129818439484,
-0.12313886731863022,
0.002749107778072357,
0.2103680819272995,
0.153060644865036,
0.22652409970760345,
0.2766125798225403,
-0.30240103602409363,
-0.018337292596697807,
-0.017322055995464325,
0.23092350363731384,
0.09866391867399216,
0.13397428393363953,
0.00484180822968483,
0.1817360818386078,
-0.22043803334236145,
-0.1300772726535797,
0.05294348672032356,
0.018751874566078186,
0.1448969542980194,
0.11226575076580048,
0.12983468174934387,
-0.4750772714614868,
-0.05487930774688721,
0.1247643232345581,
0.2411484569311142,
0.16456007957458496,
0.1172402948141098,
0.19493955373764038,
0.015986386686563492,
-0.06404012441635132,
0.1691139042377472,
0.5130970478057861,
0.22809737920761108,
-0.14630605280399323,
-0.2398630976676941,
-0.03967671096324921,
0.16291536390781403,
-0.2979975938796997,
-0.338899701833725,
-0.251714825630188,
-0.04464321956038475,
0.06423261761665344,
0.2746245861053467,
-0.03726170212030411,
-0.0674644187092781,
0.007408894598484039,
-0.06454066932201385,
0.5092500448226929,
0.0017497632652521133,
0.19698841869831085,
0.5489155054092407,
-0.14667905867099762,
0.18020090460777283,
0.7233330011367798,
-0.1412525624036789,
0.17087037861347198,
0.6186435222625732,
-0.19354897737503052,
0.08539234101772308,
-0.11357154697179794,
0.08654513955116272,
0.3685987591743469,
-0.35406017303466797,
0.0890907347202301,
-0.003983698785305023,
0.13315792381763458,
-0.12122412770986557,
0.07593829184770584,
0.4111705422401428,
-0.47003820538520813,
0.013493388891220093,
-0.1262199878692627,
0.04111454635858536,
-0.33123520016670227,
-0.16375374794006348,
0.0509781688451767,
-0.303341269493103,
-0.02069120854139328,
-0.049818702042102814,
-0.1751655638217926,
-0.2165907472372055,
0.2835385203361511,
-0.05411364138126373,
-0.004749171435832977,
-0.3328154981136322,
0.0880027711391449,
0.05662723258137703,
0.1428932249546051,
-0.15657693147659302,
0.5913044214248657,
-0.03686806559562683,
-0.07301345467567444,
0.11356531083583832,
0.5206188559532166,
0.3461637794971466,
0.46325844526290894,
0.23037953674793243,
-0.11577557772397995,
-0.21639665961265564,
0.08583088964223862,
-0.07524128258228302,
0.0980842262506485,
-0.2957973778247833,
0.2965519428253174,
0.2757493257522583,
0.1791306734085083,
-0.1302395910024643,
-0.005316036753356457,
0.09305831044912338,
0.253329873085022,
-0.333418607711792,
0.7775389552116394,
-0.12406419217586517,
0.04881298542022705,
-0.09022224694490433,
0.1605951339006424,
-0.4881574511528015,
-0.004807289689779282,
0.4742102026939392,
-0.10297945141792297,
-0.00199030339717865,
-0.1329663246870041,
0.07473675906658173,
0.1469394862651825,
0.44401487708091736,
0.2868994474411011,
-0.010856464505195618,
-0.23577579855918884,
-0.28072482347488403,
-0.8627368807792664,
0.05199333652853966,
0.24039219319820404,
0.04476770758628845,
0.3587462306022644,
-0.28239157795906067,
-0.1515064686536789,
0.09937973320484161,
0.26506632566452026,
0.22500815987586975,
-0.0839485302567482,
-0.013859417289495468,
-0.3027011454105377,
0.01666788011789322,
-0.3492402732372284,
0.011985404416918755,
-0.07529133558273315,
-0.5425403118133545,
0.3495123088359833,
-0.12908533215522766,
-0.026968777179718018,
0.18101313710212708,
0.028954990208148956,
-0.0799950659275055,
-0.19701334834098816,
0.37631914019584656,
-0.0026626456528902054,
-0.009768769145011902,
-0.06047097593545914,
0.06153813749551773,
-0.387600302696228,
-0.1920270323753357,
-0.25962263345718384,
-0.10606995970010757,
-0.09011195600032806,
0.1937500685453415,
-0.38447561860084534,
0.08027417957782745,
-0.5175479054450989,
-0.2729053795337677,
0.24646778404712677,
0.16932642459869385,
-0.1517869532108307,
0.15911415219306946,
-0.3988531827926636,
0.07766255736351013,
0.11845064163208008,
0.08393435925245285,
0.18348658084869385,
-0.004519712179899216,
-0.27727293968200684,
-0.39374253153800964,
0.49300864338874817,
0.03160557895898819,
-0.3671723008155823,
0.1381986141204834,
0.32190173864364624,
0.18458902835845947,
-0.30708906054496765,
-0.5441499352455139,
-0.04318499565124512,
0.38444414734840393,
0.1402515172958374,
-0.14116212725639343,
-0.12381857633590698,
-0.1755334436893463,
-0.008564978837966919,
-0.08892770111560822,
0.10446761548519135,
0.1326117068529129,
-0.19978410005569458,
0.3208160400390625,
-0.22863192856311798
] |
https://github.com/huggingface/datasets/issues/6152 | I think the behavior is related to these lines, which short circuited the error handling.
https://github.com/huggingface/datasets/blob/664a1cb72ea1e6ef7c47e671e2686ca4a35e8d63/src/datasets/load.py#L946-L952
So should data_dir be checked here or still delegating to actual `DatasetModule`? In that case, how to properly set `data_files` here. | FolderBase Dataset automatically resolves under current directory when data_dir is not specified | ### Describe the bug
FolderBase Dataset automatically resolves under current directory when data_dir is not specified.
For example:
```
load_dataset("audiofolder")
```
takes long time to resolve and collect data_files from current directory. But I think it should reach out to this line for error handling https://github.com/huggingface/datasets/blob/cb8c5de5145c7e7eee65391cb7f4d92f0d565d62/src/datasets/packaged_modules/folder_based_builder/folder_based_builder.py#L58-L59
### Steps to reproduce the bug
```
load_dataset("audiofolder")
```
### Expected behavior
Error report
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-5.15.0-78-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3 | 37 | FolderBase Dataset automatically resolves under current directory when data_dir is not specified
### Describe the bug
FolderBase Dataset automatically resolves under current directory when data_dir is not specified.
For example:
```
load_dataset("audiofolder")
```
takes long time to resolve and collect data_files from current directory. But I think it should reach out to this line for error handling https://github.com/huggingface/datasets/blob/cb8c5de5145c7e7eee65391cb7f4d92f0d565d62/src/datasets/packaged_modules/folder_based_builder/folder_based_builder.py#L58-L59
### Steps to reproduce the bug
```
load_dataset("audiofolder")
```
### Expected behavior
Error report
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-5.15.0-78-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
I think the behavior is related to these lines, which short circuited the error handling.
https://github.com/huggingface/datasets/blob/664a1cb72ea1e6ef7c47e671e2686ca4a35e8d63/src/datasets/load.py#L946-L952
So should data_dir be checked here or still delegating to actual `DatasetModule`? In that case, how to properly set `data_files` here. | [
-0.13462772965431213,
0.09037208557128906,
0.027538299560546875,
0.3838578462600708,
0.1457664519548416,
-0.0724802017211914,
0.22981223464012146,
0.013132331892848015,
-0.10827796161174774,
-0.09232193976640701,
0.16240432858467102,
0.17215892672538757,
-0.016087103635072708,
-0.03362998738884926,
-0.006803462281823158,
0.08008197695016861,
-0.01606908068060875,
-0.014384254813194275,
-0.34217509627342224,
-0.028478868305683136,
-0.5419752597808838,
0.12132927030324936,
-0.18664929270744324,
0.0816265344619751,
-0.487512469291687,
-0.1300986409187317,
-0.09008952230215073,
0.46416550874710083,
-0.2350592017173767,
-0.3621458113193512,
0.49694105982780457,
0.02769947052001953,
0.16380618512630463,
0.246610626578331,
-0.00011909416934940964,
0.12182387709617615,
0.3576609194278717,
-0.21904833614826202,
-0.1943192481994629,
-0.23467493057250977,
-0.32131892442703247,
-0.09699620306491852,
0.08390817046165466,
-0.10554482042789459,
0.2220156490802765,
0.05616425350308418,
0.2694129943847656,
-0.04271466284990311,
-0.06942859292030334,
0.31672123074531555,
0.1366100311279297,
0.09965880960226059,
-0.052154067903757095,
0.10918811708688736,
-0.050849929451942444,
0.33024001121520996,
0.09605968743562698,
0.5458404421806335,
0.061539340764284134,
-0.012669801712036133,
-0.31597334146499634,
0.15971088409423828,
0.17387202382087708,
-0.0866284891963005,
0.4936663508415222,
0.031998585909605026,
0.028743349015712738,
-0.17393328249454498,
-0.3562937378883362,
-0.1538030356168747,
0.4878731369972229,
-0.41255784034729004,
-0.35296547412872314,
-0.3803784251213074,
-0.11620227992534637,
-0.015770018100738525,
0.4713134467601776,
-0.030217688530683517,
-0.16138657927513123,
0.29777517914772034,
0.03537311032414436,
-0.2637448310852051,
-0.12417959421873093,
0.1012224406003952,
-0.16210344433784485,
0.031052645295858383,
-0.24354711174964905,
0.014466959051787853,
0.12850382924079895,
0.0925411805510521,
0.2229301929473877,
-0.342313677072525,
0.0029352004639804363,
0.1842672973871231,
-0.23604153096675873,
0.004825979471206665,
0.22667250037193298,
0.5594373345375061,
0.19047965109348297,
0.1630498468875885,
0.004007454961538315,
-0.07770882546901703,
-0.2603107690811157,
0.11928267776966095,
0.5301498770713806,
0.21949374675750732,
0.10529673099517822,
0.20450888574123383,
0.44992998242378235,
0.2325417399406433,
0.2275124192237854,
-0.021110303699970245,
-0.03417527675628662,
-0.37849950790405273,
-0.09203264117240906,
0.056392207741737366,
0.49205607175827026,
-0.040064603090286255,
-0.24702811241149902,
0.11178794503211975,
0.014350421726703644,
-0.12638959288597107,
0.48638638854026794,
0.335653156042099,
0.025340691208839417,
0.3666769564151764,
-0.19804558157920837,
0.1900326907634735,
0.02622886747121811,
0.47654101252555847,
-0.041674062609672546,
-0.06277233362197876,
-0.32418230175971985,
-0.10397312045097351,
0.12689568102359772,
-0.2708647549152374,
0.24429436028003693,
0.16762658953666687,
0.1693243831396103,
-0.13522613048553467,
-0.17949703335762024,
-0.3264424502849579,
0.017516419291496277,
0.3699663281440735,
-0.24343731999397278,
0.42478179931640625,
-0.1364121437072754,
0.20182979106903076,
-0.07528955489397049,
0.1609489917755127,
-0.454353928565979,
-0.4664074778556824,
0.271486759185791,
0.11726940423250198,
-0.2236766368150711,
0.27851220965385437,
-0.39171484112739563,
-0.1237003356218338,
-0.13931557536125183,
-0.23761796951293945,
0.1900973916053772,
0.018929485231637955,
0.10681360960006714,
-0.25637951493263245,
0.16771909594535828,
0.46308907866477966,
-0.08799837529659271,
0.22871145606040955,
-0.5271219611167908,
-0.18808910250663757,
0.0530143640935421,
0.18450435996055603,
-0.14375093579292297,
0.5368134379386902,
-0.5753579139709473,
0.047517329454422,
0.377512127161026,
-0.45370495319366455,
-0.5631353259086609,
0.13593317568302155,
-0.23412714898586273,
0.10166190564632416,
-0.08205829560756683,
0.20054474472999573,
-0.1344446837902069,
-0.1714787781238556,
0.15939854085445404,
0.32399818301200867,
0.005555097013711929,
0.12768328189849854,
-0.19957518577575684,
-0.05342277139425278,
-0.30546122789382935,
0.03597879409790039,
-0.18004675209522247,
0.18833763897418976,
-0.10881088674068451,
0.12158038467168808,
0.1745147705078125,
0.04828750342130661,
-0.10106268525123596,
0.17394274473190308,
0.47966450452804565,
-0.10787108540534973,
0.038610123097896576,
-0.13942399621009827,
-0.5835362672805786,
0.14019306004047394,
0.12190540134906769,
-0.20064078271389008,
-0.4860970079898834,
-0.21913769841194153,
-0.22228670120239258,
0.032765619456768036,
-0.3303614556789398,
0.12779518961906433,
0.04636486992239952,
0.24123705923557281,
0.041533514857292175,
-0.1772906333208084,
-0.41986873745918274,
0.3156926929950714,
-0.40873536467552185,
0.3460681438446045,
-0.03725156560540199,
0.30962032079696655,
0.021366018801927567,
0.00320420041680336,
-0.07789292931556702,
-0.05333505570888519,
0.09780704975128174,
-0.341918021440506,
0.17590881884098053,
0.5028683543205261,
0.26066747307777405,
0.3141138553619385,
0.03751535341143608,
-0.05729775130748749,
0.17251312732696533,
-0.14542695879936218,
-0.03315410017967224,
-0.042255204170942307,
0.15661384165287018,
0.1746329367160797,
-0.03213026002049446,
0.24756112694740295,
-0.37445786595344543,
0.22013899683952332,
0.1725102812051773,
-0.26394572854042053,
0.12795135378837585,
0.11266817152500153,
0.08644398301839828,
-0.25240960717201233,
0.11588118970394135,
0.4441941976547241,
0.5194813013076782,
0.5150187015533447,
-0.2887868881225586,
0.006755713373422623,
0.2950950264930725,
-0.18184831738471985,
0.1548682153224945,
0.2794307470321655,
0.07272367179393768,
-0.06061336398124695,
0.11329913884401321,
0.42981913685798645,
0.5682555437088013,
0.07582709193229675,
0.10138753801584244,
0.04734138399362564,
-0.1686791628599167,
-0.24186810851097107,
0.12418775260448456,
0.13449886441230774,
-0.08630037307739258,
0.36800891160964966,
-0.050026245415210724,
-0.13577426970005035,
-0.40922921895980835,
0.07578340917825699,
-0.029142476618289948,
0.21650785207748413,
-0.46196022629737854,
0.006459824740886688,
-0.2426515519618988,
-0.2681751251220703,
-0.32931965589523315,
-0.35902121663093567,
-0.3785549998283386,
-0.33510082960128784,
-0.038906216621398926,
0.020946955308318138,
-0.10642537474632263,
-0.11693444848060608,
-0.006727918982505798,
0.27118247747421265,
-0.21372979879379272,
-0.3012497127056122,
-0.17335769534111023,
0.24457377195358276,
-0.07725025713443756,
-0.021535931155085564,
0.17741701006889343,
0.01219257339835167,
0.06475664675235748,
-0.3724825382232666,
0.1564517468214035,
-0.28499725461006165,
-0.1204516813158989,
0.22025112807750702,
0.14877432584762573,
0.4492459297180176,
0.3742886483669281,
0.30982521176338196,
0.3571786880493164,
-0.3404274880886078,
0.056452371180057526,
0.2958226799964905,
-0.029798299074172974,
-0.25243574380874634,
0.32610559463500977,
0.4748155176639557,
-0.2384893000125885,
-0.2192993015050888,
-0.1648307889699936,
-0.38091254234313965,
0.21077144145965576,
-0.13923248648643494,
0.248650461435318,
-0.05275958031415939,
-0.2708936631679535,
0.151044100522995,
-0.33244121074676514,
-0.06746622920036316,
0.04004283621907234,
-0.4389781355857849,
0.27187082171440125,
0.005852062255144119,
-0.001969951670616865,
-0.31740039587020874,
-0.20141258835792542,
0.11801420152187347,
0.08842894434928894,
-0.19542977213859558,
-0.46680328249931335,
-0.15613287687301636,
0.2519894540309906,
0.15322668850421906,
0.21339212357997894,
0.16271081566810608,
0.1055828183889389,
0.052865348756313324,
-0.10319419950246811,
-0.005660355091094971,
0.25859129428863525,
0.19546788930892944,
0.231612890958786,
0.2770935893058777,
0.23970817029476166,
-0.2214423418045044,
0.7300066351890564,
0.1552751362323761,
0.006912830751389265,
0.49023646116256714,
0.051916226744651794,
0.4936979413032532,
0.0036802850663661957,
-0.1473263055086136,
0.00022188574075698853,
0.2133779227733612,
-0.2236238569021225,
0.191900834441185,
0.3298925757408142,
0.2737281918525696,
-0.0003819391131401062,
-0.4233857989311218,
-0.34862831234931946,
-0.37771880626678467,
0.08804876357316971,
-0.030107269063591957,
0.22428247332572937,
-0.12596389651298523,
0.011616922914981842,
0.07021887600421906,
-0.022260988131165504,
0.02835637331008911,
0.5534045696258545,
0.21210195124149323,
0.05568946152925491,
0.08545859158039093,
-0.3650312125682831,
-0.1986733227968216,
0.08624769747257233,
0.09064173698425293,
0.37709659337997437,
-0.11711502075195312,
-0.07541880011558533,
-0.0495387502014637,
-0.1367892324924469,
0.5179821848869324,
-0.10575500875711441,
0.07461995631456375,
-0.4967273473739624,
0.1384134292602539,
-0.18126508593559265,
0.1505434662103653,
0.05606690049171448,
0.3385576903820038,
-0.0261932834982872,
0.5230315923690796,
-0.15096408128738403,
-0.1829528510570526,
0.11053566634654999,
0.1770837903022766,
-0.15182211995124817,
-0.14265698194503784,
-0.26252061128616333,
-0.3280075788497925,
0.06722670048475266,
0.10191350430250168,
0.2078743577003479,
-0.13235750794410706,
0.18224327266216278,
-0.0801960751414299,
0.0005279891192913055,
-0.16378512978553772,
0.08264024555683136,
0.038544055074453354,
0.28710615634918213,
-0.22284063696861267,
0.015505872666835785,
0.38357028365135193,
0.16703860461711884,
0.6774154305458069,
0.6630291938781738,
-0.18222108483314514,
-0.03016240894794464,
0.017544802278280258,
-0.01812899485230446,
0.5821456909179688,
0.3907895088195801,
-0.29154837131500244,
-0.06938539445400238,
-0.3536015748977661,
-0.1796000748872757,
-0.6509184837341309,
0.13230082392692566,
0.47796106338500977,
0.25359514355659485,
-0.25888335704803467,
-0.23570013046264648,
0.49366527795791626,
0.07348011434078217,
-0.17103847861289978,
0.5176459550857544,
0.5291367173194885,
-0.39793139696121216,
-0.031545497477054596,
-0.1433313935995102,
0.8084441423416138,
0.26109710335731506,
-0.059194616973400116,
0.12346936017274857,
-0.280779629945755,
0.22166474163532257,
-0.23266665637493134,
0.16515743732452393,
-0.30663788318634033,
-0.13365833461284637,
-0.14106105268001556,
-0.33904117345809937,
0.18291735649108887,
0.19298967719078064,
-0.19454678893089294,
0.3834136426448822,
-0.3508691191673279,
-0.23155078291893005,
-0.16025453805923462,
0.2350018322467804,
-0.4607263505458832,
-0.04373585805296898,
-0.5807511806488037,
-0.006903506815433502,
0.05645890533924103,
0.3672313392162323,
-0.20867246389389038,
0.0622757151722908,
0.11507970094680786,
-0.33022046089172363,
-0.05244895815849304,
-0.12179204821586609,
-0.019004620611667633,
-0.28706175088882446,
-0.09762470424175262,
-0.0002524256706237793,
0.10657252371311188,
0.20401808619499207,
0.12760640680789948,
0.09050823003053665,
0.07829367369413376,
0.21440336108207703,
-0.21502071619033813,
0.4023244380950928,
0.15197710692882538,
-0.04426797479391098,
0.2706308662891388,
0.07092533260583878,
-0.1658620685338974,
-0.3159206509590149,
-0.3370809853076935,
-0.06437962502241135,
0.018479332327842712,
-0.07151101529598236,
-0.16957953572273254,
-0.23734833300113678,
-0.2272425889968872,
-0.1685633659362793,
0.101788729429245,
0.010317012667655945,
0.06955025345087051,
0.17624695599079132,
0.12045300006866455,
0.13029807806015015,
-0.3422746956348419,
-0.2857808768749237,
-0.07246184349060059,
0.23818857967853546,
-0.24953949451446533,
0.16585491597652435,
0.14554482698440552,
-0.17548178136348724,
-0.22710862755775452,
-0.06573069095611572,
0.30160194635391235,
0.2432647943496704,
-0.2836352288722992,
0.23123225569725037,
-0.02704380825161934,
-0.01624952256679535,
-0.12845295667648315,
0.22374176979064941,
0.20085833966732025,
-0.3120192289352417,
-0.5892882943153381,
-0.4646763205528259,
-0.3996093273162842,
0.4009152352809906,
-0.11944220215082169,
0.168343186378479,
0.09968572854995728,
-0.07531537115573883,
0.4548729360103607,
-0.30059707164764404,
-0.22408241033554077,
-0.11969613283872604,
-0.399515300989151,
0.1745653599500656,
-0.05837571248412132,
0.08374135196208954,
0.32414138317108154,
-0.12406368553638458,
0.04714128375053406,
-0.13904640078544617,
-0.04308279976248741,
-0.07183300703763962,
0.11235231161117554,
0.20669403672218323,
0.11413015425205231,
0.13835354149341583,
0.1572376787662506,
-0.38180267810821533,
0.041852664202451706,
-0.007710808888077736,
0.24141380190849304,
0.027273699641227722,
0.172394797205925,
0.06608573347330093,
0.08703506737947464,
-0.20885196328163147,
-0.09287568926811218,
0.12271037697792053,
-0.07241582870483398,
0.11146437376737595,
0.08963632583618164,
0.21852505207061768,
-0.5082526803016663,
-0.08600150048732758,
-0.012905776500701904,
0.2144160121679306,
0.09492772817611694,
0.06333820521831512,
0.02668995037674904,
0.031367313116788864,
-0.0713169127702713,
0.13157793879508972,
0.47223660349845886,
0.321206271648407,
-0.021904300898313522,
-0.1821928322315216,
0.013452842831611633,
0.10239885747432709,
-0.22332371771335602,
-0.25865286588668823,
-0.1590765118598938,
-0.12236130237579346,
0.13489551842212677,
0.3156946897506714,
-0.06472799181938171,
-0.015670135617256165,
-0.08504916727542877,
-0.09715515375137329,
0.37567731738090515,
0.1078713983297348,
0.13011471927165985,
0.5618706941604614,
-0.08221279084682465,
0.23894402384757996,
0.5587095022201538,
-0.06232082471251488,
0.2261689007282257,
0.5565722584724426,
-0.194048672914505,
0.1753852814435959,
-0.07725729048252106,
0.06945282965898514,
0.34286487102508545,
-0.39104849100112915,
0.017565803602337837,
0.004577025771141052,
0.007962707430124283,
-0.1418623924255371,
0.17048650979995728,
0.44543883204460144,
-0.3941922187805176,
0.005232088267803192,
-0.006550401449203491,
-0.04925023391842842,
-0.33468884229660034,
-0.23038749396800995,
0.0381106361746788,
-0.32722383737564087,
0.06082145869731903,
-0.06001598387956619,
-0.16863006353378296,
-0.2220277190208435,
0.14536826312541962,
0.006035430356860161,
0.020775258541107178,
-0.23492898046970367,
0.22603879868984222,
0.09674260765314102,
0.1285831481218338,
-0.05909833684563637,
0.5313650965690613,
-0.008048705756664276,
0.03523509204387665,
0.25713759660720825,
0.42075732350349426,
0.23704802989959717,
0.3268285095691681,
0.2194211781024933,
-0.0970565676689148,
-0.09260426461696625,
0.129774272441864,
-0.14060720801353455,
0.13075776398181915,
-0.31754276156425476,
0.3885124623775482,
0.35303863883018494,
0.15701380372047424,
-0.06972289085388184,
-0.12416715919971466,
0.0697719007730484,
0.16099810600280762,
-0.272495836019516,
0.7349174618721008,
-0.19018243253231049,
-0.04937338829040527,
-0.07229882478713989,
0.13828128576278687,
-0.4938651919364929,
-0.09527379274368286,
0.46051153540611267,
-0.12845374643802643,
0.029606755822896957,
-0.02659475989639759,
0.059153132140636444,
0.10519661009311676,
0.32568809390068054,
0.3474724292755127,
-0.015533078461885452,
-0.14021483063697815,
-0.2483496367931366,
-0.809198796749115,
0.04603848606348038,
0.21514970064163208,
0.06538733839988708,
0.25624945759773254,
-0.27575480937957764,
-0.1386328637599945,
0.06926774978637695,
0.23339715600013733,
0.17970232665538788,
-0.08039774745702744,
0.08593214303255081,
-0.17214566469192505,
0.023482264950871468,
-0.5312108397483826,
-0.015663497149944305,
-0.10377561300992966,
-0.5348653793334961,
0.10569348931312561,
-0.0724354237318039,
-0.060914453119039536,
0.16845205426216125,
0.08572417497634888,
-0.041692301630973816,
-0.17209088802337646,
0.35198408365249634,
-0.00187591090798378,
0.012993954122066498,
-0.05783568322658539,
0.07166384160518646,
-0.2935391366481781,
-0.20153920352458954,
-0.19600574672222137,
-0.09703119099140167,
-0.19398067891597748,
0.20871375501155853,
-0.39294952154159546,
0.08706805855035782,
-0.4738152027130127,
-0.26062947511672974,
0.2765345871448517,
0.10733367502689362,
-0.08504490554332733,
0.18704354763031006,
-0.39572983980178833,
-0.029779084026813507,
0.1200546845793724,
0.3171553611755371,
0.12865467369556427,
-0.061880093067884445,
-0.2655668258666992,
-0.311470627784729,
0.3693339228630066,
0.002682168036699295,
-0.16418316960334778,
0.1305113136768341,
0.35256147384643555,
0.15325619280338287,
-0.200921431183815,
-0.5850496292114258,
-0.05501171946525574,
0.39375394582748413,
0.07486848533153534,
-0.20241814851760864,
-0.23982886970043182,
-0.13324317336082458,
-0.09168659150600433,
-0.08154762536287308,
0.04636087268590927,
0.08843976259231567,
-0.1976391077041626,
0.27587267756462097,
-0.08982646465301514
] |
https://github.com/huggingface/datasets/issues/6152 | This is location in PackagedDatasetModuleFactory.get_module seems the be the right place to check if at least data_dir or data_files are passed | FolderBase Dataset automatically resolves under current directory when data_dir is not specified | ### Describe the bug
FolderBase Dataset automatically resolves under current directory when data_dir is not specified.
For example:
```
load_dataset("audiofolder")
```
takes long time to resolve and collect data_files from current directory. But I think it should reach out to this line for error handling https://github.com/huggingface/datasets/blob/cb8c5de5145c7e7eee65391cb7f4d92f0d565d62/src/datasets/packaged_modules/folder_based_builder/folder_based_builder.py#L58-L59
### Steps to reproduce the bug
```
load_dataset("audiofolder")
```
### Expected behavior
Error report
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-5.15.0-78-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3 | 21 | FolderBase Dataset automatically resolves under current directory when data_dir is not specified
### Describe the bug
FolderBase Dataset automatically resolves under current directory when data_dir is not specified.
For example:
```
load_dataset("audiofolder")
```
takes long time to resolve and collect data_files from current directory. But I think it should reach out to this line for error handling https://github.com/huggingface/datasets/blob/cb8c5de5145c7e7eee65391cb7f4d92f0d565d62/src/datasets/packaged_modules/folder_based_builder/folder_based_builder.py#L58-L59
### Steps to reproduce the bug
```
load_dataset("audiofolder")
```
### Expected behavior
Error report
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-5.15.0-78-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
This is location in PackagedDatasetModuleFactory.get_module seems the be the right place to check if at least data_dir or data_files are passed | [
-0.18663132190704346,
-0.1002492606639862,
-0.009631037712097168,
0.4756282567977905,
0.1902087926864624,
-0.035474665462970734,
0.1495768427848816,
0.1636379212141037,
0.031352922320365906,
-0.028886429965496063,
0.20590755343437195,
0.19654041528701782,
-0.02793583646416664,
-0.02052605152130127,
0.042952168732881546,
-0.027437405660748482,
-0.06684283912181854,
0.10477893054485321,
-0.33916816115379333,
-0.069088876247406,
-0.43015655875205994,
0.22845681011676788,
-0.3051052689552307,
0.11223898828029633,
-0.3944284915924072,
-0.13669440150260925,
-0.16059333086013794,
0.41789743304252625,
-0.29481232166290283,
-0.4187122583389282,
0.5232583284378052,
-0.04251302033662796,
0.10590898990631104,
0.3302803039550781,
-0.00012039450666634366,
0.12485435605049133,
0.4270547926425934,
-0.27275145053863525,
-0.2628605365753174,
-0.1925758272409439,
-0.2515951991081238,
-0.07818906754255295,
0.10132551193237305,
-0.16339462995529175,
0.1884394735097885,
0.0643167793750763,
0.14124727249145508,
-0.1309504210948944,
-0.019190799444913864,
0.33741524815559387,
0.14545950293540955,
0.1257196068763733,
-0.05162043496966362,
0.019571475684642792,
-0.11292288452386856,
0.43404462933540344,
0.06426648795604706,
0.5893692970275879,
0.11919103562831879,
-0.02230767160654068,
-0.18202315270900726,
0.25672072172164917,
0.03672914206981659,
0.02095017209649086,
0.41082361340522766,
0.09473110735416412,
-0.041121385991573334,
-0.18493546545505524,
-0.24944527447223663,
-0.1484786868095398,
0.45949217677116394,
-0.3779538869857788,
-0.3442378640174866,
-0.389135479927063,
-0.11730754375457764,
-0.156295508146286,
0.4227434992790222,
-0.08810916543006897,
-0.3352928161621094,
0.2910715341567993,
0.04056130722165108,
-0.337902694940567,
-0.09309752285480499,
0.04182238504290581,
-0.17117714881896973,
0.1568611115217209,
-0.2313404381275177,
-0.0013543963432312012,
0.15703271329402924,
0.12777982652187347,
0.1436890959739685,
-0.2294103056192398,
-0.009084153920412064,
0.27299657464027405,
-0.2293700873851776,
-0.02362643927335739,
0.31043383479118347,
0.6638420224189758,
0.16215434670448303,
0.1774783730506897,
-0.038351722061634064,
-0.10428669303655624,
-0.20091544091701508,
0.03914855048060417,
0.478651225566864,
0.24030892550945282,
0.11500133574008942,
0.13620992004871368,
0.41301220655441284,
0.23658083379268646,
0.2095087617635727,
0.067729651927948,
-0.09040921926498413,
-0.29899877309799194,
-0.11015292257070541,
0.06371213495731354,
0.46592772006988525,
-0.014333859086036682,
-0.25629276037216187,
-0.0023415200412273407,
-0.11472208797931671,
-0.1340714991092682,
0.407815158367157,
0.3144252598285675,
-0.03553588688373566,
0.33124426007270813,
-0.09097714722156525,
0.07976047694683075,
-0.05893326923251152,
0.32082775235176086,
-0.06401851773262024,
0.004521980881690979,
-0.3870452344417572,
-0.08531144261360168,
0.16206082701683044,
-0.38554713129997253,
0.21081501245498657,
0.20644405484199524,
0.05771712586283684,
-0.16635753214359283,
-0.2030375599861145,
-0.17633335292339325,
-0.06437274068593979,
0.34993669390678406,
-0.21870064735412598,
0.4188780188560486,
-0.030545514076948166,
0.1418379843235016,
-0.14977014064788818,
0.07453230023384094,
-0.5040935277938843,
-0.3999282717704773,
0.1800045222043991,
0.11272113770246506,
-0.1790427565574646,
0.22078227996826172,
-0.36471444368362427,
-0.14277629554271698,
-0.06350496411323547,
-0.1849311739206314,
0.28803807497024536,
0.03993864357471466,
0.1060882955789566,
-0.18780817091464996,
0.2141110599040985,
0.547950029373169,
-0.12530693411827087,
0.16352494060993195,
-0.6420450210571289,
-0.17539361119270325,
-0.0018040500581264496,
0.09496540576219559,
-0.11593057960271835,
0.5779048204421997,
-0.6418368220329285,
0.0694388598203659,
0.514056384563446,
-0.5402430295944214,
-0.5455948710441589,
0.20516158640384674,
-0.3265407681465149,
0.0811414122581482,
-0.025796659290790558,
0.10390883684158325,
-0.15956711769104004,
-0.046028852462768555,
0.20936360955238342,
0.26764795184135437,
-0.024457264691591263,
0.070184126496315,
-0.18315604329109192,
-0.10258305072784424,
-0.24518521130084991,
0.042686931788921356,
-0.07583917677402496,
0.1630210280418396,
-0.10905270278453827,
0.20408552885055542,
0.3297007381916046,
0.04862961173057556,
-0.12697067856788635,
0.2217845916748047,
0.4653519093990326,
-0.037572260946035385,
0.09184394031763077,
-0.25215646624565125,
-0.5092465281486511,
0.19614961743354797,
0.017844311892986298,
-0.10660383105278015,
-0.5034566521644592,
-0.17926234006881714,
-0.3358449935913086,
0.06497974693775177,
-0.2653731107711792,
0.0956919714808464,
0.027460020035505295,
0.30132585763931274,
0.015347354114055634,
-0.10068950802087784,
-0.4333948791027069,
0.3838638961315155,
-0.25891536474227905,
0.29419273138046265,
-0.07830597460269928,
0.3058643341064453,
0.017296506091952324,
-0.01776259019970894,
-0.012760303914546967,
0.019676508381962776,
0.23836460709571838,
-0.38570690155029297,
0.18181443214416504,
0.43482688069343567,
0.14890475571155548,
0.30287688970565796,
0.07035414129495621,
-0.08721046149730682,
0.07781602442264557,
-0.17817899584770203,
-0.04538127779960632,
0.021956000477075577,
0.17729507386684418,
0.21885089576244354,
-0.04430988430976868,
0.23390191793441772,
-0.22381627559661865,
0.2254948914051056,
0.09735238552093506,
-0.15800845623016357,
0.1653255671262741,
0.07950282096862793,
0.21972708404064178,
-0.27972835302352905,
0.13024204969406128,
0.4142647087574005,
0.44690456986427307,
0.41809773445129395,
-0.16823804378509521,
0.06550420820713043,
0.3620155155658722,
-0.14640232920646667,
0.26929840445518494,
0.19835765659809113,
0.11423647403717041,
-0.13560837507247925,
0.07044802606105804,
0.18776284158229828,
0.5618863701820374,
0.08825258910655975,
0.0681413859128952,
0.11937591433525085,
-0.07165300846099854,
-0.16477686166763306,
0.2067563235759735,
0.1270974576473236,
-0.11434045433998108,
0.3285737931728363,
-0.0984068512916565,
-0.059147369116544724,
-0.41818445920944214,
-0.14845547080039978,
-0.0810256227850914,
0.3291107714176178,
-0.37598103284835815,
0.00635121762752533,
-0.36436039209365845,
-0.2869921922683716,
-0.3433000445365906,
-0.26857221126556396,
-0.310470849275589,
-0.30838093161582947,
-0.10854195058345795,
0.08376797288656235,
0.010173104703426361,
-0.09961176663637161,
0.03040795773267746,
0.511391282081604,
-0.05456419289112091,
-0.23551854491233826,
-0.32523298263549805,
0.28712332248687744,
-0.13887757062911987,
-0.02832489274442196,
0.14454877376556396,
0.03982124850153923,
0.12110596895217896,
-0.31593018770217896,
0.14447124302387238,
-0.30162709951400757,
-0.22364169359207153,
0.3345661461353302,
0.05309237912297249,
0.42118462920188904,
0.4135245680809021,
0.31922587752342224,
0.37360846996307373,
-0.3051503300666809,
0.04158775508403778,
0.3011617958545685,
-0.14308947324752808,
-0.28367891907691956,
0.3351142108440399,
0.42133769392967224,
-0.273581862449646,
-0.24103598296642303,
-0.11383423954248428,
-0.40404948592185974,
0.12374772876501083,
-0.24921952188014984,
0.24542546272277832,
-0.08946555107831955,
-0.3283783793449402,
0.2741793692111969,
-0.3581506311893463,
-0.05983772128820419,
0.0020545199513435364,
-0.5019322633743286,
0.1798354685306549,
0.03772652894258499,
0.009227190166711807,
-0.2609882056713104,
-0.14440862834453583,
0.15473803877830505,
0.035680193454027176,
-0.26699310541152954,
-0.49487918615341187,
-0.16329145431518555,
0.18208631873130798,
0.11604059487581253,
0.15528585016727448,
0.36920106410980225,
0.0992136150598526,
0.025385960936546326,
-0.0978972390294075,
-0.10170449316501617,
0.08539576828479767,
0.1527348756790161,
0.13831809163093567,
0.23612695932388306,
0.2578701674938202,
-0.15184353291988373,
0.752315878868103,
0.19205692410469055,
0.08571897447109222,
0.5177663564682007,
0.027165202423930168,
0.5578323602676392,
-0.04066339507699013,
-0.26148349046707153,
-0.12406253814697266,
0.29535192251205444,
-0.138353168964386,
0.16599690914154053,
0.23991265892982483,
0.09267805516719818,
-0.06942790001630783,
-0.46763086318969727,
-0.3466928005218506,
-0.35603073239326477,
0.01287093199789524,
-0.15567705035209656,
0.1923980563879013,
-0.16794174909591675,
0.07261785864830017,
0.04025212675333023,
0.06304827332496643,
0.12855572998523712,
0.4408896267414093,
0.18062777817249298,
0.07990774512290955,
0.07619448006153107,
-0.4048735499382019,
-0.05382349342107773,
0.05549442768096924,
0.14149630069732666,
0.4257541596889496,
-0.23849576711654663,
0.06515362858772278,
0.008273012936115265,
-0.10920961201190948,
0.5930904746055603,
-0.17820824682712555,
0.19567659497261047,
-0.423799991607666,
0.055885329842567444,
-0.19504523277282715,
0.19132646918296814,
0.04482744634151459,
0.30180448293685913,
-0.09359029680490494,
0.4647054672241211,
-0.06575644016265869,
-0.25995102524757385,
0.2381032109260559,
0.08768448233604431,
-0.2322031408548355,
-0.06555302441120148,
-0.24674086272716522,
-0.33945849537849426,
0.059697672724723816,
0.24903282523155212,
0.23391053080558777,
0.03827548027038574,
0.24963796138763428,
-0.09688133001327515,
-0.001547452062368393,
-0.21264249086380005,
0.07171947509050369,
-0.04686683788895607,
0.29976677894592285,
-0.21676228940486908,
-0.06714288890361786,
0.41299304366111755,
0.17522595822811127,
0.36262500286102295,
0.6982702612876892,
-0.1222308948636055,
-0.03564463555812836,
0.08498962968587875,
0.016285069286823273,
0.5694902539253235,
0.4449852406978607,
-0.3055266737937927,
-0.09119808673858643,
-0.34258201718330383,
-0.06747646629810333,
-0.5806288719177246,
0.15808269381523132,
0.5065460801124573,
0.2532079517841339,
-0.3287527859210968,
-0.15406179428100586,
0.5481546521186829,
0.0817834883928299,
-0.168385311961174,
0.6092328429222107,
0.6442744135856628,
-0.40913039445877075,
-0.030538756400346756,
-0.24298173189163208,
0.8687344789505005,
0.44428953528404236,
-0.11160539090633392,
0.1989526003599167,
-0.20202331244945526,
0.20102615654468536,
-0.21718935668468475,
0.16449657082557678,
-0.20492395758628845,
-0.12126775085926056,
-0.16581040620803833,
-0.2840466797351837,
0.16662777960300446,
0.0698108971118927,
-0.26634544134140015,
0.30487674474716187,
-0.38349324464797974,
-0.13378234207630157,
-0.08427561819553375,
0.1850312352180481,
-0.44864174723625183,
-0.011887850239872932,
-0.6320298314094543,
0.010736547410488129,
0.12806200981140137,
0.4869729280471802,
-0.16222871840000153,
0.0010812915861606598,
0.15311747789382935,
-0.43476569652557373,
-0.3219285011291504,
-0.15183666348457336,
0.1520359367132187,
-0.21358005702495575,
-0.02898949384689331,
0.07868646085262299,
0.08632322400808334,
0.14571872353553772,
0.04931328445672989,
0.1290346086025238,
-0.11251794546842575,
0.14521485567092896,
-0.35874688625335693,
0.28608670830726624,
0.21900150179862976,
0.02472475916147232,
0.2010318636894226,
0.047149792313575745,
-0.21884314715862274,
-0.19421228766441345,
-0.28811007738113403,
-0.10611250251531601,
0.02557341754436493,
0.010888384655117989,
-0.15510940551757812,
-0.19104519486427307,
-0.15100881457328796,
-0.1733730584383011,
0.21154636144638062,
-0.007482573390007019,
0.05789303779602051,
0.19550861418247223,
0.04711869731545448,
0.10666370391845703,
-0.1657363474369049,
-0.2527454197406769,
-0.05477361008524895,
0.3126448392868042,
-0.1690632551908493,
0.0022245123982429504,
0.20896731317043304,
-0.19621215760707855,
-0.2782846987247467,
-0.12154825031757355,
0.2726351022720337,
0.18835370242595673,
-0.37869229912757874,
0.27061671018600464,
-0.09114596247673035,
0.005838274955749512,
-0.03442726656794548,
0.2585000693798065,
0.20329229533672333,
-0.30239295959472656,
-0.6735987663269043,
-0.60300213098526,
-0.19352862238883972,
0.3881538212299347,
-0.21700170636177063,
0.2066563069820404,
-0.01517631858587265,
-0.028456484898924828,
0.518174946308136,
-0.2842303514480591,
-0.22769051790237427,
-0.10729662328958511,
-0.40553563833236694,
0.11692945659160614,
0.047761235386133194,
0.11185794323682785,
0.22374846041202545,
-0.08624667674303055,
0.064166359603405,
0.005813950672745705,
-0.11653661727905273,
-0.07272569090127945,
0.03891608864068985,
0.21977442502975464,
0.057448580861091614,
0.2361789047718048,
0.3039279878139496,
-0.3393484950065613,
0.05818134546279907,
0.002097994089126587,
0.20920079946517944,
0.034825585782527924,
0.1817297786474228,
-0.00917593389749527,
0.29909950494766235,
-0.20645257830619812,
-0.1744956076145172,
0.14851219952106476,
-0.04292943328619003,
0.0016797296702861786,
0.19084422290325165,
0.14968599379062653,
-0.49376705288887024,
-0.05903293937444687,
0.08909101784229279,
0.24018368124961853,
0.12268797308206558,
0.07747993618249893,
0.17011238634586334,
0.008676276542246342,
-0.035219404846429825,
0.18385887145996094,
0.3458341360092163,
0.20926325023174286,
-0.03562512248754501,
-0.14890873432159424,
-0.0124382134526968,
0.12485123425722122,
-0.29830530285835266,
-0.26946547627449036,
-0.23833855986595154,
0.03805099055171013,
0.046872951090335846,
0.3163803517818451,
-0.12098851799964905,
-0.07213425636291504,
0.12499493360519409,
-0.05856679007411003,
0.5162753462791443,
0.15731260180473328,
0.1956331580877304,
0.5090560913085938,
-0.15498487651348114,
0.15412577986717224,
0.5594690442085266,
-0.06239715591073036,
0.21923860907554626,
0.5751963257789612,
-0.21889808773994446,
0.12350406497716904,
-0.20837144553661346,
0.06342335045337677,
0.30523478984832764,
-0.3676929175853729,
0.013493559323251247,
0.01287783682346344,
0.0817841961979866,
-0.12579500675201416,
0.08302941918373108,
0.37681204080581665,
-0.4227590560913086,
-0.0005253441631793976,
-0.08638302981853485,
0.033197153359651566,
-0.32359540462493896,
-0.13030564785003662,
0.13000234961509705,
-0.31593191623687744,
-0.037435002624988556,
-0.042927756905555725,
-0.06068357080221176,
-0.2692547142505646,
0.26769283413887024,
-0.0027751661837100983,
-0.04460873827338219,
-0.3065190315246582,
0.09823274612426758,
0.1037374883890152,
0.09550762176513672,
-0.07867062091827393,
0.5157838463783264,
-0.05987340211868286,
-0.014385908842086792,
0.08726455271244049,
0.41306963562965393,
0.21284908056259155,
0.39487484097480774,
0.22886155545711517,
-0.15303853154182434,
-0.16278046369552612,
0.1030619889497757,
-0.15722247958183289,
0.11480061709880829,
-0.30220508575439453,
0.4355485439300537,
0.1956252008676529,
0.1560184508562088,
-0.07813135534524918,
-0.07372938841581345,
0.06804272532463074,
0.15623292326927185,
-0.35352563858032227,
0.8472669124603271,
-0.12590473890304565,
0.021255314350128174,
-0.150538831949234,
0.1780286282300949,
-0.516749918460846,
-0.1118861585855484,
0.4157792925834656,
-0.025084637105464935,
-0.04626370593905449,
-0.09029515087604523,
0.053109608590602875,
0.13093715906143188,
0.3076861500740051,
0.34471970796585083,
0.0326797291636467,
-0.1776575744152069,
-0.26568853855133057,
-0.838293194770813,
-0.012001462280750275,
0.23879216611385345,
-0.02339029312133789,
0.28782951831817627,
-0.2051708698272705,
-0.10605692863464355,
0.08036431670188904,
0.27586182951927185,
0.24654914438724518,
-0.06328222155570984,
-0.07229669392108917,
-0.25684598088264465,
-0.07566959410905838,
-0.44699493050575256,
-0.008749723434448242,
-0.07514099031686783,
-0.5689595937728882,
0.2745366394519806,
-0.19887016713619232,
-0.043689288198947906,
0.04126833379268646,
-0.04331442713737488,
-0.08578790724277496,
-0.16984091699123383,
0.34442490339279175,
-0.041660524904727936,
0.03900735825300217,
-0.016001246869564056,
0.02767939120531082,
-0.4274827837944031,
-0.12553931772708893,
-0.17900855839252472,
-0.08497883379459381,
-0.03104027546942234,
0.18904486298561096,
-0.400041788816452,
0.1034509688615799,
-0.46090084314346313,
-0.1272023320198059,
0.3225019574165344,
0.15104758739471436,
-0.10272172093391418,
0.14407289028167725,
-0.40306538343429565,
0.039769548922777176,
0.12758129835128784,
0.10998887568712234,
0.12183644622564316,
-0.0249665267765522,
-0.29481232166290283,
-0.3490687608718872,
0.4313068091869354,
-0.04911725968122482,
-0.26153334975242615,
0.14981769025325775,
0.48514509201049805,
0.12006222456693649,
-0.296504408121109,
-0.5786827802658081,
-0.14018744230270386,
0.45471256971359253,
0.11424724757671356,
-0.10000793635845184,
-0.05786721780896187,
-0.10198049247264862,
0.016635656356811523,
-0.05117274075746536,
0.1196315735578537,
0.04991234838962555,
-0.15929828584194183,
0.33429527282714844,
-0.20450448989868164
] |
https://github.com/huggingface/datasets/issues/6152 | @mariosasko is this issue still open? i would love to kickstart my journey to open source with this issue!
Regards
zutarich | FolderBase Dataset automatically resolves under current directory when data_dir is not specified | ### Describe the bug
FolderBase Dataset automatically resolves under current directory when data_dir is not specified.
For example:
```
load_dataset("audiofolder")
```
takes long time to resolve and collect data_files from current directory. But I think it should reach out to this line for error handling https://github.com/huggingface/datasets/blob/cb8c5de5145c7e7eee65391cb7f4d92f0d565d62/src/datasets/packaged_modules/folder_based_builder/folder_based_builder.py#L58-L59
### Steps to reproduce the bug
```
load_dataset("audiofolder")
```
### Expected behavior
Error report
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-5.15.0-78-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3 | 21 | FolderBase Dataset automatically resolves under current directory when data_dir is not specified
### Describe the bug
FolderBase Dataset automatically resolves under current directory when data_dir is not specified.
For example:
```
load_dataset("audiofolder")
```
takes long time to resolve and collect data_files from current directory. But I think it should reach out to this line for error handling https://github.com/huggingface/datasets/blob/cb8c5de5145c7e7eee65391cb7f4d92f0d565d62/src/datasets/packaged_modules/folder_based_builder/folder_based_builder.py#L58-L59
### Steps to reproduce the bug
```
load_dataset("audiofolder")
```
### Expected behavior
Error report
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-5.15.0-78-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
@mariosasko is this issue still open? i would love to kickstart my journey to open source with this issue!
Regards
zutarich | [
-0.29093503952026367,
0.0026991069316864014,
0.047937847673892975,
0.4412233829498291,
0.14582736790180206,
-0.1480879783630371,
0.2705446183681488,
0.03420373052358627,
-0.07471749931573868,
-0.046285852789878845,
0.05931897461414337,
0.18162791430950165,
-0.054868146777153015,
0.027570106089115143,
-0.16330648958683014,
0.009157685562968254,
-0.01576738804578781,
-0.003607284277677536,
-0.2507747709751129,
-0.15124455094337463,
-0.5572419166564941,
0.23242172598838806,
-0.3653985559940338,
0.114085853099823,
-0.373485267162323,
-0.15244387090206146,
-0.19929158687591553,
0.27059072256088257,
-0.3964100778102875,
-0.3351455330848694,
0.49461543560028076,
0.005969593301415443,
0.26019394397735596,
0.42517560720443726,
-0.00012431455252226442,
0.010794281959533691,
0.4961780607700348,
-0.16926445066928864,
-0.16541260480880737,
-0.3053101599216461,
-0.35396838188171387,
0.03780076652765274,
0.08915765583515167,
-0.12391304969787598,
0.1837080419063568,
0.021359309554100037,
0.2067236751317978,
-0.1978445053100586,
-0.036291077733039856,
0.18298573791980743,
0.12168285250663757,
0.02570372074842453,
0.08808857202529907,
-0.01923183538019657,
-0.08015212416648865,
0.41481146216392517,
-0.027208901941776276,
0.5428969264030457,
0.08995479345321655,
-0.0841374397277832,
-0.20426592230796814,
0.15501466393470764,
0.16720512509346008,
-0.024641726166009903,
0.4927632510662079,
0.06599293649196625,
0.030935417860746384,
-0.20174306631088257,
-0.2550606429576874,
0.009572960436344147,
0.5414553880691528,
-0.30690068006515503,
-0.4400375485420227,
-0.3314136564731598,
-0.13159438967704773,
-0.16174566745758057,
0.42311814427375793,
0.2250218540430069,
-0.2801186740398407,
0.3470453917980194,
-0.0021140575408935547,
-0.42087528109550476,
-0.08716727793216705,
0.07170459628105164,
-0.26651740074157715,
0.18486878275871277,
-0.2878647446632385,
-0.014255482703447342,
0.2563781440258026,
0.01635412499308586,
0.21171343326568604,
-0.3212020695209503,
0.037720806896686554,
0.16945809125900269,
-0.37084996700286865,
0.01158095896244049,
0.1909443438053131,
0.6569603681564331,
0.1694898009300232,
0.19038546085357666,
-0.05130387097597122,
-0.09190830588340759,
-0.40178942680358887,
0.08073514699935913,
0.6251262426376343,
0.22206445038318634,
0.08327846974134445,
0.19602665305137634,
0.460944801568985,
0.19697648286819458,
0.14923208951950073,
0.11267924308776855,
-0.12294252216815948,
-0.36180296540260315,
-0.16555094718933105,
0.017246007919311523,
0.5585906505584717,
0.02036607265472412,
-0.23215125501155853,
-0.024126481264829636,
-0.04556496441364288,
-0.09308291971683502,
0.33330389857292175,
0.34016042947769165,
0.07071569561958313,
0.3445037603378296,
-0.07308949530124664,
0.11638619005680084,
-0.020287487655878067,
0.3991389870643616,
0.004000306129455566,
-0.15048348903656006,
-0.4040864408016205,
-0.17226046323776245,
0.05959564447402954,
-0.4065636992454529,
0.06330840289592743,
0.25431329011917114,
0.09812881797552109,
-0.12399595975875854,
-0.2945908308029175,
-0.20561358332633972,
0.0397215336561203,
0.1732826828956604,
-0.3029226064682007,
0.3609580397605896,
-0.1513904184103012,
0.11021500825881958,
-0.12005502730607986,
0.1886427104473114,
-0.4729645550251007,
-0.28337472677230835,
-0.009579683654010296,
0.06167672201991081,
-0.2719343304634094,
0.19994297623634338,
-0.28524672985076904,
-0.1163736879825592,
-0.18814915418624878,
-0.20831172168254852,
0.23119878768920898,
0.029408250004053116,
-0.06774154305458069,
-0.1670057326555252,
0.19288375973701477,
0.5626451969146729,
-0.046746838837862015,
0.23368313908576965,
-0.5313674211502075,
-0.08657412976026535,
-0.01154559850692749,
0.1737690567970276,
-0.014181111007928848,
0.37379884719848633,
-0.6528458595275879,
-0.03774426132440567,
0.3424459993839264,
-0.5369833111763,
-0.5766261219978333,
0.1640768051147461,
-0.18195727467536926,
-0.0038768574595451355,
-0.032671697437763214,
0.06280739605426788,
-0.07014589011669159,
-0.07425202429294586,
0.1521914005279541,
0.31188663840293884,
-0.009851577691733837,
0.02609553188085556,
-0.2439146339893341,
-0.204598069190979,
-0.2561367452144623,
-0.017687998712062836,
-0.18733899295330048,
0.21649174392223358,
-0.06929784268140793,
0.15260225534439087,
0.3561369776725769,
0.09269748628139496,
-0.03715350106358528,
0.1823398619890213,
0.647771418094635,
-0.09722452610731125,
0.10198917984962463,
-0.2762035131454468,
-0.48458150029182434,
0.1165723204612732,
0.15636977553367615,
-0.11302947998046875,
-0.3968454897403717,
-0.15429151058197021,
-0.22750218212604523,
0.13227008283138275,
-0.30533021688461304,
0.18672049045562744,
-0.03937264159321785,
0.24472035467624664,
-0.08431168645620346,
-0.11432958394289017,
-0.43409743905067444,
0.3639800548553467,
-0.30660393834114075,
0.24942676723003387,
-0.0815737396478653,
0.39220669865608215,
0.06340695172548294,
0.012994557619094849,
0.012685604393482208,
0.02789727784693241,
0.12415745854377747,
-0.3894469141960144,
0.17849276959896088,
0.436628520488739,
0.1027212142944336,
0.3566718101501465,
0.05979923531413078,
0.08382689207792282,
0.12458793818950653,
-0.23029270768165588,
-0.08034922927618027,
0.007361967116594315,
0.11375179141759872,
0.26314401626586914,
-0.12025564908981323,
0.2716495394706726,
-0.20068524777889252,
0.2095383256673813,
0.10139597207307816,
-0.1221652626991272,
0.10705184191465378,
-0.015995971858501434,
0.12473990023136139,
-0.2176719605922699,
0.16063335537910461,
0.3499675393104553,
0.4665861427783966,
0.45208704471588135,
-0.22995179891586304,
-0.1263403296470642,
0.4253271818161011,
-0.16636677086353302,
0.26837271451950073,
0.3388606905937195,
0.15713441371917725,
-0.02039966732263565,
0.07535295188426971,
0.26986128091812134,
0.5532355308532715,
0.07323232293128967,
0.07612884044647217,
0.15665757656097412,
-0.016053125262260437,
-0.16260570287704468,
0.16321592032909393,
0.06717988848686218,
-0.060970764607191086,
0.434529572725296,
0.054604243487119675,
-0.028093257918953896,
-0.4637297987937927,
0.02185811847448349,
-0.05266303941607475,
0.2083319127559662,
-0.3319530785083771,
0.0107358917593956,
-0.32746028900146484,
-0.10334046930074692,
-0.2512558102607727,
-0.2689781188964844,
-0.33102771639823914,
-0.20783361792564392,
-0.1111709326505661,
0.155600905418396,
0.023714229464530945,
-0.02973860688507557,
-0.05121986195445061,
0.5284779071807861,
-0.10640184581279755,
-0.20310348272323608,
-0.2559834420681,
0.21231073141098022,
0.01519659161567688,
-0.07306002080440521,
0.1662805825471878,
-0.20941877365112305,
0.050890542566776276,
-0.29195788502693176,
0.25871217250823975,
-0.46783044934272766,
-0.23212599754333496,
0.29113948345184326,
0.2422851324081421,
0.4502209722995758,
0.40518584847450256,
0.24951788783073425,
0.2391895353794098,
-0.32684603333473206,
0.08507853746414185,
0.08670499175786972,
-0.13461920619010925,
-0.35446617007255554,
0.29119595885276794,
0.462365061044693,
-0.22121818363666534,
-0.1834375560283661,
-0.12828655540943146,
-0.4656106233596802,
0.2672297954559326,
-0.17495188117027283,
0.20635199546813965,
-0.005903288722038269,
-0.34604570269584656,
0.048298463225364685,
-0.43651628494262695,
-0.2229621410369873,
0.036645662039518356,
-0.38945308327674866,
0.22730940580368042,
0.024514656513929367,
-0.06719928979873657,
-0.2798822820186615,
-0.18171674013137817,
0.16237550973892212,
0.020292915403842926,
-0.2554711103439331,
-0.3530702590942383,
-0.08464687317609787,
0.2995147705078125,
0.11310151219367981,
0.19307340681552887,
0.30300524830818176,
0.10457539558410645,
0.048428162932395935,
-0.1259562075138092,
-0.07111743837594986,
0.06900712847709656,
0.16678361594676971,
0.2607598304748535,
0.36446821689605713,
0.1494596004486084,
-0.21162855625152588,
0.6296825408935547,
0.2130991518497467,
0.0376042015850544,
0.5782665014266968,
0.03812989592552185,
0.5561027526855469,
-0.12676221132278442,
-0.18296343088150024,
-0.16337518393993378,
0.22615233063697815,
-0.2602696716785431,
0.21769551932811737,
0.4218399226665497,
0.13158725202083588,
-0.07290968298912048,
-0.43295395374298096,
-0.287381649017334,
-0.43170779943466187,
-0.1314130276441574,
-0.07279916107654572,
0.26129043102264404,
-0.12466545403003693,
0.013493575155735016,
0.06664304435253143,
-0.009647704660892487,
0.126887708902359,
0.4604266285896301,
0.24738381803035736,
-0.03645636513829231,
0.015232741832733154,
-0.21586573123931885,
-0.05886230617761612,
0.05916731059551239,
0.035017937421798706,
0.4490372836589813,
-0.18224406242370605,
0.08760850131511688,
-0.004638150334358215,
-0.10067521035671234,
0.5968956351280212,
-0.11613443493843079,
0.20817530155181885,
-0.30332130193710327,
0.136760413646698,
-0.17334893345832825,
0.1761329174041748,
0.12132139503955841,
0.22594714164733887,
-0.06661614775657654,
0.5334166884422302,
-0.07443048804998398,
-0.3253919184207916,
0.2655872106552124,
0.06706128269433975,
-0.17993861436843872,
-0.24184344708919525,
-0.2220764458179474,
-0.23950868844985962,
0.11097202450037003,
0.07912222295999527,
0.206643208861351,
-0.020299535244703293,
0.21379299461841583,
-0.0599285289645195,
-0.13500605523586273,
-0.17519763112068176,
0.09245286881923676,
-0.16357286274433136,
0.3363538086414337,
-0.14995786547660828,
0.014969632029533386,
0.32689473032951355,
0.11549089848995209,
0.4311034381389618,
0.6390645503997803,
-0.14922773838043213,
-0.08909502625465393,
0.1906115561723709,
0.0059811510145664215,
0.5185147523880005,
0.3953592777252197,
-0.2285527139902115,
-0.10748527944087982,
-0.312987357378006,
-0.07688343524932861,
-0.6464827656745911,
-0.04672009497880936,
0.5240047574043274,
0.2767530083656311,
-0.2884730100631714,
-0.13902106881141663,
0.5638257265090942,
0.0677226185798645,
-0.24014700949192047,
0.6930816173553467,
0.5448299050331116,
-0.2591192126274109,
0.0020628757774829865,
-0.29598599672317505,
0.9107850193977356,
0.28533297777175903,
-0.025777079164981842,
0.18041378259658813,
-0.3282162547111511,
0.06780272722244263,
-0.1274598240852356,
0.14903448522090912,
-0.24343889951705933,
-0.09998221695423126,
-0.13131535053253174,
-0.30231574177742004,
0.10077711939811707,
0.11539536714553833,
-0.15932878851890564,
0.2280585914850235,
-0.4361461400985718,
-0.1455124467611313,
-0.015739813446998596,
0.23440709710121155,
-0.36031538248062134,
0.020563729107379913,
-0.593109130859375,
-0.02805567905306816,
0.22236457467079163,
0.4581204354763031,
-0.18752853572368622,
-0.038905732333660126,
0.2271566390991211,
-0.2869182527065277,
-0.24599689245224,
-0.06345353275537491,
0.13919150829315186,
-0.23795878887176514,
0.02455170825123787,
-0.037629589438438416,
0.2553079128265381,
0.2766476273536682,
0.10307933390140533,
0.06300334632396698,
-0.08363188058137894,
0.25276193022727966,
-0.25001996755599976,
0.339156836271286,
0.19092024862766266,
0.04120549187064171,
0.13462112843990326,
0.07411441206932068,
-0.19085031747817993,
-0.178460031747818,
-0.26335710287094116,
-0.10786895453929901,
-0.05081033706665039,
0.0674055963754654,
-0.03543899208307266,
-0.2331857532262802,
-0.1124357134103775,
-0.25030848383903503,
0.16052371263504028,
0.018193989992141724,
0.044966667890548706,
0.16698426008224487,
0.1908985674381256,
0.06755220144987106,
-0.09101957827806473,
-0.33801212906837463,
-0.03737964481115341,
0.36926475167274475,
-0.11410552263259888,
0.12446661293506622,
0.25248149037361145,
-0.1470365822315216,
-0.23119443655014038,
-0.07744305580854416,
0.42847636342048645,
0.17283344268798828,
-0.3312075138092041,
0.2634798288345337,
-0.012017596513032913,
0.014060869812965393,
-0.014548607170581818,
0.3213394284248352,
0.1558867245912552,
-0.2832964062690735,
-0.6314458847045898,
-0.5192345380783081,
-0.1556946337223053,
0.33833110332489014,
-0.34917446970939636,
0.10379904508590698,
0.07745744287967682,
-0.1898515522480011,
0.46346431970596313,
-0.3649905323982239,
-0.19268174469470978,
-0.024557800963521004,
-0.3974113464355469,
0.023327291011810303,
-0.0006973110139369965,
0.011383523233234882,
0.2615441083908081,
-0.18597538769245148,
0.02361985296010971,
-0.1293223351240158,
-0.19327028095722198,
-0.027220293879508972,
0.036867253482341766,
0.260537326335907,
0.0991913378238678,
0.22316481173038483,
0.23038379848003387,
-0.40354830026626587,
-0.030102748423814774,
0.03438577800989151,
0.13172325491905212,
0.17887480556964874,
0.17521709203720093,
-0.07279673218727112,
0.09598016738891602,
-0.2383827120065689,
-0.11431729793548584,
0.13230447471141815,
0.0762183666229248,
0.1520867943763733,
0.058567386120557785,
0.1258390247821808,
-0.3563864231109619,
-0.0639035552740097,
-0.10705439746379852,
0.15574228763580322,
0.1286693662405014,
0.05062950775027275,
0.2541487514972687,
-0.007203362882137299,
-0.029848329722881317,
0.17019401490688324,
0.5177180171012878,
0.22271671891212463,
-0.0593438521027565,
-0.1704646348953247,
0.0003438107669353485,
0.08891301602125168,
-0.32060566544532776,
-0.2609114348888397,
-0.15524891018867493,
0.03360211104154587,
0.030137449502944946,
0.18524828553199768,
-0.03540438413619995,
-0.12988314032554626,
-0.10411433130502701,
-0.0874389037489891,
0.5167403221130371,
0.007011985406279564,
0.3057172894477844,
0.5911588072776794,
-0.10179705172777176,
0.15667590498924255,
0.7144403457641602,
-0.0662548840045929,
0.18586775660514832,
0.5227435231208801,
-0.22799214720726013,
0.07000701129436493,
-0.008641449734568596,
0.0856463611125946,
0.46420615911483765,
-0.36325520277023315,
-0.0062962123192846775,
0.013121865689754486,
0.1089072898030281,
-0.08691911399364471,
-0.01178697869181633,
0.39086228609085083,
-0.4452105164527893,
0.04519392177462578,
-0.1440626084804535,
0.0695183277130127,
-0.26578080654144287,
-0.2390773892402649,
0.12140525877475739,
-0.350521981716156,
0.09673288464546204,
-0.0657649114727974,
-0.20290958881378174,
-0.11273948103189468,
0.2993987798690796,
0.030972249805927277,
0.13235290348529816,
-0.25946933031082153,
0.2459881603717804,
0.07701347768306732,
0.23109620809555054,
-0.23905585706233978,
0.6043394207954407,
-0.1961294412612915,
0.024814562872052193,
0.13899892568588257,
0.6281946301460266,
0.311864972114563,
0.4878306984901428,
0.19076550006866455,
-0.14624817669391632,
-0.26831144094467163,
0.1292109191417694,
-0.04417266696691513,
0.15261799097061157,
-0.23357108235359192,
0.36622747778892517,
0.25028088688850403,
0.1236659437417984,
-0.04403164982795715,
0.08266525715589523,
0.042748063802719116,
0.22663086652755737,
-0.42744457721710205,
0.6970561146736145,
-0.2577807605266571,
0.002205684781074524,
-0.05566566810011864,
0.12923353910446167,
-0.382832407951355,
0.00769197940826416,
0.47445443272590637,
-0.16593773663043976,
-0.003094952553510666,
-0.12813542783260345,
0.024474352598190308,
0.06460431218147278,
0.25922292470932007,
0.31012439727783203,
0.027398627251386642,
-0.10486599802970886,
-0.32904940843582153,
-0.7616184949874878,
0.0551820807158947,
0.2794710695743561,
0.06464595347642899,
0.2720165550708771,
-0.1959269940853119,
-0.08680075407028198,
0.09474024176597595,
0.22175107896327972,
0.1650538444519043,
-0.17947793006896973,
0.10127545893192291,
-0.3308705985546112,
0.05387374013662338,
-0.2941449284553528,
0.08340579271316528,
-0.05144716799259186,
-0.5982986688613892,
0.24672149121761322,
-0.25696679949760437,
-0.10109125077724457,
0.21892613172531128,
0.08496400713920593,
-0.14368650317192078,
-0.18200238049030304,
0.36319711804389954,
-0.011064073070883751,
-0.0015964582562446594,
-0.013754516839981079,
0.006852284073829651,
-0.4535178542137146,
-0.3641136586666107,
-0.1086011603474617,
-0.09682270884513855,
-0.11081507802009583,
0.11918003857135773,
-0.4208228290081024,
0.0241562407463789,
-0.43760690093040466,
-0.30782178044319153,
0.11070333421230316,
0.19411003589630127,
-0.12644071877002716,
0.09413862228393555,
-0.4139938950538635,
0.022009775042533875,
0.059590235352516174,
0.11026574671268463,
0.04743632674217224,
-0.03781504929065704,
-0.19515028595924377,
-0.35418158769607544,
0.47462546825408936,
-0.10193365812301636,
-0.2555999755859375,
0.05201767757534981,
0.3750695586204529,
0.20729435980319977,
-0.2880582809448242,
-0.4668101370334625,
-0.0007307082414627075,
0.4587186574935913,
0.24574121832847595,
-0.0200875885784626,
-0.25443795323371887,
-0.18253424763679504,
-0.07533841580152512,
0.00488666445016861,
0.19527709484100342,
0.06529685854911804,
-0.19082219898700714,
0.3966546058654785,
-0.12948422133922577
] |
https://github.com/huggingface/datasets/issues/6151 | `Dataset.sort` essentially does the same thing except it uses `pyarrow.compute.sort_indices` which doesn't involve copying the data into python objects (saving memory)
```python
sort_keys = [(col, "ascending") for col in column_names]
indices = pc.sort_indices(self.data, sort_keys=sort_keys)
return self.select(indices)
``` | Faster sorting for single key items | ### Feature request
A faster way to sort a dataset which contains a large number of rows.
### Motivation
The current sorting implementations took significantly longer than expected when I was running on a dataset trying to sort by timestamps.
**Code snippet:**
```python
ds = datasets.load_dataset( "json", **{"data_files": {"train": "path-to-jsonlines"}, "split": "train"}, num_proc=os.cpu_count(), keep_in_memory=True)
sorted_ds = ds.sort("pubDate", keep_in_memory=True)
```
However, once I switched to a different method which
1. unpacked to a list of tuples
2. sorted tuples by key
3. run `.select` with the sorted list of indices
It was significantly faster (orders of magnitude, especially with M's of rows)
### Your contribution
I'd be happy to implement a crude single key sorting algorithm so that other users can benefit from this trick. Broadly, this would take a `Dataset` and perform;
```python
# ds is a Dataset object
# key_name is the sorting key
class Dataset:
...
def _sort(key_name: str) -> Dataset:
index_keys = [(i,x) for i,x in enumerate(self[key_name])]
sorted_rows = sorted(row_pubdate, key=lambda x: x[1])
sorted_indicies = [x[0] for x in sorted_rows]
return self.select(sorted_indicies)
``` | 37 | Faster sorting for single key items
### Feature request
A faster way to sort a dataset which contains a large number of rows.
### Motivation
The current sorting implementations took significantly longer than expected when I was running on a dataset trying to sort by timestamps.
**Code snippet:**
```python
ds = datasets.load_dataset( "json", **{"data_files": {"train": "path-to-jsonlines"}, "split": "train"}, num_proc=os.cpu_count(), keep_in_memory=True)
sorted_ds = ds.sort("pubDate", keep_in_memory=True)
```
However, once I switched to a different method which
1. unpacked to a list of tuples
2. sorted tuples by key
3. run `.select` with the sorted list of indices
It was significantly faster (orders of magnitude, especially with M's of rows)
### Your contribution
I'd be happy to implement a crude single key sorting algorithm so that other users can benefit from this trick. Broadly, this would take a `Dataset` and perform;
```python
# ds is a Dataset object
# key_name is the sorting key
class Dataset:
...
def _sort(key_name: str) -> Dataset:
index_keys = [(i,x) for i,x in enumerate(self[key_name])]
sorted_rows = sorted(row_pubdate, key=lambda x: x[1])
sorted_indicies = [x[0] for x in sorted_rows]
return self.select(sorted_indicies)
```
`Dataset.sort` essentially does the same thing except it uses `pyarrow.compute.sort_indices` which doesn't involve copying the data into python objects (saving memory)
```python
sort_keys = [(col, "ascending") for col in column_names]
indices = pc.sort_indices(self.data, sort_keys=sort_keys)
return self.select(indices)
``` | [
0.004457168281078339,
0.04670502245426178,
-0.1584610491991043,
-0.14311231672763824,
0.05662455037236214,
0.2312767207622528,
0.16376036405563354,
0.44003841280937195,
0.0392853245139122,
0.12945446372032166,
0.16581636667251587,
0.44436874985694885,
-0.20505958795547485,
0.13872021436691284,
0.26110491156578064,
-0.09235870093107224,
-0.013862989842891693,
-0.017985571175813675,
0.4616732597351074,
0.13031616806983948,
-0.03581172600388527,
-0.3550606966018677,
-0.16930396854877472,
-0.10830282419919968,
0.06191606819629669,
-0.22056172788143158,
-0.19252991676330566,
-0.06404595077037811,
-0.11448546499013901,
-0.3377847969532013,
0.3379405438899994,
0.09363995492458344,
-0.06793995201587677,
0.444977730512619,
-0.00011209417425561696,
-0.10224268585443497,
0.16969701647758484,
-0.025006592273712158,
-0.2701261341571808,
-0.05699676275253296,
-0.14822526276111603,
-0.25276103615760803,
-0.000142611563205719,
-0.24024617671966553,
-0.03943401947617531,
-0.4612123966217041,
-0.1396442949771881,
-0.21216851472854614,
-0.16444820165634155,
-0.08807654678821564,
0.1715051531791687,
0.0036649107933044434,
0.10521160066127777,
0.12668626010417938,
0.39409056305885315,
0.06272675096988678,
-0.09745672345161438,
-0.24386289715766907,
0.4965018033981323,
0.03722390532493591,
0.41619282960891724,
0.21028374135494232,
-0.2589632570743561,
-0.27564412355422974,
0.3376201093196869,
-0.16296114027500153,
-0.3101545572280884,
0.06052948161959648,
0.020660797134041786,
0.13133566081523895,
0.3550644814968109,
-0.2784554660320282,
-0.5531564354896545,
-0.33547094464302063,
0.18771840631961823,
-0.2205442637205124,
-0.046266041696071625,
0.08318676799535751,
-0.1876680850982666,
-0.18541331589221954,
0.05465509742498398,
-0.21356385946273804,
0.05637498199939728,
0.2630591094493866,
0.07729418575763702,
0.3285042643547058,
0.19837909936904907,
-0.05535299330949783,
0.4637579321861267,
-0.31987085938453674,
0.28787684440612793,
-0.2793424725532532,
0.31718242168426514,
0.40373796224594116,
-0.5420067310333252,
-0.4626613259315491,
0.2615695297718048,
0.13077586889266968,
0.1010861024260521,
-0.3041309416294098,
-0.05176926031708717,
-0.0010925410315394402,
0.1587587147951126,
-0.1632063388824463,
0.21357035636901855,
0.49863776564598083,
-0.027740534394979477,
0.1795451045036316,
0.19084852933883667,
0.02390817552804947,
0.17021065950393677,
0.18751028180122375,
0.0716865062713623,
-0.1992892026901245,
0.18580445647239685,
0.10114774852991104,
-0.17574894428253174,
0.0025091543793678284,
-0.04947618395090103,
-0.181873619556427,
-0.36767813563346863,
-0.09198421239852905,
0.27838703989982605,
0.08158399164676666,
0.1286686360836029,
0.04093664512038231,
-0.16780413687229156,
-0.26209884881973267,
-0.08491068333387375,
0.19707278907299042,
-0.17998357117176056,
0.15582026541233063,
0.2994968295097351,
0.03760519623756409,
0.3239020109176636,
-0.3549176752567291,
-0.4846653938293457,
0.18682652711868286,
0.001303214579820633,
-0.1233709305524826,
0.0064384788274765015,
0.12491337954998016,
-0.06302927434444427,
0.208307683467865,
-0.305671751499176,
0.09536983072757721,
0.004274369217455387,
-0.09990006685256958,
-0.3292698562145233,
0.36310333013534546,
-0.4284480810165405,
-0.5390298366546631,
0.39258888363838196,
0.1553243100643158,
-0.15121647715568542,
-0.16947844624519348,
-0.24256081879138947,
0.3546746075153351,
0.07036804407835007,
0.0681014358997345,
-0.22472776472568512,
0.029097285121679306,
-0.3041580021381378,
-0.11708761751651764,
-0.11636612564325333,
-0.181168332695961,
-0.47403591871261597,
0.028441354632377625,
-0.3179752230644226,
0.3474953770637512,
-0.14430105686187744,
0.139597550034523,
-0.052474986761808395,
0.3284492492675781,
0.17878401279449463,
0.1789456605911255,
0.038076866418123245,
-0.1418168991804123,
-0.6236597895622253,
0.24201910197734833,
-0.2436651885509491,
0.1522659957408905,
0.13697582483291626,
0.42936795949935913,
0.462374210357666,
-0.21357320249080658,
0.6518777012825012,
0.10216964036226273,
-0.0016567055135965347,
0.13434186577796936,
-0.36065375804901123,
-0.3796599209308624,
-0.040257275104522705,
0.2694813013076782,
-0.09561291337013245,
-0.25355052947998047,
-0.2541303038597107,
-0.12257298827171326,
0.4085373282432556,
-0.013092238456010818,
-0.04356011375784874,
0.22551164031028748,
-0.08862321078777313,
-0.07417003810405731,
0.1582060605287552,
-0.17131608724594116,
-0.29354727268218994,
0.3926151692867279,
0.3605040907859802,
0.014075403101742268,
-0.3417854607105255,
-0.3526255488395691,
-0.0002502948045730591,
0.0771283209323883,
0.08033115416765213,
0.3149253726005554,
0.12818142771720886,
-0.49572715163230896,
0.20563629269599915,
-0.07723475992679596,
-0.16731655597686768,
0.01526409201323986,
0.24981296062469482,
-0.042887359857559204,
-0.03414377570152283,
0.12229825556278229,
0.18747881054878235,
0.07900886237621307,
0.07983437180519104,
0.007660189643502235,
0.1204158365726471,
-0.09926015138626099,
-0.08546861261129379,
0.09124603867530823,
0.17826099693775177,
-0.27744531631469727,
-0.027003390714526176,
0.22896075248718262,
0.18075133860111237,
0.3005116879940033,
-0.03479733690619469,
0.3921498954296112,
0.1657273918390274,
0.01176673173904419,
-0.6965401768684387,
0.8725982308387756,
-0.5719531178474426,
0.29057416319847107,
-0.08610989153385162,
-0.048563890159130096,
-0.07379548251628876,
0.3274722695350647,
0.05579032003879547,
-0.014737814664840698,
0.3876153826713562,
0.1862259954214096,
-0.1550745964050293,
0.26766547560691833,
-0.08253700286149979,
0.33041173219680786,
0.19341352581977844,
-0.26448339223861694,
-0.01443827897310257,
0.17541174590587616,
0.27563366293907166,
0.04823318123817444,
0.09452328085899353,
0.4053804874420166,
0.1311745047569275,
0.3384971022605896,
-0.07691942155361176,
-0.3680479824542999,
0.13703088462352753,
-0.021094124764204025,
0.07929867506027222,
0.12942299246788025,
-0.1550220400094986,
-0.20936906337738037,
0.3322944641113281,
0.13949091732501984,
-0.0006344765424728394,
0.006217725574970245,
0.11980186402797699,
0.2715415954589844,
-0.09768567234277725,
-0.0587306022644043,
-0.3302440345287323,
-0.15658016502857208,
0.30554190278053284,
0.02995689958333969,
-0.03467441350221634,
-0.12760797142982483,
0.27038952708244324,
-0.07412322610616684,
0.17684610188007355,
-0.194540336728096,
0.17366336286067963,
0.3311477601528168,
0.11859841644763947,
-0.47355273365974426,
-0.35417914390563965,
-0.19770239293575287,
0.0929560661315918,
0.0407085195183754,
0.14994022250175476,
0.15956464409828186,
0.25897231698036194,
0.5387388467788696,
-0.22040432691574097,
0.07619431614875793,
-0.2569003105163574,
-0.29932039976119995,
-0.13534078001976013,
0.0074454303830862045,
-0.07714731991291046,
-0.05853290855884552,
-0.3390412926673889,
0.1075030267238617,
-0.18961648643016815,
0.01343131810426712,
-0.20497968792915344,
0.0014566406607627869,
0.21745678782463074,
0.11108927428722382,
-0.1681058555841446,
0.14165747165679932,
-0.24110105633735657,
-0.02469012513756752,
0.251997709274292,
0.05913244187831879,
0.31044790148735046,
-0.39892926812171936,
0.111223503947258,
-0.1293211281299591,
0.33440786600112915,
-0.1269180178642273,
0.09031364321708679,
-0.10590454190969467,
0.28383103013038635,
0.232037752866745,
-0.04208910092711449,
-0.3333861529827118,
-0.1137135922908783,
-0.5173814296722412,
0.15294814109802246,
-0.3320157825946808,
-0.15391388535499573,
-0.2586003839969635,
0.2797248363494873,
0.04384835809469223,
-0.07474867254495621,
0.5154954195022583,
0.04780540615320206,
-0.052500948309898376,
0.015299670398235321,
-0.2307594269514084,
-0.1682223081588745,
0.12818263471126556,
-0.02635185793042183,
0.10952076315879822,
0.41558149456977844,
0.4174754321575165,
0.5879032611846924,
-0.059911713004112244,
0.1116839200258255,
-0.15092286467552185,
0.19022685289382935,
-0.16999587416648865,
-0.137313574552536,
-0.22098219394683838,
-0.09826959669589996,
0.004692167043685913,
-0.0315483994781971,
-0.030652303248643875,
0.3106826841831207,
-0.08702341467142105,
-0.13827550411224365,
-0.1494314968585968,
0.15708249807357788,
-0.22164201736450195,
-0.02140880562365055,
-0.03315425291657448,
0.03508768230676651,
0.1439211070537567,
0.16192346811294556,
-0.3867505192756653,
-0.2394581437110901,
-0.02533780038356781,
0.07440941035747528,
-0.06232945993542671,
-0.18097755312919617,
-0.06218814477324486,
-0.093781977891922,
-0.5568459630012512,
0.07765322923660278,
0.20306836068630219,
-0.10467667132616043,
0.42318087816238403,
-0.03636758401989937,
0.10336553305387497,
-0.2865023910999298,
0.5602915287017822,
0.3752840459346771,
0.07885825634002686,
0.17376677691936493,
-0.21394965052604675,
-0.28450658917427063,
0.2014414668083191,
-0.12454210221767426,
0.3042944669723511,
-0.21031984686851501,
0.6389996409416199,
-0.3366648554801941,
-0.24939212203025818,
-0.06640973687171936,
0.20910769701004028,
-0.04305103421211243,
-0.398613303899765,
-0.1602526754140854,
-0.31718915700912476,
-0.01080029085278511,
0.36935362219810486,
-0.023544754832983017,
0.0824948102235794,
-0.13609367609024048,
0.019556932151317596,
-0.17222656309604645,
-0.08278103917837143,
-0.058580368757247925,
-0.2811338007450104,
0.012715213000774384,
0.07122966647148132,
0.35256797075271606,
0.25037261843681335,
-0.10134905576705933,
0.08645173907279968,
0.252430260181427,
0.20037700235843658,
-0.24471983313560486,
-0.3654688000679016,
-0.00817418098449707,
-0.03525923937559128,
0.24146628379821777,
-0.1978616714477539,
0.31200170516967773,
-0.1225399523973465,
0.14782720804214478,
-0.04013101011514664,
-0.45805594325065613,
0.14629890024662018,
-0.08234959840774536,
-0.45916852355003357,
-0.38999325037002563,
0.6672797203063965,
0.1418922245502472,
-0.19680209457874298,
0.272151917219162,
0.34649673104286194,
0.05832452327013016,
0.38789665699005127,
0.13633732497692108,
0.6849554777145386,
-0.5027285218238831,
0.14523352682590485,
0.16969355940818787,
-0.2229684591293335,
0.3345557451248169,
0.1714964359998703,
0.298382043838501,
-0.08795829117298126,
-0.4750576317310333,
0.1437256932258606,
0.07901881635189056,
-0.19503375887870789,
0.4650883376598358,
-0.2820422053337097,
0.069025918841362,
-0.04595918208360672,
-0.5589905381202698,
-0.01754147745668888,
0.18026018142700195,
0.3965778648853302,
-0.12262296676635742,
-0.36365413665771484,
0.16300171613693237,
0.16417273879051208,
0.08338084071874619,
-0.006753239780664444,
0.17732003331184387,
-0.03177863359451294,
-0.1575087010860443,
-0.34920692443847656,
-0.3550010621547699,
0.07554136961698532,
0.32561010122299194,
-0.0033174948766827583,
-0.31389904022216797,
-0.005326569080352783,
-0.17663781344890594,
-0.28758612275123596,
0.1506616324186325,
0.18947608768939972,
0.15365472435951233,
0.2552729547023773,
0.3529057502746582,
0.33948639035224915,
-0.2614270746707916,
0.1595955491065979,
0.027955815196037292,
-0.06323713809251785,
-0.04587569832801819,
-0.08088576048612595,
-0.6132369041442871,
-0.22059841454029083,
0.14249582588672638,
-0.3148929178714752,
0.17029227316379547,
-0.1378403902053833,
0.1657172292470932,
-0.03402214124798775,
-0.29947322607040405,
0.1391984224319458,
0.19886283576488495,
0.10489626973867416,
0.49372485280036926,
-0.24542787671089172,
-0.03732161223888397,
0.010185711085796356,
0.5667551755905151,
0.29138052463531494,
-0.14977964758872986,
0.19786418974399567,
0.23253002762794495,
-0.3575071096420288,
-0.20354394614696503,
0.18623846769332886,
0.030937276780605316,
0.17477938532829285,
0.4697180986404419,
-0.2369256615638733,
0.2505861520767212,
0.2620408236980438,
0.06151358783245087,
0.0946408212184906,
0.018929535523056984,
-0.025944538414478302,
-0.14711783826351166,
-0.11275127530097961,
0.14276359975337982,
0.522591769695282,
0.0628499835729599,
-0.27240481972694397,
0.025425195693969727,
-0.2932364344596863,
0.09806323051452637,
-0.25726521015167236,
0.1670818328857422,
0.02232103794813156,
-0.12977483868598938,
0.016896288841962814,
0.12597563862800598,
-0.1063215583562851,
0.10240761935710907,
0.23041456937789917,
-0.28452974557876587,
0.18121930956840515,
-0.30193281173706055,
-0.0519212931394577,
0.016752585768699646,
-0.2644253969192505,
0.2708743214607239,
0.06100358068943024,
-0.2862866520881653,
-0.30235666036605835,
-0.01547476090490818,
0.04789523035287857,
0.28515273332595825,
-0.030786167830228806,
-0.06703048944473267,
0.5309779047966003,
-0.06668386608362198,
0.08607698976993561,
0.13525474071502686,
-0.01120791956782341,
0.07631732523441315,
0.194199800491333,
0.44921717047691345,
0.08643075823783875,
0.11962084472179413,
-0.17488785088062286,
0.14768335223197937,
0.07625986635684967,
-0.08099771291017532,
0.38561487197875977,
-0.2950288951396942,
-0.10239599645137787,
0.27955517172813416,
0.1963290274143219,
0.4670211970806122,
0.06352269649505615,
-0.08909665793180466,
-0.04693225771188736,
0.16130250692367554,
-0.1675874888896942,
-0.36648741364479065,
0.09225879609584808,
0.20810508728027344,
-0.08788749575614929,
0.11354921758174896,
-0.5188844799995422,
0.31478267908096313,
-0.17638660967350006,
-0.027876947075128555,
0.18021205067634583,
-0.12621966004371643,
0.07318665832281113,
0.13062012195587158,
0.28647470474243164,
-0.4842510521411896,
0.10675352811813354,
-0.2470196634531021,
0.014169249683618546,
0.478456050157547,
-0.05926781892776489,
0.23944976925849915,
0.3458624482154846,
0.34249964356422424,
-0.16255781054496765,
-0.10845702886581421,
-0.039740435779094696,
0.3717963397502899,
-0.028236091136932373,
-0.2350655496120453,
0.19752727448940277,
-0.027908235788345337,
-0.0408332422375679,
-0.005706198513507843,
-0.0511067658662796,
-0.04797350987792015,
0.14044001698493958,
-0.0039049535989761353,
0.14675967395305634,
-0.3323259949684143,
0.016835570335388184,
-0.08304983377456665,
-0.13816463947296143,
0.03445502743124962,
0.16358870267868042,
0.15953712165355682,
0.4355814456939697,
-0.3994941711425781,
0.04170827567577362,
-0.0707535445690155,
0.6264969706535339,
0.08169269561767578,
-0.3361082971096039,
0.13632258772850037,
0.018875539302825928,
0.030988704413175583,
-0.25801384449005127,
0.04315754398703575,
0.16197137534618378,
-0.23807989060878754,
0.22150738537311554,
-0.44759586453437805,
0.002214491367340088,
0.059328868985176086,
-0.1704854518175125,
-0.13685062527656555,
-0.0029795262962579727,
0.26549527049064636,
0.07239782065153122,
-0.06963562220335007,
0.21466854214668274,
0.093327596783638,
-0.06881238520145416,
-0.3468267619609833,
0.054651062935590744,
-0.10134445130825043,
-0.35651615262031555,
-0.003013727255165577,
0.13463324308395386,
0.24347606301307678,
-0.35978779196739197,
-0.06882531940937042,
0.026911061257123947,
-0.1813315451145172,
0.0185604989528656,
0.12237711250782013,
-0.25902047753334045,
0.62966388463974,
0.11404848843812943,
0.22859585285186768,
-0.13564302027225494,
0.004340007901191711,
-0.3902754783630371,
-0.261248379945755,
-0.29569563269615173,
-0.12208731472492218,
0.37115633487701416,
0.3339923918247223,
0.04567240923643112,
0.09557714313268661,
0.12475574016571045,
-0.411995530128479,
-0.015658218413591385,
0.19080547988414764,
-0.310081422328949,
0.17379669845104218,
0.16535735130310059,
-0.035389624536037445,
-0.08108511567115784,
-0.41581565141677856,
-0.11552521586418152,
-0.18552209436893463,
0.08255790174007416,
-0.18899820744991302,
0.07042846083641052,
0.07089504599571228,
0.1898600310087204,
0.08113056421279907,
-0.08976125717163086,
-0.0683208703994751,
0.2724290192127228,
-0.05816701799631119,
0.028651390224695206,
0.34267938137054443,
-0.34714046120643616,
0.3469668924808502,
-0.03364225849509239,
0.05346362292766571,
-0.14119362831115723,
0.05156607925891876,
0.17734386026859283,
0.08917326480150223,
-0.12456014752388,
-0.16452321410179138,
-0.11011354625225067,
0.05479596555233002,
-0.19971400499343872,
0.24436935782432556,
-0.1871277242898941,
0.1503603309392929,
0.02876948192715645,
0.10653655976057053,
-0.10595723986625671,
0.028960533440113068,
0.27821826934814453,
-0.08508056402206421,
-0.08072907477617264,
-0.08047260344028473,
0.08029364049434662,
-0.2856283187866211,
0.12881465256214142,
0.335953027009964,
-0.24381214380264282,
0.3546789288520813,
0.11836441606283188,
-0.07031456381082535,
0.28889408707618713,
0.047951437532901764,
-0.1627107858657837,
-0.12946850061416626,
-0.04491912201046944,
-0.05035881698131561,
0.03074450045824051,
-0.07255569845438004,
-0.21159237623214722
] |
https://github.com/huggingface/datasets/issues/6150 | ```
dataset = IterableDataset(dataset) if type(dataset) != IterableDataset else dataset # to force dataset.take(batch_size) to work in non-streaming mode
```
| Allow dataset implement .take | ### Feature request
I want to do:
```
dataset.take(512)
```
but it only works with streaming = True
### Motivation
uniform interface to data sets. Really surprising the above only works with streaming = True.
### Your contribution
Should be trivial to copy paste the IterableDataset .take to use the local path in the data (when streaming = False) | 20 | Allow dataset implement .take
### Feature request
I want to do:
```
dataset.take(512)
```
but it only works with streaming = True
### Motivation
uniform interface to data sets. Really surprising the above only works with streaming = True.
### Your contribution
Should be trivial to copy paste the IterableDataset .take to use the local path in the data (when streaming = False)
```
dataset = IterableDataset(dataset) if type(dataset) != IterableDataset else dataset # to force dataset.take(batch_size) to work in non-streaming mode
```
| [
-0.7020734548568726,
-0.3154955506324768,
-0.04562981054186821,
-0.14700867235660553,
0.17551806569099426,
-0.2521788477897644,
0.1460411250591278,
0.19208432734012604,
0.0996364951133728,
0.3289710283279419,
0.19659018516540527,
0.12043306231498718,
-0.2602097690105438,
0.5171805024147034,
0.024184539914131165,
-0.0048484825529158115,
-0.22688326239585876,
0.15499147772789001,
-0.22121794521808624,
0.0966397076845169,
-0.2763340175151825,
-0.10938993841409683,
-0.3558899164199829,
-0.2810177206993103,
0.22486215829849243,
-0.047970615327358246,
0.04928189516067505,
-0.1663914918899536,
-0.20147675275802612,
-0.24110867083072662,
0.12841796875,
0.40753746032714844,
0.1759081780910492,
0.4052312970161438,
-0.0001234631781699136,
-0.010553538799285889,
0.5380569100379944,
-0.14203143119812012,
-0.34345826506614685,
0.06464733183383942,
-0.3091195225715637,
-0.10997305065393448,
0.09373211115598679,
-0.09112422168254852,
-0.16820447146892548,
0.1336219161748886,
0.17017745971679688,
-0.5085793733596802,
0.0013442188501358032,
0.059876229614019394,
0.10773713886737823,
0.20468392968177795,
-0.175347700715065,
-0.06079495698213577,
-0.12136748433113098,
0.2687370181083679,
-0.16039824485778809,
-0.005468899384140968,
0.5151044130325317,
0.351436048746109,
0.26011377573013306,
-0.13426926732063293,
-0.18743890523910522,
0.042437709867954254,
0.2130468487739563,
-0.281124472618103,
-0.20923984050750732,
-0.2924354076385498,
-0.08985176682472229,
0.48369890451431274,
0.5382290482521057,
-0.059257909655570984,
-0.2785681486129761,
-0.2688671350479126,
-0.1102590560913086,
-0.47956088185310364,
0.0591294951736927,
-0.023010913282632828,
-0.2877572178840637,
0.14621798694133759,
-0.29863855242729187,
-0.03621698170900345,
-0.23114930093288422,
0.3728410005569458,
0.07854343205690384,
0.22053733468055725,
-0.12058961391448975,
0.3296929895877838,
0.19959402084350586,
-0.018688565120100975,
0.21584045886993408,
-0.04752122610807419,
0.16483354568481445,
-0.017256198450922966,
-0.11812858283519745,
-0.13522811233997345,
-0.05122237280011177,
0.1176520437002182,
0.47660893201828003,
0.2316347062587738,
0.217047318816185,
0.1371932029724121,
0.01483219861984253,
0.16308419406414032,
0.3102528154850006,
-0.011830609291791916,
-0.09622403234243393,
-0.15134568512439728,
0.24781973659992218,
0.008613791316747665,
-0.007183462381362915,
-0.047143325209617615,
0.21404793858528137,
-0.1893226057291031,
-0.14349959790706635,
0.05915508791804314,
0.2165861874818802,
-0.04147043079137802,
-0.0732618123292923,
-0.28302937746047974,
-0.021200090646743774,
-0.29117923974990845,
0.3690515458583832,
0.20850712060928345,
0.11903509497642517,
-0.0006112372502684593,
-0.24068036675453186,
0.020553868263959885,
-0.08502577245235443,
-0.36012205481529236,
-0.1386745125055313,
-0.3342711329460144,
-0.05471527576446533,
-0.025558825582265854,
0.1943565011024475,
-0.10007192939519882,
0.30541956424713135,
0.06181205064058304,
0.10826202481985092,
0.2526651918888092,
0.2462339997291565,
-0.3295475244522095,
0.49022236466407776,
0.0703960657119751,
0.19940263032913208,
-0.053846538066864014,
0.03546138107776642,
-0.1064927726984024,
-0.247217059135437,
0.37201669812202454,
-0.11877550184726715,
-0.4880271553993225,
0.23784217238426208,
0.03935931622982025,
-0.17786410450935364,
-0.20575092732906342,
-0.12704256176948547,
0.23506298661231995,
-0.09971891343593597,
-0.27839934825897217,
0.1308344304561615,
-0.15786036849021912,
-0.01695985347032547,
-0.17287512123584747,
0.30809515714645386,
0.21263808012008667,
-0.18260744214057922,
-0.04136034846305847,
-0.1953890323638916,
0.04043184965848923,
0.5753594636917114,
0.17786774039268494,
-0.20099706947803497,
-0.1127428486943245,
-0.4278052747249603,
0.145090714097023,
0.8228543996810913,
-0.21549133956432343,
-0.2746852934360504,
0.5514481067657471,
-0.192884624004364,
-0.1197725385427475,
0.2885112166404724,
0.15859779715538025,
0.1780240833759308,
0.08362235128879547,
0.20364603400230408,
0.5188170671463013,
-0.060502663254737854,
-0.14975044131278992,
-0.021225742995738983,
-0.5678600668907166,
0.04843110218644142,
0.006283856928348541,
0.04021650180220604,
0.11978732794523239,
0.30609622597694397,
-0.2782314121723175,
0.474316269159317,
-0.14943189918994904,
0.13665954768657684,
-0.12891145050525665,
0.5802927017211914,
0.11257532238960266,
0.07428395748138428,
-0.24818572402000427,
0.07408523559570312,
0.13856081664562225,
0.2414027750492096,
-0.29871657490730286,
0.355663001537323,
-0.3844289183616638,
-0.08812548965215683,
-0.019739925861358643,
-0.16218793392181396,
0.19736701250076294,
-0.003610800951719284,
0.31196701526641846,
-0.022833477705717087,
-0.044072650372982025,
-0.49494025111198425,
0.03658350557088852,
-0.3793793022632599,
-0.19676268100738525,
0.060429647564888,
-0.002256341278553009,
0.3094122111797333,
-0.3098045885562897,
0.029619306325912476,
0.10223779082298279,
0.15224069356918335,
-0.1317979097366333,
-0.1661965250968933,
0.4000517725944519,
0.0007923804223537445,
0.05435232073068619,
-0.23098790645599365,
0.3405556082725525,
-0.11869858205318451,
-0.2777048945426941,
-0.13788186013698578,
0.3602926731109619,
0.11944340169429779,
0.04578540474176407,
-0.25649264454841614,
0.3950420022010803,
-0.5075100660324097,
0.3216044008731842,
0.1300927996635437,
-0.03426874801516533,
0.4420453906059265,
-0.10394489020109177,
-0.4496779441833496,
-0.23083972930908203,
0.0457177497446537,
-0.09285664558410645,
0.15382671356201172,
-0.26760435104370117,
-0.29060208797454834,
-0.15805548429489136,
0.3177199363708496,
0.28819236159324646,
0.25396624207496643,
0.008990533649921417,
0.0518127903342247,
0.09581400454044342,
0.23897407948970795,
0.10076635330915451,
0.5197148323059082,
0.3743818998336792,
0.22535687685012817,
-0.04220680892467499,
0.1741979420185089,
-0.13284938037395477,
0.337741494178772,
0.04197067394852638,
-0.12719415128231049,
0.07077918946743011,
0.09612259268760681,
-0.18693411350250244,
-0.5606988072395325,
-0.1299065500497818,
-0.003146383911371231,
-0.05524797737598419,
-0.16864344477653503,
-0.02650989219546318,
-0.3635488748550415,
-0.4831523299217224,
-0.2582477629184723,
-0.22984427213668823,
0.14099162817001343,
-0.14385350048542023,
-0.2109273374080658,
0.5453203320503235,
0.08472426235675812,
0.10774046927690506,
-0.34087425470352173,
0.6048232316970825,
-0.06621570885181427,
-0.4715919494628906,
-0.015771374106407166,
0.3143482208251953,
-0.2693191468715668,
0.03148500993847847,
0.06522670388221741,
-0.13482993841171265,
0.5883483290672302,
0.22895117104053497,
-0.1181812435388565,
-0.2358696609735489,
-0.3423362076282501,
0.0500868484377861,
0.10554331541061401,
0.16732633113861084,
0.3319432735443115,
0.10544834285974503,
0.10298317670822144,
-0.017479073256254196,
0.20256280899047852,
-0.09651696681976318,
0.10257147997617722,
-0.17036810517311096,
-0.25422337651252747,
-0.15752169489860535,
-0.1769135594367981,
0.02976335398852825,
-0.10302866250276566,
-0.5107411742210388,
0.4703242778778076,
0.3399791121482849,
0.03995135426521301,
0.06788221001625061,
0.1267029196023941,
0.3120141625404358,
0.39525166153907776,
-0.18081645667552948,
-0.14006026089191437,
-0.3092312812805176,
0.0557975247502327,
-0.21585263311862946,
-0.06161413714289665,
-0.05867390334606171,
-0.04322103038430214,
0.2789320945739746,
0.3989158570766449,
-0.1380479782819748,
-0.1302356719970703,
-0.4773681163787842,
0.4970358908176422,
-0.14495302736759186,
0.12678511440753937,
0.3346960246562958,
0.006290938705205917,
-0.02319222316145897,
-0.17565852403640747,
-0.3234744071960449,
0.0851188451051712,
0.2989785969257355,
-0.006480593234300613,
0.5717591047286987,
0.4675977826118469,
0.16765448451042175,
0.5689476728439331,
0.3345484137535095,
0.09662297368049622,
0.5855663418769836,
-0.3452368378639221,
0.23601730167865753,
-0.3548019528388977,
-0.32406681776046753,
0.4048653244972229,
0.08421774208545685,
-0.14272882044315338,
0.08829229325056076,
-0.18627288937568665,
-0.1754232496023178,
-0.16428464651107788,
-0.44198185205459595,
0.11793415248394012,
-0.17746984958648682,
0.16760914027690887,
-0.2513071596622467,
0.21375691890716553,
-0.1527911126613617,
-0.08236654847860336,
-0.32335442304611206,
-0.10142157226800919,
-0.13503511250019073,
0.15299785137176514,
0.3360259234905243,
-0.03535326197743416,
-0.6079241037368774,
-0.10549621284008026,
-0.22805815935134888,
0.21928779780864716,
-0.03401173651218414,
0.8214086294174194,
-0.2885347604751587,
-0.07281635701656342,
0.2906024158000946,
-0.0010740868747234344,
0.5828142166137695,
-0.29502975940704346,
0.023435140028595924,
-0.09041524678468704,
-0.02583453804254532,
-0.31366148591041565,
0.10040078312158585,
-0.017382852733135223,
0.3973762094974518,
-0.0528583861887455,
-0.026581790298223495,
-0.045641012489795685,
0.06773301959037781,
0.3613167107105255,
0.15126603841781616,
0.06198463588953018,
-0.2536816895008087,
-0.15237969160079956,
-0.2730266749858856,
-0.3133881688117981,
0.2067183256149292,
0.41265055537223816,
0.12625767290592194,
-0.17295308411121368,
-0.3958114981651306,
-0.5715829133987427,
-0.11420406401157379,
0.12748754024505615,
-0.04155648499727249,
-0.0010449178516864777,
0.0407501645386219,
-0.11074265092611313,
-0.07564322650432587,
-0.1219477429986,
-0.20189903676509857,
0.36237144470214844,
0.03767186775803566,
-0.4200899004936218,
0.08911758661270142,
-0.08009720593690872,
0.5931031107902527,
0.2771836817264557,
-0.06734282523393631,
0.3067156970500946,
0.5337340831756592,
0.0763084813952446,
-0.44207414984703064,
0.1279599815607071,
0.1237238347530365,
-0.13134649395942688,
-0.21943750977516174,
-0.5786802172660828,
0.48591136932373047,
0.37414488196372986,
-0.09006373584270477,
0.8895933628082275,
0.07474720478057861,
-0.35987451672554016,
0.25056955218315125,
0.1382341980934143,
0.9692884683609009,
0.21032992005348206,
-0.09527339041233063,
0.1755894273519516,
-0.02987072616815567,
-0.11102429032325745,
0.36215513944625854,
0.3597438931465149,
-0.13310420513153076,
-0.2249491810798645,
-0.11215151846408844,
-0.25491103529930115,
0.2200406789779663,
-0.25379571318626404,
-0.3923255205154419,
0.07185404002666473,
-0.018995001912117004,
0.40580493211746216,
-0.08660954236984253,
0.04258887469768524,
-0.5882483124732971,
-0.1101611852645874,
0.1522597074508667,
0.015164583921432495,
0.10126497596502304,
0.19713497161865234,
0.11506780982017517,
-0.14190693199634552,
0.3401802182197571,
-0.22053341567516327,
-0.27141648530960083,
-0.2823505699634552,
-0.32597851753234863,
0.023500483483076096,
-0.36989355087280273,
-0.22918695211410522,
0.11625903844833374,
0.31441226601600647,
0.38381826877593994,
0.19843967258930206,
-0.2795402705669403,
0.06067981943488121,
0.19865921139717102,
0.12915855646133423,
-0.35469791293144226,
0.023558784276247025,
0.045077115297317505,
-0.162474125623703,
-0.20759066939353943,
0.28921520709991455,
0.2333402931690216,
-0.3588712215423584,
-0.16966453194618225,
0.0632086843252182,
0.692563533782959,
-0.31735682487487793,
-0.3154304623603821,
-0.07853584736585617,
0.11202673614025116,
-0.15415449440479279,
0.007208467926830053,
-0.006350815296173096,
0.18676742911338806,
0.2775602340698242,
0.06373873353004456,
-0.0853363424539566,
-0.08902357518672943,
0.35274651646614075,
0.1035534143447876,
0.16657377779483795,
0.3649892807006836,
-0.27572694420814514,
-0.08153463900089264,
-0.13650289177894592,
0.10723602771759033,
-0.23712649941444397,
-0.20412328839302063,
0.14930325746536255,
0.14003075659275055,
0.04778803884983063,
0.06248991936445236,
0.3463626801967621,
-0.27742302417755127,
0.045166946947574615,
-0.35612952709198,
-0.2528967559337616,
-0.28439149260520935,
-0.0593453124165535,
-0.23257434368133545,
0.18933027982711792,
0.1385822892189026,
-0.08207351714372635,
0.20403558015823364,
-0.16568893194198608,
-0.24242660403251648,
-0.05678270757198334,
0.020632393658161163,
0.029321063309907913,
0.23496173322200775,
0.2523738145828247,
-0.2514640986919403,
0.2590913772583008,
-0.017213450744748116,
0.14096714556217194,
-0.13641467690467834,
-0.08572696894407272,
-0.24157175421714783,
0.2548828125,
0.19455832242965698,
0.07199510931968689,
-0.04256756976246834,
-0.5052962899208069,
-0.3586263358592987,
-0.2352723777294159,
0.05142135173082352,
0.03267782926559448,
-0.18672670423984528,
0.20469585061073303,
0.5453197956085205,
-0.08579058945178986,
-0.4085310995578766,
0.19245605170726776,
0.11905277520418167,
-0.19435231387615204,
-0.035526640713214874,
0.2730385959148407,
0.07475844025611877,
-0.08712682127952576,
-0.16124215722084045,
-0.1406400501728058,
0.6993051171302795,
0.24997767806053162,
-0.05647188425064087,
-0.1721624881029129,
0.02992670238018036,
-0.27015864849090576,
0.04816987365484238,
0.32784345746040344,
-0.08605650067329407,
-0.054852087050676346,
0.33317831158638,
0.06293575465679169,
-0.15680518746376038,
-0.24986381828784943,
0.0242704339325428,
0.0684858113527298,
0.2680552005767822,
0.29781055450439453,
0.2943562865257263,
-0.1943637728691101,
0.050225354731082916,
-0.12785714864730835,
0.10289408266544342,
-0.4115758538246155,
0.1830066740512848,
0.6795650124549866,
0.0826912373304367,
-0.1469927728176117,
-0.17922626435756683,
0.23653070628643036,
0.30015474557876587,
0.30441540479660034,
-0.2605706751346588,
0.2908862829208374,
0.026707656681537628,
-0.11166603863239288,
-0.05885021388530731,
-0.4745882451534271,
0.07778941094875336,
-0.05085306614637375,
-0.1183168813586235,
0.3475693166255951,
0.17234483361244202,
0.10516728460788727,
-0.20717990398406982,
-0.002975117415189743,
-0.15999028086662292,
-0.2159849852323532,
0.10512024909257889,
-0.19257014989852905,
-0.34818047285079956,
-0.1997741460800171,
-0.11536438018083572,
0.008160434663295746,
-0.03767046704888344,
0.2271602749824524,
0.07646109163761139,
-0.13087736070156097,
0.2286171317100525,
-0.31788885593414307,
0.2388376146554947,
0.3294667899608612,
0.14453411102294922,
-0.2916974425315857,
0.020601609721779823,
-0.11181759089231491,
0.1995181143283844,
0.03599613532423973,
0.333224356174469,
0.2235041707754135,
0.27372467517852783,
0.278540700674057,
-0.012669924646615982,
0.047329261898994446,
-0.166946142911911,
-0.4579674005508423,
0.04394916817545891,
0.14258894324302673,
0.1605740338563919,
0.350782185792923,
0.10338695347309113,
0.0018794052302837372,
0.2891370356082916,
-0.1881045401096344,
-0.16518822312355042,
-0.5091244578361511,
0.5342245697975159,
0.45908188819885254,
-0.1968141496181488,
0.006543757393956184,
-0.27732664346694946,
-0.14852076768875122,
0.2598978877067566,
0.3588026463985443,
-0.2222643792629242,
0.08031018078327179,
-0.01793472096323967,
-0.001325998455286026,
-0.17180097103118896,
0.17816737294197083,
0.015358831733465195,
0.0010316148400306702,
0.03885062411427498,
-0.18130099773406982,
-0.45182234048843384,
0.004079766571521759,
0.09878842532634735,
-0.03239357843995094,
0.10492707788944244,
-0.10366103053092957,
0.08457544445991516,
-0.08703678846359253,
-0.075762078166008,
-0.38979995250701904,
0.3007747232913971,
0.4608231782913208,
-0.052977610379457474,
-0.32724717259407043,
0.0051255058497190475,
0.2364760935306549,
-0.02393687143921852,
-0.374416708946228,
0.2772761583328247,
-0.09316509962081909,
0.012301750481128693,
-0.11107194423675537,
-0.03983071446418762,
0.19437602162361145,
-0.07263557612895966,
0.3496255874633789,
0.2582564055919647,
0.07578808814287186,
-0.23124438524246216,
0.3527694344520569,
-0.13216567039489746,
0.3262847065925598,
-0.374624103307724,
0.022283518686890602,
0.1498183161020279,
0.042325787246227264,
-0.3953617215156555,
0.12898509204387665,
-0.32435142993927,
0.16548259556293488,
0.07481488585472107,
0.07563246786594391,
0.3482595384120941,
0.0942782610654831,
-0.22752583026885986,
0.44548025727272034,
0.20445133745670319,
0.09784738719463348,
0.010696972720324993,
-0.07986411452293396,
-0.1308388113975525,
-0.15583443641662598,
0.6176779866218567,
-0.15311148762702942,
-0.20819607377052307,
-0.21978582441806793,
0.2489347606897354,
0.15050537884235382,
0.10469745099544525,
-0.1627676635980606,
-0.17238344252109528,
0.5703865885734558,
-0.13490723073482513,
0.14193812012672424,
0.4956750273704529,
0.2101067751646042,
0.16805164515972137,
-0.0916566401720047,
0.10680648684501648,
0.16213597357273102,
-0.22685107588768005,
-0.08911510556936264,
-0.2174501270055771
] |
https://github.com/huggingface/datasets/issues/6150 | Feel free to work on this. In addition, `IterableDataset` supports `skip`, so we should also add this method to `Dataset`. | Allow dataset implement .take | ### Feature request
I want to do:
```
dataset.take(512)
```
but it only works with streaming = True
### Motivation
uniform interface to data sets. Really surprising the above only works with streaming = True.
### Your contribution
Should be trivial to copy paste the IterableDataset .take to use the local path in the data (when streaming = False) | 20 | Allow dataset implement .take
### Feature request
I want to do:
```
dataset.take(512)
```
but it only works with streaming = True
### Motivation
uniform interface to data sets. Really surprising the above only works with streaming = True.
### Your contribution
Should be trivial to copy paste the IterableDataset .take to use the local path in the data (when streaming = False)
Feel free to work on this. In addition, `IterableDataset` supports `skip`, so we should also add this method to `Dataset`. | [
-0.7220214009284973,
-0.1629389226436615,
-0.0566975437104702,
-0.17003409564495087,
0.23154707252979279,
-0.2569749653339386,
0.1458967924118042,
0.11140163987874985,
0.13187694549560547,
0.3458045721054077,
0.15996131300926208,
0.34860000014305115,
-0.20970769226551056,
0.39109617471694946,
0.11586732417345047,
-0.019541213288903236,
-0.2132682204246521,
0.14188385009765625,
-0.2847662568092346,
0.10353141278028488,
-0.24969366192817688,
-0.1238289400935173,
-0.27943456172943115,
-0.31162893772125244,
0.2046222984790802,
-0.1026260182261467,
-0.02887452393770218,
-0.1253262460231781,
-0.2089345008134842,
-0.28282615542411804,
0.061460331082344055,
0.5181648135185242,
0.09532901644706726,
0.33288997411727905,
-0.00011817837366834283,
0.036981672048568726,
0.5018832683563232,
-0.08870211988687515,
-0.36189770698547363,
0.04076997935771942,
-0.3303346037864685,
0.012032151222229004,
0.08979339897632599,
-0.1374058574438095,
-0.06941688060760498,
0.23510012030601501,
0.1866953819990158,
-0.5334181785583496,
0.09205283224582672,
0.029649194329977036,
0.12625381350517273,
0.12279777228832245,
-0.22809499502182007,
-0.0857011079788208,
-0.08997029066085815,
0.3056999444961548,
-0.18480518460273743,
-0.028896018862724304,
0.4745485186576843,
0.38521113991737366,
0.12914946675300598,
-0.16618424654006958,
-0.15409274399280548,
0.11203896999359131,
0.2779995799064636,
-0.2439156472682953,
-0.4275568425655365,
-0.22404739260673523,
-0.15149542689323425,
0.46138688921928406,
0.6030102968215942,
-0.12270701676607132,
-0.32064902782440186,
-0.1852603554725647,
-0.11639080941677094,
-0.5072925686836243,
0.10406074672937393,
0.043788231909275055,
-0.18790099024772644,
0.21852490305900574,
-0.22849732637405396,
-0.1816650778055191,
-0.2000187188386917,
0.4027485251426697,
0.07840113341808319,
0.16608712077140808,
-0.12468095123767853,
0.32007935643196106,
0.2541589140892029,
0.07327082008123398,
0.24290931224822998,
-0.011082475073635578,
0.18045443296432495,
-0.05293431505560875,
-0.1220790296792984,
-0.12578679621219635,
0.0071760620921850204,
0.09232252836227417,
0.4014027416706085,
0.297663152217865,
0.3966984152793884,
0.20177870988845825,
-0.0806141123175621,
0.25206080079078674,
0.3124654293060303,
-0.15600723028182983,
-0.09238678216934204,
-0.06263522803783417,
0.35294705629348755,
0.023097064346075058,
-0.0009754374623298645,
-0.08570768684148788,
0.18100234866142273,
-0.06812484562397003,
-0.24530023336410522,
0.042008135467767715,
0.1394292563199997,
0.03211288899183273,
-0.04190332069993019,
-0.3862587511539459,
-0.04143979772925377,
-0.33914509415626526,
0.2973979413509369,
0.20921599864959717,
0.11169999837875366,
-0.05123893916606903,
-0.3180389404296875,
-0.02942422404885292,
0.02168434113264084,
-0.3251299262046814,
-0.1820112019777298,
-0.250755250453949,
0.08582113683223724,
0.10675615072250366,
0.21078678965568542,
-0.14326642453670502,
0.32769516110420227,
0.019867390394210815,
0.0483628548681736,
0.22181931138038635,
0.36579036712646484,
-0.22009101510047913,
0.4788682758808136,
0.030434878543019295,
0.20157817006111145,
-0.08947858214378357,
-0.08417385816574097,
-0.10652665048837662,
-0.25910258293151855,
0.38120606541633606,
-0.07208198308944702,
-0.5406999588012695,
0.2454722374677658,
0.05463473126292229,
-0.10217030346393585,
-0.1838376224040985,
0.030071483924984932,
0.2773289680480957,
-0.1415611207485199,
-0.2454795241355896,
0.07841384410858154,
0.07504136115312576,
-0.16860848665237427,
-0.09868435561656952,
0.3171865940093994,
0.21979768574237823,
-0.2534652054309845,
-0.12918312847614288,
-0.27693480253219604,
0.13153870403766632,
0.44740089774131775,
0.10467295348644257,
-0.22651013731956482,
-0.12558472156524658,
-0.41154295206069946,
0.28063952922821045,
0.7659892439842224,
-0.17561843991279602,
-0.2758456766605377,
0.4539816379547119,
-0.21446828544139862,
-0.2468145489692688,
0.19003377854824066,
0.18971851468086243,
0.27490392327308655,
0.1084311455488205,
0.2046767920255661,
0.4633447527885437,
-0.04168064892292023,
-0.13094215095043182,
0.03956690430641174,
-0.5267326235771179,
0.06095654144883156,
0.03879256546497345,
-0.11160008609294891,
0.06855198740959167,
0.3550352156162262,
-0.17001113295555115,
0.461805135011673,
-0.1313604712486267,
0.0936804935336113,
-0.02197289653122425,
0.672621488571167,
0.06626135110855103,
0.0505717471241951,
-0.22747845947742462,
0.07566232979297638,
0.1167864054441452,
0.4205945134162903,
-0.2700796127319336,
0.290155827999115,
-0.42296066880226135,
-0.03581306338310242,
0.03372924029827118,
-0.2135310024023056,
0.15197977423667908,
0.04430445283651352,
0.3464621603488922,
-0.07127536833286285,
-0.038040779531002045,
-0.5178363919258118,
0.049428604543209076,
-0.3803548812866211,
-0.15329943597316742,
-0.03494931757450104,
0.16233232617378235,
0.23363934457302094,
-0.255919486284256,
0.13980752229690552,
0.08143468201160431,
0.15071603655815125,
-0.25426530838012695,
-0.06526041030883789,
0.40474122762680054,
0.11394403129816055,
0.07566405832767487,
-0.07580412179231644,
0.36156558990478516,
-0.013857130892574787,
-0.3847532570362091,
-0.15689121186733246,
0.39678120613098145,
0.1278369128704071,
0.05908206105232239,
-0.3396693468093872,
0.29523763060569763,
-0.5348727703094482,
0.30319201946258545,
0.18679304420948029,
0.06407943367958069,
0.48144835233688354,
0.03405947983264923,
-0.4373772144317627,
-0.2404995858669281,
0.014866488985717297,
-0.028778135776519775,
0.17383088171482086,
-0.1191435232758522,
-0.26152104139328003,
-0.12592945992946625,
0.3874308168888092,
0.2835739254951477,
0.2617338299751282,
0.09425587207078934,
0.15070416033267975,
-0.05093709006905556,
0.3335954546928406,
0.15668900310993195,
0.5255642533302307,
0.3286699950695038,
0.3055749237537384,
-0.057653166353702545,
0.15114302933216095,
-0.10616081953048706,
0.31322577595710754,
0.06880444288253784,
-0.11016962677240372,
0.03715156763792038,
0.09671077877283096,
-0.2063429355621338,
-0.6146945953369141,
-0.16187889873981476,
0.10891684144735336,
0.06319433450698853,
-0.05726085230708122,
-0.10915368795394897,
-0.3920988142490387,
-0.4149681329727173,
-0.12263765931129456,
-0.15351003408432007,
0.014077659696340561,
-0.22447100281715393,
-0.19864551723003387,
0.42550984025001526,
-0.022093743085861206,
0.14215724170207977,
-0.3391098976135254,
0.6542333364486694,
-0.04977524280548096,
-0.2929718792438507,
-0.06339015066623688,
0.21154391765594482,
-0.15516425669193268,
0.035807184875011444,
0.05420980602502823,
-0.06552022695541382,
0.5882998108863831,
0.2573677599430084,
-0.1370782107114792,
-0.2589040696620941,
-0.3672078251838684,
0.13677281141281128,
0.22717806696891785,
0.14221704006195068,
0.2930973172187805,
0.09889949858188629,
0.08435982465744019,
-0.05092040076851845,
0.13960997760295868,
-0.029727529734373093,
0.054516345262527466,
-0.18475370109081268,
-0.22100526094436646,
-0.08903669565916061,
-0.17883887887001038,
-0.05849548801779747,
-0.046711042523384094,
-0.5620622634887695,
0.5418527722358704,
0.2843262255191803,
0.0475805327296257,
-0.011122914031147957,
0.03668795898556709,
0.2912861406803131,
0.28409162163734436,
-0.17040443420410156,
-0.11911483108997345,
-0.3327866792678833,
0.09649454057216644,
-0.3018352687358856,
-0.06382254511117935,
-0.019750207662582397,
-0.06477952003479004,
0.2735569477081299,
0.3207481801509857,
-0.17350438237190247,
-0.19350269436836243,
-0.4957609176635742,
0.45494186878204346,
-0.1356237828731537,
0.024259837344288826,
0.2903493344783783,
0.13167905807495117,
-0.04201160743832588,
-0.17679226398468018,
-0.447379469871521,
0.18082651495933533,
0.3788531422615051,
-0.17762990295886993,
0.5837047100067139,
0.39713162183761597,
0.27840936183929443,
0.4262979030609131,
0.33566778898239136,
0.16374649107456207,
0.590099573135376,
-0.3182707130908966,
0.248365581035614,
-0.3532003164291382,
-0.30285394191741943,
0.40096643567085266,
0.005138501524925232,
-0.1466265171766281,
0.1520180106163025,
-0.15625393390655518,
-0.20827782154083252,
-0.17862693965435028,
-0.37152770161628723,
0.1250896453857422,
-0.19755589962005615,
-0.010993605479598045,
-0.2531227171421051,
0.19275814294815063,
-0.07466422766447067,
-0.09055934101343155,
-0.2448381930589676,
-0.001132190227508545,
-0.0048298463225364685,
0.06696658581495285,
0.43575796484947205,
-0.012696607038378716,
-0.7047156691551208,
-0.021667838096618652,
-0.22011390328407288,
0.1364898979663849,
0.024762418121099472,
0.7336917519569397,
-0.3259968161582947,
-0.024334732443094254,
0.211772620677948,
-0.06755415350198746,
0.5302190780639648,
-0.24732588231563568,
0.058080799877643585,
-0.13852077722549438,
-0.10106033086776733,
-0.24951106309890747,
0.23858234286308289,
0.028616122901439667,
0.453208327293396,
-0.2106771618127823,
-0.03653043881058693,
-0.15257248282432556,
0.09730799496173859,
0.36833131313323975,
0.17697416245937347,
0.0802173912525177,
-0.18380385637283325,
-0.05664583295583725,
-0.3071700930595398,
-0.3562382459640503,
0.011103317141532898,
0.3216342031955719,
0.12552858889102936,
-0.13186602294445038,
-0.4431946873664856,
-0.35200604796409607,
-0.2572427988052368,
0.013639740645885468,
-0.11578845232725143,
0.034054774791002274,
-0.02798648178577423,
-0.05281658470630646,
-0.00986913125962019,
-0.21698440611362457,
-0.27033931016921997,
0.4301678240299225,
-0.01759803295135498,
-0.46340012550354004,
0.1077418178319931,
-0.19011369347572327,
0.5188408493995667,
0.24029016494750977,
-0.02273027040064335,
0.3242303133010864,
0.4723273515701294,
-0.07021529972553253,
-0.4701778292655945,
0.10882923007011414,
0.11105962097644806,
-0.15174242854118347,
-0.08152805268764496,
-0.5569890737533569,
0.4064899682998657,
0.3108650743961334,
-0.13543547689914703,
1.0614075660705566,
0.0630982518196106,
-0.2899846136569977,
0.1748194694519043,
0.16372047364711761,
0.8894875645637512,
0.1703137904405594,
-0.11083914339542389,
0.1552281677722931,
-0.11843784898519516,
-0.0655088797211647,
0.2715669274330139,
0.29746657609939575,
-0.12132075428962708,
-0.2972853481769562,
-0.09183971583843231,
-0.1960458755493164,
0.2232828289270401,
-0.14509393274784088,
-0.39107760787010193,
-0.03691539913415909,
0.10583515465259552,
0.4238664507865906,
-0.06766250729560852,
0.07773417234420776,
-0.4919123351573944,
-0.15762168169021606,
0.14198879897594452,
0.047982536256313324,
0.024972248822450638,
-0.017871195450425148,
0.19122353196144104,
-0.13824237883090973,
0.40573179721832275,
-0.1517980843782425,
-0.24607989192008972,
-0.31981161236763,
-0.2626091241836548,
0.10843874514102936,
-0.32197609543800354,
-0.15183116495609283,
0.011809907853603363,
0.3136604428291321,
0.3055838644504547,
0.22083550691604614,
-0.24888963997364044,
0.1287143975496292,
0.037662606686353683,
0.1515500396490097,
-0.35956335067749023,
0.083636574447155,
-0.026015788316726685,
-0.19106000661849976,
-0.12319490313529968,
0.2797040045261383,
0.16058728098869324,
-0.4422658681869507,
-0.13106021285057068,
0.014416919089853764,
0.6216447949409485,
-0.12152726203203201,
-0.273247629404068,
-0.0174618698656559,
0.02813023328781128,
-0.25484174489974976,
0.032412413507699966,
0.05601483955979347,
0.10310837626457214,
0.11711655557155609,
0.08659081906080246,
-0.008056432008743286,
-0.06245976313948631,
0.3818873167037964,
-0.06980127096176147,
0.21868544816970825,
0.3077165484428406,
-0.17289364337921143,
-0.18525665998458862,
-0.1281351000070572,
0.14733093976974487,
-0.20214563608169556,
-0.14169110357761383,
0.12009719014167786,
-0.010294541716575623,
0.09115806221961975,
-0.08337689936161041,
0.33006221055984497,
-0.34909912943840027,
-0.008404867723584175,
-0.38930657505989075,
-0.22305890917778015,
-0.2892110049724579,
-0.06425387412309647,
-0.25912192463874817,
0.19905811548233032,
0.14000873267650604,
-0.21122775971889496,
0.18295171856880188,
-0.1031058132648468,
-0.2593654990196228,
-0.08073052018880844,
-0.024880915880203247,
0.0054883938282728195,
0.33401235938072205,
0.166121244430542,
-0.3450399935245514,
0.23753204941749573,
0.017442546784877777,
0.21609967947006226,
-0.0611405074596405,
-0.08789423108100891,
-0.1815316379070282,
0.21802052855491638,
0.15612457692623138,
0.08403893560171127,
-0.040552735328674316,
-0.4517919421195984,
-0.4651227295398712,
-0.23357822000980377,
0.02182920277118683,
-0.025467131286859512,
-0.19048172235488892,
0.28941503167152405,
0.5396974086761475,
-0.15977342426776886,
-0.4562072157859802,
0.15200184285640717,
0.07194716483354568,
-0.11125463992357254,
-0.03760857135057449,
0.3039996922016144,
0.06656184047460556,
-0.15177768468856812,
-0.05041687190532684,
-0.06914030760526657,
0.5550476908683777,
0.15608187019824982,
0.058443568646907806,
-0.1777086853981018,
0.09742150455713272,
-0.2407364547252655,
0.16787302494049072,
0.30192896723747253,
-0.08167437463998795,
0.03210572153329849,
0.3136107325553894,
0.08023610711097717,
-0.1818225085735321,
-0.37122875452041626,
0.1345999538898468,
0.04588130861520767,
0.28212159872055054,
0.2086566537618637,
0.2747836112976074,
-0.1635463535785675,
0.04228883981704712,
-0.07197990268468857,
0.12399975955486298,
-0.4785202741622925,
0.26286521553993225,
0.6313684582710266,
-0.030613094568252563,
-0.13200952112674713,
-0.27482014894485474,
0.24668163061141968,
0.304093599319458,
0.4397203028202057,
-0.31571877002716064,
0.3093513548374176,
0.09885421395301819,
-0.06607326120138168,
0.124651700258255,
-0.5139842629432678,
0.14270007610321045,
-0.1418049931526184,
-0.07673721015453339,
0.28875330090522766,
0.19572550058364868,
0.08231082558631897,
-0.1151103526353836,
0.03201074153184891,
-0.13335943222045898,
-0.22446711361408234,
0.14804793894290924,
-0.14835292100906372,
-0.303236186504364,
-0.21870696544647217,
-0.15253755450248718,
0.07827752828598022,
0.0065397159196436405,
0.1956385374069214,
0.19062861800193787,
-0.14973793923854828,
0.28434503078460693,
-0.40413427352905273,
0.4180292785167694,
0.19291606545448303,
0.07177399098873138,
-0.2580396234989166,
-0.009109076112508774,
-0.08261147141456604,
0.11914363503456116,
-0.03727492690086365,
0.11410137265920639,
0.09461966156959534,
0.15105992555618286,
0.26597607135772705,
0.0757022500038147,
-0.04321659728884697,
-0.23140805959701538,
-0.4545852243900299,
0.04325898736715317,
0.04565396532416344,
0.15082886815071106,
0.39070919156074524,
0.08927647769451141,
0.0057619474828243256,
0.22777356207370758,
-0.08528617769479752,
0.0302443690598011,
-0.46070989966392517,
0.4556153118610382,
0.45905500650405884,
-0.2587481141090393,
0.0812993198633194,
-0.24944733083248138,
-0.09138308465480804,
0.10250449925661087,
0.33513858914375305,
-0.3095207214355469,
0.02883210778236389,
-0.08571189641952515,
0.02093445509672165,
-0.23169735074043274,
0.18370237946510315,
-0.10740777105093002,
0.004048461094498634,
0.09082934260368347,
-0.29312580823898315,
-0.47433602809906006,
-0.05718177556991577,
0.2372327446937561,
-0.009470492601394653,
0.19026964902877808,
-0.03995193541049957,
0.12218242883682251,
0.006378518417477608,
-0.14408236742019653,
-0.36519789695739746,
0.4346136748790741,
0.42735448479652405,
-0.09156014770269394,
-0.40163731575012207,
0.054376278072595596,
0.21204587817192078,
-0.09717903286218643,
-0.3260754346847534,
0.25386664271354675,
-0.08112849295139313,
0.0006360635161399841,
-0.11164158582687378,
-0.10893082618713379,
0.09819883853197098,
-0.014731055125594139,
0.24672448635101318,
0.2147119790315628,
-0.031904108822345734,
-0.3035743236541748,
0.4457928538322449,
-0.01798936352133751,
0.2901909053325653,
-0.31376227736473083,
0.05000199377536774,
0.07845258712768555,
0.03615830838680267,
-0.3589206039905548,
0.07908546924591064,
-0.3782005310058594,
0.11117373406887054,
0.03156101703643799,
0.12294961512088776,
0.24749097228050232,
0.16026006639003754,
-0.22113092243671417,
0.42370542883872986,
0.2118045687675476,
-0.07667592167854309,
0.04132445156574249,
-0.164743572473526,
-0.05557430535554886,
-0.17706067860126495,
0.5526054501533508,
-0.11151202023029327,
-0.15468156337738037,
-0.1873687505722046,
0.19997155666351318,
0.25166842341423035,
0.02049594558775425,
-0.17690150439739227,
-0.18850919604301453,
0.6343136429786682,
-0.19591644406318665,
0.12091533094644547,
0.44215837121009827,
0.20378361642360687,
0.24971234798431396,
-0.11931096017360687,
0.18613877892494202,
0.16999787092208862,
-0.23261700570583344,
-0.004689693450927734,
-0.20765866339206696
] |
https://github.com/huggingface/datasets/issues/6149 | Looks like this regression was introduced in `datasets==2.13.0` (`2.12.0` could load a subset of columns)
This does not appear to be fixed by https://github.com/huggingface/datasets/pull/6045 (bug still exists on `main`) | Dataset.from_parquet cannot load subset of columns | ### Describe the bug
When using `Dataset.from_parquet(path_or_paths, columns=[...])` and a subset of columns, loading fails with a variant of the following
```
ValueError: Couldn't cast
a: int64
-- schema metadata --
pandas: '{"index_columns": [], "column_indexes": [], "columns": [{"name":' + 273
to
{'a': Value(dtype='int64', id=None), 'b': Value(dtype='int64', id=None)}
because column names don't match
The above exception was the direct cause of the following exception:
```
Looks to be triggered by https://github.com/huggingface/datasets/blob/c02a44715c036b5261686669727394b1308a3a4b/src/datasets/table.py#L2285-L2286
### Steps to reproduce the bug
```
import pandas as pd
from datasets import Dataset
pd.DataFrame([{"a": 1, "b": 2}]).to_parquet("test.pq")
Dataset.from_parquet("test.pq", columns=["a"])
```
### Expected behavior
A subset of columns should be loaded without error
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-5.10.0-23-cloud-amd64-x86_64-with-glibc2.2.5
- Python version: 3.8.16
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3 | 29 | Dataset.from_parquet cannot load subset of columns
### Describe the bug
When using `Dataset.from_parquet(path_or_paths, columns=[...])` and a subset of columns, loading fails with a variant of the following
```
ValueError: Couldn't cast
a: int64
-- schema metadata --
pandas: '{"index_columns": [], "column_indexes": [], "columns": [{"name":' + 273
to
{'a': Value(dtype='int64', id=None), 'b': Value(dtype='int64', id=None)}
because column names don't match
The above exception was the direct cause of the following exception:
```
Looks to be triggered by https://github.com/huggingface/datasets/blob/c02a44715c036b5261686669727394b1308a3a4b/src/datasets/table.py#L2285-L2286
### Steps to reproduce the bug
```
import pandas as pd
from datasets import Dataset
pd.DataFrame([{"a": 1, "b": 2}]).to_parquet("test.pq")
Dataset.from_parquet("test.pq", columns=["a"])
```
### Expected behavior
A subset of columns should be loaded without error
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-5.10.0-23-cloud-amd64-x86_64-with-glibc2.2.5
- Python version: 3.8.16
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
Looks like this regression was introduced in `datasets==2.13.0` (`2.12.0` could load a subset of columns)
This does not appear to be fixed by https://github.com/huggingface/datasets/pull/6045 (bug still exists on `main`) | [
-0.1333582103252411,
-0.08192666620016098,
0.08033621311187744,
0.5715978145599365,
0.4477812349796295,
0.10835712403059006,
0.31241875886917114,
0.24921822547912598,
0.08865556865930557,
0.007296420633792877,
-0.021194105967879295,
0.5238876938819885,
0.01299673318862915,
0.14497233927249908,
0.00297410786151886,
-0.4186915159225464,
0.05245273560285568,
0.0878494530916214,
-0.1933262050151825,
0.1758502870798111,
-0.3442550003528595,
0.2612030506134033,
-0.22937434911727905,
0.25918224453926086,
0.15594182908535004,
0.025853844359517097,
-0.0941433534026146,
0.2134706676006317,
-0.11998309940099716,
-0.32459014654159546,
0.2690713405609131,
-0.30249619483947754,
0.20005369186401367,
0.3448774516582489,
-0.00011294691648799926,
-0.002216614782810211,
0.212249293923378,
-0.04520098492503166,
-0.2721884548664093,
-0.4514589011669159,
-0.07491762936115265,
-0.0932459831237793,
0.3583402633666992,
-0.24983984231948853,
-0.12056107819080353,
-0.24937304854393005,
-0.2974694073200226,
-0.06356827914714813,
0.061325233429670334,
0.25104978680610657,
0.2198585867881775,
0.5484063625335693,
-0.030779778957366943,
-0.08884461969137192,
0.16365642845630646,
-0.18266156315803528,
-0.16324317455291748,
0.024283207952976227,
0.22542184591293335,
-0.09826816618442535,
0.09616381675004959,
-0.11955292522907257,
-0.12872575223445892,
-0.06474299728870392,
0.18755201995372772,
0.06368673592805862,
0.007726648822426796,
-0.18142962455749512,
0.1964302808046341,
0.24602577090263367,
0.2955341935157776,
-0.17750832438468933,
-0.31957894563674927,
-0.39891883730888367,
-0.03716379031538963,
-0.3663080930709839,
0.2145017385482788,
0.07678745687007904,
0.17913563549518585,
0.03164263069629669,
-0.20376670360565186,
0.2641336917877197,
-0.04729966074228287,
-0.005364745855331421,
-0.3169195055961609,
0.03859594836831093,
-0.17716862261295319,
0.11844207346439362,
-0.08161038160324097,
-0.18728847801685333,
-0.2550451457500458,
0.0036866553127765656,
-0.09308705478906631,
0.2743184566497803,
-0.37025004625320435,
-0.00827893614768982,
0.103697270154953,
0.03026479296386242,
0.0035934150218963623,
0.1495676040649414,
-0.1642947494983673,
-0.004200952127575874,
0.13572213053703308,
0.19425423443317413,
0.376884400844574,
0.05778660625219345,
-0.016665052622556686,
0.1597399115562439,
0.07752205431461334,
0.447126567363739,
0.0002790912985801697,
-0.044751983135938644,
0.028215911239385605,
-0.1489340364933014,
-0.20831727981567383,
-0.2638428807258606,
0.28370872139930725,
-0.2598915696144104,
-0.4702138602733612,
0.2991335988044739,
0.0475100576877594,
-0.017310258001089096,
0.20152968168258667,
0.36352694034576416,
0.08677051961421967,
0.36038458347320557,
-0.048949673771858215,
0.3471190929412842,
-0.0153825543820858,
-0.11260746419429779,
-0.33779600262641907,
0.1347094625234604,
-0.1251387596130371,
-0.2969556450843811,
0.0007493570446968079,
-0.1632847636938095,
0.15680810809135437,
0.22765010595321655,
0.019968070089817047,
-0.23945823311805725,
-0.3180813491344452,
-0.18531878292560577,
-0.216758131980896,
0.3065946400165558,
-0.12946221232414246,
0.12457422912120819,
0.3998388946056366,
-0.22843429446220398,
-0.1636924147605896,
-0.021249879151582718,
-0.1910611093044281,
-0.13440492749214172,
-0.003096936270594597,
0.20100584626197815,
-0.199857696890831,
0.06538370996713638,
-0.6967858076095581,
0.12550564110279083,
0.061688970774412155,
0.02839358150959015,
-0.08991474658250809,
-0.12803781032562256,
-0.18328332901000977,
-0.2220074087381363,
0.3880985379219055,
0.36249589920043945,
-0.1470586359500885,
-0.07647298276424408,
0.18010860681533813,
-0.138519287109375,
0.2580207288265228,
0.23274090886116028,
-0.13657008111476898,
-0.17896084487438202,
-0.2088196724653244,
0.09286616742610931,
0.1322619616985321,
0.13015508651733398,
0.09475719928741455,
0.2935999035835266,
-0.17764727771282196,
0.21646830439567566,
0.09717237949371338,
-0.3775826096534729,
0.24401263892650604,
-0.1293705701828003,
0.031643860042095184,
0.3257516920566559,
-0.05900869518518448,
0.13814997673034668,
-0.18340405821800232,
-0.27925020456314087,
0.3308042287826538,
0.16144198179244995,
0.044636353850364685,
0.1805276870727539,
0.0672890841960907,
-0.18543818593025208,
0.16605353355407715,
-0.17206448316574097,
-0.08474467694759369,
0.1735544502735138,
0.21119749546051025,
0.1901252418756485,
0.1555110514163971,
-0.31743383407592773,
-0.5485981106758118,
0.3198707103729248,
0.2977566421031952,
-0.2206018567085266,
-0.17851576209068298,
0.026449017226696014,
-0.3314213752746582,
0.1260913610458374,
0.06729774177074432,
-0.1413218230009079,
0.032493218779563904,
0.04784572869539261,
0.06740046292543411,
-0.21391665935516357,
-0.4426156282424927,
0.2779292166233063,
-0.3426220118999481,
0.17898830771446228,
-0.28568124771118164,
0.3484134078025818,
0.111752450466156,
-0.06584018468856812,
0.16482587158679962,
0.19852550327777863,
0.3564823269844055,
-0.18494008481502533,
0.0842384397983551,
0.4064014256000519,
0.1771947741508484,
0.2812878489494324,
-0.17398017644882202,
-0.0075876712799072266,
-0.019391756504774094,
0.16224685311317444,
-0.08912324160337448,
-0.2221262902021408,
0.21346493065357208,
0.06414754688739777,
-0.1704878807067871,
0.36899900436401367,
-0.33800753951072693,
0.4512624740600586,
0.18635086715221405,
-0.017578646540641785,
0.3494412302970886,
-0.06762087345123291,
-0.03677578270435333,
-0.19564595818519592,
0.25217682123184204,
0.0872434750199318,
0.0751534178853035,
0.21467897295951843,
-0.7034221887588501,
-0.08326417952775955,
0.0693860650062561,
0.045264311134815216,
-0.13111485540866852,
0.1661105901002884,
0.16597193479537964,
-0.04113929718732834,
0.003299964591860771,
0.11391618847846985,
0.25770312547683716,
0.17515617609024048,
0.008024277165532112,
-0.044809527695178986,
-0.18818075954914093,
-0.06419529020786285,
0.2603175640106201,
0.21713286638259888,
-0.12313362956047058,
0.059472404420375824,
0.15810397267341614,
0.1750178188085556,
-0.35581693053245544,
0.05403073877096176,
0.17438861727714539,
0.20338891446590424,
-0.5976369380950928,
0.13609227538108826,
-0.37253785133361816,
-0.04134885221719742,
-0.08814646303653717,
-0.009337246417999268,
-0.08281750977039337,
-0.36813920736312866,
-0.2217717319726944,
0.40378811955451965,
-0.24171948432922363,
0.14112243056297302,
-0.348017156124115,
0.14575961232185364,
-0.10592703521251678,
-0.12851916253566742,
-0.2512954771518707,
-0.17255359888076782,
-0.13134455680847168,
0.10035283863544464,
0.011815685778856277,
0.04925690218806267,
0.15468516945838928,
-0.18328523635864258,
-0.18818393349647522,
-0.333051472902298,
-0.29445040225982666,
0.09079691022634506,
-0.31513604521751404,
0.43386250734329224,
0.24383693933486938,
0.3306216299533844,
-0.12115001678466797,
-0.37985336780548096,
0.3961932957172394,
0.00046440213918685913,
-0.18233202397823334,
0.27706676721572876,
0.10339474678039551,
-0.009268905967473984,
0.00662645697593689,
-0.29946577548980713,
-0.05571302771568298,
-0.3474689722061157,
0.30986878275871277,
-0.057001642882823944,
0.13196223974227905,
-0.006229884922504425,
-0.15377196669578552,
-0.042452141642570496,
-0.14179883897304535,
0.17345981299877167,
-0.1911441534757614,
0.011291220784187317,
0.2881758511066437,
0.0008562095463275909,
-0.23694917559623718,
-0.08251461386680603,
0.14941513538360596,
0.07263366878032684,
0.14957651495933533,
-0.4958961009979248,
-0.3167990446090698,
-0.2225225865840912,
0.0002047121524810791,
0.03874225541949272,
0.05074762552976608,
0.13409562408924103,
-0.07658996433019638,
-0.0562688484787941,
-0.11506204307079315,
-0.3460293114185333,
-0.14108812808990479,
0.36676692962646484,
0.00376167893409729,
0.024300333112478256,
0.8469825983047485,
-0.07305607199668884,
0.2946026623249054,
0.08070603013038635,
-0.02562015689909458,
0.6709910035133362,
-0.18646331131458282,
0.350406676530838,
-0.1869027018547058,
-0.3091818392276764,
0.09336991608142853,
-0.15674641728401184,
-0.17110863327980042,
0.21862047910690308,
-0.1321174055337906,
-0.07668059319257736,
-0.14481395483016968,
-0.1382513791322708,
-0.10035331547260284,
-0.1416567862033844,
-0.12974922358989716,
0.07669268548488617,
0.1258593052625656,
0.018997542560100555,
0.09504851698875427,
-0.05831269919872284,
0.0511167012155056,
0.05065618455410004,
0.18836547434329987,
0.17239990830421448,
-0.14777691662311554,
-0.11690787971019745,
0.182969868183136,
-0.2166796773672104,
0.03013225644826889,
-0.13086290657520294,
0.5574371218681335,
-0.024869024753570557,
-0.17737942934036255,
0.006584398448467255,
0.049925096333026886,
0.761440098285675,
0.07714379578828812,
0.37504062056541443,
0.20511296391487122,
-0.28256934881210327,
-0.7626100778579712,
-0.015243537724018097,
-0.13526369631290436,
0.10587514936923981,
0.09138327091932297,
0.6663053035736084,
-0.4258701801300049,
-0.037377938628196716,
0.4083383083343506,
0.3193962872028351,
0.07258091866970062,
-0.029571404680609703,
-0.2252327799797058,
-0.1391221582889557,
-0.12373489886522293,
0.19344130158424377,
0.2095252275466919,
0.49001067876815796,
0.08075310289859772,
0.2125961184501648,
-0.3452736735343933,
-0.3344089388847351,
0.052377887070178986,
0.3334645926952362,
0.40457695722579956,
-0.04726729542016983,
0.4731218218803406,
-0.08414220809936523,
0.08770495653152466,
0.12648482620716095,
0.7002761960029602,
-0.16469153761863708,
-0.36758947372436523,
0.21026846766471863,
0.20827852189540863,
0.34231695532798767,
0.2413608729839325,
-0.14365413784980774,
0.09088583290576935,
-0.3421705961227417,
0.0807456225156784,
-0.27603673934936523,
-0.09446315467357635,
0.14931511878967285,
-0.029004164040088654,
-0.030281685292720795,
-0.24485233426094055,
0.6152399182319641,
0.13394121825695038,
-0.0563226118683815,
0.12286931276321411,
0.5862889289855957,
-0.31472939252853394,
0.470394492149353,
0.024957988411188126,
0.6024917364120483,
-0.1711524873971939,
-0.09007520228624344,
0.38043928146362305,
-0.22692471742630005,
0.46442434191703796,
0.00278356671333313,
-0.13688920438289642,
-0.42937272787094116,
-0.3343430161476135,
0.09208445250988007,
-0.14350269734859467,
0.1997578740119934,
0.1275824010372162,
0.11504870653152466,
0.44363462924957275,
-0.19859254360198975,
0.6010878086090088,
0.18733666837215424,
0.017555110156536102,
-0.12605029344558716,
-0.1780683696269989,
-0.7046141028404236,
0.032205574214458466,
-0.018109586089849472,
-0.2886662483215332,
0.11393234133720398,
0.19728577136993408,
-0.08963384479284286,
-0.2874264717102051,
-0.2364014983177185,
0.3440208435058594,
-0.05487541854381561,
0.028866004198789597,
0.2647988200187683,
-0.36494672298431396,
0.20439793169498444,
0.36813971400260925,
0.1457802653312683,
-0.060318656265735626,
-0.040608927607536316,
0.22842147946357727,
-0.0988723635673523,
-0.0009023472666740417,
-0.06696741282939911,
0.14269839227199554,
0.08874154835939407,
0.19500379264354706,
0.10495322942733765,
-0.165238618850708,
-0.3120092451572418,
0.004905708134174347,
-0.018096566200256348,
0.2401430904865265,
0.014624034985899925,
-0.39465951919555664,
-0.3914629817008972,
-0.36362096667289734,
0.4234912395477295,
-0.45993101596832275,
0.11207390576601028,
0.04896308481693268,
-0.08001736551523209,
0.07342275977134705,
0.024447333067655563,
-0.2933291792869568,
-0.09996801614761353,
0.4762342572212219,
-0.3192969560623169,
0.08571036905050278,
0.4755597710609436,
0.3671591281890869,
-0.2607600688934326,
-0.07456564158201218,
-0.15264856815338135,
0.3940674364566803,
-0.33828306198120117,
0.18880224227905273,
-0.14879325032234192,
0.0009128600358963013,
0.07427845895290375,
0.2555716931819916,
0.08641491085290909,
0.0004963371902704239,
0.0370517373085022,
-0.5178602933883667,
-0.12706172466278076,
0.3917533755302429,
-0.06457196176052094,
0.07367720454931259,
0.2352275252342224,
-0.1994762271642685,
-0.2672640085220337,
-0.08532130718231201,
-0.2681131958961487,
0.09028822928667068,
-0.2771729528903961,
0.21877521276474,
0.5199452638626099,
0.026471201330423355,
0.1244906410574913,
-0.21868465840816498,
0.24879878759384155,
0.044251132756471634,
0.027545146644115448,
-0.1395147740840912,
-0.23351281881332397,
0.10139361768960953,
0.031131111085414886,
-0.04297322779893875,
-0.26504722237586975,
-0.0031905323266983032,
-0.2588827908039093,
-0.2835197448730469,
0.35905390977859497,
0.2807008624076843,
-0.010003536939620972,
-0.2525272071361542,
0.4613654911518097,
-0.033283770084381104,
-0.3246922492980957,
0.08414766937494278,
-0.2929692268371582,
0.04092409834265709,
0.019636545330286026,
0.11539731919765472,
-0.24029840528964996,
0.014087416231632233,
-0.05588071793317795,
-0.01223287358880043,
-0.08884866535663605,
0.02389097586274147,
0.2538776397705078,
-0.15816989541053772,
-0.10802000761032104,
0.4173913300037384,
0.4311412572860718,
0.39814117550849915,
-0.11649113893508911,
-0.18624988198280334,
0.2121773213148117,
0.13040849566459656,
-0.2083539515733719,
-0.2612629234790802,
0.14510782063007355,
0.14600573480129242,
0.046569012105464935,
0.3309616148471832,
0.2172151356935501,
-0.15107740461826324,
-0.25236278772354126,
0.013303257524967194,
0.8037267923355103,
0.10770374536514282,
0.21259216964244843,
0.37153974175453186,
-0.060542602092027664,
-0.0059698186814785,
0.08701535314321518,
0.3213091492652893,
0.29967015981674194,
0.1754491776227951,
-0.036231059581041336,
-0.10262752324342728,
0.03354967013001442,
0.11675137281417847,
0.06370998919010162,
-0.36942237615585327,
0.1115572601556778,
0.19276615977287292,
0.18607881665229797,
-0.08137264847755432,
-0.13449101150035858,
0.18655356764793396,
-0.0023834556341171265,
0.012062609195709229,
-0.09763456881046295,
0.19319970905780792,
-0.20754331350326538,
-0.23341169953346252,
-0.044369541108608246,
-0.28014230728149414,
-0.2173645794391632,
0.04331539571285248,
-0.2909232974052429,
-0.2645377218723297,
0.07200174033641815,
-0.0020324215292930603,
0.07810834050178528,
-0.39186590909957886,
-0.16350039839744568,
0.09608276933431625,
0.2247450202703476,
-0.29399120807647705,
0.46807536482810974,
-0.013004906475543976,
-0.22813336551189423,
0.2947379946708679,
-0.043942615389823914,
0.43566209077835083,
0.1677885502576828,
0.22801432013511658,
-0.1721424013376236,
-0.0024990681558847427,
-0.0893491581082344,
0.08356843888759613,
0.044840700924396515,
-0.24742954969406128,
0.39130330085754395,
0.3517165184020996,
0.1712380051612854,
-0.10721178352832794,
-0.05967314913868904,
0.09498792886734009,
0.29993799328804016,
-0.4384816884994507,
0.37599340081214905,
-0.07456164062023163,
-0.06263571977615356,
-0.017163900658488274,
-0.07279303669929504,
-0.19748380780220032,
-0.23319096863269806,
0.0670425146818161,
0.18586745858192444,
0.125119149684906,
0.29354286193847656,
0.09047897905111313,
0.24717415869235992,
0.311752587556839,
0.3237503468990326,
-0.37120330333709717,
-0.3068408966064453,
-0.16021253168582916,
-0.6447353363037109,
0.08344116061925888,
-0.11647658050060272,
-0.13576741516590118,
0.6184208393096924,
0.05055387318134308,
0.09743532538414001,
-0.06839676201343536,
-0.046979889273643494,
0.5193195343017578,
-0.1338270902633667,
0.16584382951259613,
-0.16119155287742615,
-0.28504249453544617,
-0.055209990590810776,
-0.01732456684112549,
-0.10756765305995941,
-0.08860306441783905,
0.21623387932777405,
0.0931272953748703,
0.0952921211719513,
-0.04760751873254776,
-0.047645702958106995,
-0.16050443053245544,
-0.3445023000240326,
0.02424333430826664,
0.002390427514910698,
0.24317525327205658,
-0.11825215071439743,
0.09564945101737976,
-0.29117438197135925,
-0.5117800235748291,
-0.10957828164100647,
0.5051378607749939,
-0.23147335648536682,
0.2338450402021408,
0.03147130459547043,
-0.1877477467060089,
-0.30675622820854187,
-0.11821999400854111,
-0.24929460883140564,
0.14323462545871735,
-0.22189676761627197,
0.1734829545021057,
0.04720950126647949,
0.009530570358037949,
0.047495223581790924,
0.17214274406433105,
0.0861821323633194,
0.35207533836364746,
0.04468941688537598,
-0.7252755165100098,
0.5548614859580994,
-0.5120178461074829,
-0.3765675127506256,
0.06780226528644562,
0.1440504789352417,
0.1560571789741516,
-0.20113281905651093,
-0.4258679747581482,
0.09902794659137726,
0.2513367831707001,
-0.17405979335308075,
-0.03983857482671738,
-0.14608828723430634,
-0.06625483930110931,
-0.07407894730567932,
-0.15195465087890625,
0.07426054775714874,
0.0987560898065567,
-0.15009409189224243,
0.1540384441614151,
-0.15557706356048584
] |
https://github.com/huggingface/datasets/issues/6147 | The cause of the error seems to be that `datasets` adds "gcs://" as a schema, while `beam` checks only "gs://".
datasets: https://github.com/huggingface/datasets/blob/c02a44715c036b5261686669727394b1308a3a4b/src/datasets/builder.py#L822
beam: [link](https://github.com/apache/beam/blob/25e1a64641b1c8a3c0a6c75c6e86031b87307f22/sdks/python/apache_beam/io/filesystems.py#L98-L101)
```
systems = [
fs for fs in FileSystem.get_all_subclasses()
if fs.scheme() == path_scheme
]
``` | ValueError when running BeamBasedBuilder with GCS path in cache_dir | ### Describe the bug
When running the BeamBasedBuilder with a GCS path specified in the cache_dir, the following ValueError occurs:
```
ValueError: Unable to get filesystem from specified path, please use the correct path or ensure the required dependency is installed, e.g., pip install apache-beam[gcp]. Path specified: gcs://my-bucket/huggingface_datasets/my_beam_dataset/default/0.0.0/my_beam_dataset-train [while running 'train/Save to parquet/Write/WriteImpl/InitializeWrite']
```
Same error occurs after running `pip install apache-beam[gcp]` as instructed.
### Steps to reproduce the bug
Put `my_beam_dataset.py`:
```python
import datasets
class MyBeamDataset(datasets.BeamBasedBuilder):
def _info(self):
features = datasets.Features({"value": datasets.Value("int64")})
return datasets.DatasetInfo(features=features)
def _split_generators(self, dl_manager, pipeline):
return [datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={})]
def _build_pcollection(self, pipeline):
import apache_beam as beam
return pipeline | beam.Create([{"value": i} for i in range(10)])
```
Run:
```bash
datasets-cli run_beam my_beam_dataset.py --cache_dir=gs://my-bucket/huggingface_datasets/ --beam_pipeline_options="runner=DirectRunner"
```
### Expected behavior
Running the BeamBasedBuilder with a GCS cache path without any errors.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-13.4-arm64-arm-64bit
- Python version: 3.9.17
- Huggingface_hub version: 0.16.4
- PyArrow version: 9.0.0
- Pandas version: 2.0.3 | 39 | ValueError when running BeamBasedBuilder with GCS path in cache_dir
### Describe the bug
When running the BeamBasedBuilder with a GCS path specified in the cache_dir, the following ValueError occurs:
```
ValueError: Unable to get filesystem from specified path, please use the correct path or ensure the required dependency is installed, e.g., pip install apache-beam[gcp]. Path specified: gcs://my-bucket/huggingface_datasets/my_beam_dataset/default/0.0.0/my_beam_dataset-train [while running 'train/Save to parquet/Write/WriteImpl/InitializeWrite']
```
Same error occurs after running `pip install apache-beam[gcp]` as instructed.
### Steps to reproduce the bug
Put `my_beam_dataset.py`:
```python
import datasets
class MyBeamDataset(datasets.BeamBasedBuilder):
def _info(self):
features = datasets.Features({"value": datasets.Value("int64")})
return datasets.DatasetInfo(features=features)
def _split_generators(self, dl_manager, pipeline):
return [datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={})]
def _build_pcollection(self, pipeline):
import apache_beam as beam
return pipeline | beam.Create([{"value": i} for i in range(10)])
```
Run:
```bash
datasets-cli run_beam my_beam_dataset.py --cache_dir=gs://my-bucket/huggingface_datasets/ --beam_pipeline_options="runner=DirectRunner"
```
### Expected behavior
Running the BeamBasedBuilder with a GCS cache path without any errors.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-13.4-arm64-arm-64bit
- Python version: 3.9.17
- Huggingface_hub version: 0.16.4
- PyArrow version: 9.0.0
- Pandas version: 2.0.3
The cause of the error seems to be that `datasets` adds "gcs://" as a schema, while `beam` checks only "gs://".
datasets: https://github.com/huggingface/datasets/blob/c02a44715c036b5261686669727394b1308a3a4b/src/datasets/builder.py#L822
beam: [link](https://github.com/apache/beam/blob/25e1a64641b1c8a3c0a6c75c6e86031b87307f22/sdks/python/apache_beam/io/filesystems.py#L98-L101)
```
systems = [
fs for fs in FileSystem.get_all_subclasses()
if fs.scheme() == path_scheme
]
``` | [
-0.29819557070732117,
0.19141258299350739,
0.014799751341342926,
0.36861103773117065,
0.2843171954154968,
0.008844070136547089,
0.2713485360145569,
0.1694406270980835,
-0.08469781279563904,
0.2694435715675354,
0.10181479156017303,
0.3879253566265106,
-0.4240404963493347,
-0.3336869776248932,
-0.2645728886127472,
-0.1987866461277008,
0.13508810102939606,
0.058684851974248886,
-0.3248650133609772,
0.05227082967758179,
-0.1768912971019745,
0.6396580934524536,
-0.15224461257457733,
0.06389514356851578,
-0.3693034052848816,
-0.2308526188135147,
0.11522109061479568,
0.33189886808395386,
-0.09075315296649933,
-0.4106096029281616,
0.19791552424430847,
-0.3518085479736328,
-0.0028625838458538055,
0.6332634687423706,
-0.0001162092958111316,
0.011990025639533997,
0.21789059042930603,
-0.04208800941705704,
-0.37673598527908325,
-0.3879568576812744,
0.11338406801223755,
-0.1444745808839798,
0.1495186686515808,
-0.2612190246582031,
-0.1865176111459732,
0.012073852121829987,
0.03850817680358887,
-0.4227727949619293,
0.10669079422950745,
0.17565400898456573,
0.1696932166814804,
0.28015846014022827,
-0.11193970590829849,
-0.11977493017911911,
0.45425811409950256,
-0.18966920673847198,
-0.15198299288749695,
0.2573111057281494,
-0.06106468290090561,
0.33553600311279297,
-0.22472414374351501,
0.4169517755508423,
-0.13123050332069397,
-0.013146689161658287,
0.2924954891204834,
-0.07672823965549469,
-0.021549422293901443,
0.04525437206029892,
0.10410722345113754,
-0.27051836252212524,
0.4918535351753235,
-0.3896127939224243,
-0.2480798363685608,
-0.14675870537757874,
-0.1453283578157425,
-0.08956517279148102,
0.5575053691864014,
0.2144162505865097,
-0.1816357523202896,
0.06931155920028687,
-0.04146862030029297,
0.015277504920959473,
-0.15562698245048523,
-0.036835938692092896,
0.17657917737960815,
-0.1538446694612503,
-0.14009763300418854,
0.14263395965099335,
0.25268828868865967,
0.340092271566391,
0.1354016661643982,
-0.2738804221153259,
-0.14578884840011597,
0.13196714222431183,
-0.3544234037399292,
0.18764333426952362,
-0.08673262596130371,
0.34326043725013733,
-0.06137719750404358,
0.12430641055107117,
-0.13023748993873596,
-0.1412658989429474,
0.004744075238704681,
0.18276157975196838,
-0.17275699973106384,
0.4968099892139435,
-0.030507229268550873,
0.11034827679395676,
0.1007712334394455,
0.06964588165283203,
-0.0009538009762763977,
-0.16600508987903595,
0.17903970181941986,
-0.5215208530426025,
0.0073393359780311584,
0.3259643614292145,
-0.02802259847521782,
-0.007686808705329895,
-0.12059637904167175,
-0.11094716936349869,
0.08298955857753754,
0.22384090721607208,
0.309863418340683,
0.5046234130859375,
0.20492179691791534,
0.25956982374191284,
0.04556182026863098,
0.201901376247406,
-0.02595929056406021,
-0.2534480094909668,
-0.23466050624847412,
0.17243972420692444,
-0.3138822317123413,
0.04453852027654648,
0.1578730344772339,
-0.16330718994140625,
0.359374463558197,
0.07152055203914642,
0.16704262793064117,
-0.11350065469741821,
0.000630110502243042,
-0.08447195589542389,
-0.021600857377052307,
0.2966713607311249,
-0.05861939117312431,
0.5667051076889038,
0.24258475005626678,
-0.0094519704580307,
-0.006879188120365143,
0.007451286539435387,
-0.302074670791626,
-0.47449028491973877,
0.08967047929763794,
0.042018771171569824,
0.006029412150382996,
0.3507313132286072,
-0.5825100541114807,
-0.3936983644962311,
0.27757447957992554,
-0.00005841255187988281,
0.10629952698945999,
-0.1811414361000061,
-0.07524015009403229,
-0.5083127021789551,
0.0078067779541015625,
0.3373912274837494,
0.022566132247447968,
0.04210928827524185,
-0.03349381685256958,
-0.02539031021296978,
0.19308778643608093,
0.162896066904068,
-0.10546423494815826,
0.16542485356330872,
-0.45995789766311646,
0.12912645936012268,
0.3864395320415497,
-0.5330471992492676,
-0.37336432933807373,
0.3538695275783539,
-0.1331246942281723,
-0.04125265032052994,
0.417502760887146,
-0.02771815098822117,
-0.02883201837539673,
-0.09588664770126343,
-0.4155866801738739,
0.18559204041957855,
0.0725187435746193,
0.33794769644737244,
-0.26048189401626587,
-0.20462331175804138,
0.10834749042987823,
-0.02198019251227379,
0.14595623314380646,
0.13549788296222687,
0.08920373022556305,
0.07754099369049072,
0.27534422278404236,
-0.16992367804050446,
0.03718746453523636,
0.3902772068977356,
0.1620318442583084,
-0.2099888026714325,
0.0413975715637207,
0.02838478982448578,
-0.4010288417339325,
0.36419713497161865,
-0.42997562885284424,
-0.14008744060993195,
-0.15941222012043,
-0.17844346165657043,
-0.16115306317806244,
0.06377959996461868,
-0.03809492662549019,
-0.5058894753456116,
-0.020757757127285004,
0.3356480002403259,
0.19604742527008057,
-0.07921084761619568,
-0.14864635467529297,
0.6627481579780579,
-0.1430739164352417,
0.2066958248615265,
-0.16802766919136047,
0.3352978527545929,
-0.06456895917654037,
-0.3002358078956604,
-0.15378233790397644,
-0.10570669919252396,
0.43974679708480835,
-0.20241397619247437,
-0.3677688241004944,
0.7350794076919556,
0.24864505231380463,
0.22843922674655914,
-0.3988099694252014,
0.14135761559009552,
0.13972963392734528,
0.01566440612077713,
0.1161828488111496,
-0.13014370203018188,
0.07956304401159286,
0.2600313425064087,
0.466697633266449,
0.05817590653896332,
-0.10031640529632568,
0.1164807453751564,
-0.01354159414768219,
0.1543683558702469,
0.07506922632455826,
-0.01208195835351944,
0.1994202733039856,
-0.03155127912759781,
0.17663916945457458,
-0.2789342999458313,
0.22877471148967743,
-0.03544017672538757,
0.02386629581451416,
-0.0016213729977607727,
0.3069663941860199,
0.20730049908161163,
-0.12311386317014694,
-0.18456541001796722,
-0.2749049961566925,
0.04857177287340164,
0.43599581718444824,
0.13479819893836975,
0.3483350872993469,
0.0953349620103836,
-0.09610769152641296,
0.0385078489780426,
0.16619990766048431,
-0.15484580397605896,
0.23354732990264893,
0.05909993499517441,
0.19207988679409027,
0.019850920885801315,
0.0016851425170898438,
0.07600703835487366,
0.042201295495033264,
0.015489287674427032,
-0.0646076500415802,
0.08548398315906525,
-0.22840313613414764,
0.09756743162870407,
-0.3146592080593109,
-0.15511441230773926,
-0.34322983026504517,
0.2235332727432251,
-0.07199008017778397,
-0.1921503245830536,
-0.123946413397789,
0.4563819468021393,
-0.11913885176181793,
0.33067405223846436,
0.24644681811332703,
0.08217031508684158,
0.11378505080938339,
-0.31372570991516113,
-0.3334941864013672,
0.1400606632232666,
-0.28731003403663635,
-0.09812191873788834,
0.1090659499168396,
0.004215210676193237,
0.027695493772625923,
0.07138199359178543,
0.1209304928779602,
-0.4986717104911804,
0.026348702609539032,
0.18910671770572662,
0.019259242340922356,
0.059077486395835876,
0.11543060839176178,
-0.016408614814281464,
-0.10383578389883041,
-0.29002612829208374,
-0.03304202854633331,
-0.3485181927680969,
-0.1282922774553299,
0.017810188233852386,
0.28176259994506836,
0.02422211319208145,
-0.08916869759559631,
-0.09192895144224167,
-0.1821969598531723,
-0.3775237202644348,
-0.12239140272140503,
-0.058647315949201584,
0.06040370836853981,
0.12339763343334198,
0.06840862333774567,
-0.0798550620675087,
-0.01260305754840374,
0.09295128285884857,
-0.014475284144282341,
-0.11950965225696564,
0.10464165359735489,
-0.34253033995628357,
-0.4163018763065338,
0.01288013905286789,
-0.13087359070777893,
0.1712133139371872,
0.18091097474098206,
-0.44474464654922485,
-0.08930827677249908,
-0.09724533557891846,
0.22131821513175964,
0.1259683221578598,
-0.057719744741916656,
0.397331178188324,
-0.0750039592385292,
0.09568260610103607,
-0.20019471645355225,
0.06647414714097977,
0.1885756403207779,
-0.1965492069721222,
0.42327725887298584,
0.19330523908138275,
0.046318139880895615,
0.2495150864124298,
0.774955689907074,
0.19415748119354248,
-0.016443241387605667,
0.3253079652786255,
0.014818867668509483,
0.37525954842567444,
-0.2945627272129059,
-0.22366484999656677,
-0.08012408018112183,
-0.007464215159416199,
-0.30875492095947266,
0.10171198844909668,
0.13860726356506348,
0.050580114126205444,
-0.04794209077954292,
-0.1327674239873886,
-0.1940523087978363,
-0.22187578678131104,
0.05196559429168701,
-0.25715744495391846,
0.25701040029525757,
0.07757136225700378,
0.19881410896778107,
0.05295076221227646,
-0.005156576633453369,
0.22571887075901031,
0.3883705735206604,
0.1383657157421112,
0.10292322188615799,
0.5466527938842773,
0.17314143478870392,
-0.43704742193222046,
0.22832301259040833,
0.06161883845925331,
-0.022303888574242592,
-0.08503659814596176,
0.021819986402988434,
0.017906837165355682,
0.09019415080547333,
0.6314966082572937,
-0.1058553084731102,
0.3006591200828552,
0.007307767868041992,
-0.1706923395395279,
-0.3264544904232025,
-0.24164332449436188,
0.11781790852546692,
0.12053286284208298,
0.12403815984725952,
0.4065397083759308,
-0.029310323297977448,
-0.034642092883586884,
-0.14510850608348846,
0.02937137335538864,
0.04641054570674896,
0.039839427918195724,
-0.13883554935455322,
-0.08303578943014145,
-0.1244216188788414,
-0.07882948219776154,
0.06008971482515335,
0.33085569739341736,
0.21185939013957977,
0.16870839893817902,
-0.1304844319820404,
-0.21517467498779297,
-0.21309682726860046,
-0.1879032403230667,
0.44741785526275635,
-0.30924415588378906,
0.03646267205476761,
-0.050898969173431396,
0.23113980889320374,
-0.06738778203725815,
0.2293650507926941,
0.027930375188589096,
0.20710667967796326,
0.2596464157104492,
0.16298116743564606,
-0.004124116152524948,
0.43218809366226196,
-0.5803085565567017,
-0.03544735163450241,
-0.2466513216495514,
-0.012571673840284348,
-0.030288245528936386,
0.23869535326957703,
0.024336200207471848,
-0.024325745180249214,
-0.11417458951473236,
-0.1800662875175476,
0.47059720754623413,
0.15140102803707123,
-0.29213860630989075,
0.12086248397827148,
0.3159663677215576,
-0.426974892616272,
0.6014062762260437,
0.03495066240429878,
0.5955954790115356,
-0.0356176383793354,
-0.013703035190701485,
0.4716082215309143,
-0.06386308372020721,
0.47037598490715027,
-0.6673383712768555,
0.1381755769252777,
-0.30575722455978394,
-0.373701810836792,
-0.0779193639755249,
-0.2806795537471771,
0.4340648651123047,
0.12644603848457336,
-0.08651676774024963,
0.3935551643371582,
0.11663852632045746,
0.7347551584243774,
-0.13008183240890503,
0.015001356601715088,
-0.2479383796453476,
-0.2355000376701355,
-0.06890225410461426,
0.09658580273389816,
-0.08376213908195496,
0.2511194348335266,
-0.08936919271945953,
-0.10213461518287659,
-0.22648605704307556,
-0.4035577178001404,
-0.27218443155288696,
0.1539131999015808,
-0.4660220146179199,
0.34101757407188416,
0.022381659597158432,
-0.42936861515045166,
-0.024655483663082123,
0.2404557466506958,
0.29191434383392334,
0.16909365355968475,
0.0361010804772377,
0.31027230620384216,
-0.04277864843606949,
0.03198693320155144,
0.06206751987338066,
-0.018151525408029556,
0.12723109126091003,
-0.06820037215948105,
0.27148711681365967,
-0.05676637962460518,
-0.39682862162590027,
-0.3666701912879944,
0.4705028533935547,
-0.09158972650766373,
0.017052235081791878,
-0.021876277402043343,
-0.034099142998456955,
0.03284618258476257,
0.13968759775161743,
-0.13362827897071838,
0.0892590880393982,
-0.18755458295345306,
-0.34628692269325256,
-0.05485500395298004,
-0.21636348962783813,
-0.25127094984054565,
-0.16440065205097198,
0.3434675633907318,
0.06460624188184738,
-0.4072079062461853,
0.419146865606308,
-0.04944963753223419,
-0.09760181605815887,
-0.14541664719581604,
0.024106457829475403,
0.34302401542663574,
-0.6278864741325378,
0.18551374971866608,
-0.23314791917800903,
-0.05127479135990143,
0.03233576565980911,
0.1230088546872139,
0.2508314251899719,
0.33298611640930176,
-0.31289899349212646,
-0.21972303092479706,
-0.24001175165176392,
0.0011409744620323181,
-0.38401368260383606,
0.13525213301181793,
-0.007179632782936096,
-0.19779983162879944,
-0.09917644411325455,
-0.2061876654624939,
-0.19782450795173645,
-0.0384785532951355,
-0.13896463811397552,
0.05526544153690338,
0.26938706636428833,
0.04341815039515495,
0.3185770809650421,
-0.026732325553894043,
0.06613552570343018,
0.291959673166275,
-0.12288124859333038,
-0.08110681921243668,
-0.013710767030715942,
0.15807005763053894,
0.11301542818546295,
0.044139884412288666,
-0.08940331637859344,
-0.14521139860153198,
-0.19585183262825012,
-0.17306120693683624,
0.2726389169692993,
0.196570485830307,
-0.06649453938007355,
-0.10057063400745392,
-0.06407657265663147,
0.2794664204120636,
-0.13953790068626404,
0.12695077061653137,
-0.3043757975101471,
0.27919429540634155,
0.11892739683389664,
0.16692763566970825,
-0.10126124322414398,
-0.04971899837255478,
-0.25533345341682434,
-0.019375350326299667,
-0.22898074984550476,
0.11446794122457504,
0.33728259801864624,
-0.2908507287502289,
-0.1173342615365982,
0.056593481451272964,
0.35326239466667175,
-0.5910862684249878,
-0.11291712522506714,
-0.27820491790771484,
0.367736279964447,
0.09861036390066147,
0.030255362391471863,
-0.0254112146794796,
0.17050139605998993,
0.005077984184026718,
0.010731339454650879,
0.4244230091571808,
0.5032703280448914,
-0.07396882772445679,
0.04486376419663429,
0.03892253339290619,
0.7015331983566284,
0.09826294332742691,
0.25131547451019287,
0.1679113358259201,
0.08746153116226196,
0.1622954159975052,
0.2970496714115143,
0.23910196125507355,
0.17892158031463623,
0.5682410597801208,
-0.5350272059440613,
0.3229006826877594,
0.061791978776454926,
-0.14783920347690582,
-0.12800288200378418,
-0.3782106637954712,
-0.20340509712696075,
-0.011047221720218658,
0.02187146246433258,
-0.059854552149772644,
-0.23178499937057495,
0.1564052402973175,
-0.21279463171958923,
-0.2685689926147461,
-0.21598055958747864,
0.2845417857170105,
-0.2501221001148224,
0.22261011600494385,
0.16174077987670898,
0.01434352993965149,
-0.33008551597595215,
0.05697430670261383,
-0.06062651425600052,
-0.1666920781135559,
0.31684011220932007,
0.1235746294260025,
-0.02500642091035843,
-0.020222846418619156,
0.2495778352022171,
0.18457916378974915,
0.09119100868701935,
-0.25766700506210327,
0.4046483337879181,
-0.13103674352169037,
0.06748861074447632,
0.12383024394512177,
-0.14274974167346954,
0.5129685997962952,
0.3324432075023651,
0.07663986086845398,
-0.2874990403652191,
-0.07159630209207535,
0.08049865067005157,
0.06866426020860672,
0.11315899342298508,
-0.29964110255241394,
0.33679381012916565,
0.3154517412185669,
0.062304168939590454,
-0.12134544551372528,
-0.033392466604709625,
0.09329238533973694,
0.6109013557434082,
-0.1470264345407486,
0.40032505989074707,
-0.2377098798751831,
0.016211748123168945,
-0.11371275782585144,
0.20003029704093933,
-0.4646041989326477,
-0.16233466565608978,
0.12810124456882477,
0.08775326609611511,
0.11399684101343155,
0.04347827285528183,
0.045265309512615204,
-0.014525008387863636,
0.35174664855003357,
0.2212168127298355,
0.12926001846790314,
-0.49895402789115906,
-0.30704355239868164,
-0.26862961053848267,
-0.06720496714115143,
0.12817543745040894,
0.017786093056201935,
-0.20995089411735535,
0.04071468859910965,
-0.11986297369003296,
0.07775413244962692,
0.41086554527282715,
0.47255396842956543,
0.14627668261528015,
0.20698216557502747,
-0.16021102666854858,
-0.13966014981269836,
-0.06432218104600906,
-0.24756111204624176,
0.08094091713428497,
-0.2669612169265747,
-0.0941377654671669,
0.18013742566108704,
0.04434046149253845,
0.07986989617347717,
-0.3412376940250397,
0.1462775021791458,
-0.4646894335746765,
0.3084302246570587,
-0.059219904243946075,
-0.05891876667737961,
0.15660065412521362,
-0.03667331859469414,
-0.3322887420654297,
-0.2650749683380127,
-0.18972425162792206,
-0.37876713275909424,
-0.182667076587677,
0.546645998954773,
-0.14915066957473755,
0.029505655169487,
-0.7052483558654785,
0.24284718930721283,
0.033698320388793945,
0.0017558671534061432,
-0.15828144550323486,
0.26703208684921265,
-0.5125076174736023,
0.3440490961074829,
0.169892355799675,
-0.07612163573503494,
0.07173512876033783,
0.4013013541698456,
-0.45383381843566895,
-0.3560096025466919,
0.5641089081764221,
-0.48129215836524963,
-0.1856788545846939,
0.19160278141498566,
0.3253058195114136,
0.3031291961669922,
-0.013270247727632523,
-0.4644266366958618,
-0.03284556418657303,
0.14135031402111053,
-0.012010578066110611,
-0.08629153668880463,
-0.23786863684654236,
-0.25940340757369995,
0.17916472256183624,
0.051505185663700104,
-0.11261515319347382,
-0.030215181410312653,
-0.06921571493148804,
0.10748843103647232,
-0.23977045714855194
] |
https://github.com/huggingface/datasets/issues/6146 | This issue can happen if there is a directory named "glue" relative to the Python script with the `load_dataset` call (similar issue to this one: https://github.com/huggingface/datasets/issues/5228). Is this the case? | DatasetGenerationError when load glue benchmark datasets from `load_dataset` | ### Describe the bug
Package version: datasets-2.14.4
When I run the codes:
```
from datasets import load_dataset
dataset = load_dataset("glue", "ax")
```
I got the following errors:
---------------------------------------------------------------------------
SchemaInferenceError Traceback (most recent call last)
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:1949, in ArrowBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, job_id)
1948 num_shards = shard_id + 1
-> 1949 num_examples, num_bytes = writer.finalize()
1950 writer.close()
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/arrow_writer.py:598, in ArrowWriter.finalize(self, close_stream)
597 self.stream.close()
--> 598 raise SchemaInferenceError("Please pass `features` or at least one example when writing data")
599 logger.debug(
600 f"Done writing {self._num_examples} {self.unit} in {self._num_bytes} bytes {self._path if self._path else ''}."
601 )
SchemaInferenceError: Please pass `features` or at least one example when writing data
The above exception was the direct cause of the following exception:
DatasetGenerationError Traceback (most recent call last)
Cell In[5], line 3
1 from datasets import load_dataset
----> 3 dataset = load_dataset("glue", "ax")
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/load.py:2136, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2133 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES
2135 # Download and prepare data
-> 2136 builder_instance.download_and_prepare(
2137 download_config=download_config,
2138 download_mode=download_mode,
2139 verification_mode=verification_mode,
2140 try_from_hf_gcs=try_from_hf_gcs,
2141 num_proc=num_proc,
2142 storage_options=storage_options,
2143 )
2145 # Build dataset for splits
2146 keep_in_memory = (
2147 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
2148 )
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:954, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs)
952 if num_proc is not None:
953 prepare_split_kwargs["num_proc"] = num_proc
--> 954 self._download_and_prepare(
955 dl_manager=dl_manager,
956 verification_mode=verification_mode,
957 **prepare_split_kwargs,
958 **download_and_prepare_kwargs,
959 )
960 # Sync info
961 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values())
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:1049, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs)
1045 split_dict.add(split_generator.split_info)
1047 try:
1048 # Prepare split will record examples associated to the split
-> 1049 self._prepare_split(split_generator, **prepare_split_kwargs)
1050 except OSError as e:
1051 raise OSError(
1052 "Cannot find data file. "
1053 + (self.manual_download_instructions or "")
1054 + "\nOriginal error:\n"
1055 + str(e)
1056 ) from None
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:1813, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, num_proc, max_shard_size)
1811 job_id = 0
1812 with pbar:
-> 1813 for job_id, done, content in self._prepare_split_single(
1814 gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args
1815 ):
1816 if done:
1817 result = content
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:1958, in ArrowBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, job_id)
1956 if isinstance(e, SchemaInferenceError) and e.__context__ is not None:
1957 e = e.__context__
-> 1958 raise DatasetGenerationError("An error occurred while generating the dataset") from e
1960 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths)
DatasetGenerationError: An error occurred while generating the dataset
### Steps to reproduce the bug
from datasets import load_dataset
dataset = load_dataset("glue", "ax")
### Expected behavior
When generating the train split:
Generating train split:
0/0 [00:00<?, ? examples/s]
It raise the error:
DatasetGenerationError: An error occurred while generating the dataset
### Environment info
datasets-2.14.4.
Python 3.10 | 30 | DatasetGenerationError when load glue benchmark datasets from `load_dataset`
### Describe the bug
Package version: datasets-2.14.4
When I run the codes:
```
from datasets import load_dataset
dataset = load_dataset("glue", "ax")
```
I got the following errors:
---------------------------------------------------------------------------
SchemaInferenceError Traceback (most recent call last)
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:1949, in ArrowBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, job_id)
1948 num_shards = shard_id + 1
-> 1949 num_examples, num_bytes = writer.finalize()
1950 writer.close()
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/arrow_writer.py:598, in ArrowWriter.finalize(self, close_stream)
597 self.stream.close()
--> 598 raise SchemaInferenceError("Please pass `features` or at least one example when writing data")
599 logger.debug(
600 f"Done writing {self._num_examples} {self.unit} in {self._num_bytes} bytes {self._path if self._path else ''}."
601 )
SchemaInferenceError: Please pass `features` or at least one example when writing data
The above exception was the direct cause of the following exception:
DatasetGenerationError Traceback (most recent call last)
Cell In[5], line 3
1 from datasets import load_dataset
----> 3 dataset = load_dataset("glue", "ax")
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/load.py:2136, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2133 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES
2135 # Download and prepare data
-> 2136 builder_instance.download_and_prepare(
2137 download_config=download_config,
2138 download_mode=download_mode,
2139 verification_mode=verification_mode,
2140 try_from_hf_gcs=try_from_hf_gcs,
2141 num_proc=num_proc,
2142 storage_options=storage_options,
2143 )
2145 # Build dataset for splits
2146 keep_in_memory = (
2147 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
2148 )
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:954, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs)
952 if num_proc is not None:
953 prepare_split_kwargs["num_proc"] = num_proc
--> 954 self._download_and_prepare(
955 dl_manager=dl_manager,
956 verification_mode=verification_mode,
957 **prepare_split_kwargs,
958 **download_and_prepare_kwargs,
959 )
960 # Sync info
961 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values())
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:1049, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs)
1045 split_dict.add(split_generator.split_info)
1047 try:
1048 # Prepare split will record examples associated to the split
-> 1049 self._prepare_split(split_generator, **prepare_split_kwargs)
1050 except OSError as e:
1051 raise OSError(
1052 "Cannot find data file. "
1053 + (self.manual_download_instructions or "")
1054 + "\nOriginal error:\n"
1055 + str(e)
1056 ) from None
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:1813, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, num_proc, max_shard_size)
1811 job_id = 0
1812 with pbar:
-> 1813 for job_id, done, content in self._prepare_split_single(
1814 gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args
1815 ):
1816 if done:
1817 result = content
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:1958, in ArrowBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, job_id)
1956 if isinstance(e, SchemaInferenceError) and e.__context__ is not None:
1957 e = e.__context__
-> 1958 raise DatasetGenerationError("An error occurred while generating the dataset") from e
1960 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths)
DatasetGenerationError: An error occurred while generating the dataset
### Steps to reproduce the bug
from datasets import load_dataset
dataset = load_dataset("glue", "ax")
### Expected behavior
When generating the train split:
Generating train split:
0/0 [00:00<?, ? examples/s]
It raise the error:
DatasetGenerationError: An error occurred while generating the dataset
### Environment info
datasets-2.14.4.
Python 3.10
This issue can happen if there is a directory named "glue" relative to the Python script with the `load_dataset` call (similar issue to this one: https://github.com/huggingface/datasets/issues/5228). Is this the case? | [
-0.4479908347129822,
0.22612975537776947,
0.0011700615286827087,
0.3219987452030182,
0.06884840130805969,
0.009246349334716797,
0.44559818506240845,
0.35875868797302246,
0.14821888506412506,
0.014389213174581528,
0.146055668592453,
0.375593364238739,
0.00011418573558330536,
0.0893615335226059,
-0.08637480437755585,
-0.19290557503700256,
-0.0072571709752082825,
0.18835729360580444,
-0.3637106418609619,
0.16056528687477112,
-0.3003990352153778,
0.16744551062583923,
-0.08598369359970093,
0.11664624512195587,
-0.39628687500953674,
-0.02631862461566925,
0.09880103170871735,
0.18662488460540771,
-0.1898719072341919,
-0.4778636395931244,
0.35306304693222046,
0.027694378048181534,
-0.0168362595140934,
0.24549901485443115,
-0.00011476344661787152,
0.09539289772510529,
0.42966529726982117,
-0.0772237777709961,
-0.25925412774086,
0.1538240611553192,
-0.2822575569152832,
-0.09624551236629486,
0.06563005596399307,
-0.02381354570388794,
0.06263667345046997,
-0.1998051106929779,
-0.15373724699020386,
-0.5163608193397522,
0.2150859534740448,
0.2315715104341507,
0.17117814719676971,
0.31829360127449036,
0.2491058111190796,
-0.1766694337129593,
0.3897068202495575,
-0.07873393595218658,
-0.32918328046798706,
0.346179723739624,
-0.012309841811656952,
-0.056022655218839645,
-0.2977263331413269,
0.394379585981369,
0.034509219229221344,
0.3605239689350128,
0.3614002764225006,
-0.15711963176727295,
0.0785994753241539,
-0.1163402795791626,
-0.02385025843977928,
0.19902434945106506,
0.25981420278549194,
-0.36820879578590393,
-0.5441701412200928,
-0.15127894282341003,
-0.04048427194356918,
-0.15243947505950928,
0.2760210335254669,
0.05322778970003128,
-0.19150418043136597,
0.15319690108299255,
0.04967673495411873,
-0.3192853629589081,
-0.13081395626068115,
-0.10383947193622589,
0.09346751868724823,
-0.0005460083484649658,
-0.18347005546092987,
0.20379389822483063,
0.323273628950119,
-0.08459745347499847,
0.2278466522693634,
-0.06633405387401581,
-0.2749120593070984,
0.12253586202859879,
-0.5079042911529541,
0.04524446278810501,
-0.14277158677577972,
0.018682073801755905,
0.20371666550636292,
0.19795259833335876,
0.08757321536540985,
0.007794508710503578,
0.21334302425384521,
0.2396908402442932,
0.14215222001075745,
0.08418382704257965,
0.506811797618866,
0.027058452367782593,
0.14145785570144653,
-0.09195861220359802,
0.09608529508113861,
-0.04317944124341011,
-0.04394642636179924,
-0.22437100112438202,
0.1873144805431366,
0.058539099991321564,
0.4360276758670807,
-0.1553870588541031,
-0.29880088567733765,
0.07634719461202621,
-0.14131028950214386,
0.046759217977523804,
-0.06779146939516068,
0.1777915060520172,
0.21614669263362885,
-0.02348759025335312,
-0.030413508415222168,
0.3320486545562744,
-0.133779376745224,
-0.3856510818004608,
-0.19637054204940796,
0.035742416977882385,
-0.11761364340782166,
0.10225491970777512,
0.21585765480995178,
-0.24411912262439728,
0.12302500754594803,
0.08217157423496246,
-0.3311038315296173,
-0.05369962379336357,
0.4551931321620941,
-0.1856309026479721,
-0.03868716210126877,
0.35533657670021057,
0.04527878016233444,
0.2248726785182953,
0.16793608665466309,
-0.08000924438238144,
-0.055317968130111694,
-0.02476491406559944,
-0.08698630332946777,
-0.2622528672218323,
-0.18820740282535553,
0.19455425441265106,
-0.25437912344932556,
0.1987857222557068,
-0.42401015758514404,
-0.14691373705863953,
0.216781347990036,
-0.10143642872571945,
-0.004827830940485001,
-0.06555940210819244,
-0.2968958616256714,
-0.26883459091186523,
0.12184852361679077,
0.3561047911643982,
-0.3930172920227051,
-0.04828055575489998,
-0.313174843788147,
-0.17346711456775665,
-0.033066440373659134,
0.20541229844093323,
-0.09842845797538757,
0.1495586335659027,
-0.21757914125919342,
0.3061450123786926,
0.36392971873283386,
-0.5231069326400757,
-0.5730438232421875,
0.3855648934841156,
-0.1593029499053955,
-0.010300301015377045,
0.12822884321212769,
-0.06231212615966797,
0.36225253343582153,
-0.012814383953809738,
-0.055924687534570694,
0.3357779383659363,
0.035956114530563354,
0.038303397595882416,
-0.14732979238033295,
-0.24156200885772705,
0.1722729504108429,
0.06668735295534134,
-0.037446897476911545,
-0.048026956617832184,
0.21300804615020752,
-0.1786891669034958,
0.058176204562187195,
-0.08141738176345825,
0.17331832647323608,
0.3030604124069214,
0.15886706113815308,
-0.26354169845581055,
0.009408246725797653,
-0.153005450963974,
-0.6145698428153992,
0.2732164263725281,
0.034216172993183136,
-0.09955407679080963,
-0.19599351286888123,
-0.10884804278612137,
-0.26546886563301086,
0.20153948664665222,
-0.3710210919380188,
-0.013758167624473572,
0.12184295058250427,
0.014520443975925446,
-0.02526583895087242,
-0.08807362616062164,
0.08729429543018341,
0.6053466796875,
-0.24740874767303467,
0.27354100346565247,
-0.28039729595184326,
0.36257272958755493,
0.07018566131591797,
-0.41215673089027405,
0.09474356472492218,
0.0009222719818353653,
0.1574050486087799,
-0.1793942153453827,
-0.206064373254776,
0.6047256588935852,
0.22575056552886963,
0.31183701753616333,
-0.08703572303056717,
-0.18904760479927063,
0.10107157379388809,
-0.398569792509079,
0.20461763441562653,
-0.02818901091814041,
0.09036904573440552,
-0.12660656869411469,
-0.12702012062072754,
0.21355177462100983,
0.07456965744495392,
0.37637701630592346,
0.11320271342992783,
0.19657588005065918,
-0.07643632590770721,
0.03826438635587692,
-0.1347164511680603,
-0.24377557635307312,
-0.03088318556547165,
-0.04988124594092369,
0.4402064383029938,
0.04727127403020859,
0.1410493105649948,
0.036571744829416275,
0.3621235191822052,
0.16493543982505798,
0.2915303707122803,
-0.08003990352153778,
-0.29821085929870605,
-0.06648954749107361,
0.45300787687301636,
0.6298960447311401,
0.6175395250320435,
0.09305159747600555,
0.027075625956058502,
-0.017591996118426323,
-0.1317286640405655,
0.06791138648986816,
0.14579668641090393,
-0.0826592966914177,
0.27669456601142883,
0.13827522099018097,
-0.008569072932004929,
-0.031515832990407944,
-0.3399559259414673,
-0.09045359492301941,
0.08382932096719742,
0.1372213065624237,
-0.5023995041847229,
-0.1614225208759308,
-0.2535151541233063,
0.041572436690330505,
-0.07483462989330292,
0.0026595070958137512,
-0.15142908692359924,
-0.3764955997467041,
-0.22758181393146515,
0.1417483240365982,
-0.03845105692744255,
0.2122184783220291,
-0.06383714079856873,
-0.08390238881111145,
0.09689436107873917,
-0.018071383237838745,
-0.05187452211976051,
-0.1341971755027771,
0.034447506070137024,
0.009552571922540665,
0.06670926511287689,
0.5764733552932739,
0.38874661922454834,
0.013193346560001373,
0.27482712268829346,
-0.4625704288482666,
-0.05586738884449005,
0.084530308842659,
-0.2131837159395218,
0.4973021447658539,
0.4481350779533386,
0.1971578598022461,
0.13164354860782623,
-0.46293848752975464,
0.18447326123714447,
-0.14794613420963287,
-0.28263160586357117,
0.09588181972503662,
0.08316542208194733,
0.1722375750541687,
-0.11129308491945267,
-0.2325248420238495,
-0.19562530517578125,
-0.506851315498352,
0.23097603023052216,
-0.020992890000343323,
0.16592305898666382,
-0.02204614318907261,
0.08108281344175339,
0.3810330629348755,
-0.0059692151844501495,
-0.08235648274421692,
-0.08174526691436768,
0.1883680820465088,
0.08893798291683197,
-0.28200164437294006,
-0.17555280029773712,
-0.01360803097486496,
0.06565836071968079,
0.34148839116096497,
0.2523958384990692,
-0.2503146529197693,
-0.054167717695236206,
-0.36401596665382385,
0.2152390480041504,
-0.10251350700855255,
-0.0024554822593927383,
0.316081166267395,
0.24492518603801727,
0.01301266998052597,
-0.25259846448898315,
-0.10513433068990707,
0.27785295248031616,
-0.17592710256576538,
-0.08104681968688965,
-0.027188485488295555,
0.4478999972343445,
-0.01952952891588211,
0.5902737379074097,
0.18309296667575836,
-0.10004198551177979,
0.3298817574977875,
-0.102723628282547,
0.29950645565986633,
-0.1138637512922287,
-0.27312999963760376,
-0.11747248470783234,
-0.18708674609661102,
0.25735440850257874,
-0.30626094341278076,
-0.018652651458978653,
-0.08544336259365082,
0.05545990914106369,
-0.16277673840522766,
-0.012106060981750488,
-0.27035313844680786,
-0.12958060204982758,
-0.366150438785553,
0.1490018367767334,
-0.13993136584758759,
0.004404209554195404,
-0.04457015544176102,
0.11352081596851349,
0.059524428099393845,
0.09665977209806442,
0.055662769824266434,
-0.04663528874516487,
-0.5541669726371765,
0.11564067006111145,
-0.1788301169872284,
0.2540341913700104,
0.023115400224924088,
0.49492499232292175,
-0.08932311087846756,
-0.079623281955719,
-0.033399321138858795,
-0.03338400274515152,
0.3082805573940277,
-0.6231419444084167,
0.11598028987646103,
0.15686795115470886,
0.19278201460838318,
-0.7537785768508911,
-0.06549997627735138,
-0.11833232641220093,
0.42159271240234375,
0.17863601446151733,
0.2589929401874542,
-0.2315576672554016,
-0.23842373490333557,
0.35111743211746216,
0.021328993141651154,
0.0715985968708992,
-0.11510695517063141,
-0.1804083287715912,
-0.09751411527395248,
-0.27880823612213135,
0.0747244730591774,
0.09640765190124512,
-0.0003879554569721222,
-0.023452986031770706,
-0.15050384402275085,
-0.36652153730392456,
-0.2760002315044403,
-0.026003453880548477,
0.1123022735118866,
0.3104591965675354,
-0.22307318449020386,
0.29673436284065247,
0.1722050905227661,
0.02440062165260315,
0.18271148204803467,
0.45686811208724976,
-0.05124705284833908,
-0.108069509267807,
0.08285526186227798,
-0.21481338143348694,
0.42739152908325195,
0.22175408899784088,
-0.24697411060333252,
0.10396881401538849,
-0.26641207933425903,
-0.1401318609714508,
-0.14540734887123108,
0.06623770296573639,
0.19616469740867615,
-0.011945318430662155,
-0.033172979950904846,
-0.10279972851276398,
0.5983672738075256,
0.22709667682647705,
-0.1068585067987442,
0.4831799268722534,
0.3850306570529938,
-0.36633092164993286,
0.3644810914993286,
-0.0370691679418087,
0.6164374947547913,
0.10429040342569351,
-0.1857309490442276,
0.20420578122138977,
-0.18767791986465454,
0.25895988941192627,
0.10125310719013214,
-0.1500188410282135,
-0.3026089072227478,
-0.5035521388053894,
-0.055079612880945206,
-0.16932393610477448,
0.48339447379112244,
0.151047483086586,
-0.4745141267776489,
0.20770488679409027,
-0.12427923083305359,
-0.062404848635196686,
-0.06178412586450577,
0.3521120250225067,
-0.523514986038208,
-0.2080734819173813,
-0.20118047297000885,
0.12344559282064438,
0.09135191142559052,
0.02026095800101757,
0.10901808738708496,
-0.08840057253837585,
-0.01293228566646576,
-0.4066101312637329,
-0.3635435104370117,
0.10917287319898605,
-0.5800636410713196,
0.19798320531845093,
0.07282011210918427,
-0.07273343950510025,
0.20932736992835999,
0.02447364293038845,
0.14645910263061523,
0.07146033644676208,
-0.11015580594539642,
0.09839650988578796,
0.18498723208904266,
-0.054627642035484314,
0.18010270595550537,
-0.11149580776691437,
0.1640620231628418,
-0.044159289449453354,
-0.1614506095647812,
0.0042397696524858475,
-0.29931434988975525,
-0.31139639019966125,
0.3200903832912445,
-0.05144491046667099,
-0.23408275842666626,
-0.34402531385421753,
-0.2259417474269867,
-0.1545361578464508,
-0.10067733377218246,
-0.204569473862648,
0.12513010203838348,
0.019551876932382584,
-0.06997188180685043,
0.10175986588001251,
-0.01925126649439335,
-0.25736385583877563,
0.0673341229557991,
0.48223817348480225,
0.016954150050878525,
0.17774085700511932,
0.457553505897522,
0.024380020797252655,
-0.0610739141702652,
-0.3064919114112854,
-0.0127495676279068,
0.6273877620697021,
-0.6134925484657288,
0.14611774682998657,
-0.37242424488067627,
-0.08973118662834167,
0.169168621301651,
0.13910822570323944,
0.22830083966255188,
0.1461222767829895,
-0.22683577239513397,
-0.30071234703063965,
-0.16666904091835022,
0.37646394968032837,
-0.15603533387184143,
0.3134033977985382,
-0.3363625407218933,
-0.19906748831272125,
-0.0883597657084465,
0.2563268542289734,
-0.2794307470321655,
0.18160094320774078,
-0.05657961964607239,
0.0534510463476181,
0.4790695309638977,
-0.04648671671748161,
0.06819342076778412,
-0.1396261602640152,
0.10618001222610474,
0.19096235930919647,
-0.25647327303886414,
-0.15514960885047913,
-0.15222501754760742,
0.08124584704637527,
-0.13270708918571472,
0.010067522525787354,
0.02897939458489418,
-0.03888583928346634,
-0.1391759216785431,
-0.03149789199233055,
0.3678252696990967,
-0.0944623127579689,
-0.24207663536071777,
0.23072747886180878,
0.2679206132888794,
0.15570831298828125,
-0.18394625186920166,
0.17483948171138763,
-0.2165852189064026,
0.0283889751881361,
-0.17922234535217285,
0.24705655872821808,
-0.007129833102226257,
-0.03851483762264252,
-0.15370357036590576,
0.050532639026641846,
-0.07801265269517899,
0.015336645767092705,
0.20135217905044556,
-0.2303571254014969,
-0.10742835700511932,
-0.01421305164694786,
0.39356082677841187,
0.2777755558490753,
-0.25205397605895996,
-0.10409314930438995,
-0.22355791926383972,
0.26293855905532837,
-0.1496121883392334,
-0.2773717939853668,
0.3417595326900482,
-0.09226532280445099,
0.15921634435653687,
0.2118307203054428,
0.41083627939224243,
0.043679237365722656,
0.08115005493164062,
0.10098205506801605,
0.21774381399154663,
-0.011351373046636581,
0.18168336153030396,
0.46085599064826965,
-0.1382342278957367,
-0.049713384360075,
0.3107075095176697,
-0.027122439816594124,
0.38876068592071533,
0.22160783410072327,
-0.06323330104351044,
0.4822516143321991,
0.29587143659591675,
0.1929512768983841,
0.12486174702644348,
-0.3575897812843323,
0.14921146631240845,
0.21874989569187164,
-0.1658269166946411,
0.06475657224655151,
0.07885676622390747,
0.6511017680168152,
-0.2109883427619934,
-0.22016111016273499,
-0.22487369179725647,
0.022541796788573265,
-0.10841076076030731,
-0.2425408661365509,
0.24780696630477905,
-0.049851201474666595,
-0.5171486139297485,
-0.15458711981773376,
-0.11014952510595322,
-0.10081876069307327,
0.429863840341568,
-0.03911523520946503,
0.1153499037027359,
-0.2397981584072113,
0.17388379573822021,
0.10450495034456253,
0.08037171512842178,
-0.36799952387809753,
0.2427854835987091,
-0.12968480587005615,
0.018443139269948006,
-0.030476758256554604,
0.3695043921470642,
0.5041925311088562,
0.26813191175460815,
-0.10739290714263916,
0.02016691491007805,
-0.014308275654911995,
-0.09784646332263947,
0.11941465735435486,
0.20030184090137482,
-0.11085008829832077,
0.1321009397506714,
0.37904608249664307,
0.20164722204208374,
-0.12139931321144104,
-0.1000041514635086,
0.030362535268068314,
0.17235860228538513,
-0.3149377703666687,
0.3444533050060272,
-0.3634791076183319,
-0.23907509446144104,
-0.04014524072408676,
0.10242277383804321,
-0.17967306077480316,
-0.12761220335960388,
0.6404633522033691,
-0.1739416867494583,
-0.021529927849769592,
-0.2209109663963318,
0.07956825196743011,
-0.2049466371536255,
0.6682415008544922,
0.20693960785865784,
0.1568141132593155,
-0.2052822709083557,
-0.2378506064414978,
-0.5712839365005493,
-0.0497576966881752,
-0.2802777588367462,
0.006994083523750305,
0.30415910482406616,
0.28169798851013184,
-0.043766409158706665,
0.2822384834289551,
0.2108829915523529,
0.25022292137145996,
-0.19874587655067444,
0.0027194954454898834,
-0.37224939465522766,
0.005723739042878151,
0.14481927454471588,
-0.21810150146484375,
0.028685100376605988,
-0.7155145406723022,
0.15307354927062988,
0.23879818618297577,
0.026484891772270203,
-0.00475732795894146,
-0.31792211532592773,
0.38677704334259033,
-0.2742782235145569,
0.5150883197784424,
-0.015198085457086563,
0.5163146257400513,
0.13180477917194366,
-0.15809059143066406,
-0.3756846785545349,
-0.4001162350177765,
-0.15818551182746887,
0.11488136649131775,
0.09141696989536285,
0.5396209359169006,
0.00979846715927124,
0.12689602375030518,
-0.252877801656723,
0.3277635872364044,
0.06747996807098389,
0.10562525689601898,
-0.2344699203968048,
0.2757199704647064,
-0.19434243440628052,
0.058766771107912064,
0.0052521564066410065,
-0.09007993340492249,
-0.040281448513269424,
0.23209336400032043,
-0.11329284310340881,
-0.3905448615550995,
0.30657315254211426,
-0.07783406972885132,
-0.051447704434394836,
0.03715905547142029,
0.35926228761672974,
0.403256893157959,
-0.2673914134502411,
-0.6860737800598145,
-0.19841618835926056,
0.3664683997631073,
-0.06045250594615936,
-0.18126484751701355,
0.16638696193695068,
0.20469732582569122,
0.05141855776309967,
0.0071809664368629456,
0.16236275434494019,
-0.1423059105873108,
-0.1705998182296753,
0.1261749118566513,
-0.25732043385505676
] |
https://github.com/huggingface/datasets/issues/6146 | > This issue can happen if there is a directory named "glue" relative to the Python script with the `load_dataset` call (similar issue to this one: #5228). Is this the case?
Thats correct!
Sorry for my late response. | DatasetGenerationError when load glue benchmark datasets from `load_dataset` | ### Describe the bug
Package version: datasets-2.14.4
When I run the codes:
```
from datasets import load_dataset
dataset = load_dataset("glue", "ax")
```
I got the following errors:
---------------------------------------------------------------------------
SchemaInferenceError Traceback (most recent call last)
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:1949, in ArrowBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, job_id)
1948 num_shards = shard_id + 1
-> 1949 num_examples, num_bytes = writer.finalize()
1950 writer.close()
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/arrow_writer.py:598, in ArrowWriter.finalize(self, close_stream)
597 self.stream.close()
--> 598 raise SchemaInferenceError("Please pass `features` or at least one example when writing data")
599 logger.debug(
600 f"Done writing {self._num_examples} {self.unit} in {self._num_bytes} bytes {self._path if self._path else ''}."
601 )
SchemaInferenceError: Please pass `features` or at least one example when writing data
The above exception was the direct cause of the following exception:
DatasetGenerationError Traceback (most recent call last)
Cell In[5], line 3
1 from datasets import load_dataset
----> 3 dataset = load_dataset("glue", "ax")
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/load.py:2136, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2133 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES
2135 # Download and prepare data
-> 2136 builder_instance.download_and_prepare(
2137 download_config=download_config,
2138 download_mode=download_mode,
2139 verification_mode=verification_mode,
2140 try_from_hf_gcs=try_from_hf_gcs,
2141 num_proc=num_proc,
2142 storage_options=storage_options,
2143 )
2145 # Build dataset for splits
2146 keep_in_memory = (
2147 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
2148 )
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:954, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs)
952 if num_proc is not None:
953 prepare_split_kwargs["num_proc"] = num_proc
--> 954 self._download_and_prepare(
955 dl_manager=dl_manager,
956 verification_mode=verification_mode,
957 **prepare_split_kwargs,
958 **download_and_prepare_kwargs,
959 )
960 # Sync info
961 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values())
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:1049, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs)
1045 split_dict.add(split_generator.split_info)
1047 try:
1048 # Prepare split will record examples associated to the split
-> 1049 self._prepare_split(split_generator, **prepare_split_kwargs)
1050 except OSError as e:
1051 raise OSError(
1052 "Cannot find data file. "
1053 + (self.manual_download_instructions or "")
1054 + "\nOriginal error:\n"
1055 + str(e)
1056 ) from None
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:1813, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, num_proc, max_shard_size)
1811 job_id = 0
1812 with pbar:
-> 1813 for job_id, done, content in self._prepare_split_single(
1814 gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args
1815 ):
1816 if done:
1817 result = content
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:1958, in ArrowBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, job_id)
1956 if isinstance(e, SchemaInferenceError) and e.__context__ is not None:
1957 e = e.__context__
-> 1958 raise DatasetGenerationError("An error occurred while generating the dataset") from e
1960 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths)
DatasetGenerationError: An error occurred while generating the dataset
### Steps to reproduce the bug
from datasets import load_dataset
dataset = load_dataset("glue", "ax")
### Expected behavior
When generating the train split:
Generating train split:
0/0 [00:00<?, ? examples/s]
It raise the error:
DatasetGenerationError: An error occurred while generating the dataset
### Environment info
datasets-2.14.4.
Python 3.10 | 38 | DatasetGenerationError when load glue benchmark datasets from `load_dataset`
### Describe the bug
Package version: datasets-2.14.4
When I run the codes:
```
from datasets import load_dataset
dataset = load_dataset("glue", "ax")
```
I got the following errors:
---------------------------------------------------------------------------
SchemaInferenceError Traceback (most recent call last)
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:1949, in ArrowBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, job_id)
1948 num_shards = shard_id + 1
-> 1949 num_examples, num_bytes = writer.finalize()
1950 writer.close()
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/arrow_writer.py:598, in ArrowWriter.finalize(self, close_stream)
597 self.stream.close()
--> 598 raise SchemaInferenceError("Please pass `features` or at least one example when writing data")
599 logger.debug(
600 f"Done writing {self._num_examples} {self.unit} in {self._num_bytes} bytes {self._path if self._path else ''}."
601 )
SchemaInferenceError: Please pass `features` or at least one example when writing data
The above exception was the direct cause of the following exception:
DatasetGenerationError Traceback (most recent call last)
Cell In[5], line 3
1 from datasets import load_dataset
----> 3 dataset = load_dataset("glue", "ax")
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/load.py:2136, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2133 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES
2135 # Download and prepare data
-> 2136 builder_instance.download_and_prepare(
2137 download_config=download_config,
2138 download_mode=download_mode,
2139 verification_mode=verification_mode,
2140 try_from_hf_gcs=try_from_hf_gcs,
2141 num_proc=num_proc,
2142 storage_options=storage_options,
2143 )
2145 # Build dataset for splits
2146 keep_in_memory = (
2147 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
2148 )
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:954, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs)
952 if num_proc is not None:
953 prepare_split_kwargs["num_proc"] = num_proc
--> 954 self._download_and_prepare(
955 dl_manager=dl_manager,
956 verification_mode=verification_mode,
957 **prepare_split_kwargs,
958 **download_and_prepare_kwargs,
959 )
960 # Sync info
961 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values())
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:1049, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs)
1045 split_dict.add(split_generator.split_info)
1047 try:
1048 # Prepare split will record examples associated to the split
-> 1049 self._prepare_split(split_generator, **prepare_split_kwargs)
1050 except OSError as e:
1051 raise OSError(
1052 "Cannot find data file. "
1053 + (self.manual_download_instructions or "")
1054 + "\nOriginal error:\n"
1055 + str(e)
1056 ) from None
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:1813, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, num_proc, max_shard_size)
1811 job_id = 0
1812 with pbar:
-> 1813 for job_id, done, content in self._prepare_split_single(
1814 gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args
1815 ):
1816 if done:
1817 result = content
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:1958, in ArrowBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, job_id)
1956 if isinstance(e, SchemaInferenceError) and e.__context__ is not None:
1957 e = e.__context__
-> 1958 raise DatasetGenerationError("An error occurred while generating the dataset") from e
1960 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths)
DatasetGenerationError: An error occurred while generating the dataset
### Steps to reproduce the bug
from datasets import load_dataset
dataset = load_dataset("glue", "ax")
### Expected behavior
When generating the train split:
Generating train split:
0/0 [00:00<?, ? examples/s]
It raise the error:
DatasetGenerationError: An error occurred while generating the dataset
### Environment info
datasets-2.14.4.
Python 3.10
> This issue can happen if there is a directory named "glue" relative to the Python script with the `load_dataset` call (similar issue to this one: #5228). Is this the case?
Thats correct!
Sorry for my late response. | [
-0.4479908347129822,
0.22612975537776947,
0.0011700615286827087,
0.3219987452030182,
0.06884840130805969,
0.009246349334716797,
0.44559818506240845,
0.35875868797302246,
0.14821888506412506,
0.014389213174581528,
0.146055668592453,
0.375593364238739,
0.00011418573558330536,
0.0893615335226059,
-0.08637480437755585,
-0.19290557503700256,
-0.0072571709752082825,
0.18835729360580444,
-0.3637106418609619,
0.16056528687477112,
-0.3003990352153778,
0.16744551062583923,
-0.08598369359970093,
0.11664624512195587,
-0.39628687500953674,
-0.02631862461566925,
0.09880103170871735,
0.18662488460540771,
-0.1898719072341919,
-0.4778636395931244,
0.35306304693222046,
0.027694378048181534,
-0.0168362595140934,
0.24549901485443115,
-0.00011476344661787152,
0.09539289772510529,
0.42966529726982117,
-0.0772237777709961,
-0.25925412774086,
0.1538240611553192,
-0.2822575569152832,
-0.09624551236629486,
0.06563005596399307,
-0.02381354570388794,
0.06263667345046997,
-0.1998051106929779,
-0.15373724699020386,
-0.5163608193397522,
0.2150859534740448,
0.2315715104341507,
0.17117814719676971,
0.31829360127449036,
0.2491058111190796,
-0.1766694337129593,
0.3897068202495575,
-0.07873393595218658,
-0.32918328046798706,
0.346179723739624,
-0.012309841811656952,
-0.056022655218839645,
-0.2977263331413269,
0.394379585981369,
0.034509219229221344,
0.3605239689350128,
0.3614002764225006,
-0.15711963176727295,
0.0785994753241539,
-0.1163402795791626,
-0.02385025843977928,
0.19902434945106506,
0.25981420278549194,
-0.36820879578590393,
-0.5441701412200928,
-0.15127894282341003,
-0.04048427194356918,
-0.15243947505950928,
0.2760210335254669,
0.05322778970003128,
-0.19150418043136597,
0.15319690108299255,
0.04967673495411873,
-0.3192853629589081,
-0.13081395626068115,
-0.10383947193622589,
0.09346751868724823,
-0.0005460083484649658,
-0.18347005546092987,
0.20379389822483063,
0.323273628950119,
-0.08459745347499847,
0.2278466522693634,
-0.06633405387401581,
-0.2749120593070984,
0.12253586202859879,
-0.5079042911529541,
0.04524446278810501,
-0.14277158677577972,
0.018682073801755905,
0.20371666550636292,
0.19795259833335876,
0.08757321536540985,
0.007794508710503578,
0.21334302425384521,
0.2396908402442932,
0.14215222001075745,
0.08418382704257965,
0.506811797618866,
0.027058452367782593,
0.14145785570144653,
-0.09195861220359802,
0.09608529508113861,
-0.04317944124341011,
-0.04394642636179924,
-0.22437100112438202,
0.1873144805431366,
0.058539099991321564,
0.4360276758670807,
-0.1553870588541031,
-0.29880088567733765,
0.07634719461202621,
-0.14131028950214386,
0.046759217977523804,
-0.06779146939516068,
0.1777915060520172,
0.21614669263362885,
-0.02348759025335312,
-0.030413508415222168,
0.3320486545562744,
-0.133779376745224,
-0.3856510818004608,
-0.19637054204940796,
0.035742416977882385,
-0.11761364340782166,
0.10225491970777512,
0.21585765480995178,
-0.24411912262439728,
0.12302500754594803,
0.08217157423496246,
-0.3311038315296173,
-0.05369962379336357,
0.4551931321620941,
-0.1856309026479721,
-0.03868716210126877,
0.35533657670021057,
0.04527878016233444,
0.2248726785182953,
0.16793608665466309,
-0.08000924438238144,
-0.055317968130111694,
-0.02476491406559944,
-0.08698630332946777,
-0.2622528672218323,
-0.18820740282535553,
0.19455425441265106,
-0.25437912344932556,
0.1987857222557068,
-0.42401015758514404,
-0.14691373705863953,
0.216781347990036,
-0.10143642872571945,
-0.004827830940485001,
-0.06555940210819244,
-0.2968958616256714,
-0.26883459091186523,
0.12184852361679077,
0.3561047911643982,
-0.3930172920227051,
-0.04828055575489998,
-0.313174843788147,
-0.17346711456775665,
-0.033066440373659134,
0.20541229844093323,
-0.09842845797538757,
0.1495586335659027,
-0.21757914125919342,
0.3061450123786926,
0.36392971873283386,
-0.5231069326400757,
-0.5730438232421875,
0.3855648934841156,
-0.1593029499053955,
-0.010300301015377045,
0.12822884321212769,
-0.06231212615966797,
0.36225253343582153,
-0.012814383953809738,
-0.055924687534570694,
0.3357779383659363,
0.035956114530563354,
0.038303397595882416,
-0.14732979238033295,
-0.24156200885772705,
0.1722729504108429,
0.06668735295534134,
-0.037446897476911545,
-0.048026956617832184,
0.21300804615020752,
-0.1786891669034958,
0.058176204562187195,
-0.08141738176345825,
0.17331832647323608,
0.3030604124069214,
0.15886706113815308,
-0.26354169845581055,
0.009408246725797653,
-0.153005450963974,
-0.6145698428153992,
0.2732164263725281,
0.034216172993183136,
-0.09955407679080963,
-0.19599351286888123,
-0.10884804278612137,
-0.26546886563301086,
0.20153948664665222,
-0.3710210919380188,
-0.013758167624473572,
0.12184295058250427,
0.014520443975925446,
-0.02526583895087242,
-0.08807362616062164,
0.08729429543018341,
0.6053466796875,
-0.24740874767303467,
0.27354100346565247,
-0.28039729595184326,
0.36257272958755493,
0.07018566131591797,
-0.41215673089027405,
0.09474356472492218,
0.0009222719818353653,
0.1574050486087799,
-0.1793942153453827,
-0.206064373254776,
0.6047256588935852,
0.22575056552886963,
0.31183701753616333,
-0.08703572303056717,
-0.18904760479927063,
0.10107157379388809,
-0.398569792509079,
0.20461763441562653,
-0.02818901091814041,
0.09036904573440552,
-0.12660656869411469,
-0.12702012062072754,
0.21355177462100983,
0.07456965744495392,
0.37637701630592346,
0.11320271342992783,
0.19657588005065918,
-0.07643632590770721,
0.03826438635587692,
-0.1347164511680603,
-0.24377557635307312,
-0.03088318556547165,
-0.04988124594092369,
0.4402064383029938,
0.04727127403020859,
0.1410493105649948,
0.036571744829416275,
0.3621235191822052,
0.16493543982505798,
0.2915303707122803,
-0.08003990352153778,
-0.29821085929870605,
-0.06648954749107361,
0.45300787687301636,
0.6298960447311401,
0.6175395250320435,
0.09305159747600555,
0.027075625956058502,
-0.017591996118426323,
-0.1317286640405655,
0.06791138648986816,
0.14579668641090393,
-0.0826592966914177,
0.27669456601142883,
0.13827522099018097,
-0.008569072932004929,
-0.031515832990407944,
-0.3399559259414673,
-0.09045359492301941,
0.08382932096719742,
0.1372213065624237,
-0.5023995041847229,
-0.1614225208759308,
-0.2535151541233063,
0.041572436690330505,
-0.07483462989330292,
0.0026595070958137512,
-0.15142908692359924,
-0.3764955997467041,
-0.22758181393146515,
0.1417483240365982,
-0.03845105692744255,
0.2122184783220291,
-0.06383714079856873,
-0.08390238881111145,
0.09689436107873917,
-0.018071383237838745,
-0.05187452211976051,
-0.1341971755027771,
0.034447506070137024,
0.009552571922540665,
0.06670926511287689,
0.5764733552932739,
0.38874661922454834,
0.013193346560001373,
0.27482712268829346,
-0.4625704288482666,
-0.05586738884449005,
0.084530308842659,
-0.2131837159395218,
0.4973021447658539,
0.4481350779533386,
0.1971578598022461,
0.13164354860782623,
-0.46293848752975464,
0.18447326123714447,
-0.14794613420963287,
-0.28263160586357117,
0.09588181972503662,
0.08316542208194733,
0.1722375750541687,
-0.11129308491945267,
-0.2325248420238495,
-0.19562530517578125,
-0.506851315498352,
0.23097603023052216,
-0.020992890000343323,
0.16592305898666382,
-0.02204614318907261,
0.08108281344175339,
0.3810330629348755,
-0.0059692151844501495,
-0.08235648274421692,
-0.08174526691436768,
0.1883680820465088,
0.08893798291683197,
-0.28200164437294006,
-0.17555280029773712,
-0.01360803097486496,
0.06565836071968079,
0.34148839116096497,
0.2523958384990692,
-0.2503146529197693,
-0.054167717695236206,
-0.36401596665382385,
0.2152390480041504,
-0.10251350700855255,
-0.0024554822593927383,
0.316081166267395,
0.24492518603801727,
0.01301266998052597,
-0.25259846448898315,
-0.10513433068990707,
0.27785295248031616,
-0.17592710256576538,
-0.08104681968688965,
-0.027188485488295555,
0.4478999972343445,
-0.01952952891588211,
0.5902737379074097,
0.18309296667575836,
-0.10004198551177979,
0.3298817574977875,
-0.102723628282547,
0.29950645565986633,
-0.1138637512922287,
-0.27312999963760376,
-0.11747248470783234,
-0.18708674609661102,
0.25735440850257874,
-0.30626094341278076,
-0.018652651458978653,
-0.08544336259365082,
0.05545990914106369,
-0.16277673840522766,
-0.012106060981750488,
-0.27035313844680786,
-0.12958060204982758,
-0.366150438785553,
0.1490018367767334,
-0.13993136584758759,
0.004404209554195404,
-0.04457015544176102,
0.11352081596851349,
0.059524428099393845,
0.09665977209806442,
0.055662769824266434,
-0.04663528874516487,
-0.5541669726371765,
0.11564067006111145,
-0.1788301169872284,
0.2540341913700104,
0.023115400224924088,
0.49492499232292175,
-0.08932311087846756,
-0.079623281955719,
-0.033399321138858795,
-0.03338400274515152,
0.3082805573940277,
-0.6231419444084167,
0.11598028987646103,
0.15686795115470886,
0.19278201460838318,
-0.7537785768508911,
-0.06549997627735138,
-0.11833232641220093,
0.42159271240234375,
0.17863601446151733,
0.2589929401874542,
-0.2315576672554016,
-0.23842373490333557,
0.35111743211746216,
0.021328993141651154,
0.0715985968708992,
-0.11510695517063141,
-0.1804083287715912,
-0.09751411527395248,
-0.27880823612213135,
0.0747244730591774,
0.09640765190124512,
-0.0003879554569721222,
-0.023452986031770706,
-0.15050384402275085,
-0.36652153730392456,
-0.2760002315044403,
-0.026003453880548477,
0.1123022735118866,
0.3104591965675354,
-0.22307318449020386,
0.29673436284065247,
0.1722050905227661,
0.02440062165260315,
0.18271148204803467,
0.45686811208724976,
-0.05124705284833908,
-0.108069509267807,
0.08285526186227798,
-0.21481338143348694,
0.42739152908325195,
0.22175408899784088,
-0.24697411060333252,
0.10396881401538849,
-0.26641207933425903,
-0.1401318609714508,
-0.14540734887123108,
0.06623770296573639,
0.19616469740867615,
-0.011945318430662155,
-0.033172979950904846,
-0.10279972851276398,
0.5983672738075256,
0.22709667682647705,
-0.1068585067987442,
0.4831799268722534,
0.3850306570529938,
-0.36633092164993286,
0.3644810914993286,
-0.0370691679418087,
0.6164374947547913,
0.10429040342569351,
-0.1857309490442276,
0.20420578122138977,
-0.18767791986465454,
0.25895988941192627,
0.10125310719013214,
-0.1500188410282135,
-0.3026089072227478,
-0.5035521388053894,
-0.055079612880945206,
-0.16932393610477448,
0.48339447379112244,
0.151047483086586,
-0.4745141267776489,
0.20770488679409027,
-0.12427923083305359,
-0.062404848635196686,
-0.06178412586450577,
0.3521120250225067,
-0.523514986038208,
-0.2080734819173813,
-0.20118047297000885,
0.12344559282064438,
0.09135191142559052,
0.02026095800101757,
0.10901808738708496,
-0.08840057253837585,
-0.01293228566646576,
-0.4066101312637329,
-0.3635435104370117,
0.10917287319898605,
-0.5800636410713196,
0.19798320531845093,
0.07282011210918427,
-0.07273343950510025,
0.20932736992835999,
0.02447364293038845,
0.14645910263061523,
0.07146033644676208,
-0.11015580594539642,
0.09839650988578796,
0.18498723208904266,
-0.054627642035484314,
0.18010270595550537,
-0.11149580776691437,
0.1640620231628418,
-0.044159289449453354,
-0.1614506095647812,
0.0042397696524858475,
-0.29931434988975525,
-0.31139639019966125,
0.3200903832912445,
-0.05144491046667099,
-0.23408275842666626,
-0.34402531385421753,
-0.2259417474269867,
-0.1545361578464508,
-0.10067733377218246,
-0.204569473862648,
0.12513010203838348,
0.019551876932382584,
-0.06997188180685043,
0.10175986588001251,
-0.01925126649439335,
-0.25736385583877563,
0.0673341229557991,
0.48223817348480225,
0.016954150050878525,
0.17774085700511932,
0.457553505897522,
0.024380020797252655,
-0.0610739141702652,
-0.3064919114112854,
-0.0127495676279068,
0.6273877620697021,
-0.6134925484657288,
0.14611774682998657,
-0.37242424488067627,
-0.08973118662834167,
0.169168621301651,
0.13910822570323944,
0.22830083966255188,
0.1461222767829895,
-0.22683577239513397,
-0.30071234703063965,
-0.16666904091835022,
0.37646394968032837,
-0.15603533387184143,
0.3134033977985382,
-0.3363625407218933,
-0.19906748831272125,
-0.0883597657084465,
0.2563268542289734,
-0.2794307470321655,
0.18160094320774078,
-0.05657961964607239,
0.0534510463476181,
0.4790695309638977,
-0.04648671671748161,
0.06819342076778412,
-0.1396261602640152,
0.10618001222610474,
0.19096235930919647,
-0.25647327303886414,
-0.15514960885047913,
-0.15222501754760742,
0.08124584704637527,
-0.13270708918571472,
0.010067522525787354,
0.02897939458489418,
-0.03888583928346634,
-0.1391759216785431,
-0.03149789199233055,
0.3678252696990967,
-0.0944623127579689,
-0.24207663536071777,
0.23072747886180878,
0.2679206132888794,
0.15570831298828125,
-0.18394625186920166,
0.17483948171138763,
-0.2165852189064026,
0.0283889751881361,
-0.17922234535217285,
0.24705655872821808,
-0.007129833102226257,
-0.03851483762264252,
-0.15370357036590576,
0.050532639026641846,
-0.07801265269517899,
0.015336645767092705,
0.20135217905044556,
-0.2303571254014969,
-0.10742835700511932,
-0.01421305164694786,
0.39356082677841187,
0.2777755558490753,
-0.25205397605895996,
-0.10409314930438995,
-0.22355791926383972,
0.26293855905532837,
-0.1496121883392334,
-0.2773717939853668,
0.3417595326900482,
-0.09226532280445099,
0.15921634435653687,
0.2118307203054428,
0.41083627939224243,
0.043679237365722656,
0.08115005493164062,
0.10098205506801605,
0.21774381399154663,
-0.011351373046636581,
0.18168336153030396,
0.46085599064826965,
-0.1382342278957367,
-0.049713384360075,
0.3107075095176697,
-0.027122439816594124,
0.38876068592071533,
0.22160783410072327,
-0.06323330104351044,
0.4822516143321991,
0.29587143659591675,
0.1929512768983841,
0.12486174702644348,
-0.3575897812843323,
0.14921146631240845,
0.21874989569187164,
-0.1658269166946411,
0.06475657224655151,
0.07885676622390747,
0.6511017680168152,
-0.2109883427619934,
-0.22016111016273499,
-0.22487369179725647,
0.022541796788573265,
-0.10841076076030731,
-0.2425408661365509,
0.24780696630477905,
-0.049851201474666595,
-0.5171486139297485,
-0.15458711981773376,
-0.11014952510595322,
-0.10081876069307327,
0.429863840341568,
-0.03911523520946503,
0.1153499037027359,
-0.2397981584072113,
0.17388379573822021,
0.10450495034456253,
0.08037171512842178,
-0.36799952387809753,
0.2427854835987091,
-0.12968480587005615,
0.018443139269948006,
-0.030476758256554604,
0.3695043921470642,
0.5041925311088562,
0.26813191175460815,
-0.10739290714263916,
0.02016691491007805,
-0.014308275654911995,
-0.09784646332263947,
0.11941465735435486,
0.20030184090137482,
-0.11085008829832077,
0.1321009397506714,
0.37904608249664307,
0.20164722204208374,
-0.12139931321144104,
-0.1000041514635086,
0.030362535268068314,
0.17235860228538513,
-0.3149377703666687,
0.3444533050060272,
-0.3634791076183319,
-0.23907509446144104,
-0.04014524072408676,
0.10242277383804321,
-0.17967306077480316,
-0.12761220335960388,
0.6404633522033691,
-0.1739416867494583,
-0.021529927849769592,
-0.2209109663963318,
0.07956825196743011,
-0.2049466371536255,
0.6682415008544922,
0.20693960785865784,
0.1568141132593155,
-0.2052822709083557,
-0.2378506064414978,
-0.5712839365005493,
-0.0497576966881752,
-0.2802777588367462,
0.006994083523750305,
0.30415910482406616,
0.28169798851013184,
-0.043766409158706665,
0.2822384834289551,
0.2108829915523529,
0.25022292137145996,
-0.19874587655067444,
0.0027194954454898834,
-0.37224939465522766,
0.005723739042878151,
0.14481927454471588,
-0.21810150146484375,
0.028685100376605988,
-0.7155145406723022,
0.15307354927062988,
0.23879818618297577,
0.026484891772270203,
-0.00475732795894146,
-0.31792211532592773,
0.38677704334259033,
-0.2742782235145569,
0.5150883197784424,
-0.015198085457086563,
0.5163146257400513,
0.13180477917194366,
-0.15809059143066406,
-0.3756846785545349,
-0.4001162350177765,
-0.15818551182746887,
0.11488136649131775,
0.09141696989536285,
0.5396209359169006,
0.00979846715927124,
0.12689602375030518,
-0.252877801656723,
0.3277635872364044,
0.06747996807098389,
0.10562525689601898,
-0.2344699203968048,
0.2757199704647064,
-0.19434243440628052,
0.058766771107912064,
0.0052521564066410065,
-0.09007993340492249,
-0.040281448513269424,
0.23209336400032043,
-0.11329284310340881,
-0.3905448615550995,
0.30657315254211426,
-0.07783406972885132,
-0.051447704434394836,
0.03715905547142029,
0.35926228761672974,
0.403256893157959,
-0.2673914134502411,
-0.6860737800598145,
-0.19841618835926056,
0.3664683997631073,
-0.06045250594615936,
-0.18126484751701355,
0.16638696193695068,
0.20469732582569122,
0.05141855776309967,
0.0071809664368629456,
0.16236275434494019,
-0.1423059105873108,
-0.1705998182296753,
0.1261749118566513,
-0.25732043385505676
] |
https://github.com/huggingface/datasets/issues/6153 | > This is an issue for the [Datasets repo](https://github.com/huggingface/datasets).
Thanks @sgugger , I guess I will wait for them to address the issue . Looking forward to hearing from them | custom load dataset to hub | ### System Info
kaggle notebook
i transformed dataset:
```
dataset = load_dataset("Dahoas/first-instruct-human-assistant-prompt")
```
to
formatted_dataset:
```
Dataset({
features: ['message_tree_id', 'message_tree_text'],
num_rows: 33143
})
```
but would like to know how to upload to hub
### Who can help?
@ArthurZucker @younesbelkada
### Information
- [ ] The official example scripts
- [ ] My own modified scripts
### Tasks
- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)
### Reproduction
shared above
### Expected behavior
load dataset to hub | 30 | custom load dataset to hub
### System Info
kaggle notebook
i transformed dataset:
```
dataset = load_dataset("Dahoas/first-instruct-human-assistant-prompt")
```
to
formatted_dataset:
```
Dataset({
features: ['message_tree_id', 'message_tree_text'],
num_rows: 33143
})
```
but would like to know how to upload to hub
### Who can help?
@ArthurZucker @younesbelkada
### Information
- [ ] The official example scripts
- [ ] My own modified scripts
### Tasks
- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)
### Reproduction
shared above
### Expected behavior
load dataset to hub
> This is an issue for the [Datasets repo](https://github.com/huggingface/datasets).
Thanks @sgugger , I guess I will wait for them to address the issue . Looking forward to hearing from them | [
-0.09595555067062378,
-0.42560431361198425,
-0.02857043221592903,
0.09417508542537689,
0.12886416912078857,
0.20121827721595764,
0.4490395486354828,
0.06897752732038498,
0.24217703938484192,
-0.0015879124402999878,
-0.27853912115097046,
0.46894994378089905,
-0.02148927003145218,
0.6027344465255737,
0.1409778743982315,
0.17100566625595093,
0.1875353753566742,
0.037820544093847275,
0.05775602161884308,
-0.032025180757045746,
-0.2383754849433899,
0.011268718168139458,
-0.031598299741744995,
-0.1262136697769165,
-0.5225720405578613,
-0.17465442419052124,
-0.08194480836391449,
0.41751742362976074,
-0.15275128185749054,
-0.23247893154621124,
0.3294941484928131,
0.36484062671661377,
0.24247264862060547,
0.43234771490097046,
-0.00012114355922676623,
-0.14615067839622498,
0.24437148869037628,
-0.16095410287380219,
-0.3727918565273285,
-0.005779758095741272,
-0.11459942907094955,
-0.18477971851825714,
0.06772711873054504,
-0.1307087540626526,
-0.018022730946540833,
0.27775198221206665,
-0.1682516634464264,
0.014446437358856201,
0.3966328799724579,
0.3954422175884247,
0.14367318153381348,
0.11970867216587067,
0.042576856911182404,
-0.3318030834197998,
-0.030420314520597458,
0.5163096785545349,
-0.15785449743270874,
0.1666179895401001,
0.3264947831630707,
0.18271005153656006,
0.03421211242675781,
-0.22540484368801117,
0.09736128896474838,
-0.13718920946121216,
0.28436338901519775,
-0.1524377316236496,
-0.3177952170372009,
-0.15357480943202972,
0.040765587240457535,
0.31171244382858276,
0.5098819136619568,
-0.2963760793209076,
-0.20550276339054108,
-0.3230542838573456,
0.14468196034431458,
-0.06750670820474625,
0.21520617604255676,
0.165492445230484,
-0.14809373021125793,
0.20788846909999847,
-0.03368544578552246,
-0.31427836418151855,
-0.31876829266548157,
-0.05544964224100113,
-0.12085355818271637,
0.18151208758354187,
-0.14234493672847748,
-0.13122808933258057,
-0.19868341088294983,
-0.19554628431797028,
0.47569286823272705,
0.05529766157269478,
-0.04365997761487961,
0.10902701318264008,
-0.37654414772987366,
-0.18660776317119598,
-0.17483875155448914,
0.14162829518318176,
0.2629120349884033,
0.34742268919944763,
0.21774829924106598,
0.22354771196842194,
-0.3279368281364441,
-0.14273113012313843,
0.19802828133106232,
0.4689174294471741,
0.388806015253067,
0.10618749260902405,
0.008824034593999386,
0.32450979948043823,
0.28584587574005127,
-0.005134970881044865,
-0.3692259192466736,
0.06657016277313232,
-0.03393789380788803,
0.0170145146548748,
0.34165698289871216,
-0.02509673684835434,
-0.27563732862472534,
-0.2182522714138031,
0.3920341432094574,
0.17344845831394196,
0.017300285398960114,
0.1487186849117279,
0.024335026741027832,
0.07925210893154144,
-0.1023082509636879,
0.2214328497648239,
0.025140605866909027,
-0.1064625084400177,
-0.12082794308662415,
0.07503072917461395,
-0.07485827058553696,
0.2099250853061676,
0.3034811019897461,
-0.30156993865966797,
0.21515513956546783,
0.1268634796142578,
0.19931074976921082,
0.028839923441410065,
-0.4370705783367157,
0.10682061314582825,
-0.017933238297700882,
0.15905584394931793,
0.34447866678237915,
0.3739185333251953,
0.0655897855758667,
0.00656900554895401,
-0.13587704300880432,
0.18355046212673187,
-0.3956781029701233,
-0.2912132143974304,
-0.16458232700824738,
0.06458962708711624,
-0.5347964763641357,
-0.24410270154476166,
-0.6538639068603516,
0.19276028871536255,
-0.14794310927391052,
0.18824122846126556,
0.017333511263132095,
0.3425714671611786,
-0.10536780953407288,
-0.19152764976024628,
0.15160948038101196,
0.2910926640033722,
-0.3203083872795105,
-0.050381168723106384,
-0.0346204936504364,
0.02542433887720108,
-0.08763650059700012,
0.00839259847998619,
0.09372048825025558,
0.5159419775009155,
-0.24670179188251495,
0.383442223072052,
0.23340913653373718,
-0.6414985656738281,
-0.419800728559494,
-0.016254695132374763,
-0.13301435112953186,
0.09925993531942368,
-0.00043676048517227173,
0.07954021543264389,
0.2914402484893799,
-0.09444419294595718,
0.07137702405452728,
0.5279655456542969,
0.19244976341724396,
0.052703917026519775,
-0.15761733055114746,
-0.13849571347236633,
-0.18046821653842926,
0.1803334504365921,
-0.10472699999809265,
0.18251487612724304,
0.15081341564655304,
0.27125704288482666,
0.10259322822093964,
-0.021728701889514923,
0.10718793421983719,
-0.02894068881869316,
0.28329595923423767,
0.0595182366669178,
0.09710890799760818,
-0.03706737980246544,
-0.37480536103248596,
0.13274621963500977,
0.08784199506044388,
-0.08008038997650146,
-0.014146402478218079,
-0.14685477316379547,
-0.8086658716201782,
0.039404720067977905,
-0.515544593334198,
0.005135448649525642,
0.08709047734737396,
-0.18609289824962616,
-0.19446417689323425,
-0.2772942781448364,
-0.28586775064468384,
0.8173935413360596,
-0.14408200979232788,
0.03151746466755867,
-0.4381996691226959,
0.3220311105251312,
0.20440062880516052,
-0.21401476860046387,
0.17994603514671326,
0.2072075456380844,
0.2442440241575241,
-0.0633263811469078,
-0.11885102838277817,
0.32524967193603516,
0.0404793806374073,
0.3682946264743805,
0.11211919784545898,
-0.15388604998588562,
0.2879105508327484,
-0.25582993030548096,
0.1787988692522049,
-0.07973749190568924,
0.06768810749053955,
-0.19587692618370056,
-0.6568182706832886,
-0.01662129908800125,
-0.44813981652259827,
0.08798989653587341,
-0.18056687712669373,
0.10707370191812515,
0.15998682379722595,
-0.042988114058971405,
-0.10719148814678192,
0.007218562066555023,
0.022800151258707047,
0.19744493067264557,
0.025738395750522614,
-0.13755714893341064,
0.15643683075904846,
0.2655905783176422,
0.41765981912612915,
-0.06781163066625595,
0.271348774433136,
0.10905160009860992,
-0.3428707718849182,
-0.12344489991664886,
0.23772990703582764,
-0.28825271129608154,
0.20920050144195557,
0.050168998539447784,
0.05019138753414154,
0.15034052729606628,
0.07750283181667328,
-0.11494404822587967,
-0.0804930105805397,
-0.047585856169462204,
0.20323407649993896,
0.32141274213790894,
0.21465781331062317,
-0.12913495302200317,
-0.22985821962356567,
0.14052510261535645,
0.005520053207874298,
0.08261891454458237,
-0.39467138051986694,
-0.2646934390068054,
-0.1367364078760147,
0.19875915348529816,
0.0850321352481842,
-0.49295538663864136,
-0.06683927774429321,
-0.21232208609580994,
-0.02251221239566803,
0.18490499258041382,
0.40138083696365356,
-0.09948016703128815,
0.4894689917564392,
0.38867002725601196,
0.016006045043468475,
-0.06329920887947083,
-0.18956807255744934,
-0.030373863875865936,
-0.04229579120874405,
0.052288077771663666,
-0.09387427568435669,
0.3388659358024597,
0.3942417502403259,
-0.3672214448451996,
0.46455761790275574,
-0.21311163902282715,
-0.04751043766736984,
-0.11265982687473297,
-0.10421496629714966,
0.07759228348731995,
-0.0759907215833664,
0.3371787369251251,
0.01571132242679596,
0.04147104173898697,
0.0543493777513504,
0.016171641647815704,
-0.28743046522140503,
0.05687648057937622,
-0.309692919254303,
0.09784373641014099,
0.2160106599330902,
-0.3037842810153961,
-0.12770357728004456,
-0.3727470636367798,
0.3707903325557709,
0.22851435840129852,
-0.0006576348096132278,
-0.0217285193502903,
0.11420321464538574,
-0.01906188391149044,
0.4145507216453552,
-0.31183841824531555,
-0.24200209975242615,
-0.5685809254646301,
0.4703047573566437,
-0.36374491453170776,
-0.32089582085609436,
0.16819268465042114,
0.055985771119594574,
0.26433467864990234,
-0.1262175589799881,
-0.10369991511106491,
-0.1697743535041809,
-0.11278849095106125,
0.07005609571933746,
-0.0777750313282013,
0.03860088437795639,
0.45243343710899353,
-0.10854603350162506,
0.08822419494390488,
-0.10607337951660156,
-0.46647408604621887,
0.2528560161590576,
0.4154708683490753,
-0.0007260851562023163,
-0.11477816104888916,
0.050341468304395676,
0.011844269931316376,
0.2670471668243408,
0.2630307674407959,
0.06768451631069183,
0.3448764681816101,
-0.07040257006883621,
0.22979836165905,
-0.312550812959671,
-0.33863431215286255,
-0.04865061864256859,
0.18856075406074524,
0.16884028911590576,
0.3316904902458191,
0.2859966456890106,
0.12454887479543686,
-0.13506819307804108,
-0.4206928312778473,
-0.28054454922676086,
-0.038631241768598557,
-0.059853941202163696,
-0.05388901010155678,
-0.04613138362765312,
-0.19811630249023438,
-0.039643481373786926,
-0.4598489999771118,
-0.31767046451568604,
0.2781504988670349,
0.2506115138530731,
-0.12709257006645203,
0.06021064519882202,
-0.5150739550590515,
-0.14416244626045227,
-0.39533302187919617,
0.17516909539699554,
-0.12257469445466995,
0.11848680675029755,
-0.14484557509422302,
0.011247359216213226,
0.15345808863639832,
0.02825179323554039,
0.4007946848869324,
-0.399297833442688,
0.13932162523269653,
0.10043296217918396,
0.15200328826904297,
-0.5643174648284912,
-0.15892867743968964,
0.023683227598667145,
0.2067229151725769,
-0.24240344762802124,
0.7210545539855957,
-0.12473542988300323,
0.038037266582250595,
0.04192383959889412,
-0.050982583314180374,
-0.2812950015068054,
-0.3936639428138733,
-0.189609095454216,
-0.40152496099472046,
-0.4073982536792755,
-0.1431475281715393,
0.27433261275291443,
0.20382815599441528,
-0.1912350058555603,
-0.25962013006210327,
-0.16900397837162018,
0.07576605677604675,
0.06600192189216614,
-0.03894080966711044,
0.1735294908285141,
0.40671306848526,
-0.0034934282302856445,
0.3609764575958252,
0.18295444548130035,
0.019411226734519005,
0.7761744260787964,
-0.005960202310234308,
-0.2845185399055481,
-0.10674148797988892,
-0.3474734425544739,
0.05340352654457092,
0.3582136332988739,
0.15192848443984985,
-0.16501319408416748,
-0.24125482141971588,
-0.1726900339126587,
-0.6306465864181519,
0.38912054896354675,
-0.021154768764972687,
-0.11404897272586823,
-0.48790475726127625,
-0.17119699716567993,
0.5773202180862427,
-0.12775073945522308,
-0.13271911442279816,
0.03235199302434921,
0.175152987241745,
-0.35888224840164185,
0.27540305256843567,
0.08631721138954163,
0.9779025316238403,
-0.2788384258747101,
0.17550088465213776,
0.31976762413978577,
-0.20995226502418518,
0.12506170570850372,
-0.5091318488121033,
-0.23881132900714874,
-0.4006223678588867,
-0.044567205011844635,
-0.06620065122842789,
0.07404268532991409,
0.0894169956445694,
0.25688639283180237,
-0.29216933250427246,
0.05894717574119568,
-0.2803610563278198,
0.2983764111995697,
0.04587838798761368,
0.3469909727573395,
-0.2021895796060562,
-0.4228613078594208,
-0.30739909410476685,
0.1471770703792572,
-0.1229330375790596,
0.1922764927148819,
0.014710541814565659,
-0.09153056889772415,
-0.3139030933380127,
0.08916732668876648,
-0.31332969665527344,
0.08889411389827728,
0.17469342052936554,
-0.21965648233890533,
-0.11724132299423218,
-0.24488963186740875,
0.11574769020080566,
0.4014182388782501,
0.678686261177063,
-0.01614159531891346,
-0.3272920846939087,
0.24637077748775482,
-0.11644670367240906,
-0.16524860262870789,
-0.11981752514839172,
0.11147066950798035,
0.14841896295547485,
-0.17041847109794617,
-0.3029960095882416,
0.06218394264578819,
0.13019725680351257,
-0.09807857125997543,
-0.3374362885951996,
-0.06708521395921707,
0.3303666114807129,
-0.6308280825614929,
-0.10759322345256805,
0.0651082918047905,
0.35399407148361206,
-0.026391174644231796,
0.038764964789152145,
0.0672612339258194,
-0.037555113434791565,
0.3167263865470886,
0.10200349986553192,
-0.09853819012641907,
0.04960880056023598,
0.4284006655216217,
-0.14300742745399475,
-0.3240916430950165,
0.3877704441547394,
0.07685807347297668,
0.07189656794071198,
-0.13742373883724213,
0.40345335006713867,
0.471097856760025,
-0.23004809021949768,
0.020090565085411072,
0.1393016278743744,
-0.06894798576831818,
0.004853963851928711,
0.3633803725242615,
0.07210130989551544,
-0.1860405057668686,
0.00589955598115921,
-0.13092990219593048,
-0.222601979970932,
-0.09489700943231583,
-0.07953473925590515,
0.3526153862476349,
-0.10046888142824173,
-0.1509823054075241,
0.13369430601596832,
0.13804616034030914,
-0.24260258674621582,
0.27249082922935486,
-0.14668303728103638,
0.06694188714027405,
-0.18059398233890533,
-0.01073523797094822,
-0.017002390697598457,
-0.16786177456378937,
0.04332631081342697,
-0.09009044617414474,
-0.0844440832734108,
-0.2293078750371933,
-0.27116239070892334,
0.18092454969882965,
0.0995226800441742,
0.15292876958847046,
-0.1706146001815796,
-0.296093225479126,
-0.15599440038204193,
-0.21563145518302917,
0.3238515853881836,
0.33569401502609253,
0.010136974975466728,
0.15361297130584717,
0.596136748790741,
0.3213411569595337,
-0.31858503818511963,
0.1415855586528778,
0.22952011227607727,
0.03712001442909241,
-0.35690876841545105,
-0.09481775760650635,
0.03737395629286766,
0.008198454976081848,
0.18512487411499023,
0.2815064489841461,
0.7037160992622375,
0.09452450275421143,
0.09414809197187424,
-0.20131035149097443,
0.40657615661621094,
-0.06169584020972252,
0.003591187298297882,
-0.06864932924509048,
-0.311328649520874,
0.027646563947200775,
0.052803948521614075,
0.13037052750587463,
-0.045180544257164,
-0.15048304200172424,
0.3545754551887512,
-0.21172389388084412,
-0.05005349591374397,
0.18329811096191406,
0.40086236596107483,
-0.07041770219802856,
-0.1026117354631424,
0.05547600984573364,
0.2663723826408386,
0.12079544365406036,
-0.024574102833867073,
0.25292667746543884,
-0.36870360374450684,
-0.009276209399104118,
0.30465972423553467,
-0.038750894367694855,
-0.172780379652977,
0.6284538507461548,
0.12268485128879547,
0.35855257511138916,
0.2595858573913574,
0.08240626752376556,
0.5246613025665283,
-0.48195403814315796,
-0.15026910603046417,
-0.17821265757083893,
0.020464524626731873,
0.0960557758808136,
-0.006620053201913834,
0.5716033577919006,
-0.06538285315036774,
-0.09550595283508301,
-0.21963563561439514,
-0.27971696853637695,
-0.09729771316051483,
0.08170220255851746,
-0.15528151392936707,
-0.2139778733253479,
-0.23887768387794495,
-0.13323543965816498,
-0.15542778372764587,
-0.3810640573501587,
0.07709582895040512,
-0.012684877961874008,
-0.06297369301319122,
0.14109165966510773,
0.006317000836133957,
0.060078900307416916,
0.16890370845794678,
-0.06749648600816727,
0.17043641209602356,
-0.1405411958694458,
-0.08299379050731659,
0.3748798370361328,
0.1995302438735962,
0.15102489292621613,
0.23753485083580017,
-0.2570226192474365,
0.6025488376617432,
0.1995268166065216,
-0.17542806267738342,
0.27165094017982483,
0.12373813986778259,
-0.07787837088108063,
0.0430467464029789,
0.03392839804291725,
0.1736345887184143,
-0.07880395650863647,
0.09839575737714767,
-0.14183545112609863,
-0.0070987604558467865,
-0.0843021422624588,
0.4850721061229706,
-0.20101507008075714,
-0.2794676423072815,
-0.1367337703704834,
0.1495794951915741,
-0.3931266665458679,
-0.18969373404979706,
0.264480859041214,
0.03447653353214264,
0.10043691098690033,
-0.18394502997398376,
0.037225548177957535,
-0.21562476456165314,
0.44798627495765686,
0.11273280531167984,
-0.0709729790687561,
0.06869102269411087,
-0.24909654259681702,
-0.26310962438583374,
0.15653470158576965,
0.33763712644577026,
-0.17289528250694275,
0.1174389123916626,
-0.1781608760356903,
-0.08066090941429138,
0.13059642910957336,
-0.06190718710422516,
-0.25107425451278687,
0.040248624980449677,
0.4530279040336609,
-0.2916404604911804,
0.053243573755025864,
0.42350104451179504,
0.40875357389450073,
-0.04596588760614395,
-0.17960813641548157,
0.2521474361419678,
0.3562479615211487,
-0.12397167831659317,
0.0609000027179718,
-0.019381560385227203,
0.2854573726654053,
-0.27833229303359985,
0.17068397998809814,
-0.19150540232658386,
0.4395976662635803,
-0.04223764315247536,
0.30775362253189087,
-0.21138502657413483,
-0.078018918633461,
-0.17366597056388855,
0.10515269637107849,
0.05755447968840599,
0.37130072712898254,
-0.010280732065439224,
0.057886507362127304,
0.08555997908115387,
-0.0536002442240715,
-0.03936117887496948,
0.2248372733592987,
-0.300947904586792,
0.07957606017589569,
-0.12835341691970825,
0.049643807113170624,
0.3687511682510376,
0.2806055247783661,
-0.06032753363251686,
0.13414892554283142,
-0.19996368885040283,
-0.370837539434433,
0.4132178723812103,
-0.051562875509262085,
-0.3852560818195343,
-0.08154048025608063,
0.03049624338746071,
0.12365716695785522,
-0.019789908081293106,
-0.4161011576652527,
0.1902744323015213,
0.2671777307987213,
-0.22045359015464783,
0.07370258867740631,
0.5379477739334106,
-0.11440623551607132,
0.026700779795646667,
-0.11161771416664124,
0.20273293554782867,
0.20178908109664917,
0.2117553949356079,
-0.138496994972229,
-0.27634546160697937
] |
https://github.com/huggingface/datasets/issues/6153 | > You can use `.push_to_hub("<username>/<repo>")` to push a `Dataset` to the Hub.
how about subset? like `.load_dataset("<username>/<repo>", "<subset>")`, how can I upload multi-dataset in one repo? thanks a lot ! | custom load dataset to hub | ### System Info
kaggle notebook
i transformed dataset:
```
dataset = load_dataset("Dahoas/first-instruct-human-assistant-prompt")
```
to
formatted_dataset:
```
Dataset({
features: ['message_tree_id', 'message_tree_text'],
num_rows: 33143
})
```
but would like to know how to upload to hub
### Who can help?
@ArthurZucker @younesbelkada
### Information
- [ ] The official example scripts
- [ ] My own modified scripts
### Tasks
- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)
### Reproduction
shared above
### Expected behavior
load dataset to hub | 30 | custom load dataset to hub
### System Info
kaggle notebook
i transformed dataset:
```
dataset = load_dataset("Dahoas/first-instruct-human-assistant-prompt")
```
to
formatted_dataset:
```
Dataset({
features: ['message_tree_id', 'message_tree_text'],
num_rows: 33143
})
```
but would like to know how to upload to hub
### Who can help?
@ArthurZucker @younesbelkada
### Information
- [ ] The official example scripts
- [ ] My own modified scripts
### Tasks
- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)
### Reproduction
shared above
### Expected behavior
load dataset to hub
> You can use `.push_to_hub("<username>/<repo>")` to push a `Dataset` to the Hub.
how about subset? like `.load_dataset("<username>/<repo>", "<subset>")`, how can I upload multi-dataset in one repo? thanks a lot ! | [
-0.2940673232078552,
-0.4400447905063629,
-0.10339982807636261,
0.11101476103067398,
0.144892618060112,
0.17570477724075317,
0.37880921363830566,
0.0910642221570015,
0.20257394015789032,
0.06475270539522171,
-0.39361822605133057,
0.49827486276626587,
0.053432200103998184,
0.6498446464538574,
0.22188825905323029,
0.07839737832546234,
0.20783795416355133,
0.11294041574001312,
0.09386980533599854,
-0.05647529661655426,
-0.11488786339759827,
-0.08798686414957047,
0.054233625531196594,
-0.21407708525657654,
-0.342570960521698,
-0.3142748773097992,
-0.24820491671562195,
0.25909242033958435,
-0.21505431830883026,
-0.19487997889518738,
0.1826743185520172,
0.4703236222267151,
0.28496605157852173,
0.5586500763893127,
-0.00012158138997619972,
-0.14902029931545258,
0.011845153756439686,
-0.16516247391700745,
-0.4468866288661957,
0.014859586954116821,
-0.26677456498146057,
-0.15929627418518066,
0.052328482270240784,
-0.27498742938041687,
0.09317420423030853,
0.31009215116500854,
-0.11225540190935135,
-0.062459081411361694,
0.44842803478240967,
0.2729935646057129,
0.1201019287109375,
0.16286861896514893,
0.13224051892757416,
-0.28797605633735657,
0.08078855276107788,
0.42228254675865173,
-0.17765182256698608,
0.13757887482643127,
0.5258157253265381,
0.19253860414028168,
0.04334135726094246,
-0.15101397037506104,
0.0934368446469307,
-0.03095106966793537,
0.2145048826932907,
-0.15393143892288208,
-0.20492899417877197,
-0.26558372378349304,
-0.03918340802192688,
0.3155258297920227,
0.5458452105522156,
-0.29812896251678467,
-0.3598840832710266,
-0.1799599826335907,
0.08570753782987595,
-0.12192182242870331,
-0.024957194924354553,
0.20677772164344788,
-0.14177224040031433,
0.13426625728607178,
-0.1734374761581421,
-0.3391203284263611,
-0.2803158164024353,
0.0437057726085186,
-0.094609834253788,
0.3112732768058777,
-0.004403337836265564,
-0.025621570646762848,
-0.125001460313797,
-0.10780559480190277,
0.34914177656173706,
-0.10879972577095032,
-0.0995573177933693,
0.07222786545753479,
-0.4626639783382416,
-0.22882495820522308,
-0.1900508552789688,
-0.010209482163190842,
0.382185697555542,
0.35351940989494324,
0.17391282320022583,
0.2652795910835266,
-0.2591797709465027,
-0.06250008195638657,
0.2740078568458557,
0.39323821663856506,
0.33697304129600525,
0.18330997228622437,
0.03385148197412491,
0.21569597721099854,
0.2484499216079712,
0.0027707070112228394,
-0.4363388419151306,
0.0980171263217926,
0.02048908919095993,
0.1018066480755806,
0.3021487891674042,
-0.006857775151729584,
-0.22521093487739563,
-0.39846304059028625,
0.19912536442279816,
0.056586381047964096,
-0.0392860509455204,
0.10274986922740936,
0.08213139325380325,
0.16145160794258118,
-0.34546974301338196,
0.2801484763622284,
0.08711493015289307,
-0.10927566885948181,
-0.11465118825435638,
0.18524561822414398,
-0.008165299892425537,
0.282306432723999,
0.2549629807472229,
-0.41413071751594543,
0.2568911910057068,
0.06466223299503326,
0.37589627504348755,
-0.09772630780935287,
-0.12666556239128113,
-0.054210513830184937,
-0.1874293088912964,
0.12187691032886505,
0.44556179642677307,
0.331196665763855,
-0.009755916893482208,
-0.05516580864787102,
-0.2170739471912384,
0.12612971663475037,
-0.44083383679389954,
-0.33442792296409607,
-0.18094690144062042,
0.09220241010189056,
-0.3985074460506439,
-0.17174312472343445,
-0.78317791223526,
0.11247299611568451,
-0.09752920269966125,
0.2977481484413147,
-0.03545743599534035,
0.4214017987251282,
-0.03098742663860321,
-0.2504144608974457,
0.15032054483890533,
0.16055460274219513,
-0.18290549516677856,
-0.049035560339689255,
0.0007632896304130554,
0.059170205146074295,
-0.1702873706817627,
0.05620959401130676,
-0.08157666027545929,
0.5063069462776184,
-0.0780714824795723,
0.33433499932289124,
0.444198340177536,
-0.8812434673309326,
-0.29354792833328247,
0.08099689334630966,
-0.07983411848545074,
-0.0719802975654602,
0.06968294829130173,
0.05575815215706825,
0.2580820918083191,
-0.031216340139508247,
0.040719423443078995,
0.6094835996627808,
0.016079584136605263,
0.17902301251888275,
-0.009944289922714233,
-0.1922481656074524,
-0.21222811937332153,
0.2560557425022125,
0.002473392290994525,
-0.04120093956589699,
0.1491633653640747,
0.2740709185600281,
0.17501600086688995,
-0.11573106050491333,
0.2722824215888977,
-0.03974831476807594,
0.2856188416481018,
-0.10899834334850311,
0.11116381734609604,
-0.13033421337604523,
-0.49181538820266724,
0.18066592514514923,
0.09157545864582062,
-0.18932446837425232,
0.07635075598955154,
-0.22484275698661804,
-0.6870911121368408,
-0.025002270936965942,
-0.5035222768783569,
0.05954864248633385,
0.07379341870546341,
0.019407635554671288,
-0.14755359292030334,
-0.3195175230503082,
-0.3558892607688904,
0.7365156412124634,
0.14159885048866272,
0.05547401309013367,
-0.33745285868644714,
0.3674347698688507,
0.08629611879587173,
-0.0920962244272232,
0.14510206878185272,
0.10810114443302155,
0.2544109523296356,
-0.16933032870292664,
0.04991234466433525,
0.30900922417640686,
0.09218154102563858,
0.34633445739746094,
0.23061275482177734,
-0.2283351570367813,
0.34440064430236816,
-0.16372518241405487,
0.17501631379127502,
-0.17364582419395447,
0.050111621618270874,
-0.23562541604042053,
-0.6789977550506592,
-0.027301348745822906,
-0.3657206892967224,
0.05792568251490593,
-0.1847400665283203,
0.10964898765087128,
0.24440553784370422,
-0.11399820446968079,
-0.07684218138456345,
0.04471550136804581,
-0.038451556116342545,
0.3040488660335541,
0.07516811788082123,
-0.21701887249946594,
0.21828871965408325,
0.2716125249862671,
0.30093351006507874,
-0.04065944254398346,
0.25750234723091125,
-0.032309260219335556,
-0.30538231134414673,
-0.16093066334724426,
0.2234325408935547,
-0.11001010239124298,
0.16492708027362823,
0.062312155961990356,
0.0568518191576004,
-0.13813111186027527,
0.18339015543460846,
-0.057214055210351944,
-0.1378326267004013,
0.013263953849673271,
0.39813876152038574,
0.33707284927368164,
0.20236173272132874,
-0.1545432209968567,
-0.13077907264232635,
0.01173902302980423,
0.291321337223053,
0.12901531159877777,
-0.18822088837623596,
-0.28597086668014526,
-0.0455409437417984,
0.16756337881088257,
0.04437510296702385,
-0.4785469174385071,
-0.08223479241132736,
-0.1134784072637558,
0.018261056393384933,
0.14482249319553375,
0.36055538058280945,
-0.017167450860142708,
0.5229568481445312,
0.3593909740447998,
-0.027425486594438553,
-0.01641872711479664,
-0.038851648569107056,
-0.04132911190390587,
0.10019173473119736,
0.06832748651504517,
-0.029340999200940132,
0.2531183362007141,
0.42187821865081787,
-0.19939175248146057,
0.3447844684123993,
-0.38228994607925415,
0.08990494906902313,
-0.09214382618665695,
-0.09959569573402405,
-0.03314991667866707,
-0.11118447780609131,
0.2813062369823456,
-0.04375071823596954,
-0.11526757478713989,
0.060940444469451904,
0.22768381237983704,
-0.3462177813053131,
-0.05861359462141991,
-0.3000963628292084,
0.03698595240712166,
0.2203015387058258,
-0.27636969089508057,
-0.21781376004219055,
-0.35154810547828674,
0.38665202260017395,
0.29400870203971863,
0.08992955088615417,
-0.1694411039352417,
0.03506077080965042,
-0.03214065730571747,
0.3078954815864563,
-0.3338547348976135,
-0.08305248618125916,
-0.4171360731124878,
0.32989394664764404,
-0.3425113260746002,
-0.26655063033103943,
0.15462681651115417,
0.06361526250839233,
0.23914268612861633,
0.13827107846736908,
0.0022518858313560486,
-0.23289188742637634,
-0.10234306752681732,
0.016994178295135498,
-0.05831121280789375,
0.024246463552117348,
0.3778407871723175,
-0.07005597651004791,
0.032535992562770844,
-0.08490246534347534,
-0.43068766593933105,
0.21633312106132507,
0.5077807903289795,
0.010575920343399048,
-0.1736423820257187,
0.10229387134313583,
0.059721723198890686,
0.3814413547515869,
0.3522056043148041,
0.15549537539482117,
0.2849629819393158,
0.09314961731433868,
0.030779564753174782,
-0.13777434825897217,
-0.3057379126548767,
-0.0017861686646938324,
0.11145009100437164,
0.23648414015769958,
0.255761981010437,
0.2325476109981537,
-0.046691346913576126,
-0.17111605405807495,
-0.40930089354515076,
-0.23651091754436493,
0.045446887612342834,
0.023364825174212456,
-0.15308912098407745,
-0.00039774924516677856,
-0.3005245327949524,
-0.23559540510177612,
-0.46436774730682373,
-0.2256793975830078,
0.13687032461166382,
0.14192789793014526,
-0.19591179490089417,
0.06428304314613342,
-0.5718191266059875,
-0.11351338028907776,
-0.32932740449905396,
0.1731071025133133,
-0.03490179777145386,
-0.056598976254463196,
0.08263899385929108,
0.20188665390014648,
0.12036947160959244,
-0.10468645393848419,
0.3463010787963867,
-0.39379456639289856,
0.16944856941699982,
0.12025179713964462,
0.009884893894195557,
-0.5370926260948181,
-0.15579622983932495,
-0.12288112938404083,
0.2253781408071518,
-0.3046949505805969,
0.7338020205497742,
-0.23390412330627441,
-0.05375034362077713,
0.06829273700714111,
-0.023009292781352997,
-0.275174617767334,
-0.2351713478565216,
-0.08278290927410126,
-0.3721986413002014,
-0.4756041467189789,
-0.1431483030319214,
0.22731217741966248,
0.1970895528793335,
-0.07124883681535721,
-0.3131204843521118,
-0.062241747975349426,
0.15952849388122559,
0.00555560365319252,
-0.09440335631370544,
0.1855267435312271,
0.4438871741294861,
0.0042128488421440125,
0.23993109166622162,
0.17849241197109222,
0.18149028718471527,
0.5497373342514038,
-0.046093422919511795,
-0.29275354743003845,
-0.11845226585865021,
-0.3809216320514679,
0.11207753419876099,
0.2515571415424347,
0.24330265820026398,
0.015078647062182426,
-0.2740534245967865,
-0.13850432634353638,
-0.39637401700019836,
0.3959563374519348,
0.016439445316791534,
-0.1175086572766304,
-0.5375162959098816,
-0.2220650017261505,
0.5136667490005493,
-0.08850235491991043,
-0.1643177717924118,
0.07527226209640503,
0.063541479408741,
-0.3207465410232544,
0.28981325030326843,
0.205789253115654,
0.8964625597000122,
-0.3248061537742615,
0.17918972671031952,
0.09229627996683121,
-0.25964659452438354,
0.21532799303531647,
-0.6316856741905212,
-0.18797248601913452,
-0.34560245275497437,
0.0063987672328948975,
-0.07822003960609436,
0.06968583166599274,
-0.0060344841331243515,
0.24249514937400818,
-0.5113097429275513,
-0.008581642061471939,
-0.17573411762714386,
0.3775064945220947,
-0.08936043828725815,
0.33585232496261597,
-0.1906173974275589,
-0.4119377136230469,
-0.09139163792133331,
0.14420601725578308,
-0.2022438943386078,
0.052604567259550095,
-0.008155662566423416,
-0.14795172214508057,
-0.3100360929965973,
0.12026497721672058,
-0.4097389578819275,
0.020228810608386993,
0.13931861519813538,
0.03344089537858963,
-0.31465739011764526,
-0.25055763125419617,
0.012107640504837036,
0.4316971004009247,
0.760508120059967,
-0.08919452130794525,
-0.2547009587287903,
0.19590404629707336,
-0.15168075263500214,
-0.20955020189285278,
-0.2619668245315552,
-0.04963051155209541,
0.09849120676517487,
-0.27509501576423645,
-0.36205875873565674,
0.14201757311820984,
0.13057178258895874,
-0.19461041688919067,
-0.2401537299156189,
0.12639011442661285,
0.34628644585609436,
-0.46309006214141846,
0.030447866767644882,
0.3044984042644501,
0.28406423330307007,
-0.13340647518634796,
0.02710006758570671,
0.19686245918273926,
-0.14862631261348724,
0.39160603284835815,
0.049697041511535645,
-0.05640089511871338,
0.12666630744934082,
0.33796754479408264,
0.09426502883434296,
-0.3923965096473694,
0.3310738801956177,
-0.0006716251373291016,
0.07985633611679077,
-0.2054799497127533,
0.3842531442642212,
0.3749712407588959,
-0.18289265036582947,
0.006275951862335205,
-0.05177298188209534,
-0.045316800475120544,
0.09452792257070541,
0.27916568517684937,
0.08669222891330719,
0.008338355459272861,
0.02753520756959915,
-0.1456269472837448,
-0.1839638650417328,
-0.03620203211903572,
-0.06234924495220184,
0.34618377685546875,
-0.14199550449848175,
-0.2847241759300232,
0.15306690335273743,
0.4061545431613922,
-0.23650379478931427,
0.26150304079055786,
-0.3598863482475281,
0.11896778643131256,
-0.10842053592205048,
0.031592123210430145,
-0.11535543203353882,
-0.1323603242635727,
0.031493179500103,
-0.1423618346452713,
-0.17115192115306854,
-0.1998022347688675,
-0.26690733432769775,
0.19964970648288727,
0.08011545985937119,
0.11093199998140335,
-0.0532209575176239,
-0.21008199453353882,
-0.10314038395881653,
-0.11440937221050262,
0.3740459084510803,
0.20008544623851776,
0.08404293656349182,
0.09999455511569977,
0.8249586224555969,
0.20543015003204346,
-0.40774092078208923,
0.1516375094652176,
0.30099251866340637,
-0.008006598800420761,
-0.24147038161754608,
0.08800177276134491,
0.10358743369579315,
-0.08698365092277527,
0.14649458229541779,
0.19307924807071686,
0.7716427445411682,
0.16586238145828247,
-0.05666927620768547,
-0.12011445313692093,
0.285855770111084,
-0.06900189816951752,
0.08050307631492615,
-0.04224074259400368,
-0.28053614497184753,
0.21156728267669678,
0.007002603262662888,
0.13357172906398773,
-0.023124035447835922,
-0.2705953121185303,
0.43715953826904297,
-0.2901754379272461,
0.06536272168159485,
0.28179094195365906,
0.29355454444885254,
0.0004932582378387451,
-0.0275077186524868,
0.02101418375968933,
0.2961007356643677,
0.11036363244056702,
0.05483013391494751,
0.2091478556394577,
-0.25333690643310547,
-0.08759716153144836,
0.17681065201759338,
0.06465840339660645,
0.00001099705696105957,
0.44101443886756897,
-0.06873029470443726,
0.44414880871772766,
0.37222111225128174,
-0.07216933369636536,
0.6804608702659607,
-0.3088573217391968,
-0.08292074501514435,
-0.07203817367553711,
0.035967592149972916,
-0.04233268275856972,
0.054056283086538315,
0.5147093534469604,
-0.03748399764299393,
-0.16294148564338684,
-0.2304217517375946,
-0.09048449993133545,
-0.04036490619182587,
0.13005350530147552,
-0.3260076642036438,
-0.1785547137260437,
-0.3195425868034363,
-0.01870299130678177,
-0.1562720686197281,
-0.36552050709724426,
0.24050472676753998,
0.06267178803682327,
-0.012422021478414536,
0.20439134538173676,
0.07221253216266632,
0.14999276399612427,
0.07513908296823502,
-0.15944060683250427,
0.09351906180381775,
0.021792754530906677,
-0.21947702765464783,
0.0981254130601883,
0.3309513032436371,
0.08461672067642212,
0.15853874385356903,
-0.11727489531040192,
0.659410297870636,
0.2987886369228363,
-0.07320479303598404,
0.2611907422542572,
-0.07590311765670776,
-0.0783197283744812,
0.04181116819381714,
0.03938160464167595,
0.14442703127861023,
-0.0823589414358139,
0.10227775573730469,
-0.05747482180595398,
-0.2119481861591339,
-0.055487073957920074,
0.35414090752601624,
-0.08812873065471649,
-0.35284966230392456,
-0.05958688259124756,
0.2185109257698059,
-0.37420856952667236,
-0.15511029958724976,
0.27532652020454407,
-0.00888502225279808,
0.05336558818817139,
-0.14734819531440735,
0.029633060097694397,
-0.14458370208740234,
0.5218079090118408,
0.048352599143981934,
-0.05615925416350365,
-0.07017700374126434,
-0.3522406816482544,
-0.22927416861057281,
0.08403195440769196,
0.13140557706356049,
-0.17969202995300293,
0.05441562086343765,
0.049528054893016815,
-0.03544013574719429,
0.19478262960910797,
0.015110887587070465,
-0.2116057276725769,
0.11470484733581543,
0.5097371339797974,
-0.4776361584663391,
0.05289214849472046,
0.5920643210411072,
0.3925032913684845,
0.057834118604660034,
-0.2815116047859192,
0.3305657207965851,
0.36897388100624084,
-0.10930808633565903,
0.04321054741740227,
-0.06610250473022461,
0.4729616641998291,
-0.42114654183387756,
0.13628621399402618,
-0.337213397026062,
0.43628084659576416,
-0.0813371017575264,
0.25049662590026855,
-0.07113402336835861,
-0.05663106590509415,
-0.19786189496517181,
-0.08047135919332504,
0.16424721479415894,
0.3097284138202667,
-0.11219143867492676,
0.11946757137775421,
0.1333276480436325,
0.009928729385137558,
-0.13680803775787354,
0.16363871097564697,
-0.13485872745513916,
-0.056127700954675674,
0.059675052762031555,
-0.1327037513256073,
0.378823459148407,
0.18071317672729492,
-0.05101057514548302,
0.011725135147571564,
-0.3204609751701355,
-0.3463166356086731,
0.3526785373687744,
0.06188278645277023,
-0.32107335329055786,
-0.22660112380981445,
0.10770077258348465,
0.0694604143500328,
0.0809532031416893,
-0.3145768642425537,
0.23293699324131012,
0.3327149450778961,
-0.11178474128246307,
-0.1590874195098877,
0.4885920286178589,
0.022225644439458847,
-0.12764696776866913,
-0.09969325363636017,
0.1187743991613388,
0.16860461235046387,
0.02068421244621277,
-0.3452194631099701,
-0.24697676301002502
] |
https://github.com/huggingface/datasets/issues/6153 | > > You can use `.push_to_hub("<username>/<repo>")` to push a `Dataset` to the Hub.
>
> how about subset? like `.load_dataset("<username>/<repo>", "<subset>")`, how can I upload multi-dataset in one repo? thanks a lot !
I solved it by upgrading `Datasets` version to 2.15.0 | custom load dataset to hub | ### System Info
kaggle notebook
i transformed dataset:
```
dataset = load_dataset("Dahoas/first-instruct-human-assistant-prompt")
```
to
formatted_dataset:
```
Dataset({
features: ['message_tree_id', 'message_tree_text'],
num_rows: 33143
})
```
but would like to know how to upload to hub
### Who can help?
@ArthurZucker @younesbelkada
### Information
- [ ] The official example scripts
- [ ] My own modified scripts
### Tasks
- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)
### Reproduction
shared above
### Expected behavior
load dataset to hub | 42 | custom load dataset to hub
### System Info
kaggle notebook
i transformed dataset:
```
dataset = load_dataset("Dahoas/first-instruct-human-assistant-prompt")
```
to
formatted_dataset:
```
Dataset({
features: ['message_tree_id', 'message_tree_text'],
num_rows: 33143
})
```
but would like to know how to upload to hub
### Who can help?
@ArthurZucker @younesbelkada
### Information
- [ ] The official example scripts
- [ ] My own modified scripts
### Tasks
- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)
### Reproduction
shared above
### Expected behavior
load dataset to hub
> > You can use `.push_to_hub("<username>/<repo>")` to push a `Dataset` to the Hub.
>
> how about subset? like `.load_dataset("<username>/<repo>", "<subset>")`, how can I upload multi-dataset in one repo? thanks a lot !
I solved it by upgrading `Datasets` version to 2.15.0 | [
-0.29901033639907837,
-0.35831522941589355,
-0.0736541897058487,
0.14873656630516052,
0.12786555290222168,
0.1778545081615448,
0.352297842502594,
0.15155190229415894,
0.16484904289245605,
0.0901644229888916,
-0.41371792554855347,
0.4942428767681122,
-0.001936374232172966,
0.5234367847442627,
0.12179719656705856,
0.1401122659444809,
0.2150668203830719,
0.08360739797353745,
0.009360363706946373,
-0.045928776264190674,
-0.14779295027256012,
-0.027639204636216164,
0.01048104465007782,
-0.1760093867778778,
-0.3459551930427551,
-0.26044371724128723,
-0.27173733711242676,
0.26098328828811646,
-0.2037770003080368,
-0.23531508445739746,
0.25411057472229004,
0.5380685329437256,
0.28596827387809753,
0.45467859506607056,
-0.0001221374695887789,
-0.12684772908687592,
0.04385579377412796,
-0.11866508424282074,
-0.4971897006034851,
-0.05154665559530258,
-0.2500307261943817,
-0.20666459202766418,
0.028008893132209778,
-0.23917730152606964,
0.14159297943115234,
0.2761964797973633,
-0.07565762847661972,
-0.01636999100446701,
0.40446004271507263,
0.27797165513038635,
0.1210881695151329,
0.13330116868019104,
0.09660749137401581,
-0.3500472605228424,
0.13606177270412445,
0.42478567361831665,
-0.20658186078071594,
0.170163094997406,
0.48515117168426514,
0.12055796384811401,
0.019040513783693314,
-0.14636746048927307,
0.07281891256570816,
-0.04361390694975853,
0.27520525455474854,
-0.15875230729579926,
-0.17502620816230774,
-0.26646098494529724,
-0.0297349002212286,
0.2943893373012543,
0.4843441843986511,
-0.26525840163230896,
-0.41352787613868713,
-0.2272290736436844,
0.022520437836647034,
-0.09132698178291321,
-0.0023143384605646133,
0.16460758447647095,
-0.12934398651123047,
0.10323341190814972,
-0.07030321657657623,
-0.40243691205978394,
-0.252837598323822,
0.011137151159346104,
-0.014522083103656769,
0.3732645511627197,
0.015119906514883041,
-0.0043268948793411255,
-0.12197032570838928,
-0.20329640805721283,
0.395283043384552,
-0.09257473051548004,
-0.13578815758228302,
0.1417974978685379,
-0.5224320888519287,
-0.15830957889556885,
-0.10564905405044556,
-0.06573151051998138,
0.4534934163093567,
0.34475091099739075,
0.1339665800333023,
0.2516060769557953,
-0.2362753450870514,
-0.13656994700431824,
0.27782142162323,
0.34484168887138367,
0.39016154408454895,
0.23452293872833252,
0.03484414145350456,
0.3347012400627136,
0.2815810441970825,
-0.016061706468462944,
-0.46154531836509705,
-0.004450749605894089,
0.011220335960388184,
0.1253361999988556,
0.31901830434799194,
-0.009976208209991455,
-0.1627010852098465,
-0.33771899342536926,
0.186016246676445,
0.05013171210885048,
-0.03422856330871582,
0.0790594220161438,
0.046253055334091187,
0.17200088500976562,
-0.3199544847011566,
0.26033222675323486,
0.03568018972873688,
0.010740019381046295,
-0.12986043095588684,
0.13705238699913025,
0.06368456780910492,
0.2720625698566437,
0.2787075340747833,
-0.461320161819458,
0.20146390795707703,
0.040669217705726624,
0.33882299065589905,
-0.032522425055503845,
-0.122834213078022,
-0.08154629170894623,
-0.1562221646308899,
0.1823878139257431,
0.4111768901348114,
0.4218357503414154,
-0.03451472520828247,
-0.1014668345451355,
-0.22119659185409546,
0.11532067507505417,
-0.4460125267505646,
-0.3860204219818115,
-0.11751528084278107,
0.09050850570201874,
-0.43177881836891174,
-0.17218466103076935,
-0.7922781109809875,
0.15936315059661865,
-0.1632840633392334,
0.23811058700084686,
-0.08077029883861542,
0.36344072222709656,
-0.09329541772603989,
-0.19145318865776062,
0.17793959379196167,
0.24942119419574738,
-0.18712455034255981,
-0.02164270728826523,
-0.03195294737815857,
0.05765575170516968,
-0.1812642514705658,
-0.004241357557475567,
-0.0758073553442955,
0.44676700234413147,
-0.13896211981773376,
0.3095925450325012,
0.43976277112960815,
-0.8996147513389587,
-0.3625916838645935,
0.13441585004329681,
-0.06397373229265213,
-0.0601884126663208,
0.058506038039922714,
0.01664169505238533,
0.25781816244125366,
-0.04320334270596504,
-0.021347317844629288,
0.5763242840766907,
0.04290067404508591,
0.1609661728143692,
-0.06146395951509476,
-0.22005608677864075,
-0.17008289694786072,
0.2808266282081604,
0.08874942362308502,
-0.009037617594003677,
0.1623869091272354,
0.32472825050354004,
0.1860399693250656,
-0.09153860807418823,
0.2992570400238037,
0.02113470435142517,
0.34050071239471436,
-0.10796593129634857,
0.13002867996692657,
-0.1560276746749878,
-0.43905627727508545,
0.19894641637802124,
0.0056624263525009155,
-0.1836416870355606,
0.03959978371858597,
-0.21191878616809845,
-0.7007223963737488,
-0.025132037699222565,
-0.569175660610199,
0.004048369824886322,
0.06525500118732452,
0.037572119385004044,
-0.15926770865917206,
-0.2520277202129364,
-0.20095354318618774,
0.7720912098884583,
0.05972011387348175,
0.04663608968257904,
-0.3916635513305664,
0.40549543499946594,
0.0835745632648468,
-0.1298946738243103,
0.15281154215335846,
0.08317110687494278,
0.22348928451538086,
-0.11529473960399628,
-0.007244866341352463,
0.335426390171051,
0.09759162366390228,
0.3229699432849884,
0.29849740862846375,
-0.2338312268257141,
0.26542046666145325,
-0.13009798526763916,
0.16195148229599,
-0.17915475368499756,
0.05792629346251488,
-0.15522849559783936,
-0.6755703687667847,
-0.039843544363975525,
-0.3517807722091675,
0.10868237912654877,
-0.08957108110189438,
0.10036670416593552,
0.2213982343673706,
-0.037455540150403976,
-0.11709193140268326,
-0.028099089860916138,
-0.06120046600699425,
0.32909852266311646,
0.065694659948349,
-0.21259818971157074,
0.20076912641525269,
0.27493199706077576,
0.3671616017818451,
0.03770466148853302,
0.26525598764419556,
0.03501249849796295,
-0.27996596693992615,
-0.1617860496044159,
0.22111761569976807,
-0.09793148934841156,
0.2062079906463623,
0.02885480225086212,
0.08130191266536713,
-0.11181288957595825,
0.1578986793756485,
-0.026364989578723907,
-0.07094993442296982,
0.014287952333688736,
0.3772892653942108,
0.3544737994670868,
0.23529471457004547,
-0.14741846919059753,
-0.18610122799873352,
0.012119434773921967,
0.28952911496162415,
0.17055624723434448,
-0.2139212191104889,
-0.303310751914978,
-0.13172292709350586,
0.11008110642433167,
0.011611822992563248,
-0.4275701344013214,
-0.12321490049362183,
-0.2077876329421997,
-0.0196080282330513,
0.21473515033721924,
0.36480990052223206,
0.0209098719060421,
0.4872001111507416,
0.33224189281463623,
-0.0016952529549598694,
0.012887774035334587,
-0.04282110556960106,
-0.05894354730844498,
0.04522619768977165,
0.062096647918224335,
-0.04645136743783951,
0.3053494095802307,
0.37602499127388,
-0.15070870518684387,
0.36248475313186646,
-0.4026288688182831,
0.004932783544063568,
-0.10349719226360321,
-0.08593831956386566,
0.05641670525074005,
-0.005849603563547134,
0.1852445900440216,
-0.06532157957553864,
-0.10883624106645584,
0.13681231439113617,
0.18891960382461548,
-0.34340038895606995,
-0.017358779907226562,
-0.3392757177352905,
0.06922758370637894,
0.2155318707227707,
-0.3526749908924103,
-0.19367718696594238,
-0.3683619797229767,
0.34102967381477356,
0.27396464347839355,
0.09463360160589218,
-0.1167321652173996,
0.024426832795143127,
-0.02880772575736046,
0.3246482312679291,
-0.2996264696121216,
-0.10495027154684067,
-0.4184330403804779,
0.34858977794647217,
-0.3965490758419037,
-0.2427554726600647,
0.16452786326408386,
0.07230047881603241,
0.20840750634670258,
0.07735240459442139,
-0.08117904514074326,
-0.26899564266204834,
-0.15296773612499237,
0.0038708969950675964,
-0.012098194099962711,
-0.007552050054073334,
0.36841335892677307,
-0.013848470523953438,
0.07280769944190979,
-0.030996467918157578,
-0.44990089535713196,
0.23934568464756012,
0.4830894470214844,
-0.011537842452526093,
-0.16317269206047058,
0.17022766172885895,
0.1470869779586792,
0.4234074652194977,
0.3804337680339813,
0.24129100143909454,
0.2953334450721741,
0.004591142758727074,
0.08660043776035309,
-0.22529485821723938,
-0.3834978938102722,
0.0495341457426548,
0.18821784853935242,
0.26752540469169617,
0.2172609269618988,
0.18329814076423645,
-0.0006356500089168549,
-0.12741003930568695,
-0.4381835162639618,
-0.18264225125312805,
0.011257097125053406,
-0.013605310581624508,
-0.24710200726985931,
-0.024847064167261124,
-0.257887065410614,
-0.24087011814117432,
-0.5086601376533508,
-0.24266764521598816,
0.1314302235841751,
0.14354465901851654,
-0.164137601852417,
0.1344769150018692,
-0.4845096468925476,
-0.09723776578903198,
-0.3111768066883087,
0.1792142689228058,
-0.0030772872269153595,
0.05124485865235329,
0.07246038317680359,
0.13556617498397827,
0.09158496558666229,
-0.10802766680717468,
0.36960798501968384,
-0.48225417733192444,
0.1295192539691925,
0.1898368000984192,
0.03185824304819107,
-0.6480752825737,
-0.21153199672698975,
-0.09142810851335526,
0.18623490631580353,
-0.35573533177375793,
0.6838136315345764,
-0.2384166568517685,
-0.15190359950065613,
0.07625716179609299,
-0.02078845165669918,
-0.31189966201782227,
-0.1831672638654709,
-0.15313011407852173,
-0.33228233456611633,
-0.48813366889953613,
-0.17350836098194122,
0.22380772233009338,
0.24587738513946533,
-0.12913614511489868,
-0.36655038595199585,
-0.0811208039522171,
0.1337469220161438,
0.0058462731540203094,
-0.08251308649778366,
0.18093524873256683,
0.4556941092014313,
0.05892709642648697,
0.21393626928329468,
0.22766515612602234,
0.18292492628097534,
0.5924912095069885,
-0.045213788747787476,
-0.3869483470916748,
-0.01162600889801979,
-0.37440750002861023,
0.07657857239246368,
0.21988153457641602,
0.1457928568124771,
0.045000575482845306,
-0.25781211256980896,
-0.09421367943286896,
-0.37953388690948486,
0.4244270920753479,
0.06174197047948837,
-0.1159030869603157,
-0.4721205532550812,
-0.21420669555664062,
0.4455832242965698,
-0.011311326175928116,
-0.19701488316059113,
0.0696287602186203,
0.049437277019023895,
-0.3682766556739807,
0.2570650279521942,
0.1895102858543396,
0.8182158470153809,
-0.2502681314945221,
0.1330636739730835,
0.08482445776462555,
-0.2947072386741638,
0.28544262051582336,
-0.5302042961120605,
-0.20456528663635254,
-0.38594597578048706,
-0.10809589177370071,
-0.050956226885318756,
0.05756799131631851,
0.0036981692537665367,
0.2137269377708435,
-0.4683554172515869,
0.079221710562706,
-0.1896405965089798,
0.3506392538547516,
-0.11107035726308823,
0.36935243010520935,
-0.2583416998386383,
-0.39834779500961304,
-0.08886262774467468,
0.12940354645252228,
-0.1862076073884964,
0.04537229612469673,
-0.03955644369125366,
-0.12100058048963547,
-0.297368586063385,
0.036470018327236176,
-0.4177572727203369,
0.05917593836784363,
0.20104607939720154,
0.05013284459710121,
-0.2716788351535797,
-0.17950338125228882,
0.028316795825958252,
0.43711161613464355,
0.7775349020957947,
-0.09127265959978104,
-0.23078981041908264,
0.1916762888431549,
-0.26933470368385315,
-0.12297379970550537,
-0.22077156603336334,
0.01328251138329506,
0.15848888456821442,
-0.3043546974658966,
-0.36045148968696594,
0.0962979793548584,
0.08671367913484573,
-0.14130502939224243,
-0.3034517168998718,
0.07773609459400177,
0.29696962237358093,
-0.4320080876350403,
-0.0007124282419681549,
0.2903858423233032,
0.25351014733314514,
-0.1371433287858963,
0.0240265391767025,
0.15451259911060333,
-0.08763128519058228,
0.3738943934440613,
-0.02555716224014759,
-0.04468414932489395,
0.141211599111557,
0.3869737684726715,
0.039862193167209625,
-0.34277498722076416,
0.34574267268180847,
-0.02996828407049179,
0.1017448753118515,
-0.19349953532218933,
0.4048954248428345,
0.41709792613983154,
-0.235362246632576,
0.037534818053245544,
-0.04146652668714523,
-0.026571884751319885,
0.15526002645492554,
0.3413274586200714,
0.06399886310100555,
0.005642952397465706,
0.03588402271270752,
-0.11723808944225311,
-0.18717965483665466,
-0.025987770408391953,
-0.1307150274515152,
0.30119338631629944,
-0.19661986827850342,
-0.2936203181743622,
0.16320554912090302,
0.32882368564605713,
-0.22579410672187805,
0.30996912717819214,
-0.313652902841568,
0.12725071609020233,
-0.2197602540254593,
0.012121744453907013,
-0.12615233659744263,
-0.11207589507102966,
0.02779412269592285,
-0.131535604596138,
-0.20120558142662048,
-0.19047680497169495,
-0.2979290783405304,
0.18840664625167847,
0.07498517632484436,
0.11365062743425369,
-0.10023897886276245,
-0.2738489508628845,
-0.12345731258392334,
-0.11351541429758072,
0.448336660861969,
0.19900619983673096,
0.02468137815594673,
0.18834221363067627,
0.7693121433258057,
0.21183054149150848,
-0.3671744465827942,
0.179316908121109,
0.30048346519470215,
-0.042273543775081635,
-0.20398588478565216,
0.08213476836681366,
0.11505667865276337,
-0.11293397843837738,
0.14725610613822937,
0.19105303287506104,
0.7231960892677307,
0.1169474795460701,
-0.023753192275762558,
-0.14903825521469116,
0.26808640360832214,
-0.05827021971344948,
0.10372036695480347,
0.013562755659222603,
-0.22379842400550842,
0.14330318570137024,
0.0009161941707134247,
0.11371531337499619,
-0.06892755627632141,
-0.3045920431613922,
0.42127373814582825,
-0.25867852568626404,
0.021335318684577942,
0.2158544510602951,
0.29737424850463867,
-0.026389487087726593,
0.06947175413370132,
0.05898372083902359,
0.2691766619682312,
0.055828046053647995,
0.027618151158094406,
0.2370225042104721,
-0.2597801387310028,
-0.033167216926813126,
0.2317754179239273,
0.011065663769841194,
0.010387100279331207,
0.5179791450500488,
-0.08172895014286041,
0.45722052454948425,
0.373368501663208,
0.0007575349882245064,
0.7110806703567505,
-0.4001011848449707,
-0.10342204570770264,
-0.05966643989086151,
0.016512230038642883,
0.005788601003587246,
0.03456892818212509,
0.5456954836845398,
-0.042892467230558395,
-0.15174686908721924,
-0.2566627562046051,
-0.14627161622047424,
-0.0676778256893158,
0.044085148721933365,
-0.3730190098285675,
-0.15741150081157684,
-0.31240272521972656,
-0.054515812546014786,
-0.15726685523986816,
-0.3900303840637207,
0.24786560237407684,
0.03843751177191734,
-0.02204706147313118,
0.10586640238761902,
0.04879752919077873,
0.15762625634670258,
0.12984706461429596,
-0.1899205446243286,
0.10743694752454758,
0.035174112766981125,
-0.27143439650535583,
0.08179642260074615,
0.3530116677284241,
0.111077219247818,
0.12383769452571869,
-0.1414259672164917,
0.6506379842758179,
0.337911456823349,
-0.07287207990884781,
0.23393842577934265,
-0.01566966623067856,
-0.06361247599124908,
0.033750422298908234,
0.04833775758743286,
0.13484805822372437,
-0.07081848382949829,
0.18264876306056976,
-0.046931710094213486,
-0.1192808598279953,
-0.0805194228887558,
0.3566344976425171,
-0.04518848657608032,
-0.29039037227630615,
0.04916328564286232,
0.257895827293396,
-0.39281877875328064,
-0.15696752071380615,
0.2977040708065033,
0.019231177866458893,
0.07819456607103348,
-0.22014319896697998,
0.029792238026857376,
-0.1266476958990097,
0.47353020310401917,
0.13112051784992218,
-0.061948664486408234,
-0.01764819771051407,
-0.3243074417114258,
-0.31746333837509155,
0.06900452077388763,
0.23883572220802307,
-0.10950081050395966,
0.11098526418209076,
0.09713457524776459,
-0.07295176386833191,
0.09929712116718292,
0.006897084414958954,
-0.26566922664642334,
0.07828216999769211,
0.467312216758728,
-0.5039476156234741,
0.06640486419200897,
0.5055528879165649,
0.3552870750427246,
0.05447383224964142,
-0.2698967158794403,
0.304573118686676,
0.32780832052230835,
-0.11304150521755219,
0.03984786942601204,
-0.08121773600578308,
0.4824899435043335,
-0.33744895458221436,
0.11046493798494339,
-0.2691952586174011,
0.3968905806541443,
-0.06945411115884781,
0.28780806064605713,
-0.17347456514835358,
-0.0942426323890686,
-0.15788376331329346,
-0.022861052304506302,
0.0936882495880127,
0.4060644507408142,
-0.10404103994369507,
0.1315654218196869,
0.1277662217617035,
-0.020008154213428497,
-0.1312858611345291,
0.1842000037431717,
-0.1918756663799286,
0.031157217919826508,
0.11528880894184113,
-0.07950197160243988,
0.3121090829372406,
0.25237226486206055,
-0.03786689415574074,
0.010942086577415466,
-0.2945547103881836,
-0.3614213168621063,
0.3229498863220215,
0.1443236917257309,
-0.3035220801830292,
-0.26891571283340454,
0.14929458498954773,
0.06851407885551453,
-0.00562206469476223,
-0.33479321002960205,
0.23104359209537506,
0.3581070005893707,
-0.05760239437222481,
-0.13890671730041504,
0.46558162569999695,
0.043154336512088776,
-0.007778964936733246,
-0.14704230427742004,
0.11185438930988312,
0.11226069927215576,
0.08289206773042679,
-0.2352220118045807,
-0.25032922625541687
] |
https://github.com/huggingface/datasets/issues/6144 | another file not found:
```
Traceback (most recent call last):
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/implementations/http.py", line 417, in _info
await _file_info(
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/implementations/http.py", line 837, in _file_info
r.raise_for_status()
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1005, in raise_for_status
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('https://the-eye.eu/public/AI/pile_preliminary_components/pile_uspto.tar')
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/lfs/ampere1/0/brando9/.vscode-server-insiders/extensions/ms-python.python-2023.14.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/__main__.py", line 39, in <module>
cli.main()
File "/lfs/ampere1/0/brando9/.vscode-server-insiders/extensions/ms-python.python-2023.14.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 430, in main
run()
File "/lfs/ampere1/0/brando9/.vscode-server-insiders/extensions/ms-python.python-2023.14.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 284, in run_file
runpy.run_path(target, run_name="__main__")
File "/lfs/ampere1/0/brando9/.vscode-server-insiders/extensions/ms-python.python-2023.14.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 321, in run_path
return _run_module_code(code, init_globals, run_name,
File "/lfs/ampere1/0/brando9/.vscode-server-insiders/extensions/ms-python.python-2023.14.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 135, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/lfs/ampere1/0/brando9/.vscode-server-insiders/extensions/ms-python.python-2023.14.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 124, in _run_code
exec(code, run_globals)
File "/lfs/ampere1/0/brando9/beyond-scale-language-data-diversity/src/diversity/div_coeff.py", line 526, in <module>
experiment_compute_diveristy_coeff_single_dataset_then_combined_datasets_with_domain_weights()
File "/lfs/ampere1/0/brando9/beyond-scale-language-data-diversity/src/diversity/div_coeff.py", line 475, in experiment_compute_diveristy_coeff_single_dataset_then_combined_datasets_with_domain_weights
column_names = next(iter(dataset)).keys()
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 1353, in __iter__
for key, example in ex_iterable:
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 207, in __iter__
yield from self.generate_examples_fn(**self.kwargs)
File "/lfs/ampere1/0/brando9/.cache/huggingface/modules/datasets_modules/datasets/EleutherAI--pile/ebea56d358e91cf4d37b0fde361d563bed1472fbd8221a21b38fc8bb4ba554fb/pile.py", line 257, in _generate_examples
for path, file in files[subset]:
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/datasets/download/streaming_download_manager.py", line 840, in __iter__
yield from self.generator(*self.args, **self.kwargs)
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/datasets/download/streaming_download_manager.py", line 891, in _iter_from_urlpath
with xopen(urlpath, "rb", download_config=download_config) as f:
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/datasets/download/streaming_download_manager.py", line 496, in xopen
file_obj = fsspec.open(file, mode=mode, *args, **kwargs).open()
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/core.py", line 134, in open
return self.__enter__()
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/core.py", line 102, in __enter__
f = self.fs.open(self.path, mode=mode)
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/spec.py", line 1241, in open
f = self._open(
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/implementations/http.py", line 356, in _open
size = size or self.info(path, **kwargs)["size"]
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/asyn.py", line 121, in wrapper
return sync(self.loop, func, *args, **kwargs)
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/asyn.py", line 106, in sync
raise return_result
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/asyn.py", line 61, in _runner
result[0] = await coro
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/implementations/http.py", line 430, in _info
raise FileNotFoundError(url) from exc
FileNotFoundError: https://the-eye.eu/public/AI/pile_preliminary_components/pile_uspto.tar
``` | NIH exporter file not found | ### Describe the bug
can't use or download the nih exporter pile data.
```
15 experiment_compute_diveristy_coeff_single_dataset_then_combined_datasets_with_domain_weights()
16 File "/lfs/ampere1/0/brando9/beyond-scale-language-data-diversity/src/diversity/div_coeff.py", line 474, in experiment_compute_diveristy_coeff_single_dataset_then_combined_datasets_with_domain_weights
17 column_names = next(iter(dataset)).keys()
18 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 1353, in __iter__
19 for key, example in ex_iterable:
20 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 207, in __iter__
21 yield from self.generate_examples_fn(**self.kwargs)
22 File "/lfs/ampere1/0/brando9/.cache/huggingface/modules/datasets_modules/datasets/EleutherAI--pile/ebea56d358e91cf4d37b0fde361d563bed1472fbd8221a21b38fc8bb4ba554fb/pile.py", line 236, in _generate_examples
23 with zstd.open(open(files[subset], "rb"), "rt", encoding="utf-8") as f:
24 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/datasets/streaming.py", line 74, in wrapper
25 return function(*args, download_config=download_config, **kwargs)
26 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/datasets/download/streaming_download_manager.py", line 496, in xopen
27 file_obj = fsspec.open(file, mode=mode, *args, **kwargs).open()
28 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/core.py", line 134, in open
29 return self.__enter__()
30 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/core.py", line 102, in __enter__
31 f = self.fs.open(self.path, mode=mode)
32 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/spec.py", line 1241, in open
33 f = self._open(
34 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/implementations/http.py", line 356, in _open
35 size = size or self.info(path, **kwargs)["size"]
36 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/asyn.py", line 121, in wrapper
37 return sync(self.loop, func, *args, **kwargs)
38 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/asyn.py", line 106, in sync
39 raise return_result
40 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/asyn.py", line 61, in _runner
41 result[0] = await coro
42 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/implementations/http.py", line 430, in _info
43 raise FileNotFoundError(url) from exc
44 FileNotFoundError: https://the-eye.eu/public/AI/pile_preliminary_components/NIH_ExPORTER_awarded_grant_text.jsonl.zst
```
### Steps to reproduce the bug
run this:
```
from datasets import load_dataset
path, name = 'EleutherAI/pile', 'nih_exporter'
# -- Get data set
dataset = load_dataset(path, name, streaming=True, split="train").with_format("torch")
batch = dataset.take(512)
print(f'{batch=}')
```
### Expected behavior
print the batch
### Environment info
```
(beyond_scale) brando9@ampere1:~/beyond-scale-language-data-diversity$ datasets-cli env
Copy-and-paste the text below in your GitHub issue.
- `datasets` version: 2.14.4
- Platform: Linux-5.4.0-122-generic-x86_64-with-glibc2.31
- Python version: 3.10.11
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
``` | 283 | NIH exporter file not found
### Describe the bug
can't use or download the nih exporter pile data.
```
15 experiment_compute_diveristy_coeff_single_dataset_then_combined_datasets_with_domain_weights()
16 File "/lfs/ampere1/0/brando9/beyond-scale-language-data-diversity/src/diversity/div_coeff.py", line 474, in experiment_compute_diveristy_coeff_single_dataset_then_combined_datasets_with_domain_weights
17 column_names = next(iter(dataset)).keys()
18 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 1353, in __iter__
19 for key, example in ex_iterable:
20 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 207, in __iter__
21 yield from self.generate_examples_fn(**self.kwargs)
22 File "/lfs/ampere1/0/brando9/.cache/huggingface/modules/datasets_modules/datasets/EleutherAI--pile/ebea56d358e91cf4d37b0fde361d563bed1472fbd8221a21b38fc8bb4ba554fb/pile.py", line 236, in _generate_examples
23 with zstd.open(open(files[subset], "rb"), "rt", encoding="utf-8") as f:
24 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/datasets/streaming.py", line 74, in wrapper
25 return function(*args, download_config=download_config, **kwargs)
26 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/datasets/download/streaming_download_manager.py", line 496, in xopen
27 file_obj = fsspec.open(file, mode=mode, *args, **kwargs).open()
28 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/core.py", line 134, in open
29 return self.__enter__()
30 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/core.py", line 102, in __enter__
31 f = self.fs.open(self.path, mode=mode)
32 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/spec.py", line 1241, in open
33 f = self._open(
34 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/implementations/http.py", line 356, in _open
35 size = size or self.info(path, **kwargs)["size"]
36 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/asyn.py", line 121, in wrapper
37 return sync(self.loop, func, *args, **kwargs)
38 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/asyn.py", line 106, in sync
39 raise return_result
40 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/asyn.py", line 61, in _runner
41 result[0] = await coro
42 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/implementations/http.py", line 430, in _info
43 raise FileNotFoundError(url) from exc
44 FileNotFoundError: https://the-eye.eu/public/AI/pile_preliminary_components/NIH_ExPORTER_awarded_grant_text.jsonl.zst
```
### Steps to reproduce the bug
run this:
```
from datasets import load_dataset
path, name = 'EleutherAI/pile', 'nih_exporter'
# -- Get data set
dataset = load_dataset(path, name, streaming=True, split="train").with_format("torch")
batch = dataset.take(512)
print(f'{batch=}')
```
### Expected behavior
print the batch
### Environment info
```
(beyond_scale) brando9@ampere1:~/beyond-scale-language-data-diversity$ datasets-cli env
Copy-and-paste the text below in your GitHub issue.
- `datasets` version: 2.14.4
- Platform: Linux-5.4.0-122-generic-x86_64-with-glibc2.31
- Python version: 3.10.11
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
```
another file not found:
```
Traceback (most recent call last):
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/implementations/http.py", line 417, in _info
await _file_info(
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/implementations/http.py", line 837, in _file_info
r.raise_for_status()
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1005, in raise_for_status
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('https://the-eye.eu/public/AI/pile_preliminary_components/pile_uspto.tar')
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/lfs/ampere1/0/brando9/.vscode-server-insiders/extensions/ms-python.python-2023.14.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/__main__.py", line 39, in <module>
cli.main()
File "/lfs/ampere1/0/brando9/.vscode-server-insiders/extensions/ms-python.python-2023.14.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 430, in main
run()
File "/lfs/ampere1/0/brando9/.vscode-server-insiders/extensions/ms-python.python-2023.14.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 284, in run_file
runpy.run_path(target, run_name="__main__")
File "/lfs/ampere1/0/brando9/.vscode-server-insiders/extensions/ms-python.python-2023.14.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 321, in run_path
return _run_module_code(code, init_globals, run_name,
File "/lfs/ampere1/0/brando9/.vscode-server-insiders/extensions/ms-python.python-2023.14.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 135, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/lfs/ampere1/0/brando9/.vscode-server-insiders/extensions/ms-python.python-2023.14.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 124, in _run_code
exec(code, run_globals)
File "/lfs/ampere1/0/brando9/beyond-scale-language-data-diversity/src/diversity/div_coeff.py", line 526, in <module>
experiment_compute_diveristy_coeff_single_dataset_then_combined_datasets_with_domain_weights()
File "/lfs/ampere1/0/brando9/beyond-scale-language-data-diversity/src/diversity/div_coeff.py", line 475, in experiment_compute_diveristy_coeff_single_dataset_then_combined_datasets_with_domain_weights
column_names = next(iter(dataset)).keys()
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 1353, in __iter__
for key, example in ex_iterable:
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 207, in __iter__
yield from self.generate_examples_fn(**self.kwargs)
File "/lfs/ampere1/0/brando9/.cache/huggingface/modules/datasets_modules/datasets/EleutherAI--pile/ebea56d358e91cf4d37b0fde361d563bed1472fbd8221a21b38fc8bb4ba554fb/pile.py", line 257, in _generate_examples
for path, file in files[subset]:
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/datasets/download/streaming_download_manager.py", line 840, in __iter__
yield from self.generator(*self.args, **self.kwargs)
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/datasets/download/streaming_download_manager.py", line 891, in _iter_from_urlpath
with xopen(urlpath, "rb", download_config=download_config) as f:
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/datasets/download/streaming_download_manager.py", line 496, in xopen
file_obj = fsspec.open(file, mode=mode, *args, **kwargs).open()
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/core.py", line 134, in open
return self.__enter__()
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/core.py", line 102, in __enter__
f = self.fs.open(self.path, mode=mode)
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/spec.py", line 1241, in open
f = self._open(
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/implementations/http.py", line 356, in _open
size = size or self.info(path, **kwargs)["size"]
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/asyn.py", line 121, in wrapper
return sync(self.loop, func, *args, **kwargs)
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/asyn.py", line 106, in sync
raise return_result
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/asyn.py", line 61, in _runner
result[0] = await coro
File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/implementations/http.py", line 430, in _info
raise FileNotFoundError(url) from exc
FileNotFoundError: https://the-eye.eu/public/AI/pile_preliminary_components/pile_uspto.tar
``` | [
-0.2584576904773712,
0.008933529257774353,
-0.06965087354183197,
0.2353883683681488,
0.16815856099128723,
0.13015833497047424,
0.3746143877506256,
0.5034440755844116,
0.03095618635416031,
0.47794991731643677,
-0.20891538262367249,
0.10971230268478394,
-0.12225690484046936,
0.2982402443885803,
0.06446437537670135,
-0.10143952071666718,
-0.1277635395526886,
0.11975342035293579,
-0.10980001091957092,
-0.22379052639007568,
-0.18325471878051758,
0.31772300601005554,
-0.16147905588150024,
0.21188893914222717,
0.3268741965293884,
-0.12286923080682755,
-0.05927450954914093,
0.3844963610172272,
-0.23902644217014313,
-0.212949737906456,
0.19391457736492157,
0.0720578283071518,
0.41433045268058777,
0.13394567370414734,
-0.00010650128388078883,
0.14716315269470215,
0.2468058168888092,
-0.2728186845779419,
-0.30404132604599,
-0.340511292219162,
0.1377747654914856,
-0.2407340109348297,
-0.2721337676048279,
-0.45285409688949585,
0.014082036912441254,
-0.3474024534225464,
-0.08902544528245926,
-0.13408797979354858,
0.20044025778770447,
0.2521281838417053,
0.29279661178588867,
0.3165326714515686,
0.13468383252620697,
-0.31292617321014404,
0.1895449161529541,
-0.10498079657554626,
-0.18873614072799683,
0.3284415006637573,
0.02455310896039009,
-0.016681410372257233,
-0.09397011250257492,
0.23113049566745758,
0.36790135502815247,
-0.08498378098011017,
-0.13394159078598022,
0.15935006737709045,
0.282726913690567,
-0.2915283441543579,
-0.24319517612457275,
0.23250915110111237,
0.09950293600559235,
0.06995336711406708,
-0.25512969493865967,
0.12742400169372559,
0.022867009043693542,
-0.24860727787017822,
0.09604587405920029,
0.3608042001724243,
-0.19192585349082947,
0.014810176566243172,
0.2615680396556854,
-0.07685293257236481,
-0.3452940583229065,
0.13772521913051605,
0.08137485384941101,
0.1532527059316635,
-0.17102353274822235,
0.004314083606004715,
0.08729718625545502,
-0.14361247420310974,
0.08885085582733154,
0.11203113198280334,
-0.12353290617465973,
-0.18756422400474548,
-0.40823790431022644,
-0.2765008807182312,
0.23351778090000153,
-0.26776623725891113,
0.10045474767684937,
0.041862331330776215,
0.32678812742233276,
-0.06343507766723633,
0.1262543499469757,
-0.04729471355676651,
0.1371513307094574,
0.01144995167851448,
0.038652148097753525,
0.12755581736564636,
0.2560667395591736,
0.5226669311523438,
0.11339797079563141,
-0.11417966336011887,
-0.16352057456970215,
-0.1759047955274582,
-0.11421851813793182,
0.02426953613758087,
0.030536383390426636,
-0.24981097877025604,
-0.16340449452400208,
0.02912033349275589,
0.03222879767417908,
0.13296201825141907,
-0.04077419638633728,
0.2540227174758911,
0.2214866280555725,
0.0787573903799057,
0.01758401095867157,
0.250436007976532,
-0.04264079034328461,
-0.050611041486263275,
-0.31651219725608826,
0.36952489614486694,
0.0005804449319839478,
-0.08988666534423828,
0.06799095869064331,
-0.04573490470647812,
0.29739344120025635,
-0.03980420529842377,
0.1631583273410797,
0.11950692534446716,
0.06640072166919708,
-0.18010197579860687,
0.06211479753255844,
0.23251654207706451,
0.21034380793571472,
0.045469678938388824,
0.15984849631786346,
-0.03735081106424332,
-0.11731421202421188,
-0.029133114963769913,
-0.1256512850522995,
-0.20530042052268982,
-0.3691036105155945,
0.3237708508968353,
-0.14143973588943481,
0.18817728757858276,
0.17735034227371216,
-0.2965051233768463,
-0.19726213812828064,
-0.20960918068885803,
0.0997481644153595,
-0.46964171528816223,
-0.007529206573963165,
-0.34654462337493896,
0.28862857818603516,
0.1844281256198883,
-0.2822574973106384,
-0.06320524215698242,
-0.2370130568742752,
-0.12979787588119507,
0.4326007664203644,
0.19080477952957153,
-0.28000330924987793,
0.32214418053627014,
-0.4685668647289276,
0.2437392771244049,
0.7442121505737305,
-0.35185569524765015,
-0.2802845239639282,
0.12832728028297424,
-0.2921268343925476,
0.05900479853153229,
0.10386805236339569,
0.04055871069431305,
0.06545424461364746,
-0.21834087371826172,
0.10935146361589432,
0.3899748921394348,
-0.1608995646238327,
-0.1773274838924408,
-0.2662310004234314,
-0.0929730162024498,
-0.036376677453517914,
0.13922753930091858,
0.08197151124477386,
0.12879334390163422,
0.3555362820625305,
0.24452358484268188,
0.31072986125946045,
-0.15233361721038818,
0.13319602608680725,
0.10806526243686676,
0.40722179412841797,
-0.041111260652542114,
0.03798293694853783,
-0.19769173860549927,
-0.03912748396396637,
0.30110883712768555,
-0.5797610282897949,
0.29259222745895386,
-0.12506777048110962,
-0.00842360407114029,
-0.1530362367630005,
-0.06841380894184113,
-0.32429757714271545,
-0.2626335620880127,
0.25850021839141846,
0.1985253542661667,
0.2718276381492615,
-0.07005951553583145,
-0.047697022557258606,
0.17337442934513092,
-0.4290451407432556,
-0.11435055732727051,
-0.46156588196754456,
0.41514989733695984,
-0.4137052893638611,
-0.15775129199028015,
0.10401541739702225,
0.01849227026104927,
-0.01474093273282051,
-0.34435799717903137,
-0.2234911024570465,
0.22805055975914001,
-0.3554384112358093,
0.013176888227462769,
0.27668890357017517,
-0.09438274800777435,
0.140130415558815,
-0.31469565629959106,
0.2849167585372925,
0.07475186139345169,
0.14753226935863495,
0.06555590033531189,
-0.03630581125617027,
0.3830658793449402,
-0.324786514043808,
-0.015326201915740967,
0.24140280485153198,
0.04523976892232895,
0.42124292254447937,
-0.10396712273359299,
0.25085604190826416,
-0.2963851988315582,
0.2453427016735077,
0.07066063582897186,
-0.12863264977931976,
-0.25982949137687683,
-0.017509877681732178,
-0.0023494549095630646,
0.6232227683067322,
0.16032667458057404,
-0.10449926555156708,
0.27895525097846985,
-0.09234261512756348,
-0.09496485441923141,
0.09046920388936996,
0.3087521493434906,
0.5424649119377136,
0.10161596536636353,
0.33443596959114075,
0.027528511360287666,
0.18016597628593445,
-0.1950322836637497,
0.2449120283126831,
-0.02941349521279335,
0.26207587122917175,
0.3616464138031006,
0.00690712034702301,
0.11851795017719269,
-0.15445426106452942,
-0.21229171752929688,
-0.1751120537519455,
0.2640725374221802,
-0.05852518230676651,
-0.0632326677441597,
-0.09110128879547119,
-0.17996887862682343,
-0.10116226971149445,
-0.12941224873065948,
0.01222851313650608,
-0.4979206323623657,
-0.02681957371532917,
0.2374189794063568,
-0.19244511425495148,
-0.07103793323040009,
0.05065444856882095,
-0.17360220849514008,
0.28163522481918335,
0.08359545469284058,
-0.2717791795730591,
-0.144682839512825,
-0.25609785318374634,
0.23003116250038147,
-0.09959562122821808,
0.2777476906776428,
0.11256876587867737,
-0.17859482765197754,
-0.025805190205574036,
-0.4768430292606354,
-0.13292376697063446,
0.1767301857471466,
-0.020777184516191483,
0.2713601589202881,
0.4605458974838257,
0.39234182238578796,
0.14659549295902252,
-0.17874255776405334,
0.41946372389793396,
-0.5308354496955872,
-0.26706668734550476,
0.2945402264595032,
-0.07382658869028091,
0.019909799098968506,
-0.1558629721403122,
-0.45088183879852295,
-0.6593803763389587,
-0.6567697525024414,
-0.09336133301258087,
0.057981401681900024,
0.31123387813568115,
0.4056699275970459,
-0.009541686624288559,
0.21906951069831848,
0.24382612109184265,
-0.019798625260591507,
0.03915141895413399,
-0.3477110266685486,
0.3549434244632721,
-0.3820550739765167,
-0.4427129626274109,
-0.10668997466564178,
-0.023886069655418396,
-0.05909162759780884,
0.053385112434625626,
-0.41133177280426025,
0.005154281854629517,
-0.15739257633686066,
0.1966075599193573,
0.0838007777929306,
0.21790112555027008,
0.16327911615371704,
-0.05216490477323532,
-0.14047172665596008,
-0.08458802103996277,
0.14698931574821472,
0.270391583442688,
0.26644736528396606,
0.1414513736963272,
0.0842837393283844,
0.3803151547908783,
0.006493568420410156,
0.21695953607559204,
0.31777822971343994,
-0.013690801337361336,
0.6029472351074219,
-0.001624520868062973,
0.29889577627182007,
0.03546582907438278,
-0.36416956782341003,
0.1137300431728363,
0.16326434910297394,
0.16668812930583954,
0.31856006383895874,
-0.18554480373859406,
0.07887431234121323,
-0.1729719340801239,
-0.3092854619026184,
-0.06740347295999527,
-0.27876582741737366,
0.24376501142978668,
0.021527418866753578,
-0.05743322893977165,
-0.2546709477901459,
-0.3161086440086365,
-0.0898841843008995,
-0.12829242646694183,
0.27299511432647705,
0.18703117966651917,
0.0060065388679504395,
0.22376200556755066,
-0.1758653223514557,
0.13945546746253967,
-0.2590188980102539,
0.16294901072978973,
0.008465994149446487,
0.2710428535938263,
-0.1310431808233261,
-0.27003926038742065,
-0.11428259313106537,
-0.10812084376811981,
0.5565721392631531,
-0.14610107243061066,
0.16999635100364685,
0.10596016049385071,
-0.057202551513910294,
-0.031028851866722107,
-0.2838546335697174,
-0.47855812311172485,
0.30733025074005127,
0.5456464290618896,
0.3184475898742676,
-0.14111076295375824,
-0.025734081864356995,
0.5136938691139221,
0.23543553054332733,
-0.18821755051612854,
-0.22140344977378845,
-0.18961907923221588,
-0.34996455907821655,
-0.417536199092865,
-0.11262974143028259,
-0.19268402457237244,
0.4816896915435791,
-0.09215863049030304,
-0.1279820203781128,
0.085113525390625,
-0.22487638890743256,
0.06858900934457779,
0.15649117529392242,
0.11662726104259491,
-0.08348642289638519,
0.12264081835746765,
0.050202883780002594,
0.10793130099773407,
0.25304606556892395,
0.42715394496917725,
0.16871406137943268,
-0.18550536036491394,
0.05928247794508934,
-0.261839896440506,
-0.06383588910102844,
0.12841077148914337,
-0.09571818262338638,
-0.07984979450702667,
-0.04419303685426712,
0.40756702423095703,
0.10241375863552094,
0.004981487989425659,
0.1590629667043686,
-0.08467447757720947,
-0.4560915231704712,
0.04186317324638367,
0.15554970502853394,
-0.06275980919599533,
0.25285959243774414,
0.3794082999229431,
0.24238206446170807,
-0.22876697778701782,
0.32797327637672424,
-0.2024037092924118,
0.6869305372238159,
0.12102632224559784,
0.1153392344713211,
0.2468283623456955,
0.2575383186340332,
0.5508442521095276,
0.13436169922351837,
0.05190018564462662,
-0.27061527967453003,
-0.6595309972763062,
0.05669431388378143,
-0.14448536932468414,
0.23412372171878815,
0.14502520859241486,
-0.13328702747821808,
0.377084344625473,
-0.09666468948125839,
0.14415952563285828,
-0.14050526916980743,
0.2251339703798294,
-0.0519476979970932,
-0.050143249332904816,
0.045114826411008835,
0.14056624472141266,
-0.06350243836641312,
0.29802361130714417,
-0.07565438747406006,
-0.3892972767353058,
-0.15260842442512512,
-0.1229800209403038,
-0.11053086817264557,
0.42614418268203735,
-0.02888454683125019,
0.28715240955352783,
-0.17286263406276703,
-0.3482654094696045,
0.16427919268608093,
0.1422489732503891,
0.34024783968925476,
0.03867604210972786,
0.015790006145834923,
-0.07045683264732361,
0.12781459093093872,
-0.1580808311700821,
0.16003291308879852,
0.25945425033569336,
0.40666666626930237,
-0.27150505781173706,
-0.3428518772125244,
0.19083993136882782,
0.06608930230140686,
-0.28897279500961304,
0.16657549142837524,
-0.024802040308713913,
-0.07754641771316528,
-0.16262571513652802,
-0.159205362200737,
-0.13303174078464508,
-0.26451438665390015,
-0.36773258447647095,
0.16227546334266663,
0.15972602367401123,
-0.3416324257850647,
-0.053705014288425446,
-0.029130447655916214,
-0.14243309199810028,
-0.07512730360031128,
-0.07998718321323395,
0.1700265109539032,
0.1067657470703125,
0.2395687997341156,
0.15271495282649994,
-0.1972750425338745,
-0.25118115544319153,
-0.30031830072402954,
-0.015215964987874031,
-0.3958919644355774,
0.2569356858730316,
0.12153248488903046,
0.1556459665298462,
-0.07365500926971436,
0.258302241563797,
0.31084343791007996,
0.003510124981403351,
-0.16814376413822174,
-0.6192024946212769,
-0.1929970234632492,
-0.05676195025444031,
-0.2412852942943573,
0.2491004467010498,
-0.05334357172250748,
-0.17265203595161438,
-0.06232047080993652,
0.045969828963279724,
-0.43134212493896484,
-0.012798789888620377,
-0.4134909510612488,
-0.0319153368473053,
-0.07655782252550125,
-0.06760622560977936,
0.17936518788337708,
-0.023133592680096626,
0.2194225788116455,
0.024168528616428375,
-0.15606717765331268,
-0.24347274005413055,
-0.10910049080848694,
0.08300071209669113,
-0.019976019859313965,
-0.08440801501274109,
0.07450249791145325,
-0.13726955652236938,
-0.18564638495445251,
-0.05985572189092636,
0.08978412300348282,
-0.2325422316789627,
0.1183471828699112,
0.25930577516555786,
0.32186710834503174,
-0.08570249378681183,
-0.1482086479663849,
0.32770949602127075,
0.17710831761360168,
0.18493804335594177,
-0.1904861032962799,
0.2576831877231598,
-0.05346286669373512,
-0.21705254912376404,
-0.565376877784729,
-0.06708339601755142,
-0.11651325970888138,
0.10802523046731949,
0.2856868505477905,
-0.060843050479888916,
-0.3077033758163452,
0.09876319766044617,
0.3244885802268982,
0.30240362882614136,
-0.0878317803144455,
0.14118260145187378,
0.12169253826141357,
0.2604556381702423,
-0.45870357751846313,
0.2244749367237091,
0.07251235842704773,
-0.20025266706943512,
0.06182500720024109,
0.2836568355560303,
0.1420717090368271,
-0.18183067440986633,
0.2242087721824646,
0.10793530195951462,
0.2603300213813782,
-0.18393199145793915,
0.21737349033355713,
0.31290149688720703,
-0.0384635329246521,
0.11187700182199478,
0.205486461520195,
-0.054438285529613495,
0.12406973540782928,
0.29032447934150696,
-0.1341506689786911,
0.2563931345939636,
0.028652090579271317,
-0.15238851308822632,
0.10078698396682739,
-0.5200996398925781,
-0.003302871249616146,
0.3078621029853821,
-0.15976811945438385,
-0.020355451852083206,
0.13715271651744843,
-0.004684966057538986,
-0.16858357191085815,
0.07482662796974182,
-0.29780158400535583,
0.166786789894104,
-0.2721939980983734,
0.263234406709671,
-0.1780136525630951,
-0.21468418836593628,
-0.18598872423171997,
-0.028958000242710114,
0.2775096595287323,
-0.06102820485830307,
0.0037763305008411407,
0.24520361423492432,
-0.19248083233833313,
-0.24264611303806305,
-0.003058895468711853,
0.1232159286737442,
-0.04916534572839737,
-0.3946143090724945,
0.061252161860466,
0.47365301847457886,
-0.0583786740899086,
-0.2190500646829605,
0.2641162872314453,
0.47875645756721497,
0.214262917637825,
0.07046057283878326,
0.1820036619901657,
0.1524524986743927,
-0.18362295627593994,
-0.11365323513746262,
-0.062002960592508316,
-0.06074700877070427,
0.24921490252017975,
0.24804741144180298,
0.2791242003440857,
-0.2244347631931305,
-0.20371535420417786,
0.16324245929718018,
0.09300301969051361,
0.017148420214653015,
0.4454292058944702,
-0.0655858963727951,
0.02693970501422882,
-0.18893273174762726,
-0.06128666177392006,
-0.4624686539173126,
0.020040664821863174,
0.08689627051353455,
-0.046603355556726456,
0.1901424527168274,
-0.01987661048769951,
0.1487291008234024,
-0.15294748544692993,
0.3024739921092987,
0.5378361940383911,
-0.05444717779755592,
-0.2150561660528183,
-0.1369255781173706,
-0.5039241313934326,
0.30971264839172363,
0.0413208082318306,
-0.05313586816191673,
-0.005148330703377724,
0.33485889434814453,
0.05238516628742218,
0.002438051626086235,
0.180966317653656,
0.04068557545542717,
0.06902382522821426,
0.19116325676441193,
-0.4025806784629822,
0.009625134989619255,
0.19631454348564148,
-0.07743793725967407,
-0.056284524500370026,
-0.4984322190284729,
0.16760572791099548,
-0.34347909688949585,
0.1995241492986679,
-0.11351820826530457,
-0.025983616709709167,
0.18370851874351501,
-0.20853343605995178,
0.25271037220954895,
-0.002088043838739395,
0.09161897003650665,
-0.11041970551013947,
-0.0780983418226242,
-0.05217219516634941,
-0.08171741664409637,
-0.06842656433582306,
0.14280253648757935,
0.17119675874710083,
0.30384892225265503,
0.05988150089979172,
-0.06851103901863098,
-0.40291303396224976,
-0.0492774173617363,
-0.1352352648973465,
-0.0807773619890213,
-0.09673137962818146,
0.3127273619174957,
0.004243776202201843,
-0.04534794017672539,
0.3000475764274597,
-0.021813590079545975,
-0.07040949165821075,
-0.06683904677629471,
-0.42016446590423584,
-0.5053126811981201,
0.3283834457397461,
-0.18389928340911865,
-0.36576464772224426,
0.024271797388792038,
0.09966103732585907,
-0.2648107409477234,
0.10528791695833206,
-0.4470980167388916,
0.38179272413253784,
0.3073422908782959,
-0.008051973767578602,
-0.012706093490123749,
0.25140926241874695,
-0.05146166682243347,
0.09518972784280777,
0.11744190007448196,
0.10118740797042847,
0.06574852764606476,
-0.32187074422836304,
-0.017160244286060333,
-0.023721493780612946
] |
https://github.com/huggingface/datasets/issues/6144 | this seems to work but it's rather annoying.
Summary of how to make it work:
1. get urls to parquet files into a list
2. load list to load_dataset via `load_dataset('parquet', data_files=urls)` (note api names to hf are really confusing sometimes)
3. then it should work, print a batch of text.
presudo code
```python
urls_hacker_news = [
"https://huggingface.co/datasets/EleutherAI/pile/resolve/refs%2Fconvert%2Fparquet/hacker_news/pile-train-00000-of-00004.parquet",
"https://huggingface.co/datasets/EleutherAI/pile/resolve/refs%2Fconvert%2Fparquet/hacker_news/pile-train-00001-of-00004.parquet",
"https://huggingface.co/datasets/EleutherAI/pile/resolve/refs%2Fconvert%2Fparquet/hacker_news/pile-train-00002-of-00004.parquet",
"https://huggingface.co/datasets/EleutherAI/pile/resolve/refs%2Fconvert%2Fparquet/hacker_news/pile-train-00003-of-00004.parquet"
]
...
# streaming = False
from diversity.pile_subset_urls import urls_hacker_news
path, name, data_files = 'parquet', 'hacker_news', urls_hacker_news
# not changing
batch_size = 512
today = datetime.datetime.now().strftime('%Y-m%m-d%d-t%Hh_%Mm_%Ss')
run_name = f'{path} div_coeff_{num_batches=} ({today=} ({name=}) {data_mixture_name=} {probabilities=})'
print(f'{run_name=}')
# - Init wandb
debug: bool = mode == 'dryrun'
run = wandb.init(mode=mode, project="beyond-scale", name=run_name, save_code=True)
wandb.config.update({"num_batches": num_batches, "path": path, "name": name, "today": today, 'probabilities': probabilities, 'batch_size': batch_size, 'debug': debug, 'data_mixture_name': data_mixture_name, 'streaming': streaming, 'data_files': data_files})
# run.notify_on_failure() # https://community.wandb.ai/t/how-do-i-set-the-wandb-alert-programatically-for-my-current-run/4891
print(f'{debug=}')
print(f'{wandb.config=}')
# -- Get probe network
from datasets import load_dataset
import torch
from transformers import GPT2Tokenizer, GPT2LMHeadModel
tokenizer = GPT2Tokenizer.from_pretrained("gpt2")
if tokenizer.pad_token_id is None:
tokenizer.pad_token = tokenizer.eos_token
probe_network = GPT2LMHeadModel.from_pretrained("gpt2")
device = torch.device(f"cuda:{0}" if torch.cuda.is_available() else "cpu")
probe_network = probe_network.to(device)
# -- Get data set
def my_load_dataset(path, name):
print(f'{path=} {name=} {streaming=}')
if path == 'json' or path == 'bin' or path == 'csv':
print(f'{data_files_prefix+name=}')
return load_dataset(path, data_files=data_files_prefix+name, streaming=streaming, split="train").with_format("torch")
elif path == 'parquet':
print(f'{data_files=}')
return load_dataset(path, data_files=data_files, streaming=streaming, split="train").with_format("torch")
else:
return load_dataset(path, name, streaming=streaming, split="train").with_format("torch")
# - get data set for real now
if isinstance(path, str):
dataset = my_load_dataset(path, name)
else:
print('-- interleaving datasets')
datasets = [my_load_dataset(path, name).with_format("torch") for path, name in zip(path, name)]
[print(f'{dataset.description=}') for dataset in datasets]
dataset = interleave_datasets(datasets, probabilities)
print(f'{dataset=}')
batch = dataset.take(batch_size)
print(f'{next(iter(batch))=}')
column_names = next(iter(batch)).keys()
print(f'{column_names=}')
# - Prepare functions to tokenize batch
def preprocess(examples):
return tokenizer(examples["text"], padding="max_length", max_length=128, truncation=True, return_tensors="pt")
remove_columns = column_names # remove all keys that are not tensors to avoid bugs in collate function in task2vec's pytorch data loader
def map(batch):
return batch.map(preprocess, batched=True, remove_columns=remove_columns)
tokenized_batch = map(batch)
print(f'{next(iter(tokenized_batch))=}')
```
https://stackoverflow.com/questions/76891189/how-to-download-data-from-hugging-face-that-is-visible-on-the-data-viewer-but-th/76902681#76902681
https://discuss.huggingface.co/t/how-to-download-data-from-hugging-face-that-is-visible-on-the-data-viewer-but-the-files-are-not-available/50555/5?u=severo | NIH exporter file not found | ### Describe the bug
can't use or download the nih exporter pile data.
```
15 experiment_compute_diveristy_coeff_single_dataset_then_combined_datasets_with_domain_weights()
16 File "/lfs/ampere1/0/brando9/beyond-scale-language-data-diversity/src/diversity/div_coeff.py", line 474, in experiment_compute_diveristy_coeff_single_dataset_then_combined_datasets_with_domain_weights
17 column_names = next(iter(dataset)).keys()
18 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 1353, in __iter__
19 for key, example in ex_iterable:
20 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 207, in __iter__
21 yield from self.generate_examples_fn(**self.kwargs)
22 File "/lfs/ampere1/0/brando9/.cache/huggingface/modules/datasets_modules/datasets/EleutherAI--pile/ebea56d358e91cf4d37b0fde361d563bed1472fbd8221a21b38fc8bb4ba554fb/pile.py", line 236, in _generate_examples
23 with zstd.open(open(files[subset], "rb"), "rt", encoding="utf-8") as f:
24 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/datasets/streaming.py", line 74, in wrapper
25 return function(*args, download_config=download_config, **kwargs)
26 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/datasets/download/streaming_download_manager.py", line 496, in xopen
27 file_obj = fsspec.open(file, mode=mode, *args, **kwargs).open()
28 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/core.py", line 134, in open
29 return self.__enter__()
30 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/core.py", line 102, in __enter__
31 f = self.fs.open(self.path, mode=mode)
32 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/spec.py", line 1241, in open
33 f = self._open(
34 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/implementations/http.py", line 356, in _open
35 size = size or self.info(path, **kwargs)["size"]
36 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/asyn.py", line 121, in wrapper
37 return sync(self.loop, func, *args, **kwargs)
38 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/asyn.py", line 106, in sync
39 raise return_result
40 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/asyn.py", line 61, in _runner
41 result[0] = await coro
42 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/implementations/http.py", line 430, in _info
43 raise FileNotFoundError(url) from exc
44 FileNotFoundError: https://the-eye.eu/public/AI/pile_preliminary_components/NIH_ExPORTER_awarded_grant_text.jsonl.zst
```
### Steps to reproduce the bug
run this:
```
from datasets import load_dataset
path, name = 'EleutherAI/pile', 'nih_exporter'
# -- Get data set
dataset = load_dataset(path, name, streaming=True, split="train").with_format("torch")
batch = dataset.take(512)
print(f'{batch=}')
```
### Expected behavior
print the batch
### Environment info
```
(beyond_scale) brando9@ampere1:~/beyond-scale-language-data-diversity$ datasets-cli env
Copy-and-paste the text below in your GitHub issue.
- `datasets` version: 2.14.4
- Platform: Linux-5.4.0-122-generic-x86_64-with-glibc2.31
- Python version: 3.10.11
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
``` | 319 | NIH exporter file not found
### Describe the bug
can't use or download the nih exporter pile data.
```
15 experiment_compute_diveristy_coeff_single_dataset_then_combined_datasets_with_domain_weights()
16 File "/lfs/ampere1/0/brando9/beyond-scale-language-data-diversity/src/diversity/div_coeff.py", line 474, in experiment_compute_diveristy_coeff_single_dataset_then_combined_datasets_with_domain_weights
17 column_names = next(iter(dataset)).keys()
18 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 1353, in __iter__
19 for key, example in ex_iterable:
20 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 207, in __iter__
21 yield from self.generate_examples_fn(**self.kwargs)
22 File "/lfs/ampere1/0/brando9/.cache/huggingface/modules/datasets_modules/datasets/EleutherAI--pile/ebea56d358e91cf4d37b0fde361d563bed1472fbd8221a21b38fc8bb4ba554fb/pile.py", line 236, in _generate_examples
23 with zstd.open(open(files[subset], "rb"), "rt", encoding="utf-8") as f:
24 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/datasets/streaming.py", line 74, in wrapper
25 return function(*args, download_config=download_config, **kwargs)
26 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/datasets/download/streaming_download_manager.py", line 496, in xopen
27 file_obj = fsspec.open(file, mode=mode, *args, **kwargs).open()
28 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/core.py", line 134, in open
29 return self.__enter__()
30 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/core.py", line 102, in __enter__
31 f = self.fs.open(self.path, mode=mode)
32 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/spec.py", line 1241, in open
33 f = self._open(
34 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/implementations/http.py", line 356, in _open
35 size = size or self.info(path, **kwargs)["size"]
36 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/asyn.py", line 121, in wrapper
37 return sync(self.loop, func, *args, **kwargs)
38 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/asyn.py", line 106, in sync
39 raise return_result
40 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/asyn.py", line 61, in _runner
41 result[0] = await coro
42 File "/lfs/ampere1/0/brando9/miniconda/envs/beyond_scale/lib/python3.10/site-packages/fsspec/implementations/http.py", line 430, in _info
43 raise FileNotFoundError(url) from exc
44 FileNotFoundError: https://the-eye.eu/public/AI/pile_preliminary_components/NIH_ExPORTER_awarded_grant_text.jsonl.zst
```
### Steps to reproduce the bug
run this:
```
from datasets import load_dataset
path, name = 'EleutherAI/pile', 'nih_exporter'
# -- Get data set
dataset = load_dataset(path, name, streaming=True, split="train").with_format("torch")
batch = dataset.take(512)
print(f'{batch=}')
```
### Expected behavior
print the batch
### Environment info
```
(beyond_scale) brando9@ampere1:~/beyond-scale-language-data-diversity$ datasets-cli env
Copy-and-paste the text below in your GitHub issue.
- `datasets` version: 2.14.4
- Platform: Linux-5.4.0-122-generic-x86_64-with-glibc2.31
- Python version: 3.10.11
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
```
this seems to work but it's rather annoying.
Summary of how to make it work:
1. get urls to parquet files into a list
2. load list to load_dataset via `load_dataset('parquet', data_files=urls)` (note api names to hf are really confusing sometimes)
3. then it should work, print a batch of text.
presudo code
```python
urls_hacker_news = [
"https://huggingface.co/datasets/EleutherAI/pile/resolve/refs%2Fconvert%2Fparquet/hacker_news/pile-train-00000-of-00004.parquet",
"https://huggingface.co/datasets/EleutherAI/pile/resolve/refs%2Fconvert%2Fparquet/hacker_news/pile-train-00001-of-00004.parquet",
"https://huggingface.co/datasets/EleutherAI/pile/resolve/refs%2Fconvert%2Fparquet/hacker_news/pile-train-00002-of-00004.parquet",
"https://huggingface.co/datasets/EleutherAI/pile/resolve/refs%2Fconvert%2Fparquet/hacker_news/pile-train-00003-of-00004.parquet"
]
...
# streaming = False
from diversity.pile_subset_urls import urls_hacker_news
path, name, data_files = 'parquet', 'hacker_news', urls_hacker_news
# not changing
batch_size = 512
today = datetime.datetime.now().strftime('%Y-m%m-d%d-t%Hh_%Mm_%Ss')
run_name = f'{path} div_coeff_{num_batches=} ({today=} ({name=}) {data_mixture_name=} {probabilities=})'
print(f'{run_name=}')
# - Init wandb
debug: bool = mode == 'dryrun'
run = wandb.init(mode=mode, project="beyond-scale", name=run_name, save_code=True)
wandb.config.update({"num_batches": num_batches, "path": path, "name": name, "today": today, 'probabilities': probabilities, 'batch_size': batch_size, 'debug': debug, 'data_mixture_name': data_mixture_name, 'streaming': streaming, 'data_files': data_files})
# run.notify_on_failure() # https://community.wandb.ai/t/how-do-i-set-the-wandb-alert-programatically-for-my-current-run/4891
print(f'{debug=}')
print(f'{wandb.config=}')
# -- Get probe network
from datasets import load_dataset
import torch
from transformers import GPT2Tokenizer, GPT2LMHeadModel
tokenizer = GPT2Tokenizer.from_pretrained("gpt2")
if tokenizer.pad_token_id is None:
tokenizer.pad_token = tokenizer.eos_token
probe_network = GPT2LMHeadModel.from_pretrained("gpt2")
device = torch.device(f"cuda:{0}" if torch.cuda.is_available() else "cpu")
probe_network = probe_network.to(device)
# -- Get data set
def my_load_dataset(path, name):
print(f'{path=} {name=} {streaming=}')
if path == 'json' or path == 'bin' or path == 'csv':
print(f'{data_files_prefix+name=}')
return load_dataset(path, data_files=data_files_prefix+name, streaming=streaming, split="train").with_format("torch")
elif path == 'parquet':
print(f'{data_files=}')
return load_dataset(path, data_files=data_files, streaming=streaming, split="train").with_format("torch")
else:
return load_dataset(path, name, streaming=streaming, split="train").with_format("torch")
# - get data set for real now
if isinstance(path, str):
dataset = my_load_dataset(path, name)
else:
print('-- interleaving datasets')
datasets = [my_load_dataset(path, name).with_format("torch") for path, name in zip(path, name)]
[print(f'{dataset.description=}') for dataset in datasets]
dataset = interleave_datasets(datasets, probabilities)
print(f'{dataset=}')
batch = dataset.take(batch_size)
print(f'{next(iter(batch))=}')
column_names = next(iter(batch)).keys()
print(f'{column_names=}')
# - Prepare functions to tokenize batch
def preprocess(examples):
return tokenizer(examples["text"], padding="max_length", max_length=128, truncation=True, return_tensors="pt")
remove_columns = column_names # remove all keys that are not tensors to avoid bugs in collate function in task2vec's pytorch data loader
def map(batch):
return batch.map(preprocess, batched=True, remove_columns=remove_columns)
tokenized_batch = map(batch)
print(f'{next(iter(tokenized_batch))=}')
```
https://stackoverflow.com/questions/76891189/how-to-download-data-from-hugging-face-that-is-visible-on-the-data-viewer-but-th/76902681#76902681
https://discuss.huggingface.co/t/how-to-download-data-from-hugging-face-that-is-visible-on-the-data-viewer-but-the-files-are-not-available/50555/5?u=severo | [
-0.2584576904773712,
0.008933529257774353,
-0.06965087354183197,
0.2353883683681488,
0.16815856099128723,
0.13015833497047424,
0.3746143877506256,
0.5034440755844116,
0.03095618635416031,
0.47794991731643677,
-0.20891538262367249,
0.10971230268478394,
-0.12225690484046936,
0.2982402443885803,
0.06446437537670135,
-0.10143952071666718,
-0.1277635395526886,
0.11975342035293579,
-0.10980001091957092,
-0.22379052639007568,
-0.18325471878051758,
0.31772300601005554,
-0.16147905588150024,
0.21188893914222717,
0.3268741965293884,
-0.12286923080682755,
-0.05927450954914093,
0.3844963610172272,
-0.23902644217014313,
-0.212949737906456,
0.19391457736492157,
0.0720578283071518,
0.41433045268058777,
0.13394567370414734,
-0.00010650128388078883,
0.14716315269470215,
0.2468058168888092,
-0.2728186845779419,
-0.30404132604599,
-0.340511292219162,
0.1377747654914856,
-0.2407340109348297,
-0.2721337676048279,
-0.45285409688949585,
0.014082036912441254,
-0.3474024534225464,
-0.08902544528245926,
-0.13408797979354858,
0.20044025778770447,
0.2521281838417053,
0.29279661178588867,
0.3165326714515686,
0.13468383252620697,
-0.31292617321014404,
0.1895449161529541,
-0.10498079657554626,
-0.18873614072799683,
0.3284415006637573,
0.02455310896039009,
-0.016681410372257233,
-0.09397011250257492,
0.23113049566745758,
0.36790135502815247,
-0.08498378098011017,
-0.13394159078598022,
0.15935006737709045,
0.282726913690567,
-0.2915283441543579,
-0.24319517612457275,
0.23250915110111237,
0.09950293600559235,
0.06995336711406708,
-0.25512969493865967,
0.12742400169372559,
0.022867009043693542,
-0.24860727787017822,
0.09604587405920029,
0.3608042001724243,
-0.19192585349082947,
0.014810176566243172,
0.2615680396556854,
-0.07685293257236481,
-0.3452940583229065,
0.13772521913051605,
0.08137485384941101,
0.1532527059316635,
-0.17102353274822235,
0.004314083606004715,
0.08729718625545502,
-0.14361247420310974,
0.08885085582733154,
0.11203113198280334,
-0.12353290617465973,
-0.18756422400474548,
-0.40823790431022644,
-0.2765008807182312,
0.23351778090000153,
-0.26776623725891113,
0.10045474767684937,
0.041862331330776215,
0.32678812742233276,
-0.06343507766723633,
0.1262543499469757,
-0.04729471355676651,
0.1371513307094574,
0.01144995167851448,
0.038652148097753525,
0.12755581736564636,
0.2560667395591736,
0.5226669311523438,
0.11339797079563141,
-0.11417966336011887,
-0.16352057456970215,
-0.1759047955274582,
-0.11421851813793182,
0.02426953613758087,
0.030536383390426636,
-0.24981097877025604,
-0.16340449452400208,
0.02912033349275589,
0.03222879767417908,
0.13296201825141907,
-0.04077419638633728,
0.2540227174758911,
0.2214866280555725,
0.0787573903799057,
0.01758401095867157,
0.250436007976532,
-0.04264079034328461,
-0.050611041486263275,
-0.31651219725608826,
0.36952489614486694,
0.0005804449319839478,
-0.08988666534423828,
0.06799095869064331,
-0.04573490470647812,
0.29739344120025635,
-0.03980420529842377,
0.1631583273410797,
0.11950692534446716,
0.06640072166919708,
-0.18010197579860687,
0.06211479753255844,
0.23251654207706451,
0.21034380793571472,
0.045469678938388824,
0.15984849631786346,
-0.03735081106424332,
-0.11731421202421188,
-0.029133114963769913,
-0.1256512850522995,
-0.20530042052268982,
-0.3691036105155945,
0.3237708508968353,
-0.14143973588943481,
0.18817728757858276,
0.17735034227371216,
-0.2965051233768463,
-0.19726213812828064,
-0.20960918068885803,
0.0997481644153595,
-0.46964171528816223,
-0.007529206573963165,
-0.34654462337493896,
0.28862857818603516,
0.1844281256198883,
-0.2822574973106384,
-0.06320524215698242,
-0.2370130568742752,
-0.12979787588119507,
0.4326007664203644,
0.19080477952957153,
-0.28000330924987793,
0.32214418053627014,
-0.4685668647289276,
0.2437392771244049,
0.7442121505737305,
-0.35185569524765015,
-0.2802845239639282,
0.12832728028297424,
-0.2921268343925476,
0.05900479853153229,
0.10386805236339569,
0.04055871069431305,
0.06545424461364746,
-0.21834087371826172,
0.10935146361589432,
0.3899748921394348,
-0.1608995646238327,
-0.1773274838924408,
-0.2662310004234314,
-0.0929730162024498,
-0.036376677453517914,
0.13922753930091858,
0.08197151124477386,
0.12879334390163422,
0.3555362820625305,
0.24452358484268188,
0.31072986125946045,
-0.15233361721038818,
0.13319602608680725,
0.10806526243686676,
0.40722179412841797,
-0.041111260652542114,
0.03798293694853783,
-0.19769173860549927,
-0.03912748396396637,
0.30110883712768555,
-0.5797610282897949,
0.29259222745895386,
-0.12506777048110962,
-0.00842360407114029,
-0.1530362367630005,
-0.06841380894184113,
-0.32429757714271545,
-0.2626335620880127,
0.25850021839141846,
0.1985253542661667,
0.2718276381492615,
-0.07005951553583145,
-0.047697022557258606,
0.17337442934513092,
-0.4290451407432556,
-0.11435055732727051,
-0.46156588196754456,
0.41514989733695984,
-0.4137052893638611,
-0.15775129199028015,
0.10401541739702225,
0.01849227026104927,
-0.01474093273282051,
-0.34435799717903137,
-0.2234911024570465,
0.22805055975914001,
-0.3554384112358093,
0.013176888227462769,
0.27668890357017517,
-0.09438274800777435,
0.140130415558815,
-0.31469565629959106,
0.2849167585372925,
0.07475186139345169,
0.14753226935863495,
0.06555590033531189,
-0.03630581125617027,
0.3830658793449402,
-0.324786514043808,
-0.015326201915740967,
0.24140280485153198,
0.04523976892232895,
0.42124292254447937,
-0.10396712273359299,
0.25085604190826416,
-0.2963851988315582,
0.2453427016735077,
0.07066063582897186,
-0.12863264977931976,
-0.25982949137687683,
-0.017509877681732178,
-0.0023494549095630646,
0.6232227683067322,
0.16032667458057404,
-0.10449926555156708,
0.27895525097846985,
-0.09234261512756348,
-0.09496485441923141,
0.09046920388936996,
0.3087521493434906,
0.5424649119377136,
0.10161596536636353,
0.33443596959114075,
0.027528511360287666,
0.18016597628593445,
-0.1950322836637497,
0.2449120283126831,
-0.02941349521279335,
0.26207587122917175,
0.3616464138031006,
0.00690712034702301,
0.11851795017719269,
-0.15445426106452942,
-0.21229171752929688,
-0.1751120537519455,
0.2640725374221802,
-0.05852518230676651,
-0.0632326677441597,
-0.09110128879547119,
-0.17996887862682343,
-0.10116226971149445,
-0.12941224873065948,
0.01222851313650608,
-0.4979206323623657,
-0.02681957371532917,
0.2374189794063568,
-0.19244511425495148,
-0.07103793323040009,
0.05065444856882095,
-0.17360220849514008,
0.28163522481918335,
0.08359545469284058,
-0.2717791795730591,
-0.144682839512825,
-0.25609785318374634,
0.23003116250038147,
-0.09959562122821808,
0.2777476906776428,
0.11256876587867737,
-0.17859482765197754,
-0.025805190205574036,
-0.4768430292606354,
-0.13292376697063446,
0.1767301857471466,
-0.020777184516191483,
0.2713601589202881,
0.4605458974838257,
0.39234182238578796,
0.14659549295902252,
-0.17874255776405334,
0.41946372389793396,
-0.5308354496955872,
-0.26706668734550476,
0.2945402264595032,
-0.07382658869028091,
0.019909799098968506,
-0.1558629721403122,
-0.45088183879852295,
-0.6593803763389587,
-0.6567697525024414,
-0.09336133301258087,
0.057981401681900024,
0.31123387813568115,
0.4056699275970459,
-0.009541686624288559,
0.21906951069831848,
0.24382612109184265,
-0.019798625260591507,
0.03915141895413399,
-0.3477110266685486,
0.3549434244632721,
-0.3820550739765167,
-0.4427129626274109,
-0.10668997466564178,
-0.023886069655418396,
-0.05909162759780884,
0.053385112434625626,
-0.41133177280426025,
0.005154281854629517,
-0.15739257633686066,
0.1966075599193573,
0.0838007777929306,
0.21790112555027008,
0.16327911615371704,
-0.05216490477323532,
-0.14047172665596008,
-0.08458802103996277,
0.14698931574821472,
0.270391583442688,
0.26644736528396606,
0.1414513736963272,
0.0842837393283844,
0.3803151547908783,
0.006493568420410156,
0.21695953607559204,
0.31777822971343994,
-0.013690801337361336,
0.6029472351074219,
-0.001624520868062973,
0.29889577627182007,
0.03546582907438278,
-0.36416956782341003,
0.1137300431728363,
0.16326434910297394,
0.16668812930583954,
0.31856006383895874,
-0.18554480373859406,
0.07887431234121323,
-0.1729719340801239,
-0.3092854619026184,
-0.06740347295999527,
-0.27876582741737366,
0.24376501142978668,
0.021527418866753578,
-0.05743322893977165,
-0.2546709477901459,
-0.3161086440086365,
-0.0898841843008995,
-0.12829242646694183,
0.27299511432647705,
0.18703117966651917,
0.0060065388679504395,
0.22376200556755066,
-0.1758653223514557,
0.13945546746253967,
-0.2590188980102539,
0.16294901072978973,
0.008465994149446487,
0.2710428535938263,
-0.1310431808233261,
-0.27003926038742065,
-0.11428259313106537,
-0.10812084376811981,
0.5565721392631531,
-0.14610107243061066,
0.16999635100364685,
0.10596016049385071,
-0.057202551513910294,
-0.031028851866722107,
-0.2838546335697174,
-0.47855812311172485,
0.30733025074005127,
0.5456464290618896,
0.3184475898742676,
-0.14111076295375824,
-0.025734081864356995,
0.5136938691139221,
0.23543553054332733,
-0.18821755051612854,
-0.22140344977378845,
-0.18961907923221588,
-0.34996455907821655,
-0.417536199092865,
-0.11262974143028259,
-0.19268402457237244,
0.4816896915435791,
-0.09215863049030304,
-0.1279820203781128,
0.085113525390625,
-0.22487638890743256,
0.06858900934457779,
0.15649117529392242,
0.11662726104259491,
-0.08348642289638519,
0.12264081835746765,
0.050202883780002594,
0.10793130099773407,
0.25304606556892395,
0.42715394496917725,
0.16871406137943268,
-0.18550536036491394,
0.05928247794508934,
-0.261839896440506,
-0.06383588910102844,
0.12841077148914337,
-0.09571818262338638,
-0.07984979450702667,
-0.04419303685426712,
0.40756702423095703,
0.10241375863552094,
0.004981487989425659,
0.1590629667043686,
-0.08467447757720947,
-0.4560915231704712,
0.04186317324638367,
0.15554970502853394,
-0.06275980919599533,
0.25285959243774414,
0.3794082999229431,
0.24238206446170807,
-0.22876697778701782,
0.32797327637672424,
-0.2024037092924118,
0.6869305372238159,
0.12102632224559784,
0.1153392344713211,
0.2468283623456955,
0.2575383186340332,
0.5508442521095276,
0.13436169922351837,
0.05190018564462662,
-0.27061527967453003,
-0.6595309972763062,
0.05669431388378143,
-0.14448536932468414,
0.23412372171878815,
0.14502520859241486,
-0.13328702747821808,
0.377084344625473,
-0.09666468948125839,
0.14415952563285828,
-0.14050526916980743,
0.2251339703798294,
-0.0519476979970932,
-0.050143249332904816,
0.045114826411008835,
0.14056624472141266,
-0.06350243836641312,
0.29802361130714417,
-0.07565438747406006,
-0.3892972767353058,
-0.15260842442512512,
-0.1229800209403038,
-0.11053086817264557,
0.42614418268203735,
-0.02888454683125019,
0.28715240955352783,
-0.17286263406276703,
-0.3482654094696045,
0.16427919268608093,
0.1422489732503891,
0.34024783968925476,
0.03867604210972786,
0.015790006145834923,
-0.07045683264732361,
0.12781459093093872,
-0.1580808311700821,
0.16003291308879852,
0.25945425033569336,
0.40666666626930237,
-0.27150505781173706,
-0.3428518772125244,
0.19083993136882782,
0.06608930230140686,
-0.28897279500961304,
0.16657549142837524,
-0.024802040308713913,
-0.07754641771316528,
-0.16262571513652802,
-0.159205362200737,
-0.13303174078464508,
-0.26451438665390015,
-0.36773258447647095,
0.16227546334266663,
0.15972602367401123,
-0.3416324257850647,
-0.053705014288425446,
-0.029130447655916214,
-0.14243309199810028,
-0.07512730360031128,
-0.07998718321323395,
0.1700265109539032,
0.1067657470703125,
0.2395687997341156,
0.15271495282649994,
-0.1972750425338745,
-0.25118115544319153,
-0.30031830072402954,
-0.015215964987874031,
-0.3958919644355774,
0.2569356858730316,
0.12153248488903046,
0.1556459665298462,
-0.07365500926971436,
0.258302241563797,
0.31084343791007996,
0.003510124981403351,
-0.16814376413822174,
-0.6192024946212769,
-0.1929970234632492,
-0.05676195025444031,
-0.2412852942943573,
0.2491004467010498,
-0.05334357172250748,
-0.17265203595161438,
-0.06232047080993652,
0.045969828963279724,
-0.43134212493896484,
-0.012798789888620377,
-0.4134909510612488,
-0.0319153368473053,
-0.07655782252550125,
-0.06760622560977936,
0.17936518788337708,
-0.023133592680096626,
0.2194225788116455,
0.024168528616428375,
-0.15606717765331268,
-0.24347274005413055,
-0.10910049080848694,
0.08300071209669113,
-0.019976019859313965,
-0.08440801501274109,
0.07450249791145325,
-0.13726955652236938,
-0.18564638495445251,
-0.05985572189092636,
0.08978412300348282,
-0.2325422316789627,
0.1183471828699112,
0.25930577516555786,
0.32186710834503174,
-0.08570249378681183,
-0.1482086479663849,
0.32770949602127075,
0.17710831761360168,
0.18493804335594177,
-0.1904861032962799,
0.2576831877231598,
-0.05346286669373512,
-0.21705254912376404,
-0.565376877784729,
-0.06708339601755142,
-0.11651325970888138,
0.10802523046731949,
0.2856868505477905,
-0.060843050479888916,
-0.3077033758163452,
0.09876319766044617,
0.3244885802268982,
0.30240362882614136,
-0.0878317803144455,
0.14118260145187378,
0.12169253826141357,
0.2604556381702423,
-0.45870357751846313,
0.2244749367237091,
0.07251235842704773,
-0.20025266706943512,
0.06182500720024109,
0.2836568355560303,
0.1420717090368271,
-0.18183067440986633,
0.2242087721824646,
0.10793530195951462,
0.2603300213813782,
-0.18393199145793915,
0.21737349033355713,
0.31290149688720703,
-0.0384635329246521,
0.11187700182199478,
0.205486461520195,
-0.054438285529613495,
0.12406973540782928,
0.29032447934150696,
-0.1341506689786911,
0.2563931345939636,
0.028652090579271317,
-0.15238851308822632,
0.10078698396682739,
-0.5200996398925781,
-0.003302871249616146,
0.3078621029853821,
-0.15976811945438385,
-0.020355451852083206,
0.13715271651744843,
-0.004684966057538986,
-0.16858357191085815,
0.07482662796974182,
-0.29780158400535583,
0.166786789894104,
-0.2721939980983734,
0.263234406709671,
-0.1780136525630951,
-0.21468418836593628,
-0.18598872423171997,
-0.028958000242710114,
0.2775096595287323,
-0.06102820485830307,
0.0037763305008411407,
0.24520361423492432,
-0.19248083233833313,
-0.24264611303806305,
-0.003058895468711853,
0.1232159286737442,
-0.04916534572839737,
-0.3946143090724945,
0.061252161860466,
0.47365301847457886,
-0.0583786740899086,
-0.2190500646829605,
0.2641162872314453,
0.47875645756721497,
0.214262917637825,
0.07046057283878326,
0.1820036619901657,
0.1524524986743927,
-0.18362295627593994,
-0.11365323513746262,
-0.062002960592508316,
-0.06074700877070427,
0.24921490252017975,
0.24804741144180298,
0.2791242003440857,
-0.2244347631931305,
-0.20371535420417786,
0.16324245929718018,
0.09300301969051361,
0.017148420214653015,
0.4454292058944702,
-0.0655858963727951,
0.02693970501422882,
-0.18893273174762726,
-0.06128666177392006,
-0.4624686539173126,
0.020040664821863174,
0.08689627051353455,
-0.046603355556726456,
0.1901424527168274,
-0.01987661048769951,
0.1487291008234024,
-0.15294748544692993,
0.3024739921092987,
0.5378361940383911,
-0.05444717779755592,
-0.2150561660528183,
-0.1369255781173706,
-0.5039241313934326,
0.30971264839172363,
0.0413208082318306,
-0.05313586816191673,
-0.005148330703377724,
0.33485889434814453,
0.05238516628742218,
0.002438051626086235,
0.180966317653656,
0.04068557545542717,
0.06902382522821426,
0.19116325676441193,
-0.4025806784629822,
0.009625134989619255,
0.19631454348564148,
-0.07743793725967407,
-0.056284524500370026,
-0.4984322190284729,
0.16760572791099548,
-0.34347909688949585,
0.1995241492986679,
-0.11351820826530457,
-0.025983616709709167,
0.18370851874351501,
-0.20853343605995178,
0.25271037220954895,
-0.002088043838739395,
0.09161897003650665,
-0.11041970551013947,
-0.0780983418226242,
-0.05217219516634941,
-0.08171741664409637,
-0.06842656433582306,
0.14280253648757935,
0.17119675874710083,
0.30384892225265503,
0.05988150089979172,
-0.06851103901863098,
-0.40291303396224976,
-0.0492774173617363,
-0.1352352648973465,
-0.0807773619890213,
-0.09673137962818146,
0.3127273619174957,
0.004243776202201843,
-0.04534794017672539,
0.3000475764274597,
-0.021813590079545975,
-0.07040949165821075,
-0.06683904677629471,
-0.42016446590423584,
-0.5053126811981201,
0.3283834457397461,
-0.18389928340911865,
-0.36576464772224426,
0.024271797388792038,
0.09966103732585907,
-0.2648107409477234,
0.10528791695833206,
-0.4470980167388916,
0.38179272413253784,
0.3073422908782959,
-0.008051973767578602,
-0.012706093490123749,
0.25140926241874695,
-0.05146166682243347,
0.09518972784280777,
0.11744190007448196,
0.10118740797042847,
0.06574852764606476,
-0.32187074422836304,
-0.017160244286060333,
-0.023721493780612946
] |
https://github.com/huggingface/datasets/issues/6142 | It seems that some parquet files have additional columns.
I ran a scan and found that two files have the additional `__id__` column:
1. `hf://datasets/bigcode/the-stack-dedup/data/numpy/data-00000-of-00001.parquet`
2. `hf://datasets/bigcode/the-stack-dedup/data/omgrofl/data-00000-of-00001.parquet`
We should open a PR to fix those two files | the-stack-dedup fails to generate | ### Describe the bug
I'm getting an error generating the-stack-dedup with datasets 2.13.1, and with 2.14.4 nothing happens.
### Steps to reproduce the bug
My code:
```
import os
import datasets as ds
MY_CACHE_DIR = "/home/ubuntu/the-stack-dedup-local"
MY_TOKEN="my-token"
the_stack_ds = ds.load_dataset("bigcode/the-stack-dedup", split="train", download_mode="reuse_cache_if_exists", cache_dir=MY_CACHE_DIR, use_auth_token=MY_TOKEN, num_proc=64)
```
The exception:
```
Generating train split: 233248251 examples [54:31, 57280.00 examples/s]
multiprocess.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/build
er.py", line 1879, in _prepare_split_single
for _, table in generator:
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/packa
ged_modules/parquet/parquet.py", line 82, in _generate_tables
yield f"{file_idx}_{batch_idx}", self._cast_table(pa_table)
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/packa
ged_modules/parquet/parquet.py", line 61, in _cast_table
pa_table = table_cast(pa_table, self.info.features.arrow_schema)
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/table
.py", line 2324, in table_cast
return cast_table_to_schema(table, schema)
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/table
.py", line 2282, in cast_table_to_schema
raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nb
ecause column names don't match")
ValueError: Couldn't cast
hexsha: string
size: int64
ext: string
lang: string
max_stars_repo_path: string
max_stars_repo_name: string
max_stars_repo_head_hexsha: string
max_stars_repo_licenses: list<item: string>
child 0, item: string
max_stars_count: int64
max_stars_repo_stars_event_min_datetime: string
max_stars_repo_stars_event_max_datetime: string
max_issues_repo_path: string
max_issues_repo_name: string
max_issues_repo_head_hexsha: string
max_issues_repo_licenses: list<item: string>
child 0, item: string
max_issues_count: int64
max_issues_repo_issues_event_min_datetime: string
max_issues_repo_issues_event_max_datetime: string
max_forks_repo_path: string
max_forks_repo_name: string
max_forks_repo_head_hexsha: string
max_forks_repo_licenses: list<item: string>
child 0, item: string
max_forks_count: int64
max_forks_repo_forks_event_min_datetime: string
max_forks_repo_forks_event_max_datetime: string
content: string
avg_line_length: double
max_line_length: int64
alphanum_fraction: double
__id__: int64
-- schema metadata --
huggingface: '{"info": {"features": {"hexsha": {"dtype": "string", "_type' + 1979
to
{'hexsha': Value(dtype='string', id=None), 'size': Value(dtype='int64', id=None), 'ext': Value(dtype='string', id=None), 'lang': Value(dtype='string', id=None), 'max_stars_repo_path': Value(dtype='string', id=None), 'max_stars_repo_name': Value(dtype='string', id=None), 'max_stars_repo_head_hexsha': Value(dtype='string', id=None), 'max_stars_repo_licenses': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'max_stars_count': Value(dtype='int64', id=None), 'max_stars_repo_stars_event_min_datetime': Value(dtype='string', id=None), 'max_stars_repo_stars_event_max_datetime': Value(dtype='string', id=None), 'max_issues_repo_path': Value(dtype='string', id=None), 'max_issues_repo_name': Value(dtype='string', id=None), 'max_issues_repo_head_hexsha': Value(dtype='string', id=None), 'max_issues_repo_licenses': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'max_issues_count': Value(dtype='int64', id=None), 'max_issues_repo_issues_event_min_datetime': Value(dtype='string', id=None), 'max_issues_repo_issues_event_max_datetime': Value(dtype='string', id=None), 'max_forks_repo_path': Value(dtype='string', id=None), 'max_forks_repo_name': Value(dtype='string', id=None), 'max_forks_repo_head_hexsha': Value(dtype='string', id=None), 'max_forks_repo_licenses': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'max_forks_count': Value(dtype='int64', id=None), 'max_forks_repo_forks_event_min_datetime': Value(dtype='string', id=None), 'max_forks_repo_forks_event_max_datetime': Value(dtype='string', id=None), 'content': Value(dtype='string', id=None), 'avg_line_length': Value(dtype='float64', id=None), 'max_line_length': Value(dtype='int64', id=None), 'alphanum_fraction': Value(dtype='float64', id=None)}
because column names don't match
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.10/site-packages/multiprocess/p
ool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/utils
/py_utils.py", line 1328, in _write_generator_to_queue
for i, result in enumerate(func(**kwargs)):
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/build
er.py", line 1912, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating th
e dataset") from e
datasets.builder.DatasetGenerationError: An error occurred while genera
ting the dataset
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/ubuntu/download_the_stack.py", line 7, in <module>
the_stack_ds = ds.load_dataset("bigcode/the-stack-dedup", split="tr
ain", download_mode="reuse_cache_if_exists", cache_dir=MY_CACHE_DIR, us
e_auth_token=MY_TOKEN, num_proc=64)
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/load.
py", line 1809, in load_dataset
builder_instance.download_and_prepare(
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/build
er.py", line 909, in download_and_prepare
self._download_and_prepare(
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/build
er.py", line 1004, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/build
er.py", line 1796, in _prepare_split
for job_id, done, content in iflatmap_unordered(
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/utils
/py_utils.py", line 1354, in iflatmap_unordered
[async_result.get(timeout=0.05) for async_result in async_results]
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/utils
/py_utils.py", line 1354, in <listcomp>
[async_result.get(timeout=0.05) for async_result in async_results]
File "/home/ubuntu/.local/lib/python3.10/site-packages/multiprocess/p
ool.py", line 774, in get
raise self._value
datasets.builder.DatasetGenerationError: An error occurred while generating the dataset
```
### Expected behavior
The dataset downloads properly. @lhoestq @loub
### Environment info
Datasets 2.13.1, large VM with 2TB RAM, Ubuntu 20.04 | 37 | the-stack-dedup fails to generate
### Describe the bug
I'm getting an error generating the-stack-dedup with datasets 2.13.1, and with 2.14.4 nothing happens.
### Steps to reproduce the bug
My code:
```
import os
import datasets as ds
MY_CACHE_DIR = "/home/ubuntu/the-stack-dedup-local"
MY_TOKEN="my-token"
the_stack_ds = ds.load_dataset("bigcode/the-stack-dedup", split="train", download_mode="reuse_cache_if_exists", cache_dir=MY_CACHE_DIR, use_auth_token=MY_TOKEN, num_proc=64)
```
The exception:
```
Generating train split: 233248251 examples [54:31, 57280.00 examples/s]
multiprocess.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/build
er.py", line 1879, in _prepare_split_single
for _, table in generator:
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/packa
ged_modules/parquet/parquet.py", line 82, in _generate_tables
yield f"{file_idx}_{batch_idx}", self._cast_table(pa_table)
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/packa
ged_modules/parquet/parquet.py", line 61, in _cast_table
pa_table = table_cast(pa_table, self.info.features.arrow_schema)
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/table
.py", line 2324, in table_cast
return cast_table_to_schema(table, schema)
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/table
.py", line 2282, in cast_table_to_schema
raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nb
ecause column names don't match")
ValueError: Couldn't cast
hexsha: string
size: int64
ext: string
lang: string
max_stars_repo_path: string
max_stars_repo_name: string
max_stars_repo_head_hexsha: string
max_stars_repo_licenses: list<item: string>
child 0, item: string
max_stars_count: int64
max_stars_repo_stars_event_min_datetime: string
max_stars_repo_stars_event_max_datetime: string
max_issues_repo_path: string
max_issues_repo_name: string
max_issues_repo_head_hexsha: string
max_issues_repo_licenses: list<item: string>
child 0, item: string
max_issues_count: int64
max_issues_repo_issues_event_min_datetime: string
max_issues_repo_issues_event_max_datetime: string
max_forks_repo_path: string
max_forks_repo_name: string
max_forks_repo_head_hexsha: string
max_forks_repo_licenses: list<item: string>
child 0, item: string
max_forks_count: int64
max_forks_repo_forks_event_min_datetime: string
max_forks_repo_forks_event_max_datetime: string
content: string
avg_line_length: double
max_line_length: int64
alphanum_fraction: double
__id__: int64
-- schema metadata --
huggingface: '{"info": {"features": {"hexsha": {"dtype": "string", "_type' + 1979
to
{'hexsha': Value(dtype='string', id=None), 'size': Value(dtype='int64', id=None), 'ext': Value(dtype='string', id=None), 'lang': Value(dtype='string', id=None), 'max_stars_repo_path': Value(dtype='string', id=None), 'max_stars_repo_name': Value(dtype='string', id=None), 'max_stars_repo_head_hexsha': Value(dtype='string', id=None), 'max_stars_repo_licenses': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'max_stars_count': Value(dtype='int64', id=None), 'max_stars_repo_stars_event_min_datetime': Value(dtype='string', id=None), 'max_stars_repo_stars_event_max_datetime': Value(dtype='string', id=None), 'max_issues_repo_path': Value(dtype='string', id=None), 'max_issues_repo_name': Value(dtype='string', id=None), 'max_issues_repo_head_hexsha': Value(dtype='string', id=None), 'max_issues_repo_licenses': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'max_issues_count': Value(dtype='int64', id=None), 'max_issues_repo_issues_event_min_datetime': Value(dtype='string', id=None), 'max_issues_repo_issues_event_max_datetime': Value(dtype='string', id=None), 'max_forks_repo_path': Value(dtype='string', id=None), 'max_forks_repo_name': Value(dtype='string', id=None), 'max_forks_repo_head_hexsha': Value(dtype='string', id=None), 'max_forks_repo_licenses': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'max_forks_count': Value(dtype='int64', id=None), 'max_forks_repo_forks_event_min_datetime': Value(dtype='string', id=None), 'max_forks_repo_forks_event_max_datetime': Value(dtype='string', id=None), 'content': Value(dtype='string', id=None), 'avg_line_length': Value(dtype='float64', id=None), 'max_line_length': Value(dtype='int64', id=None), 'alphanum_fraction': Value(dtype='float64', id=None)}
because column names don't match
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.10/site-packages/multiprocess/p
ool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/utils
/py_utils.py", line 1328, in _write_generator_to_queue
for i, result in enumerate(func(**kwargs)):
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/build
er.py", line 1912, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating th
e dataset") from e
datasets.builder.DatasetGenerationError: An error occurred while genera
ting the dataset
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/ubuntu/download_the_stack.py", line 7, in <module>
the_stack_ds = ds.load_dataset("bigcode/the-stack-dedup", split="tr
ain", download_mode="reuse_cache_if_exists", cache_dir=MY_CACHE_DIR, us
e_auth_token=MY_TOKEN, num_proc=64)
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/load.
py", line 1809, in load_dataset
builder_instance.download_and_prepare(
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/build
er.py", line 909, in download_and_prepare
self._download_and_prepare(
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/build
er.py", line 1004, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/build
er.py", line 1796, in _prepare_split
for job_id, done, content in iflatmap_unordered(
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/utils
/py_utils.py", line 1354, in iflatmap_unordered
[async_result.get(timeout=0.05) for async_result in async_results]
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/utils
/py_utils.py", line 1354, in <listcomp>
[async_result.get(timeout=0.05) for async_result in async_results]
File "/home/ubuntu/.local/lib/python3.10/site-packages/multiprocess/p
ool.py", line 774, in get
raise self._value
datasets.builder.DatasetGenerationError: An error occurred while generating the dataset
```
### Expected behavior
The dataset downloads properly. @lhoestq @loub
### Environment info
Datasets 2.13.1, large VM with 2TB RAM, Ubuntu 20.04
It seems that some parquet files have additional columns.
I ran a scan and found that two files have the additional `__id__` column:
1. `hf://datasets/bigcode/the-stack-dedup/data/numpy/data-00000-of-00001.parquet`
2. `hf://datasets/bigcode/the-stack-dedup/data/omgrofl/data-00000-of-00001.parquet`
We should open a PR to fix those two files | [
-0.2608025372028351,
-0.025322765111923218,
0.030000541359186172,
0.38186246156692505,
0.043696630746126175,
-0.03949412703514099,
0.5020748972892761,
0.38187968730926514,
-0.04980931431055069,
-0.06252968311309814,
0.21321964263916016,
0.5592825412750244,
0.04533160477876663,
0.054538793861866,
0.23558321595191956,
-0.05239605903625488,
0.20431745052337646,
0.003597080707550049,
-0.15224967896938324,
-0.031557559967041016,
-0.07234498113393784,
0.2126641571521759,
-0.25354257225990295,
-0.04951596260070801,
-0.15213751792907715,
0.295377254486084,
0.0435551181435585,
0.03984951227903366,
0.05305801331996918,
-0.4402918815612793,
0.6022636890411377,
-0.03049035556614399,
-0.026286862790584564,
0.40190014243125916,
-0.0001232836948474869,
0.16549086570739746,
0.3325713276863098,
-0.004602648317813873,
-0.2144017517566681,
-0.15757140517234802,
-0.3999960422515869,
-0.14649683237075806,
-0.15743140876293182,
-0.08022072166204453,
-0.04893144592642784,
-0.22599545121192932,
-0.25848373770713806,
-0.3947603106498718,
0.46791309118270874,
0.5752434730529785,
0.06917242705821991,
0.07614777237176895,
0.18238000571727753,
-0.26227182149887085,
0.2213277965784073,
0.4607096016407013,
-0.12136241793632507,
0.13156664371490479,
-0.0673326775431633,
-0.05437668785452843,
-0.07146900147199631,
-0.21574291586875916,
-0.04352138936519623,
0.09790095686912537,
-0.04586393013596535,
0.1110696941614151,
0.14768044650554657,
-0.19467204809188843,
0.27412745356559753,
0.22070196270942688,
0.09949342906475067,
-0.43392518162727356,
-0.19819742441177368,
-0.06684844195842743,
-0.007558900862932205,
-0.20060588419437408,
0.21883970499038696,
0.06066229194402695,
-0.17946022748947144,
0.1400606632232666,
0.001217663288116455,
-0.060842473059892654,
-0.21694880723953247,
-0.03090890496969223,
0.03542768955230713,
-0.11056888848543167,
0.11351214349269867,
0.015583646483719349,
0.11598570644855499,
0.07095413655042648,
0.48766160011291504,
0.07092944532632828,
-0.013556177727878094,
0.1613740622997284,
-0.33043795824050903,
0.06773363053798676,
0.20120617747306824,
-0.221460223197937,
0.3436477780342102,
0.3031872510910034,
-0.463392972946167,
-0.11593925207853317,
0.26639825105667114,
0.0718219131231308,
-0.06342615187168121,
-0.2525314390659332,
-0.3364846408367157,
0.038581483066082,
0.41292107105255127,
0.02661866322159767,
0.17614349722862244,
0.0038344813510775566,
-0.1929871141910553,
-0.161310613155365,
0.09757746011018753,
0.022450584918260574,
0.21617285907268524,
-0.24339312314987183,
-0.15527835488319397,
0.18816016614437103,
-0.31060805916786194,
0.022650156170129776,
0.016083449125289917,
0.23614798486232758,
0.35020825266838074,
0.40442460775375366,
-0.026870425790548325,
0.21142691373825073,
-0.21872402727603912,
-0.4936831295490265,
-0.09935731440782547,
-0.03353516012430191,
-0.19152426719665527,
-0.12830588221549988,
0.4293392598628998,
-0.03212417662143707,
-0.05084500089287758,
0.39981088042259216,
0.0692598968744278,
-0.3231922686100006,
-0.13577426970005035,
-0.22779613733291626,
0.0841987282037735,
0.2194204181432724,
-0.2113221287727356,
-0.14336594939231873,
0.11960342526435852,
-0.06641644239425659,
0.03259795904159546,
0.0978335440158844,
-0.04125610738992691,
-0.2473629117012024,
-0.2503868341445923,
0.10262630134820938,
0.27062949538230896,
0.13113386929035187,
-0.6416183114051819,
0.22893604636192322,
0.31269392371177673,
0.1597558856010437,
0.004118006676435471,
-0.3886300325393677,
-0.03049619495868683,
-0.16388846933841705,
0.6185105443000793,
0.5126932859420776,
-0.5208104252815247,
0.17574885487556458,
-0.41632187366485596,
-0.1012759804725647,
0.3131764829158783,
0.07084789127111435,
-0.20804764330387115,
0.611671507358551,
-0.4350990355014801,
-0.13072550296783447,
0.3270426094532013,
-0.1097874641418457,
-0.10304071754217148,
0.2847132682800293,
-0.1793658435344696,
-0.14748260378837585,
0.0187141802161932,
-0.29654282331466675,
-0.06475621461868286,
0.13828767836093903,
0.026596371084451675,
0.037562061101198196,
-0.23781239986419678,
-0.005885966122150421,
-0.15227559208869934,
0.10172976553440094,
0.24532856047153473,
0.09746627509593964,
0.5272570252418518,
0.4189566671848297,
0.021561728790402412,
0.00042100250720977783,
0.25115010142326355,
-0.032511234283447266,
0.10403472185134888,
0.12785939872264862,
0.8492044806480408,
-0.07841136306524277,
0.06588567793369293,
-0.05376255512237549,
-0.2718454599380493,
0.18257969617843628,
-0.056367725133895874,
-0.19771766662597656,
0.1478782296180725,
0.025934822857379913,
-0.24774841964244843,
0.32758402824401855,
0.08252803981304169,
-0.15124118328094482,
0.028184697031974792,
0.14540967345237732,
0.35590091347694397,
0.01788027584552765,
0.02202703058719635,
0.45694559812545776,
-0.08847750723361969,
0.14248457551002502,
-0.17690977454185486,
0.4789981544017792,
-0.06248480826616287,
-0.1729942411184311,
0.024706564843654633,
0.19313250482082367,
0.11794278025627136,
-0.06236563250422478,
-0.12244650721549988,
0.29031676054000854,
0.37800657749176025,
-0.09782422333955765,
-0.2002546191215515,
-0.17284296452999115,
0.017809180542826653,
-0.17006666958332062,
0.05919483304023743,
-0.060916025191545486,
0.028528228402137756,
0.01957342028617859,
0.28138160705566406,
-0.016281522810459137,
0.1885310262441635,
0.1725107729434967,
0.029186919331550598,
0.11484028398990631,
0.10706961899995804,
-0.07882988452911377,
0.5431431531906128,
0.0823754072189331,
0.005416891537606716,
-0.37166064977645874,
0.08665706217288971,
-0.1667325645685196,
-0.33074477314949036,
0.2937471270561218,
0.3831067681312561,
0.07681450247764587,
-0.06455956399440765,
0.12064270675182343,
0.08789211511611938,
-0.25413447618484497,
0.2804010808467865,
0.38615983724594116,
0.6080988049507141,
0.02506294846534729,
-0.007237451151013374,
0.10208426415920258,
-0.1381622701883316,
-0.07079143822193146,
0.12722070515155792,
-0.25925809144973755,
-0.18225549161434174,
0.24190708994865417,
0.2009258270263672,
-0.10794218629598618,
-0.3000086545944214,
-0.19332708418369293,
0.05811581760644913,
0.2213483601808548,
-0.28187865018844604,
0.09658244252204895,
-0.4101216793060303,
-0.09980931133031845,
-0.46143147349357605,
0.33820706605911255,
-0.018207533285021782,
-0.2592501640319824,
-0.0732976496219635,
0.17740322649478912,
0.009971335530281067,
0.1100413054227829,
-0.2894057631492615,
0.03144995868206024,
-0.015840165317058563,
-0.12404131144285202,
-0.33364856243133545,
-0.0074258409440517426,
-0.3798521161079407,
-0.026097634807229042,
0.06881309300661087,
0.03766031935811043,
0.25039753317832947,
-0.009215224534273148,
-0.4162850081920624,
-0.3670940399169922,
-0.11030609160661697,
0.27747368812561035,
-0.18721997737884521,
0.21962082386016846,
0.1683349758386612,
-0.018025275319814682,
-0.23469233512878418,
-0.17515772581100464,
0.3184663951396942,
-0.3130769729614258,
-0.3577420711517334,
0.22335989773273468,
-0.0384075790643692,
0.057793162763118744,
-0.31849122047424316,
-0.5930789709091187,
0.2183714658021927,
-0.2130683809518814,
0.42106202244758606,
-0.2592517137527466,
0.11586975306272507,
0.035460472106933594,
0.1385771930217743,
0.2771429121494293,
0.06804519891738892,
-0.00966038927435875,
-0.26219895482063293,
0.02887207269668579,
0.08444823324680328,
-0.2471006065607071,
-0.3481840193271637,
-0.11587989330291748,
0.010242268443107605,
0.19432362914085388,
0.18503576517105103,
-0.5795999765396118,
0.2983708679676056,
-0.3095149099826813,
0.05020664632320404,
-0.3355921804904938,
0.15839305520057678,
0.09610164165496826,
-0.00937977060675621,
0.07246974855661392,
-0.19895043969154358,
0.06135466694831848,
0.4836963713169098,
0.10367242991924286,
0.20634615421295166,
0.19827713072299957,
0.45306307077407837,
-0.06334646046161652,
0.6828688979148865,
0.3655323088169098,
-0.21874916553497314,
0.1418445110321045,
-0.12788927555084229,
0.26219338178634644,
-0.11388736963272095,
-0.19458451867103577,
0.09602458775043488,
0.03346865624189377,
0.1152573749423027,
-0.08032090961933136,
-0.17829909920692444,
-0.1786593645811081,
-0.0191485658288002,
0.11346866190433502,
0.00601920485496521,
-0.3661074936389923,
-0.14548417925834656,
-0.2743987739086151,
0.11550752818584442,
-0.06683309376239777,
0.12339099496603012,
0.023641273379325867,
-0.03964215889573097,
0.01426752284169197,
-0.15018373727798462,
0.1266624927520752,
0.24313025176525116,
0.050325728952884674,
0.21398189663887024,
-0.41014400124549866,
0.1366669237613678,
-0.012579314410686493,
0.6693252325057983,
-0.06373508274555206,
-0.011313430964946747,
-0.013075783848762512,
0.01192484050989151,
0.544867992401123,
-0.2918943464756012,
0.15502840280532837,
0.12288814783096313,
0.10355085879564285,
-0.30904749035835266,
-0.19733868539333344,
-0.17664363980293274,
-0.020633839070796967,
0.20809359848499298,
-0.15938271582126617,
-0.19342395663261414,
-0.35113754868507385,
0.2651325464248657,
0.1807645857334137,
0.1743869036436081,
-0.14887367188930511,
-0.08307881653308868,
-0.2626630663871765,
0.034364357590675354,
0.30233362317085266,
0.5255436897277832,
0.19507044553756714,
-0.17150205373764038,
-0.23737500607967377,
-0.10694403946399689,
-0.1372356116771698,
0.13238920271396637,
0.1458650529384613,
0.2244047075510025,
-0.4565005302429199,
0.4817293882369995,
0.09839595854282379,
0.06001393869519234,
0.7912300825119019,
0.21500274538993835,
-0.3013259470462799,
0.09659264981746674,
0.13184186816215515,
0.055520616471767426,
0.37797805666923523,
0.12882967293262482,
-0.4033084511756897,
0.1286509782075882,
-0.1572517454624176,
0.03379971161484718,
-0.1579957902431488,
0.07693488150835037,
0.26077523827552795,
-0.2073688954114914,
-0.19309186935424805,
-0.34219008684158325,
0.09108775854110718,
0.022879861295223236,
0.1074860692024231,
0.4194115102291107,
0.15073370933532715,
-0.32285276055336,
0.21245229244232178,
-0.19174081087112427,
0.5460221767425537,
0.22540885210037231,
-0.12816226482391357,
-0.06262890994548798,
-0.033642277121543884,
0.2169433981180191,
-0.6935359835624695,
0.23414525389671326,
-0.4154064357280731,
-0.0900721326470375,
-0.09531055390834808,
-0.38922032713890076,
-0.08318425714969635,
0.4540861248970032,
-0.03201685845851898,
0.21681195497512817,
0.0026001036167144775,
0.5390001535415649,
0.06532008945941925,
0.08683925867080688,
0.062099285423755646,
-0.12598657608032227,
-0.17813703417778015,
0.0883442610502243,
-0.03043874353170395,
-0.09982641786336899,
-0.1504167914390564,
-0.13962256908416748,
-0.19299042224884033,
-0.221173495054245,
-0.5403085947036743,
0.41214340925216675,
-0.21565307676792145,
0.44511526823043823,
0.5049794912338257,
-0.06116371601819992,
0.28266072273254395,
0.012350145727396011,
0.30781981348991394,
0.2884365916252136,
-0.1816682070493698,
-0.10475125908851624,
0.36762064695358276,
-0.0028806589543819427,
-0.014949122443795204,
-0.011192545294761658,
0.16495847702026367,
0.0516849011182785,
-0.2749108374118805,
-0.24260850250720978,
-0.1958378255367279,
-0.08068745583295822,
0.1372610181570053,
0.17300638556480408,
-0.3428226709365845,
-0.008943427354097366,
0.3281904458999634,
0.24954229593276978,
0.22859817743301392,
-0.27371829748153687,
0.04961030185222626,
0.22248688340187073,
-0.19628816843032837,
0.07569505274295807,
-0.04100070893764496,
-0.04146350175142288,
-0.07067975401878357,
0.3754560351371765,
-0.06643469631671906,
0.049409642815589905,
0.042307447642087936,
0.1291252076625824,
-0.1188650131225586,
-0.21819326281547546,
-0.09542663395404816,
-0.0023772157728672028,
-0.5327746868133545,
0.22547703981399536,
-0.38168400526046753,
0.06849315762519836,
0.1858646422624588,
-0.32601574063301086,
-0.013516507111489773,
-0.03758396953344345,
0.01765265315771103,
-0.135517418384552,
-0.24518480896949768,
-0.0825178325176239,
-0.3624458909034729,
0.09001465141773224,
0.05718030035495758,
0.2889779806137085,
0.014525838196277618,
-0.15109355747699738,
-0.16029350459575653,
-0.0011474862694740295,
0.029055163264274597,
-0.14652472734451294,
-0.12554194033145905,
-0.18975451588630676,
0.1569822132587433,
-0.1148424744606018,
0.010984297841787338,
0.3247317969799042,
-0.07969678938388824,
-0.04745568707585335,
-0.13566651940345764,
0.15698085725307465,
-0.08837790787220001,
0.01130586862564087,
0.03448520600795746,
0.03485272824764252,
-0.35973861813545227,
-0.030761681497097015,
0.5324242115020752,
0.09790747612714767,
-0.03833438828587532,
0.08639106899499893,
0.21197867393493652,
0.27989840507507324,
-0.2877597510814667,
-0.21375295519828796,
0.03267550468444824,
0.07977965474128723,
0.09707094728946686,
0.12336824834346771,
0.00784643366932869,
-0.03180626034736633,
-0.32710474729537964,
0.1329924762248993,
-0.08296254277229309,
-0.12623418867588043,
0.269832581281662,
-0.26059675216674805,
-0.42286592721939087,
-0.18904367089271545,
0.24925124645233154,
0.48810145258903503,
-0.09096470475196838,
-0.044488392770290375,
0.3550426959991455,
0.08930835127830505,
-0.31041258573532104,
0.20826847851276398,
0.4293974041938782,
0.054619815200567245,
-0.0769869014620781,
0.49627983570098877,
0.40518152713775635,
-0.33816587924957275,
-0.3019731938838959,
0.15560805797576904,
-0.08553335070610046,
-0.15368182957172394,
0.13567255437374115,
0.33429592847824097,
-0.06506012380123138,
0.18518424034118652,
0.05192147195339203,
-0.020066993311047554,
0.1510191112756729,
0.526597261428833,
0.1030864417552948,
0.22590021789073944,
-0.12020619213581085,
-0.009671257808804512,
0.33249372243881226,
-0.19374004006385803,
-0.07019703090190887,
0.39351123571395874,
-0.13194817304611206,
-0.07971620559692383,
-0.23296791315078735,
0.16723716259002686,
-0.00722932443022728,
-0.2308887094259262,
-0.6257522702217102,
0.07675521820783615,
-0.304519921541214,
0.09081210196018219,
0.544292151927948,
-0.07463310658931732,
-0.5106385946273804,
-0.07646716386079788,
0.3312520384788513,
-0.08033151924610138,
0.3570574223995209,
0.1442968100309372,
-0.06212065741419792,
-0.2235850989818573,
0.28134697675704956,
0.08992515504360199,
0.21782246232032776,
-0.08223144710063934,
0.15994815528392792,
0.12903599441051483,
-0.5115562081336975,
-0.3236266076564789,
0.09450064599514008,
0.35599425435066223,
0.2223711460828781,
0.03720565140247345,
-0.2970125377178192,
0.24891461431980133,
0.15689502656459808,
0.01692163199186325,
0.5958830118179321,
-0.07021316885948181,
0.21346570551395416,
0.2471553534269333,
-0.03828577324748039,
0.0009081847965717316,
-0.2998981177806854,
0.28738832473754883,
0.35608914494514465,
-0.26011860370635986,
0.7080665826797485,
0.055867914110422134,
0.051377683877944946,
-0.04533402621746063,
-0.00638241320848465,
-0.13726890087127686,
-0.2891671359539032,
0.6335808634757996,
0.07558679580688477,
-0.00818873941898346,
-0.1854371279478073,
0.017885997891426086,
-0.08942066133022308,
0.09994782507419586,
0.10124163329601288,
0.01732323318719864,
-0.08286378532648087,
-0.27308034896850586,
-0.29713040590286255,
0.030601276084780693,
-0.3300035893917084,
0.43062716722488403,
0.07529999315738678,
0.21024975180625916,
-0.14333859086036682,
0.050739165395498276,
0.272855669260025,
-0.1310790628194809,
-0.09588469564914703,
0.29054975509643555,
-0.26350945234298706,
-0.1086268424987793,
-0.20542480051517487,
-0.31540927290916443,
0.2050272673368454,
-0.4809413552284241,
-0.1224200576543808,
0.08091571927070618,
-0.028997212648391724,
0.0007468890398740768,
-0.1079145222902298,
0.18255236744880676,
-0.09866425395011902,
0.32686877250671387,
0.28277602791786194,
0.2904539108276367,
0.21284763514995575,
-0.22955377399921417,
-0.32942384481430054,
-0.2571644186973572,
-0.15372365713119507,
0.4917561709880829,
-0.2321399748325348,
0.17284998297691345,
-0.06164904683828354,
-0.3395954370498657,
-0.28432053327560425,
0.28447431325912476,
0.324099600315094,
-0.0641772598028183,
-0.5174705982208252,
0.12485361844301224,
-0.3348677158355713,
-0.05929720774292946,
0.2215988039970398,
-0.060698915272951126,
-0.14410829544067383,
0.3751590847969055,
-0.29272666573524475,
-0.5461521744728088,
0.13407114148139954,
-0.534084677696228,
-0.30799537897109985,
-0.3038834035396576,
0.4796675145626068,
0.15094739198684692,
-0.21907798945903778,
-0.7745288610458374,
0.041682660579681396,
0.3128069043159485,
-0.1778126060962677,
0.036514103412628174,
-0.03462477773427963,
-0.3378053903579712,
0.29239189624786377,
0.00047040730714797974,
0.41518452763557434,
-0.09624199569225311,
-0.07304757833480835,
0.36947765946388245,
-0.08920229226350784
] |
https://github.com/huggingface/datasets/issues/6142 | The files have been fixed ! I'm closing this one but feel free to re-open if you still have the issue | the-stack-dedup fails to generate | ### Describe the bug
I'm getting an error generating the-stack-dedup with datasets 2.13.1, and with 2.14.4 nothing happens.
### Steps to reproduce the bug
My code:
```
import os
import datasets as ds
MY_CACHE_DIR = "/home/ubuntu/the-stack-dedup-local"
MY_TOKEN="my-token"
the_stack_ds = ds.load_dataset("bigcode/the-stack-dedup", split="train", download_mode="reuse_cache_if_exists", cache_dir=MY_CACHE_DIR, use_auth_token=MY_TOKEN, num_proc=64)
```
The exception:
```
Generating train split: 233248251 examples [54:31, 57280.00 examples/s]
multiprocess.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/build
er.py", line 1879, in _prepare_split_single
for _, table in generator:
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/packa
ged_modules/parquet/parquet.py", line 82, in _generate_tables
yield f"{file_idx}_{batch_idx}", self._cast_table(pa_table)
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/packa
ged_modules/parquet/parquet.py", line 61, in _cast_table
pa_table = table_cast(pa_table, self.info.features.arrow_schema)
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/table
.py", line 2324, in table_cast
return cast_table_to_schema(table, schema)
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/table
.py", line 2282, in cast_table_to_schema
raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nb
ecause column names don't match")
ValueError: Couldn't cast
hexsha: string
size: int64
ext: string
lang: string
max_stars_repo_path: string
max_stars_repo_name: string
max_stars_repo_head_hexsha: string
max_stars_repo_licenses: list<item: string>
child 0, item: string
max_stars_count: int64
max_stars_repo_stars_event_min_datetime: string
max_stars_repo_stars_event_max_datetime: string
max_issues_repo_path: string
max_issues_repo_name: string
max_issues_repo_head_hexsha: string
max_issues_repo_licenses: list<item: string>
child 0, item: string
max_issues_count: int64
max_issues_repo_issues_event_min_datetime: string
max_issues_repo_issues_event_max_datetime: string
max_forks_repo_path: string
max_forks_repo_name: string
max_forks_repo_head_hexsha: string
max_forks_repo_licenses: list<item: string>
child 0, item: string
max_forks_count: int64
max_forks_repo_forks_event_min_datetime: string
max_forks_repo_forks_event_max_datetime: string
content: string
avg_line_length: double
max_line_length: int64
alphanum_fraction: double
__id__: int64
-- schema metadata --
huggingface: '{"info": {"features": {"hexsha": {"dtype": "string", "_type' + 1979
to
{'hexsha': Value(dtype='string', id=None), 'size': Value(dtype='int64', id=None), 'ext': Value(dtype='string', id=None), 'lang': Value(dtype='string', id=None), 'max_stars_repo_path': Value(dtype='string', id=None), 'max_stars_repo_name': Value(dtype='string', id=None), 'max_stars_repo_head_hexsha': Value(dtype='string', id=None), 'max_stars_repo_licenses': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'max_stars_count': Value(dtype='int64', id=None), 'max_stars_repo_stars_event_min_datetime': Value(dtype='string', id=None), 'max_stars_repo_stars_event_max_datetime': Value(dtype='string', id=None), 'max_issues_repo_path': Value(dtype='string', id=None), 'max_issues_repo_name': Value(dtype='string', id=None), 'max_issues_repo_head_hexsha': Value(dtype='string', id=None), 'max_issues_repo_licenses': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'max_issues_count': Value(dtype='int64', id=None), 'max_issues_repo_issues_event_min_datetime': Value(dtype='string', id=None), 'max_issues_repo_issues_event_max_datetime': Value(dtype='string', id=None), 'max_forks_repo_path': Value(dtype='string', id=None), 'max_forks_repo_name': Value(dtype='string', id=None), 'max_forks_repo_head_hexsha': Value(dtype='string', id=None), 'max_forks_repo_licenses': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'max_forks_count': Value(dtype='int64', id=None), 'max_forks_repo_forks_event_min_datetime': Value(dtype='string', id=None), 'max_forks_repo_forks_event_max_datetime': Value(dtype='string', id=None), 'content': Value(dtype='string', id=None), 'avg_line_length': Value(dtype='float64', id=None), 'max_line_length': Value(dtype='int64', id=None), 'alphanum_fraction': Value(dtype='float64', id=None)}
because column names don't match
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.10/site-packages/multiprocess/p
ool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/utils
/py_utils.py", line 1328, in _write_generator_to_queue
for i, result in enumerate(func(**kwargs)):
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/build
er.py", line 1912, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating th
e dataset") from e
datasets.builder.DatasetGenerationError: An error occurred while genera
ting the dataset
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/ubuntu/download_the_stack.py", line 7, in <module>
the_stack_ds = ds.load_dataset("bigcode/the-stack-dedup", split="tr
ain", download_mode="reuse_cache_if_exists", cache_dir=MY_CACHE_DIR, us
e_auth_token=MY_TOKEN, num_proc=64)
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/load.
py", line 1809, in load_dataset
builder_instance.download_and_prepare(
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/build
er.py", line 909, in download_and_prepare
self._download_and_prepare(
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/build
er.py", line 1004, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/build
er.py", line 1796, in _prepare_split
for job_id, done, content in iflatmap_unordered(
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/utils
/py_utils.py", line 1354, in iflatmap_unordered
[async_result.get(timeout=0.05) for async_result in async_results]
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/utils
/py_utils.py", line 1354, in <listcomp>
[async_result.get(timeout=0.05) for async_result in async_results]
File "/home/ubuntu/.local/lib/python3.10/site-packages/multiprocess/p
ool.py", line 774, in get
raise self._value
datasets.builder.DatasetGenerationError: An error occurred while generating the dataset
```
### Expected behavior
The dataset downloads properly. @lhoestq @loub
### Environment info
Datasets 2.13.1, large VM with 2TB RAM, Ubuntu 20.04 | 21 | the-stack-dedup fails to generate
### Describe the bug
I'm getting an error generating the-stack-dedup with datasets 2.13.1, and with 2.14.4 nothing happens.
### Steps to reproduce the bug
My code:
```
import os
import datasets as ds
MY_CACHE_DIR = "/home/ubuntu/the-stack-dedup-local"
MY_TOKEN="my-token"
the_stack_ds = ds.load_dataset("bigcode/the-stack-dedup", split="train", download_mode="reuse_cache_if_exists", cache_dir=MY_CACHE_DIR, use_auth_token=MY_TOKEN, num_proc=64)
```
The exception:
```
Generating train split: 233248251 examples [54:31, 57280.00 examples/s]
multiprocess.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/build
er.py", line 1879, in _prepare_split_single
for _, table in generator:
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/packa
ged_modules/parquet/parquet.py", line 82, in _generate_tables
yield f"{file_idx}_{batch_idx}", self._cast_table(pa_table)
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/packa
ged_modules/parquet/parquet.py", line 61, in _cast_table
pa_table = table_cast(pa_table, self.info.features.arrow_schema)
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/table
.py", line 2324, in table_cast
return cast_table_to_schema(table, schema)
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/table
.py", line 2282, in cast_table_to_schema
raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nb
ecause column names don't match")
ValueError: Couldn't cast
hexsha: string
size: int64
ext: string
lang: string
max_stars_repo_path: string
max_stars_repo_name: string
max_stars_repo_head_hexsha: string
max_stars_repo_licenses: list<item: string>
child 0, item: string
max_stars_count: int64
max_stars_repo_stars_event_min_datetime: string
max_stars_repo_stars_event_max_datetime: string
max_issues_repo_path: string
max_issues_repo_name: string
max_issues_repo_head_hexsha: string
max_issues_repo_licenses: list<item: string>
child 0, item: string
max_issues_count: int64
max_issues_repo_issues_event_min_datetime: string
max_issues_repo_issues_event_max_datetime: string
max_forks_repo_path: string
max_forks_repo_name: string
max_forks_repo_head_hexsha: string
max_forks_repo_licenses: list<item: string>
child 0, item: string
max_forks_count: int64
max_forks_repo_forks_event_min_datetime: string
max_forks_repo_forks_event_max_datetime: string
content: string
avg_line_length: double
max_line_length: int64
alphanum_fraction: double
__id__: int64
-- schema metadata --
huggingface: '{"info": {"features": {"hexsha": {"dtype": "string", "_type' + 1979
to
{'hexsha': Value(dtype='string', id=None), 'size': Value(dtype='int64', id=None), 'ext': Value(dtype='string', id=None), 'lang': Value(dtype='string', id=None), 'max_stars_repo_path': Value(dtype='string', id=None), 'max_stars_repo_name': Value(dtype='string', id=None), 'max_stars_repo_head_hexsha': Value(dtype='string', id=None), 'max_stars_repo_licenses': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'max_stars_count': Value(dtype='int64', id=None), 'max_stars_repo_stars_event_min_datetime': Value(dtype='string', id=None), 'max_stars_repo_stars_event_max_datetime': Value(dtype='string', id=None), 'max_issues_repo_path': Value(dtype='string', id=None), 'max_issues_repo_name': Value(dtype='string', id=None), 'max_issues_repo_head_hexsha': Value(dtype='string', id=None), 'max_issues_repo_licenses': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'max_issues_count': Value(dtype='int64', id=None), 'max_issues_repo_issues_event_min_datetime': Value(dtype='string', id=None), 'max_issues_repo_issues_event_max_datetime': Value(dtype='string', id=None), 'max_forks_repo_path': Value(dtype='string', id=None), 'max_forks_repo_name': Value(dtype='string', id=None), 'max_forks_repo_head_hexsha': Value(dtype='string', id=None), 'max_forks_repo_licenses': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'max_forks_count': Value(dtype='int64', id=None), 'max_forks_repo_forks_event_min_datetime': Value(dtype='string', id=None), 'max_forks_repo_forks_event_max_datetime': Value(dtype='string', id=None), 'content': Value(dtype='string', id=None), 'avg_line_length': Value(dtype='float64', id=None), 'max_line_length': Value(dtype='int64', id=None), 'alphanum_fraction': Value(dtype='float64', id=None)}
because column names don't match
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.10/site-packages/multiprocess/p
ool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/utils
/py_utils.py", line 1328, in _write_generator_to_queue
for i, result in enumerate(func(**kwargs)):
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/build
er.py", line 1912, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating th
e dataset") from e
datasets.builder.DatasetGenerationError: An error occurred while genera
ting the dataset
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/ubuntu/download_the_stack.py", line 7, in <module>
the_stack_ds = ds.load_dataset("bigcode/the-stack-dedup", split="tr
ain", download_mode="reuse_cache_if_exists", cache_dir=MY_CACHE_DIR, us
e_auth_token=MY_TOKEN, num_proc=64)
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/load.
py", line 1809, in load_dataset
builder_instance.download_and_prepare(
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/build
er.py", line 909, in download_and_prepare
self._download_and_prepare(
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/build
er.py", line 1004, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/build
er.py", line 1796, in _prepare_split
for job_id, done, content in iflatmap_unordered(
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/utils
/py_utils.py", line 1354, in iflatmap_unordered
[async_result.get(timeout=0.05) for async_result in async_results]
File "/home/ubuntu/.local/lib/python3.10/site-packages/datasets/utils
/py_utils.py", line 1354, in <listcomp>
[async_result.get(timeout=0.05) for async_result in async_results]
File "/home/ubuntu/.local/lib/python3.10/site-packages/multiprocess/p
ool.py", line 774, in get
raise self._value
datasets.builder.DatasetGenerationError: An error occurred while generating the dataset
```
### Expected behavior
The dataset downloads properly. @lhoestq @loub
### Environment info
Datasets 2.13.1, large VM with 2TB RAM, Ubuntu 20.04
The files have been fixed ! I'm closing this one but feel free to re-open if you still have the issue | [
-0.2608025372028351,
-0.025322765111923218,
0.030000541359186172,
0.38186246156692505,
0.043696630746126175,
-0.03949412703514099,
0.5020748972892761,
0.38187968730926514,
-0.04980931431055069,
-0.06252968311309814,
0.21321964263916016,
0.5592825412750244,
0.04533160477876663,
0.054538793861866,
0.23558321595191956,
-0.05239605903625488,
0.20431745052337646,
0.003597080707550049,
-0.15224967896938324,
-0.031557559967041016,
-0.07234498113393784,
0.2126641571521759,
-0.25354257225990295,
-0.04951596260070801,
-0.15213751792907715,
0.295377254486084,
0.0435551181435585,
0.03984951227903366,
0.05305801331996918,
-0.4402918815612793,
0.6022636890411377,
-0.03049035556614399,
-0.026286862790584564,
0.40190014243125916,
-0.0001232836948474869,
0.16549086570739746,
0.3325713276863098,
-0.004602648317813873,
-0.2144017517566681,
-0.15757140517234802,
-0.3999960422515869,
-0.14649683237075806,
-0.15743140876293182,
-0.08022072166204453,
-0.04893144592642784,
-0.22599545121192932,
-0.25848373770713806,
-0.3947603106498718,
0.46791309118270874,
0.5752434730529785,
0.06917242705821991,
0.07614777237176895,
0.18238000571727753,
-0.26227182149887085,
0.2213277965784073,
0.4607096016407013,
-0.12136241793632507,
0.13156664371490479,
-0.0673326775431633,
-0.05437668785452843,
-0.07146900147199631,
-0.21574291586875916,
-0.04352138936519623,
0.09790095686912537,
-0.04586393013596535,
0.1110696941614151,
0.14768044650554657,
-0.19467204809188843,
0.27412745356559753,
0.22070196270942688,
0.09949342906475067,
-0.43392518162727356,
-0.19819742441177368,
-0.06684844195842743,
-0.007558900862932205,
-0.20060588419437408,
0.21883970499038696,
0.06066229194402695,
-0.17946022748947144,
0.1400606632232666,
0.001217663288116455,
-0.060842473059892654,
-0.21694880723953247,
-0.03090890496969223,
0.03542768955230713,
-0.11056888848543167,
0.11351214349269867,
0.015583646483719349,
0.11598570644855499,
0.07095413655042648,
0.48766160011291504,
0.07092944532632828,
-0.013556177727878094,
0.1613740622997284,
-0.33043795824050903,
0.06773363053798676,
0.20120617747306824,
-0.221460223197937,
0.3436477780342102,
0.3031872510910034,
-0.463392972946167,
-0.11593925207853317,
0.26639825105667114,
0.0718219131231308,
-0.06342615187168121,
-0.2525314390659332,
-0.3364846408367157,
0.038581483066082,
0.41292107105255127,
0.02661866322159767,
0.17614349722862244,
0.0038344813510775566,
-0.1929871141910553,
-0.161310613155365,
0.09757746011018753,
0.022450584918260574,
0.21617285907268524,
-0.24339312314987183,
-0.15527835488319397,
0.18816016614437103,
-0.31060805916786194,
0.022650156170129776,
0.016083449125289917,
0.23614798486232758,
0.35020825266838074,
0.40442460775375366,
-0.026870425790548325,
0.21142691373825073,
-0.21872402727603912,
-0.4936831295490265,
-0.09935731440782547,
-0.03353516012430191,
-0.19152426719665527,
-0.12830588221549988,
0.4293392598628998,
-0.03212417662143707,
-0.05084500089287758,
0.39981088042259216,
0.0692598968744278,
-0.3231922686100006,
-0.13577426970005035,
-0.22779613733291626,
0.0841987282037735,
0.2194204181432724,
-0.2113221287727356,
-0.14336594939231873,
0.11960342526435852,
-0.06641644239425659,
0.03259795904159546,
0.0978335440158844,
-0.04125610738992691,
-0.2473629117012024,
-0.2503868341445923,
0.10262630134820938,
0.27062949538230896,
0.13113386929035187,
-0.6416183114051819,
0.22893604636192322,
0.31269392371177673,
0.1597558856010437,
0.004118006676435471,
-0.3886300325393677,
-0.03049619495868683,
-0.16388846933841705,
0.6185105443000793,
0.5126932859420776,
-0.5208104252815247,
0.17574885487556458,
-0.41632187366485596,
-0.1012759804725647,
0.3131764829158783,
0.07084789127111435,
-0.20804764330387115,
0.611671507358551,
-0.4350990355014801,
-0.13072550296783447,
0.3270426094532013,
-0.1097874641418457,
-0.10304071754217148,
0.2847132682800293,
-0.1793658435344696,
-0.14748260378837585,
0.0187141802161932,
-0.29654282331466675,
-0.06475621461868286,
0.13828767836093903,
0.026596371084451675,
0.037562061101198196,
-0.23781239986419678,
-0.005885966122150421,
-0.15227559208869934,
0.10172976553440094,
0.24532856047153473,
0.09746627509593964,
0.5272570252418518,
0.4189566671848297,
0.021561728790402412,
0.00042100250720977783,
0.25115010142326355,
-0.032511234283447266,
0.10403472185134888,
0.12785939872264862,
0.8492044806480408,
-0.07841136306524277,
0.06588567793369293,
-0.05376255512237549,
-0.2718454599380493,
0.18257969617843628,
-0.056367725133895874,
-0.19771766662597656,
0.1478782296180725,
0.025934822857379913,
-0.24774841964244843,
0.32758402824401855,
0.08252803981304169,
-0.15124118328094482,
0.028184697031974792,
0.14540967345237732,
0.35590091347694397,
0.01788027584552765,
0.02202703058719635,
0.45694559812545776,
-0.08847750723361969,
0.14248457551002502,
-0.17690977454185486,
0.4789981544017792,
-0.06248480826616287,
-0.1729942411184311,
0.024706564843654633,
0.19313250482082367,
0.11794278025627136,
-0.06236563250422478,
-0.12244650721549988,
0.29031676054000854,
0.37800657749176025,
-0.09782422333955765,
-0.2002546191215515,
-0.17284296452999115,
0.017809180542826653,
-0.17006666958332062,
0.05919483304023743,
-0.060916025191545486,
0.028528228402137756,
0.01957342028617859,
0.28138160705566406,
-0.016281522810459137,
0.1885310262441635,
0.1725107729434967,
0.029186919331550598,
0.11484028398990631,
0.10706961899995804,
-0.07882988452911377,
0.5431431531906128,
0.0823754072189331,
0.005416891537606716,
-0.37166064977645874,
0.08665706217288971,
-0.1667325645685196,
-0.33074477314949036,
0.2937471270561218,
0.3831067681312561,
0.07681450247764587,
-0.06455956399440765,
0.12064270675182343,
0.08789211511611938,
-0.25413447618484497,
0.2804010808467865,
0.38615983724594116,
0.6080988049507141,
0.02506294846534729,
-0.007237451151013374,
0.10208426415920258,
-0.1381622701883316,
-0.07079143822193146,
0.12722070515155792,
-0.25925809144973755,
-0.18225549161434174,
0.24190708994865417,
0.2009258270263672,
-0.10794218629598618,
-0.3000086545944214,
-0.19332708418369293,
0.05811581760644913,
0.2213483601808548,
-0.28187865018844604,
0.09658244252204895,
-0.4101216793060303,
-0.09980931133031845,
-0.46143147349357605,
0.33820706605911255,
-0.018207533285021782,
-0.2592501640319824,
-0.0732976496219635,
0.17740322649478912,
0.009971335530281067,
0.1100413054227829,
-0.2894057631492615,
0.03144995868206024,
-0.015840165317058563,
-0.12404131144285202,
-0.33364856243133545,
-0.0074258409440517426,
-0.3798521161079407,
-0.026097634807229042,
0.06881309300661087,
0.03766031935811043,
0.25039753317832947,
-0.009215224534273148,
-0.4162850081920624,
-0.3670940399169922,
-0.11030609160661697,
0.27747368812561035,
-0.18721997737884521,
0.21962082386016846,
0.1683349758386612,
-0.018025275319814682,
-0.23469233512878418,
-0.17515772581100464,
0.3184663951396942,
-0.3130769729614258,
-0.3577420711517334,
0.22335989773273468,
-0.0384075790643692,
0.057793162763118744,
-0.31849122047424316,
-0.5930789709091187,
0.2183714658021927,
-0.2130683809518814,
0.42106202244758606,
-0.2592517137527466,
0.11586975306272507,
0.035460472106933594,
0.1385771930217743,
0.2771429121494293,
0.06804519891738892,
-0.00966038927435875,
-0.26219895482063293,
0.02887207269668579,
0.08444823324680328,
-0.2471006065607071,
-0.3481840193271637,
-0.11587989330291748,
0.010242268443107605,
0.19432362914085388,
0.18503576517105103,
-0.5795999765396118,
0.2983708679676056,
-0.3095149099826813,
0.05020664632320404,
-0.3355921804904938,
0.15839305520057678,
0.09610164165496826,
-0.00937977060675621,
0.07246974855661392,
-0.19895043969154358,
0.06135466694831848,
0.4836963713169098,
0.10367242991924286,
0.20634615421295166,
0.19827713072299957,
0.45306307077407837,
-0.06334646046161652,
0.6828688979148865,
0.3655323088169098,
-0.21874916553497314,
0.1418445110321045,
-0.12788927555084229,
0.26219338178634644,
-0.11388736963272095,
-0.19458451867103577,
0.09602458775043488,
0.03346865624189377,
0.1152573749423027,
-0.08032090961933136,
-0.17829909920692444,
-0.1786593645811081,
-0.0191485658288002,
0.11346866190433502,
0.00601920485496521,
-0.3661074936389923,
-0.14548417925834656,
-0.2743987739086151,
0.11550752818584442,
-0.06683309376239777,
0.12339099496603012,
0.023641273379325867,
-0.03964215889573097,
0.01426752284169197,
-0.15018373727798462,
0.1266624927520752,
0.24313025176525116,
0.050325728952884674,
0.21398189663887024,
-0.41014400124549866,
0.1366669237613678,
-0.012579314410686493,
0.6693252325057983,
-0.06373508274555206,
-0.011313430964946747,
-0.013075783848762512,
0.01192484050989151,
0.544867992401123,
-0.2918943464756012,
0.15502840280532837,
0.12288814783096313,
0.10355085879564285,
-0.30904749035835266,
-0.19733868539333344,
-0.17664363980293274,
-0.020633839070796967,
0.20809359848499298,
-0.15938271582126617,
-0.19342395663261414,
-0.35113754868507385,
0.2651325464248657,
0.1807645857334137,
0.1743869036436081,
-0.14887367188930511,
-0.08307881653308868,
-0.2626630663871765,
0.034364357590675354,
0.30233362317085266,
0.5255436897277832,
0.19507044553756714,
-0.17150205373764038,
-0.23737500607967377,
-0.10694403946399689,
-0.1372356116771698,
0.13238920271396637,
0.1458650529384613,
0.2244047075510025,
-0.4565005302429199,
0.4817293882369995,
0.09839595854282379,
0.06001393869519234,
0.7912300825119019,
0.21500274538993835,
-0.3013259470462799,
0.09659264981746674,
0.13184186816215515,
0.055520616471767426,
0.37797805666923523,
0.12882967293262482,
-0.4033084511756897,
0.1286509782075882,
-0.1572517454624176,
0.03379971161484718,
-0.1579957902431488,
0.07693488150835037,
0.26077523827552795,
-0.2073688954114914,
-0.19309186935424805,
-0.34219008684158325,
0.09108775854110718,
0.022879861295223236,
0.1074860692024231,
0.4194115102291107,
0.15073370933532715,
-0.32285276055336,
0.21245229244232178,
-0.19174081087112427,
0.5460221767425537,
0.22540885210037231,
-0.12816226482391357,
-0.06262890994548798,
-0.033642277121543884,
0.2169433981180191,
-0.6935359835624695,
0.23414525389671326,
-0.4154064357280731,
-0.0900721326470375,
-0.09531055390834808,
-0.38922032713890076,
-0.08318425714969635,
0.4540861248970032,
-0.03201685845851898,
0.21681195497512817,
0.0026001036167144775,
0.5390001535415649,
0.06532008945941925,
0.08683925867080688,
0.062099285423755646,
-0.12598657608032227,
-0.17813703417778015,
0.0883442610502243,
-0.03043874353170395,
-0.09982641786336899,
-0.1504167914390564,
-0.13962256908416748,
-0.19299042224884033,
-0.221173495054245,
-0.5403085947036743,
0.41214340925216675,
-0.21565307676792145,
0.44511526823043823,
0.5049794912338257,
-0.06116371601819992,
0.28266072273254395,
0.012350145727396011,
0.30781981348991394,
0.2884365916252136,
-0.1816682070493698,
-0.10475125908851624,
0.36762064695358276,
-0.0028806589543819427,
-0.014949122443795204,
-0.011192545294761658,
0.16495847702026367,
0.0516849011182785,
-0.2749108374118805,
-0.24260850250720978,
-0.1958378255367279,
-0.08068745583295822,
0.1372610181570053,
0.17300638556480408,
-0.3428226709365845,
-0.008943427354097366,
0.3281904458999634,
0.24954229593276978,
0.22859817743301392,
-0.27371829748153687,
0.04961030185222626,
0.22248688340187073,
-0.19628816843032837,
0.07569505274295807,
-0.04100070893764496,
-0.04146350175142288,
-0.07067975401878357,
0.3754560351371765,
-0.06643469631671906,
0.049409642815589905,
0.042307447642087936,
0.1291252076625824,
-0.1188650131225586,
-0.21819326281547546,
-0.09542663395404816,
-0.0023772157728672028,
-0.5327746868133545,
0.22547703981399536,
-0.38168400526046753,
0.06849315762519836,
0.1858646422624588,
-0.32601574063301086,
-0.013516507111489773,
-0.03758396953344345,
0.01765265315771103,
-0.135517418384552,
-0.24518480896949768,
-0.0825178325176239,
-0.3624458909034729,
0.09001465141773224,
0.05718030035495758,
0.2889779806137085,
0.014525838196277618,
-0.15109355747699738,
-0.16029350459575653,
-0.0011474862694740295,
0.029055163264274597,
-0.14652472734451294,
-0.12554194033145905,
-0.18975451588630676,
0.1569822132587433,
-0.1148424744606018,
0.010984297841787338,
0.3247317969799042,
-0.07969678938388824,
-0.04745568707585335,
-0.13566651940345764,
0.15698085725307465,
-0.08837790787220001,
0.01130586862564087,
0.03448520600795746,
0.03485272824764252,
-0.35973861813545227,
-0.030761681497097015,
0.5324242115020752,
0.09790747612714767,
-0.03833438828587532,
0.08639106899499893,
0.21197867393493652,
0.27989840507507324,
-0.2877597510814667,
-0.21375295519828796,
0.03267550468444824,
0.07977965474128723,
0.09707094728946686,
0.12336824834346771,
0.00784643366932869,
-0.03180626034736633,
-0.32710474729537964,
0.1329924762248993,
-0.08296254277229309,
-0.12623418867588043,
0.269832581281662,
-0.26059675216674805,
-0.42286592721939087,
-0.18904367089271545,
0.24925124645233154,
0.48810145258903503,
-0.09096470475196838,
-0.044488392770290375,
0.3550426959991455,
0.08930835127830505,
-0.31041258573532104,
0.20826847851276398,
0.4293974041938782,
0.054619815200567245,
-0.0769869014620781,
0.49627983570098877,
0.40518152713775635,
-0.33816587924957275,
-0.3019731938838959,
0.15560805797576904,
-0.08553335070610046,
-0.15368182957172394,
0.13567255437374115,
0.33429592847824097,
-0.06506012380123138,
0.18518424034118652,
0.05192147195339203,
-0.020066993311047554,
0.1510191112756729,
0.526597261428833,
0.1030864417552948,
0.22590021789073944,
-0.12020619213581085,
-0.009671257808804512,
0.33249372243881226,
-0.19374004006385803,
-0.07019703090190887,
0.39351123571395874,
-0.13194817304611206,
-0.07971620559692383,
-0.23296791315078735,
0.16723716259002686,
-0.00722932443022728,
-0.2308887094259262,
-0.6257522702217102,
0.07675521820783615,
-0.304519921541214,
0.09081210196018219,
0.544292151927948,
-0.07463310658931732,
-0.5106385946273804,
-0.07646716386079788,
0.3312520384788513,
-0.08033151924610138,
0.3570574223995209,
0.1442968100309372,
-0.06212065741419792,
-0.2235850989818573,
0.28134697675704956,
0.08992515504360199,
0.21782246232032776,
-0.08223144710063934,
0.15994815528392792,
0.12903599441051483,
-0.5115562081336975,
-0.3236266076564789,
0.09450064599514008,
0.35599425435066223,
0.2223711460828781,
0.03720565140247345,
-0.2970125377178192,
0.24891461431980133,
0.15689502656459808,
0.01692163199186325,
0.5958830118179321,
-0.07021316885948181,
0.21346570551395416,
0.2471553534269333,
-0.03828577324748039,
0.0009081847965717316,
-0.2998981177806854,
0.28738832473754883,
0.35608914494514465,
-0.26011860370635986,
0.7080665826797485,
0.055867914110422134,
0.051377683877944946,
-0.04533402621746063,
-0.00638241320848465,
-0.13726890087127686,
-0.2891671359539032,
0.6335808634757996,
0.07558679580688477,
-0.00818873941898346,
-0.1854371279478073,
0.017885997891426086,
-0.08942066133022308,
0.09994782507419586,
0.10124163329601288,
0.01732323318719864,
-0.08286378532648087,
-0.27308034896850586,
-0.29713040590286255,
0.030601276084780693,
-0.3300035893917084,
0.43062716722488403,
0.07529999315738678,
0.21024975180625916,
-0.14333859086036682,
0.050739165395498276,
0.272855669260025,
-0.1310790628194809,
-0.09588469564914703,
0.29054975509643555,
-0.26350945234298706,
-0.1086268424987793,
-0.20542480051517487,
-0.31540927290916443,
0.2050272673368454,
-0.4809413552284241,
-0.1224200576543808,
0.08091571927070618,
-0.028997212648391724,
0.0007468890398740768,
-0.1079145222902298,
0.18255236744880676,
-0.09866425395011902,
0.32686877250671387,
0.28277602791786194,
0.2904539108276367,
0.21284763514995575,
-0.22955377399921417,
-0.32942384481430054,
-0.2571644186973572,
-0.15372365713119507,
0.4917561709880829,
-0.2321399748325348,
0.17284998297691345,
-0.06164904683828354,
-0.3395954370498657,
-0.28432053327560425,
0.28447431325912476,
0.324099600315094,
-0.0641772598028183,
-0.5174705982208252,
0.12485361844301224,
-0.3348677158355713,
-0.05929720774292946,
0.2215988039970398,
-0.060698915272951126,
-0.14410829544067383,
0.3751590847969055,
-0.29272666573524475,
-0.5461521744728088,
0.13407114148139954,
-0.534084677696228,
-0.30799537897109985,
-0.3038834035396576,
0.4796675145626068,
0.15094739198684692,
-0.21907798945903778,
-0.7745288610458374,
0.041682660579681396,
0.3128069043159485,
-0.1778126060962677,
0.036514103412628174,
-0.03462477773427963,
-0.3378053903579712,
0.29239189624786377,
0.00047040730714797974,
0.41518452763557434,
-0.09624199569225311,
-0.07304757833480835,
0.36947765946388245,
-0.08920229226350784
] |
https://github.com/huggingface/datasets/issues/6141 | Hi! I cannot reproduce this error on my machine or in Colab. Which version of `fsspec` do you have installed? | TypeError: ClientSession._request() got an unexpected keyword argument 'https' | ### Describe the bug
Hello, when I ran the [code snippet](https://huggingface.co/docs/datasets/v2.14.4/en/loading#json) on the document, I encountered the following problem:
```
Python 3.10.9 (main, Mar 1 2023, 18:23:06) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from datasets import load_dataset
>>> base_url = "https://rajpurkar.github.io/SQuAD-explorer/dataset/"
>>> dataset = load_dataset("json", data_files={"train": base_url + "train-v1.1.json", "validation": base_url + "dev-v1.1.json"}, field="data")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/liushuai/anaconda3/lib/python3.10/site-packages/datasets/load.py", line 2112, in load_dataset
builder_instance = load_dataset_builder(
File "/home/liushuai/anaconda3/lib/python3.10/site-packages/datasets/load.py", line 1798, in load_dataset_builder
dataset_module = dataset_module_factory(
File "/home/liushuai/anaconda3/lib/python3.10/site-packages/datasets/load.py", line 1413, in dataset_module_factory
).get_module()
File "/home/liushuai/anaconda3/lib/python3.10/site-packages/datasets/load.py", line 949, in get_module
data_files = DataFilesDict.from_patterns(
File "/home/liushuai/anaconda3/lib/python3.10/site-packages/datasets/data_files.py", line 672, in from_patterns
DataFilesList.from_patterns(
File "/home/liushuai/anaconda3/lib/python3.10/site-packages/datasets/data_files.py", line 578, in from_patterns
resolve_pattern(
File "/home/liushuai/anaconda3/lib/python3.10/site-packages/datasets/data_files.py", line 340, in resolve_pattern
for filepath, info in fs.glob(pattern, detail=True).items()
File "/home/liushuai/anaconda3/lib/python3.10/site-packages/fsspec/asyn.py", line 113, in wrapper
return sync(self.loop, func, *args, **kwargs)
File "/home/liushuai/anaconda3/lib/python3.10/site-packages/fsspec/asyn.py", line 98, in sync
raise return_result
File "/home/liushuai/anaconda3/lib/python3.10/site-packages/fsspec/asyn.py", line 53, in _runner
result[0] = await coro
File "/home/liushuai/anaconda3/lib/python3.10/site-packages/fsspec/implementations/http.py", line 449, in _glob
elif await self._exists(path):
File "/home/liushuai/anaconda3/lib/python3.10/site-packages/fsspec/implementations/http.py", line 306, in _exists
r = await session.get(self.encode_url(path), **kw)
File "/home/liushuai/anaconda3/lib/python3.10/site-packages/aiohttp/client.py", line 922, in get
self._request(hdrs.METH_GET, url, allow_redirects=allow_redirects, **kwargs)
TypeError: ClientSession._request() got an unexpected keyword argument 'https'
```
### Steps to reproduce the bug
```
from datasets import load_dataset
base_url = "https://rajpurkar.github.io/SQuAD-explorer/dataset/"
dataset = load_dataset("json", data_files={"train": base_url + "train-v1.1.json", "validation": base_url + "dev-v1.1.json"}, field="data")
```
### Expected behavior
able to load normally
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-5.4.54-2-x86_64-with-glibc2.27
- Python version: 3.10.9
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3 | 20 | TypeError: ClientSession._request() got an unexpected keyword argument 'https'
### Describe the bug
Hello, when I ran the [code snippet](https://huggingface.co/docs/datasets/v2.14.4/en/loading#json) on the document, I encountered the following problem:
```
Python 3.10.9 (main, Mar 1 2023, 18:23:06) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from datasets import load_dataset
>>> base_url = "https://rajpurkar.github.io/SQuAD-explorer/dataset/"
>>> dataset = load_dataset("json", data_files={"train": base_url + "train-v1.1.json", "validation": base_url + "dev-v1.1.json"}, field="data")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/liushuai/anaconda3/lib/python3.10/site-packages/datasets/load.py", line 2112, in load_dataset
builder_instance = load_dataset_builder(
File "/home/liushuai/anaconda3/lib/python3.10/site-packages/datasets/load.py", line 1798, in load_dataset_builder
dataset_module = dataset_module_factory(
File "/home/liushuai/anaconda3/lib/python3.10/site-packages/datasets/load.py", line 1413, in dataset_module_factory
).get_module()
File "/home/liushuai/anaconda3/lib/python3.10/site-packages/datasets/load.py", line 949, in get_module
data_files = DataFilesDict.from_patterns(
File "/home/liushuai/anaconda3/lib/python3.10/site-packages/datasets/data_files.py", line 672, in from_patterns
DataFilesList.from_patterns(
File "/home/liushuai/anaconda3/lib/python3.10/site-packages/datasets/data_files.py", line 578, in from_patterns
resolve_pattern(
File "/home/liushuai/anaconda3/lib/python3.10/site-packages/datasets/data_files.py", line 340, in resolve_pattern
for filepath, info in fs.glob(pattern, detail=True).items()
File "/home/liushuai/anaconda3/lib/python3.10/site-packages/fsspec/asyn.py", line 113, in wrapper
return sync(self.loop, func, *args, **kwargs)
File "/home/liushuai/anaconda3/lib/python3.10/site-packages/fsspec/asyn.py", line 98, in sync
raise return_result
File "/home/liushuai/anaconda3/lib/python3.10/site-packages/fsspec/asyn.py", line 53, in _runner
result[0] = await coro
File "/home/liushuai/anaconda3/lib/python3.10/site-packages/fsspec/implementations/http.py", line 449, in _glob
elif await self._exists(path):
File "/home/liushuai/anaconda3/lib/python3.10/site-packages/fsspec/implementations/http.py", line 306, in _exists
r = await session.get(self.encode_url(path), **kw)
File "/home/liushuai/anaconda3/lib/python3.10/site-packages/aiohttp/client.py", line 922, in get
self._request(hdrs.METH_GET, url, allow_redirects=allow_redirects, **kwargs)
TypeError: ClientSession._request() got an unexpected keyword argument 'https'
```
### Steps to reproduce the bug
```
from datasets import load_dataset
base_url = "https://rajpurkar.github.io/SQuAD-explorer/dataset/"
dataset = load_dataset("json", data_files={"train": base_url + "train-v1.1.json", "validation": base_url + "dev-v1.1.json"}, field="data")
```
### Expected behavior
able to load normally
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-5.4.54-2-x86_64-with-glibc2.27
- Python version: 3.10.9
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
Hi! I cannot reproduce this error on my machine or in Colab. Which version of `fsspec` do you have installed? | [
0.18585044145584106,
-0.17859402298927307,
-0.05237463861703873,
0.23951728641986847,
0.2108559012413025,
0.032153770327568054,
0.06183677911758423,
0.17651477456092834,
-0.18309633433818817,
-0.04363574832677841,
0.15922331809997559,
0.3644048869609833,
0.18158484995365143,
0.0929638147354126,
0.12051140516996384,
0.06857878714799881,
0.035652171820402145,
-0.028283555060625076,
-0.28380751609802246,
0.141357421875,
-0.21867981553077698,
0.3575614094734192,
-0.27480971813201904,
0.11732479929924011,
0.07720603048801422,
-0.23057368397712708,
-0.07443121075630188,
0.17799049615859985,
-0.2731161415576935,
-0.5416329503059387,
0.29979249835014343,
0.014280648902058601,
-0.016223210841417313,
0.2757587730884552,
-0.00011305842053843662,
0.232118159532547,
0.33571070432662964,
-0.005119334906339645,
-0.39537858963012695,
-0.27420783042907715,
-0.28701817989349365,
-0.0500224269926548,
0.1836872696876526,
-0.30535048246383667,
0.058770813047885895,
-0.21393227577209473,
-0.2138514518737793,
-0.22925806045532227,
0.5171397924423218,
0.37226545810699463,
0.21552279591560364,
0.323941707611084,
-0.08863718062639236,
-0.1738385260105133,
-0.16418904066085815,
0.05961716175079346,
0.0024678632616996765,
0.266726553440094,
0.10506417602300644,
0.053054891526699066,
0.16966961324214935,
0.325199156999588,
-0.07648462057113647,
-0.08219596743583679,
0.4370972514152527,
-0.08515124022960663,
-0.14895674586296082,
-0.16384661197662354,
0.09392856806516647,
-0.022057194262742996,
0.5556113123893738,
-0.05870215594768524,
-0.2970728874206543,
-0.15092864632606506,
0.06144202873110771,
0.04974255710840225,
0.4079316556453705,
0.11476264894008636,
-0.1452951729297638,
0.11343947052955627,
0.06978679448366165,
-0.11519216001033783,
-0.15151076018810272,
0.19140362739562988,
0.2040576934814453,
0.15352055430412292,
-0.24651694297790527,
0.26818612217903137,
0.3947988450527191,
-0.23667125403881073,
-0.055513396859169006,
-0.2864691913127899,
0.00987138319760561,
0.09369570761919022,
-0.20323500037193298,
0.07278135418891907,
0.14206786453723907,
0.05149129405617714,
0.3913080394268036,
0.08349205553531647,
0.0398503914475441,
-0.2063831239938736,
-0.15672582387924194,
0.026530366390943527,
0.25348496437072754,
0.03332009166479111,
0.17050239443778992,
0.0555737167596817,
0.1464717984199524,
0.39774012565612793,
0.024338603019714355,
0.0665552169084549,
0.05163676291704178,
-0.1852097064256668,
0.0175374373793602,
0.06355981528759003,
0.595127284526825,
0.01352711021900177,
-0.1740616261959076,
0.16354705393314362,
-0.15052524209022522,
-0.1145327091217041,
-0.10794483125209808,
0.42379945516586304,
-0.002282179892063141,
0.030163291841745377,
0.21147075295448303,
0.18515612185001373,
0.014391772449016571,
-0.2885562777519226,
-0.15042079985141754,
-0.057780954986810684,
-0.015407346189022064,
-0.056923266500234604,
-0.012219548225402832,
-0.30049097537994385,
0.14911799132823944,
0.17458485066890717,
-0.026713509112596512,
-0.28266653418540955,
0.039797574281692505,
0.07094372808933258,
-0.146773099899292,
0.16244611144065857,
-0.025302987545728683,
0.11624172329902649,
0.22736258804798126,
-0.09674099087715149,
0.004250556230545044,
0.09068478643894196,
-0.41479671001434326,
-0.14326342940330505,
-0.1945749819278717,
0.173439159989357,
-0.033485837280750275,
-0.12821251153945923,
-0.4964219033718109,
-0.0026701728347688913,
-0.12412236630916595,
0.1196172684431076,
0.03405999392271042,
-0.05092565342783928,
-0.049494143575429916,
-0.14426441490650177,
0.10840539634227753,
0.4432199001312256,
-0.15945860743522644,
-0.21380318701267242,
0.09920278191566467,
-0.09547778964042664,
-0.269305557012558,
0.14240214228630066,
-0.2447548359632492,
0.24048590660095215,
-0.263522744178772,
0.21538014709949493,
0.38573580980300903,
-0.5315338373184204,
-0.5137378573417664,
0.37380221486091614,
-0.23178470134735107,
0.0690247118473053,
-0.003075540065765381,
-0.15121497213840485,
0.06568880379199982,
0.12796013057231903,
0.3385060727596283,
0.26425468921661377,
0.10760846734046936,
0.17429153621196747,
-0.18608668446540833,
-0.37260347604751587,
-0.05516235530376434,
0.08109906315803528,
-0.14726316928863525,
0.11821702122688293,
0.08187655359506607,
-0.21475036442279816,
0.135133296251297,
-0.19834236800670624,
-0.05030237138271332,
0.3739699423313141,
0.11837144196033478,
0.18915525078773499,
0.07351062446832657,
0.15258173644542694,
-0.5835064053535461,
0.07769083976745605,
0.08150643110275269,
0.23995882272720337,
-0.5511186718940735,
-0.18919089436531067,
-0.39881619811058044,
0.06898535043001175,
-0.2292354851961136,
0.07746674865484238,
0.0891152024269104,
0.02537783980369568,
-0.1676217019557953,
0.37163758277893066,
0.058648303151130676,
0.11738010495901108,
-0.07401544600725174,
0.2741650342941284,
-0.33762213587760925,
0.13520854711532593,
-0.21320772171020508,
-0.03629709407687187,
0.22930169105529785,
-0.08300071954727173,
0.43852290511131287,
-0.17941981554031372,
-0.26072952151298523,
0.24667823314666748,
-0.0732060968875885,
0.15731284022331238,
0.1066126748919487,
0.08248677849769592,
-0.0967186838388443,
-0.2673623263835907,
-0.15544003248214722,
0.21663808822631836,
0.19818510115146637,
0.10864800959825516,
0.12786060571670532,
0.27832141518592834,
0.022095954045653343,
0.2343127727508545,
-0.05508682504296303,
0.1696157157421112,
0.3256493806838989,
0.013622604310512543,
-0.15397575497627258,
-0.08479507267475128,
0.22472065687179565,
-0.08154498785734177,
0.16647715866565704,
-0.1303865611553192,
-0.03553883731365204,
-0.10436664521694183,
0.4296286106109619,
-0.1507990062236786,
0.2507929801940918,
0.15999186038970947,
-0.17694158852100372,
0.08395597338676453,
0.0036380402743816376,
0.0867920070886612,
0.5303506851196289,
0.024816598743200302,
-0.27706795930862427,
0.27600860595703125,
0.29789549112319946,
-0.14970749616622925,
0.3464660048484802,
0.0888785570859909,
0.24021649360656738,
-0.05637006834149361,
0.12950833141803741,
-0.005024421960115433,
-0.2831803858280182,
-0.2298693060874939,
0.05567595362663269,
0.22195592522621155,
-0.5202378034591675,
0.3450304865837097,
-0.34811103343963623,
-0.244065523147583,
0.01915818825364113,
0.04486985504627228,
-0.19285345077514648,
-0.3737112283706665,
-0.1706034541130066,
-0.03791455179452896,
-0.13967783749103546,
0.036986932158470154,
-0.3285697102546692,
0.34984874725341797,
0.279222309589386,
-0.2589765787124634,
-0.14133743941783905,
-0.1716826856136322,
-0.09239955246448517,
-0.06574837118387222,
0.26054883003234863,
-0.2352697253227234,
0.4730554223060608,
-0.25828737020492554,
-0.032734498381614685,
-0.15088890492916107,
-0.34377896785736084,
0.291728138923645,
-0.16233788430690765,
0.20938526093959808,
0.3289217948913574,
0.3705785870552063,
0.053403958678245544,
0.0527692548930645,
0.46238452196121216,
0.045511357486248016,
-0.18150053918361664,
0.0324510782957077,
-0.05585462972521782,
-0.023603009060025215,
-0.2763497829437256,
-0.3607627749443054,
-0.09605683386325836,
-0.2171616405248642,
0.2535170912742615,
-0.06345362961292267,
0.058348603546619415,
0.2231992483139038,
0.1524912267923355,
0.2425622045993805,
-0.17588567733764648,
0.16090555489063263,
-0.39789143204689026,
-0.4725409746170044,
0.22987453639507294,
-0.11121553182601929,
-0.4715797007083893,
0.022452041506767273,
0.09023504704236984,
0.15527591109275818,
-0.29095613956451416,
-0.6683675050735474,
-0.5209438800811768,
-0.0038023628294467926,
0.3587377071380615,
-0.32706233859062195,
-0.06296779215335846,
0.09016235172748566,
-0.1831134408712387,
-0.06424472481012344,
-0.23376454412937164,
-0.3489336371421814,
0.006129205226898193,
-0.04285424202680588,
0.10106723010540009,
0.17535731196403503,
0.563791036605835,
0.14970561861991882,
0.4823901355266571,
0.24349135160446167,
-0.14700105786323547,
0.4554859399795532,
-0.2591800093650818,
0.2335548847913742,
-0.000837862491607666,
-0.35729244351387024,
-0.09917905926704407,
0.005829334259033203,
0.2730395197868347,
0.07584479451179504,
-0.01908114179968834,
0.271171510219574,
-0.1522059440612793,
-0.2687392830848694,
-0.48452484607696533,
-0.31446513533592224,
0.1037057563662529,
-0.24340297281742096,
0.04907282441854477,
0.09155131876468658,
0.12926116585731506,
-0.24836429953575134,
0.026834800839424133,
0.07691111415624619,
0.3804790675640106,
0.20787903666496277,
-0.125606968998909,
-0.3116248846054077,
0.12762349843978882,
-0.42905932664871216,
0.511379599571228,
-0.07508450746536255,
0.3293365240097046,
-0.14562936127185822,
0.2673145532608032,
0.18836677074432373,
-0.15752604603767395,
0.8544775247573853,
-0.1181892529129982,
0.15073426067829132,
-0.0167471282184124,
0.14431223273277283,
-0.4999583959579468,
-0.03067776933312416,
-0.10145850479602814,
0.07176706194877625,
0.25525400042533875,
0.4700222313404083,
-0.5287392735481262,
-0.1422792375087738,
-0.015911873430013657,
-0.10473597794771194,
-0.24175706505775452,
-0.14301201701164246,
-0.41090571880340576,
-0.8013786673545837,
-0.38655024766921997,
0.1340193748474121,
0.1068616732954979,
0.23318800330162048,
0.15296407043933868,
0.08410623669624329,
0.37027037143707275,
-0.0439019538462162,
-0.05010605230927467,
0.126952663064003,
0.10910524427890778,
0.07994987070560455,
0.029330670833587646,
0.12995204329490662,
0.19186806678771973,
0.2120237499475479,
0.8015207648277283,
0.16647228598594666,
-0.6660977602005005,
-0.18779869377613068,
0.01459166407585144,
0.04639417678117752,
0.21845249831676483,
-0.18333306908607483,
0.299950510263443,
0.3317130208015442,
0.275992751121521,
-0.17468047142028809,
0.011480450630187988,
0.5819427371025085,
-0.00073285773396492,
-0.35066187381744385,
-0.3861261308193207,
0.40495601296424866,
-0.09629698842763901,
-0.18833975493907928,
0.3348079323768616,
0.48847609758377075,
-0.3064279854297638,
0.2609674036502838,
-0.21264414489269257,
0.7886670231819153,
0.13137006759643555,
0.09366920590400696,
0.47377684712409973,
-0.20721715688705444,
0.7420819401741028,
-0.005510076880455017,
-0.08298823237419128,
-0.30478766560554504,
-0.11009964346885681,
-0.004994627088308334,
-0.21136704087257385,
0.18705546855926514,
-0.010826651006937027,
-0.2921687066555023,
0.11063966155052185,
-0.32129114866256714,
0.2628708779811859,
0.07867386937141418,
0.3251989781856537,
-0.3186604380607605,
-0.02756386622786522,
-0.5066688656806946,
0.19673219323158264,
-0.1651650071144104,
0.24821075797080994,
-0.07682120054960251,
-0.24885344505310059,
-0.1253366768360138,
-0.6175533533096313,
-0.16526569426059723,
0.3059215545654297,
-0.2940016984939575,
0.18717581033706665,
0.23044453561306,
0.21898357570171356,
0.2536830008029938,
0.27534112334251404,
0.2300810068845749,
-0.03692370653152466,
-0.2570575773715973,
0.3065647482872009,
-0.2988346815109253,
0.07539910078048706,
-0.025774236768484116,
0.021679431200027466,
0.2500118613243103,
-0.16327324509620667,
-0.37635180354118347,
0.08474922180175781,
0.039082467555999756,
-0.3978502154350281,
-0.17279651761054993,
0.06304126977920532,
-0.3046194016933441,
-0.4081251919269562,
-0.3102584481239319,
-0.28214675188064575,
0.08604167401790619,
-0.14419277012348175,
0.09066179394721985,
0.11810898780822754,
-0.08140493929386139,
0.11664143204689026,
0.2315310835838318,
-0.1663108766078949,
0.14182023704051971,
0.4144977927207947,
-0.22400076687335968,
0.012842096388339996,
0.5698056221008301,
0.11927014589309692,
-0.12346579134464264,
-0.24069947004318237,
0.16241347789764404,
0.017179731279611588,
-0.3048742115497589,
0.24806582927703857,
0.02788986638188362,
0.11865952610969543,
-0.19782228767871857,
0.3417324423789978,
-0.003325576661154628,
0.09934946894645691,
0.19864115118980408,
-0.44572001695632935,
-0.03030792996287346,
0.20401005446910858,
-0.20243293046951294,
-0.21249666810035706,
0.28665733337402344,
0.24686762690544128,
0.03450632840394974,
-0.06588701903820038,
-0.2975996732711792,
0.29712623357772827,
-0.10511120408773422,
0.06092338636517525,
0.3997616469860077,
-0.07433611154556274,
0.44576579332351685,
0.0036114268004894257,
0.13546714186668396,
0.11320701241493225,
-0.20623494684696198,
-0.20539063215255737,
-0.3171839118003845,
0.14738301932811737,
0.03548436611890793,
-0.18547305464744568,
-0.04701320081949234,
-0.35595181584358215,
-0.02378370240330696,
-0.0070816949009895325,
0.22578385472297668,
0.03870691359043121,
0.000012654811143875122,
0.05309643596410751,
-0.34616735577583313,
0.2163594365119934,
0.012771017849445343,
0.07058504223823547,
-0.16552075743675232,
0.2641697824001312,
0.15888579189777374,
0.10389896482229233,
-0.1695440411567688,
0.048572197556495667,
-0.4151545763015747,
0.26546794176101685,
0.1226402074098587,
0.21203215420246124,
0.4581059217453003,
-0.3513600528240204,
0.09759979695081711,
-0.02432677336037159,
0.20073425769805908,
0.24709086120128632,
-0.6479108929634094,
0.0751674622297287,
-0.0800512284040451,
0.18610575795173645,
-0.08803002536296844,
-0.23549339175224304,
0.34171849489212036,
0.11850942671298981,
-0.06513310223817825,
-0.022926487028598785,
-0.023146137595176697,
0.029492735862731934,
-0.2888258695602417,
-0.1266513466835022,
0.5265107154846191,
0.19496379792690277,
0.17138022184371948,
0.35399940609931946,
-0.13048671185970306,
0.0651494711637497,
0.23557670414447784,
-0.12437443435192108,
0.005220822989940643,
0.27821940183639526,
-0.26082074642181396,
0.09571484476327896,
-0.1299823522567749,
0.09851306676864624,
0.0545627623796463,
-0.3883941173553467,
0.27765846252441406,
0.12380918860435486,
-0.022686433047056198,
0.1395120471715927,
0.046248286962509155,
0.41939690709114075,
-0.1963578313589096,
-0.02455061487853527,
-0.33243656158447266,
0.23620522022247314,
-0.14551371335983276,
-0.11009376496076584,
-0.34305375814437866,
-0.07827097922563553,
0.07381235063076019,
0.022303827106952667,
-0.13537997007369995,
-0.3638201355934143,
0.2120240330696106,
0.06192147731781006,
-0.19234514236450195,
-0.3334929943084717,
-0.2558055818080902,
0.1913573294878006,
0.18597149848937988,
-0.24924886226654053,
0.271767795085907,
0.23941974341869354,
0.07891029119491577,
0.1463565230369568,
0.19843655824661255,
0.6391836404800415,
0.308746337890625,
0.0939943790435791,
0.0011824890971183777,
0.021501053124666214,
0.017117902636528015,
-0.005325637757778168,
0.13506704568862915,
0.2916763722896576,
0.26439395546913147,
0.25989028811454773,
0.1471637785434723,
-0.14583313465118408,
0.07593782246112823,
0.23517592251300812,
0.3412633538246155,
-0.07364565134048462,
0.04885151982307434,
-0.5221871137619019,
0.023491375148296356,
-0.3919270634651184,
0.2655101716518402,
-0.30161052942276,
-0.005568861961364746,
0.35513073205947876,
0.16995900869369507,
0.24310773611068726,
-0.25299808382987976,
0.07427371293306351,
-0.09168918430805206,
0.42677003145217896,
0.2525636851787567,
0.04760178551077843,
-0.2687225043773651,
-0.013705983757972717,
-0.5191197395324707,
0.10427969694137573,
0.05971567705273628,
-0.22661259770393372,
0.16910745203495026,
-0.01279815286397934,
0.09706301987171173,
0.18114985525608063,
0.2543095648288727,
-0.008370384573936462,
-0.04590018838644028,
-0.01515289582312107,
-0.3572003245353699,
-0.19797927141189575,
-0.023264210671186447,
0.1609094887971878,
0.12185977399349213,
-0.26903003454208374,
0.11765286326408386,
-0.17938558757305145,
0.024803519248962402,
-0.2788871228694916,
-0.040183715522289276,
-0.13265973329544067,
-0.15320852398872375,
0.7243139743804932,
0.1917404979467392,
0.6091901659965515,
-0.0326324962079525,
-0.29400360584259033,
-0.09462428092956543,
-0.279244065284729,
-0.05684869736433029,
0.3673701584339142,
0.03571655601263046,
0.2635672390460968,
-0.10064035654067993,
-0.05756170302629471,
-0.29261067509651184,
0.2205808460712433,
-0.09384015947580338,
-0.2969345450401306,
-0.4079545736312866,
0.15119947493076324,
-0.10354223102331161,
0.09065119177103043,
-0.11821950972080231,
0.1930592805147171,
-0.08855601400136948,
0.1187044233083725,
-0.18470728397369385,
-0.26941412687301636,
0.6993947625160217,
-0.3275716304779053,
-0.23513111472129822,
0.13105255365371704,
0.2906559705734253,
0.05840051919221878,
-0.2315780222415924,
-0.5534067153930664,
0.15692533552646637,
0.370361328125,
0.028232738375663757,
-0.3488832116127014,
0.3343881070613861,
-0.08980067074298859,
0.16196182370185852,
0.024579860270023346,
0.060175132006406784,
-0.032578885555267334,
-0.2670084834098816,
0.19603393971920013,
-0.22618767619132996
] |
https://github.com/huggingface/datasets/issues/6139 | Hi, thanks for the suggestion. It's not possible at the moment. The viewer is part of the Hub codebase and only works on public datasets. Also, it relies on [Datasets Server](https://github.com/huggingface/datasets-server/), which prepares the data and provides an API to access the rows, size, etc.
If you're interested in hosting your data as a private dataset on the Hub, you might want to look at https://github.com/huggingface/datasets-server/issues/39. | Offline dataset viewer | ### Feature request
The dataset viewer feature is very nice. It enables to the user to easily view the dataset. However, when working for private companies we cannot always upload the dataset to the hub. Is there a way to create dataset viewer offline? I.e. to run a code that will open some kind of html or something that makes it easy to view the dataset.
### Motivation
I want to easily view my dataset even when it is hosted locally.
### Your contribution
N.A. | 66 | Offline dataset viewer
### Feature request
The dataset viewer feature is very nice. It enables to the user to easily view the dataset. However, when working for private companies we cannot always upload the dataset to the hub. Is there a way to create dataset viewer offline? I.e. to run a code that will open some kind of html or something that makes it easy to view the dataset.
### Motivation
I want to easily view my dataset even when it is hosted locally.
### Your contribution
N.A.
Hi, thanks for the suggestion. It's not possible at the moment. The viewer is part of the Hub codebase and only works on public datasets. Also, it relies on [Datasets Server](https://github.com/huggingface/datasets-server/), which prepares the data and provides an API to access the rows, size, etc.
If you're interested in hosting your data as a private dataset on the Hub, you might want to look at https://github.com/huggingface/datasets-server/issues/39. | [
-0.5306944847106934,
-0.10730038583278656,
-0.06526888906955719,
0.1415955275297165,
-0.1613258570432663,
0.023090340197086334,
0.44106897711753845,
0.32372617721557617,
0.11866387724876404,
0.28429850935935974,
-0.07933178544044495,
0.2532556354999542,
-0.200007826089859,
0.7066411972045898,
-0.033958859741687775,
0.06638780981302261,
-0.04554378241300583,
0.28833991289138794,
0.25451505184173584,
0.07051752507686615,
0.022502437233924866,
-0.3343549966812134,
-0.18178749084472656,
-0.17790386080741882,
-0.08158209174871445,
-0.1317284256219864,
-0.010354280471801758,
-0.08020135760307312,
-0.32194021344184875,
-0.3473583459854126,
0.26064783334732056,
0.2783651649951935,
0.32260528206825256,
0.21777966618537903,
-0.00011939210526179522,
-0.06416314095258713,
0.07147100567817688,
0.08614985644817352,
-0.2842772901058197,
0.05851051211357117,
-0.3706696033477783,
-0.12490411102771759,
0.3408067524433136,
-0.3253737986087799,
-0.18829874694347382,
-0.06468275189399719,
0.259528249502182,
-0.3091999888420105,
0.2512085437774658,
-0.04229578375816345,
0.049990639090538025,
0.10437635332345963,
-0.09846905618906021,
-0.06958308815956116,
-0.2712723910808563,
0.4973103702068329,
-0.43630802631378174,
-0.099654421210289,
0.021260881796479225,
0.2408294826745987,
-0.24512842297554016,
-0.012492593377828598,
-0.18485963344573975,
0.07027293741703033,
0.4160401523113251,
-0.07619210332632065,
-0.6262291669845581,
-0.28273168206214905,
0.18484048545360565,
0.4261959493160248,
0.8276835680007935,
-0.2351745218038559,
-0.1831367015838623,
-0.4027280807495117,
0.10922262817621231,
-0.04584018513560295,
0.11249233782291412,
0.3390266001224518,
-0.08858971297740936,
0.4995065927505493,
-0.32081282138824463,
-0.4865773022174835,
-0.5936511158943176,
0.08902588486671448,
-0.1590624749660492,
-0.12959063053131104,
-0.21962900459766388,
-0.14768433570861816,
-0.020494768396019936,
0.01865307055413723,
0.4605744481086731,
-0.28949594497680664,
0.07344470918178558,
0.12266813218593597,
0.09667249023914337,
-0.27972859144210815,
0.20359165966510773,
0.3971550762653351,
-0.21001297235488892,
0.17841985821723938,
0.09900312125682831,
0.0007559768855571747,
-0.3647168278694153,
0.07833918929100037,
0.07896269857883453,
-0.06061329320073128,
0.29254359006881714,
-0.03292572498321533,
0.5024548172950745,
0.041271381080150604,
0.256881445646286,
-0.00030962470918893814,
-0.28306469321250916,
0.12439824640750885,
-0.1760672628879547,
-0.20910638570785522,
0.35659852623939514,
-0.10928422212600708,
0.05619758367538452,
-0.06592708826065063,
0.05880099534988403,
0.11814259737730026,
0.052275147289037704,
-0.10100586712360382,
-0.15771175920963287,
-0.18422740697860718,
0.019640550017356873,
0.003189200535416603,
-0.14939914643764496,
-0.7116953730583191,
0.15260381996631622,
-0.12612026929855347,
0.1695089042186737,
0.18551966547966003,
0.148861825466156,
-0.322089821100235,
-0.18851202726364136,
0.020946025848388672,
0.07601912319660187,
-0.0983138382434845,
0.22137852013111115,
-0.112789586186409,
-0.22212344408035278,
0.048938099294900894,
0.3058627247810364,
-0.20482558012008667,
0.0006318306550383568,
-0.18272531032562256,
0.031406670808792114,
0.1913730353116989,
0.17977449297904968,
-0.5754914283752441,
-0.41469839215278625,
-0.010087508708238602,
-0.4900769591331482,
-0.09497993439435959,
-0.3881092667579651,
0.12644796073436737,
-0.4975889325141907,
-0.20878419280052185,
-0.007405411452054977,
0.34057092666625977,
-0.22438913583755493,
-0.13263925909996033,
0.2866305410861969,
0.7042840719223022,
-0.5272722244262695,
0.21440307796001434,
-0.13674286007881165,
-0.14430548250675201,
-0.2920510172843933,
-0.38694366812705994,
-0.2489684522151947,
0.6603267192840576,
-0.20659473538398743,
-0.23474538326263428,
0.5140761137008667,
-0.2887783646583557,
-0.44871291518211365,
0.43644416332244873,
-0.1457051932811737,
-0.18486341834068298,
-0.04380902275443077,
0.4428447186946869,
0.48397231101989746,
0.10704302042722702,
-0.44262322783470154,
0.3291003108024597,
0.07468970865011215,
-0.00034699589014053345,
0.009413272142410278,
-0.15171881020069122,
-0.11255962401628494,
0.2916022539138794,
0.13623297214508057,
0.030018210411071777,
0.42909494042396545,
0.029610998928546906,
0.1294190138578415,
0.03701973333954811,
0.20820342004299164,
-0.25798043608665466,
0.19952651858329773,
0.2857400178909302,
-0.1641617864370346,
-0.19097021222114563,
-0.31230244040489197,
0.14266297221183777,
0.018469370901584625,
-0.0394851416349411,
-0.06865405291318893,
-0.33971989154815674,
-0.023504778742790222,
-0.11270266771316528,
-0.39395996928215027,
0.26649826765060425,
0.040381669998168945,
-0.1178952157497406,
-0.07560331374406815,
0.17330434918403625,
-0.2735744118690491,
0.3216339647769928,
0.0346531867980957,
0.06605136394500732,
-0.3003179132938385,
0.5007064938545227,
0.3118988573551178,
0.35471615195274353,
-0.08976663649082184,
0.030364010483026505,
0.13249166309833527,
0.011257831007242203,
-0.08004148304462433,
0.2844427824020386,
0.060525089502334595,
0.3369786739349365,
0.68262779712677,
0.33781951665878296,
0.19371113181114197,
-0.3761891722679138,
0.5967162847518921,
-0.21529936790466309,
0.010821335017681122,
0.08936724066734314,
-0.578467607498169,
0.31312045454978943,
-0.12287285923957825,
0.10015155375003815,
-0.23582062125205994,
0.07506945729255676,
-0.012246325612068176,
0.01941327005624771,
-0.1271049976348877,
-0.004626624286174774,
0.026787271723151207,
0.25630491971969604,
0.07193604111671448,
-0.11704818904399872,
-0.2117999792098999,
0.20242367684841156,
0.023851487785577774,
-0.07204867899417877,
0.3049047291278839,
0.01825089007616043,
-0.04328443482518196,
0.1472470462322235,
0.12356584519147873,
-0.01798366755247116,
-0.03816976398229599,
0.06494547426700592,
-0.14105910062789917,
0.4592825174331665,
0.25052541494369507,
0.0296383835375309,
-0.08077077567577362,
0.12295058369636536,
0.06117812544107437,
-0.13310512900352478,
0.041015833616256714,
-0.026886848732829094,
-0.1650746762752533,
-0.25022560358047485,
0.15330654382705688,
0.127412348985672,
-0.001386210322380066,
-0.18110080063343048,
-0.24457916617393494,
-0.28243130445480347,
0.05796153098344803,
-0.05902127921581268,
-0.3032209575176239,
-0.04209133982658386,
0.16433076560497284,
0.28758862614631653,
0.02928256243467331,
-0.20338395237922668,
-0.2432475984096527,
0.714887261390686,
-0.21469275653362274,
-0.057018622756004333,
0.14144401252269745,
-0.09046812355518341,
0.03191440552473068,
0.024419419467449188,
0.3525077700614929,
0.3199171721935272,
0.4495060443878174,
-0.18439289927482605,
0.35974013805389404,
-0.5215698480606079,
-0.04263343662023544,
0.10618801414966583,
0.2680632174015045,
0.0029489975422620773,
-0.034748371690511703,
-0.0917324498295784,
-0.14462727308273315,
0.30706197023391724,
0.03263444826006889,
0.03869672864675522,
0.15549974143505096,
-0.12541869282722473,
-0.09889073669910431,
0.11017854511737823,
0.19983118772506714,
0.05079185962677002,
-0.24540747702121735,
-0.3075413107872009,
0.3331356644630432,
-0.010560721158981323,
0.23729608952999115,
-0.4147510230541229,
-0.13654398918151855,
0.15644776821136475,
-0.004932750016450882,
-0.1614697277545929,
0.17072047293186188,
-0.6654963493347168,
0.1491505652666092,
-0.40685850381851196,
-0.24715454876422882,
0.32330310344696045,
0.20898883044719696,
0.006466886959969997,
-0.09968030452728271,
-0.7454514503479004,
-0.09877200424671173,
0.2078791707754135,
0.27914607524871826,
0.02607138827443123,
-0.21535220742225647,
0.2661036550998688,
0.11409090459346771,
0.188012033700943,
0.04228925704956055,
-0.01174335926771164,
-0.1465810388326645,
-0.02856627106666565,
-0.13360628485679626,
0.18957126140594482,
-0.00012798048555850983,
0.18748751282691956,
0.2564575970172882,
0.03979988396167755,
0.332420289516449,
0.057752031832933426,
-0.16450531780719757,
0.5132322311401367,
-0.1508960723876953,
-0.12438245862722397,
-0.09611687064170837,
0.03118939697742462,
-0.3072494864463806,
0.28605806827545166,
0.2659252882003784,
0.08370719105005264,
-0.41280311346054077,
-0.43208378553390503,
-0.35595929622650146,
-0.17530721426010132,
-0.17589978873729706,
0.07416152209043503,
0.23387709259986877,
-0.07368714362382889,
0.16961395740509033,
-0.4611172676086426,
-0.243106409907341,
0.030673891305923462,
0.24381130933761597,
0.2911771535873413,
-0.062089260667562485,
-0.03412196785211563,
0.050501637160778046,
-0.028328560292720795,
0.23194628953933716,
0.00831601396203041,
-0.18220014870166779,
0.14027705788612366,
0.21290531754493713,
0.26338306069374084,
0.15135131776332855,
0.4073597192764282,
-0.30427998304367065,
0.10959041118621826,
-0.03842359781265259,
-0.10172048211097717,
-0.1954392045736313,
0.01038765162229538,
0.02536284178495407,
-0.0010052919387817383,
-0.13828697800636292,
0.26051759719848633,
0.1583995372056961,
-0.10077613592147827,
0.29300057888031006,
0.10885253548622131,
-0.39248937368392944,
-0.36836665868759155,
0.10698823630809784,
0.025280192494392395,
-0.08395129442214966,
-0.028081659227609634,
-0.33358216285705566,
0.08183445781469345,
-0.07779450714588165,
-0.11998916417360306,
-0.24545688927173615,
0.13250106573104858,
-0.047973211854696274,
0.1102123111486435,
-0.0660693421959877,
-0.016783175989985466,
0.14841458201408386,
0.4098249673843384,
0.2487657219171524,
0.38188716769218445,
0.3753948211669922,
0.186923086643219,
-0.28944283723831177,
0.2833133041858673,
-0.18515335023403168,
0.1929868906736374,
0.15133389830589294,
0.12321915477514267,
-0.10245632380247116,
0.29054707288742065,
0.3180359899997711,
-0.46636196970939636,
-0.11181612312793732,
-0.04933084174990654,
-0.08503994345664978,
-0.4173938035964966,
-0.3684672713279724,
0.7479974031448364,
-0.10701268911361694,
-0.08672689646482468,
-0.06342214345932007,
0.45238441228866577,
0.11332236975431442,
0.00730525329709053,
-0.20731425285339355,
0.7500666379928589,
-0.011096382513642311,
-0.10882691293954849,
0.0245993509888649,
-0.20488063991069794,
0.3574136793613434,
-0.6782193183898926,
0.13038623332977295,
-0.13699978590011597,
-0.2853958010673523,
-0.3379073143005371,
-0.0064484551548957825,
0.3444701135158539,
-0.1217203289270401,
0.01682029664516449,
0.07129024714231491,
-0.09764005243778229,
0.5186054110527039,
-0.1589725911617279,
0.14647448062896729,
-0.11953139305114746,
-0.13454772531986237,
-0.2571130692958832,
0.017402343451976776,
0.11517250537872314,
0.08265868574380875,
-0.1742025464773178,
-0.18629421293735504,
0.2542433738708496,
0.24799703061580658,
-0.4025202989578247,
-0.09702759981155396,
0.3532828092575073,
-0.1328805536031723,
-0.21549761295318604,
0.006960764527320862,
0.32178401947021484,
0.3957976996898651,
0.23830324411392212,
0.1660529524087906,
-0.3509902060031891,
-0.17181295156478882,
-0.09828382730484009,
-0.09502828121185303,
-0.06922537088394165,
0.24542561173439026,
0.03954913467168808,
-0.1902483105659485,
-0.27315300703048706,
0.4109145700931549,
0.03658987209200859,
-0.09206831455230713,
0.16356515884399414,
-0.04397628456354141,
0.3931204080581665,
-0.49485713243484497,
0.33302032947540283,
0.012061962857842445,
0.19245238602161407,
-0.036564815789461136,
0.011232474818825722,
0.18820686638355255,
0.1207190752029419,
-0.035369623452425,
0.09279491007328033,
-0.10287860780954361,
-0.02376066893339157,
0.043110642582178116,
0.23586542904376984,
-0.1349557340145111,
-0.09457944333553314,
0.1714692860841751,
-0.25578123331069946,
-0.13900664448738098,
0.49462592601776123,
0.1440066248178482,
-0.15888983011245728,
0.05829150974750519,
0.137803852558136,
0.4370998740196228,
0.006532385945320129,
-0.22253090143203735,
-0.07911453396081924,
-0.17306414246559143,
-0.27945220470428467,
-0.2749035358428955,
-0.02636684849858284,
0.10588867217302322,
0.11179971694946289,
0.08135196566581726,
0.18449121713638306,
-0.02436748892068863,
0.15542858839035034,
-0.18870311975479126,
-0.18453717231750488,
0.12000397592782974,
-0.06535465270280838,
-0.1227572038769722,
-0.20854929089546204,
0.24368198215961456,
-0.050348881632089615,
-0.059066709131002426,
-0.06102234125137329,
-0.04754789173603058,
-0.34779274463653564,
-0.0025026649236679077,
-0.006468713283538818,
0.2651771008968353,
0.16931597888469696,
-0.10684613138437271,
-0.07758105546236038,
-0.3680999279022217,
-0.39606794714927673,
-0.07867037504911423,
0.08681929856538773,
0.21659168601036072,
-0.049973178654909134,
-0.36729374527931213,
0.3609152138233185,
0.09009335190057755,
-0.27030473947525024,
0.16519935429096222,
0.49107787013053894,
0.5602425336837769,
-0.3674468994140625,
0.09830061346292496,
-0.05953693017363548,
0.013173118233680725,
0.16265304386615753,
0.24834558367729187,
0.4816376268863678,
-0.17649169266223907,
0.463947057723999,
-0.22264936566352844,
0.45646771788597107,
0.062463704496622086,
0.38317960500717163,
-0.05664009228348732,
0.043465957045555115,
0.1256805956363678,
0.31408536434173584,
0.05259139835834503,
-0.27875056862831116,
-0.014758601784706116,
0.2041281759738922,
0.051945384591817856,
0.1540701538324356,
0.003399565815925598,
0.24232333898544312,
0.25621312856674194,
-0.23874574899673462,
-0.13627684116363525,
0.21249742805957794,
-0.047660116106271744,
0.1345198005437851,
0.5636487007141113,
-0.22924113273620605,
0.08033477514982224,
0.04074788838624954,
0.5736644268035889,
-0.12988826632499695,
0.4327738583087921,
-0.04987042397260666,
0.19853326678276062,
0.22775530815124512,
0.16016307473182678,
0.2168131172657013,
-0.437278151512146,
-0.05338346213102341,
-0.05128338932991028,
0.10420160740613937,
-0.13532190024852753,
-0.36857882142066956,
-0.2681555151939392,
-0.11034621298313141,
0.1598953753709793,
-0.35684794187545776,
0.07038264721632004,
0.1559544801712036,
0.4889342784881592,
-0.1783144325017929,
-0.2446538209915161,
0.08382326364517212,
0.1502045840024948,
0.098819300532341,
-0.4152688682079315,
-0.3414950370788574,
-0.01970113441348076,
0.1805752068758011,
0.10748191922903061,
0.2123657763004303,
0.2910721004009247,
0.17108887434005737,
-0.1038438156247139,
-0.27455973625183105,
-0.008380800485610962,
0.24058443307876587,
0.010090362280607224,
0.4031898081302643,
-0.12329035997390747,
0.048208534717559814,
-0.12206970155239105,
0.11743297427892685,
-0.16018381714820862,
-0.10126927495002747,
0.11463941633701324,
-0.12324315309524536,
0.044715434312820435,
0.3489268720149994,
0.1197521761059761,
-0.004133814945816994,
0.04215181991457939,
0.40905511379241943,
-0.3251030743122101,
0.20770889520645142,
-0.3532271683216095,
0.3049744963645935,
0.04727574810385704,
-0.18429780006408691,
-0.06735889613628387,
-0.24292907118797302,
-0.046146854758262634,
-0.14331933856010437,
0.5089545845985413,
0.12275431305170059,
-0.07922986149787903,
-0.02620074339210987,
-0.003458132967352867,
-0.06288878619670868,
0.2578738331794739,
0.3435763716697693,
0.3951457738876343,
0.22489182651042938,
-0.19698750972747803,
-0.2541705369949341,
0.15023447573184967,
-0.01766371540725231,
-0.16613125801086426,
0.2113509178161621,
-0.06300429254770279,
0.04217619448900223,
0.4558164179325104,
0.25944817066192627,
0.003657478839159012,
0.13489708304405212,
0.032755281776189804,
0.050123266875743866,
-0.07617968320846558,
0.10564981400966644,
0.13075286149978638,
-0.20827719569206238,
-0.27843642234802246,
0.39351311326026917,
-0.03372801095247269,
-0.1096888929605484,
0.1341458261013031,
0.364859402179718,
-0.23978395760059357,
-0.778644859790802,
0.3864805996417999,
-0.23168791830539703,
0.049400605261325836,
0.22832508385181427,
0.0527370423078537,
-0.10592605918645859,
0.2975793480873108,
-0.1626775860786438,
0.2457095980644226,
0.136794775724411,
-0.015707992017269135,
-0.23141255974769592,
-0.15207748115062714,
-0.038945551961660385,
-0.06379789113998413,
-0.08778148889541626,
0.5405677556991577,
-0.18720969557762146,
-0.3278033435344696,
-0.308491051197052,
0.11568416655063629,
0.1542326658964157,
-0.28354617953300476,
-0.002566797658801079,
-0.044884093105793,
-0.05364305526018143,
0.18455913662910461,
0.2652517557144165,
-0.36787599325180054,
0.03497371822595596,
-0.2340283840894699,
0.17372292280197144,
0.31736400723457336,
-0.10587906092405319,
-0.2522941529750824,
0.12407872080802917,
0.43779101967811584,
-0.04266321659088135,
0.5811825394630432,
0.21175985038280487,
-0.1458742320537567,
0.08454574644565582,
0.0010831207036972046,
0.34413304924964905,
-0.32038599252700806,
-0.06034012883901596,
-0.12930653989315033,
-0.2383718490600586
] |
https://github.com/huggingface/datasets/issues/6139 | Hi, we are building an offline dataset viewer: https://github.com/Renumics/spotlight
It supports many HF datasets, but currently you have to use it via Pandas:
df=ds.to_pandas()
spotlight.show(df)
Would love to hear from you if that works for your use case. If not, feel free to open an issue on the repo: https://github.com/Renumics/spotlight/issues | Offline dataset viewer | ### Feature request
The dataset viewer feature is very nice. It enables to the user to easily view the dataset. However, when working for private companies we cannot always upload the dataset to the hub. Is there a way to create dataset viewer offline? I.e. to run a code that will open some kind of html or something that makes it easy to view the dataset.
### Motivation
I want to easily view my dataset even when it is hosted locally.
### Your contribution
N.A. | 50 | Offline dataset viewer
### Feature request
The dataset viewer feature is very nice. It enables to the user to easily view the dataset. However, when working for private companies we cannot always upload the dataset to the hub. Is there a way to create dataset viewer offline? I.e. to run a code that will open some kind of html or something that makes it easy to view the dataset.
### Motivation
I want to easily view my dataset even when it is hosted locally.
### Your contribution
N.A.
Hi, we are building an offline dataset viewer: https://github.com/Renumics/spotlight
It supports many HF datasets, but currently you have to use it via Pandas:
df=ds.to_pandas()
spotlight.show(df)
Would love to hear from you if that works for your use case. If not, feel free to open an issue on the repo: https://github.com/Renumics/spotlight/issues | [
-0.5132324695587158,
0.03274783492088318,
-0.06676776707172394,
0.07542572915554047,
-0.13829393684864044,
0.07182638347148895,
0.47000652551651,
0.37849292159080505,
0.09861810505390167,
0.17905691266059875,
-0.10398733615875244,
0.16178832948207855,
-0.1710074543952942,
0.48786628246307373,
-0.07252675294876099,
-0.018176928162574768,
0.00621071457862854,
0.30344268679618835,
0.13475625216960907,
-0.040869638323783875,
-0.014994435012340546,
-0.3585473895072937,
-0.12362570315599442,
-0.1093173623085022,
-0.12806209921836853,
-0.22082747519016266,
-0.06068488955497742,
-0.08030363917350769,
-0.22981175780296326,
-0.3247280418872833,
0.2273452877998352,
0.31464502215385437,
0.38689833879470825,
0.265536367893219,
-0.00011857571371365339,
-0.11559295654296875,
0.05875667929649353,
0.10771886259317398,
-0.24160830676555634,
0.06455953419208527,
-0.3977128565311432,
-0.2400989532470703,
0.31246283650398254,
-0.3596600294113159,
-0.0737537145614624,
-0.08538926392793655,
0.18281488120555878,
-0.35491061210632324,
0.17013230919837952,
0.007254417985677719,
0.07078000903129578,
0.08245140314102173,
-0.10564682632684708,
-0.04566711559891701,
-0.22816479206085205,
0.5603744387626648,
-0.3722301423549652,
-0.20111942291259766,
-0.06419113278388977,
0.031366027891635895,
-0.30480140447616577,
-0.07098452746868134,
-0.23180732131004333,
-0.00209745392203331,
0.3881171941757202,
-0.09351351112127304,
-0.628777027130127,
-0.30351582169532776,
0.14646488428115845,
0.5167250037193298,
0.745241641998291,
-0.16101308166980743,
-0.15505115687847137,
-0.36464178562164307,
0.010499157011508942,
-0.00006302446126937866,
0.019044917076826096,
0.3736502528190613,
-0.07449735701084137,
0.41387927532196045,
-0.16005459427833557,
-0.4989830255508423,
-0.5988060235977173,
0.1577334702014923,
-0.1636175513267517,
-0.025503072887659073,
-0.07133856415748596,
-0.1515117883682251,
0.028418967500329018,
0.004754945635795593,
0.5376342535018921,
-0.36035242676734924,
0.09451868385076523,
0.1052720844745636,
0.03818744793534279,
-0.2247430682182312,
0.21061430871486664,
0.23114150762557983,
-0.2046656757593155,
0.09744127094745636,
0.013983476907014847,
0.02575315535068512,
-0.4085823595523834,
0.07483577728271484,
0.059143051505088806,
-0.016751877963542938,
0.26554355025291443,
0.015529505908489227,
0.509599506855011,
-0.07671237736940384,
0.18927693367004395,
-0.04295108839869499,
-0.24190233647823334,
0.11111847311258316,
-0.12006238102912903,
-0.1951945424079895,
0.29245585203170776,
-0.0799991711974144,
0.07302910089492798,
0.037535857409238815,
-0.008130840957164764,
0.09490595757961273,
0.021396934986114502,
-0.08088698983192444,
-0.0972294807434082,
0.018190596252679825,
-0.047283705323934555,
0.05278951674699783,
-0.1352342665195465,
-0.6948203444480896,
0.20243151485919952,
-0.08697200566530228,
0.13150404393672943,
0.15339350700378418,
0.10247652232646942,
-0.13354386389255524,
-0.21753372251987457,
0.034363944083452225,
0.19502593576908112,
0.014601647853851318,
0.33805280923843384,
-0.20095796883106232,
-0.22726376354694366,
0.03517526388168335,
0.23191513121128082,
-0.17016449570655823,
0.11086630076169968,
-0.10158466547727585,
0.04052434861660004,
0.19116568565368652,
0.25869429111480713,
-0.5391044020652771,
-0.45593705773353577,
0.009790359996259212,
-0.3790592551231384,
-0.1383371651172638,
-0.3811691105365753,
0.1251777857542038,
-0.5744141936302185,
-0.10078856348991394,
0.03777331858873367,
0.2529484033584595,
-0.08472040295600891,
-0.1539871245622635,
0.2178553342819214,
0.7547231316566467,
-0.47973597049713135,
0.31200048327445984,
-0.27762845158576965,
-0.07590201497077942,
-0.2765117883682251,
-0.3111070394515991,
-0.32473763823509216,
0.6812167763710022,
-0.2348233461380005,
-0.2069879174232483,
0.5963367819786072,
-0.28215479850769043,
-0.39428892731666565,
0.61027991771698,
-0.12263665348291397,
-0.16397741436958313,
0.03835891932249069,
0.5021002888679504,
0.4601977467536926,
0.048486288636922836,
-0.6044405102729797,
0.38386666774749756,
-0.01338722463697195,
-0.03608618304133415,
0.019560568034648895,
-0.08145932853221893,
-0.03413861617445946,
0.2360503226518631,
0.3267679810523987,
0.07229451835155487,
0.42491626739501953,
0.14432281255722046,
0.23169966042041779,
0.037746891379356384,
0.20811502635478973,
-0.21575841307640076,
0.20050105452537537,
0.34433862566947937,
-0.09207864105701447,
-0.1535089761018753,
-0.2057601511478424,
0.10218138992786407,
0.039834827184677124,
-0.0540485605597496,
-0.1342466026544571,
-0.34320181608200073,
-0.018176477402448654,
-0.07735349237918854,
-0.36453694105148315,
0.20602615177631378,
0.0683470219373703,
-0.0658068060874939,
-0.18722347915172577,
0.20758658647537231,
-0.2031049132347107,
0.376966655254364,
0.11791563034057617,
0.001981213688850403,
-0.08941124379634857,
0.4990274906158447,
0.2539883852005005,
0.44807589054107666,
-0.14379817247390747,
0.004015510901808739,
0.12733666598796844,
0.0004995763301849365,
-0.1581442803144455,
0.36942747235298157,
0.004855155944824219,
0.2619006335735321,
0.8135740160942078,
0.3301064968109131,
0.2036803811788559,
-0.49023765325546265,
0.6582777500152588,
-0.08823706209659576,
0.029408033937215805,
0.05612708628177643,
-0.5116310119628906,
0.32996684312820435,
-0.11267992854118347,
0.12807895243167877,
-0.19652891159057617,
0.08757538348436356,
0.023019619286060333,
-0.012975059449672699,
0.03048936277627945,
-0.027619697153568268,
0.05883564054965973,
0.2935871183872223,
0.13471642136573792,
-0.04531733691692352,
-0.33859050273895264,
0.2280620038509369,
0.08209531009197235,
-0.061128076165914536,
0.23051388561725616,
-0.03531287983059883,
-0.008456502109766006,
0.15631407499313354,
0.17386822402477264,
-0.036137327551841736,
-0.0929250717163086,
0.1138397678732872,
-0.22723625600337982,
0.4033934473991394,
0.14245076477527618,
0.020918406546115875,
-0.053379058837890625,
0.13000287115573883,
0.04527176171541214,
-0.10591012984514236,
0.058098237961530685,
0.004292819648981094,
-0.13819897174835205,
-0.3308771252632141,
0.13869726657867432,
0.08019820600748062,
0.03193563222885132,
-0.11069043725728989,
-0.29959365725517273,
-0.33473822474479675,
-0.0021933913230895996,
-0.009651456028223038,
-0.36178526282310486,
-0.1448921263217926,
0.13443878293037415,
0.2245812565088272,
0.13313019275665283,
-0.1166255995631218,
-0.37186503410339355,
0.5607101917266846,
-0.14973950386047363,
-0.1094343438744545,
0.16071687638759613,
-0.17864800989627838,
0.013819113373756409,
0.015032634139060974,
0.35900935530662537,
0.31385132670402527,
0.4643646478652954,
-0.06311190873384476,
0.34247052669525146,
-0.6684838533401489,
-0.022647790610790253,
0.06536681950092316,
0.25412073731422424,
-0.057305723428726196,
-0.12183396518230438,
-0.11765281856060028,
-0.23348617553710938,
0.2174011915922165,
0.011006318032741547,
0.051630474627017975,
0.22977688908576965,
-0.056049227714538574,
-0.12853774428367615,
0.09308961033821106,
0.288632333278656,
0.001980077475309372,
-0.22907322645187378,
-0.3410969376564026,
0.15854069590568542,
-0.08177919685840607,
0.2451692521572113,
-0.4332067370414734,
-0.1736106127500534,
0.10768111050128937,
0.15725359320640564,
-0.18004265427589417,
0.2037258744239807,
-0.5704547166824341,
0.2145913988351822,
-0.42253249883651733,
-0.29584094882011414,
0.2554852366447449,
0.12972547113895416,
-0.08835028111934662,
0.0028703510761260986,
-0.7829988598823547,
0.029241658747196198,
0.2048848569393158,
0.37611669301986694,
-0.05034537613391876,
-0.2643938958644867,
0.18945923447608948,
0.07966841757297516,
0.1580774337053299,
0.028849013149738312,
0.12254296243190765,
-0.0432465560734272,
-0.10948754847049713,
-0.015470124781131744,
0.20603340864181519,
0.1462763249874115,
0.1755993366241455,
0.386576384305954,
-0.15076783299446106,
0.3677814304828644,
0.19119003415107727,
-0.1667969971895218,
0.4991149604320526,
-0.12552863359451294,
-0.17372658848762512,
-0.10222621262073517,
0.07741458714008331,
-0.23699122667312622,
0.2190975397825241,
0.1516445279121399,
-0.004127673804759979,
-0.32492193579673767,
-0.39655086398124695,
-0.35009706020355225,
-0.19391374289989471,
-0.08230071514844894,
-0.11427660286426544,
0.3345164656639099,
-0.13874611258506775,
0.2233554869890213,
-0.4217528998851776,
-0.26618728041648865,
0.10364827513694763,
0.21150177717208862,
0.29488733410835266,
-0.05053982138633728,
0.08467558771371841,
0.06427969038486481,
0.014496552757918835,
0.19261878728866577,
-0.03886660560965538,
-0.07063336670398712,
0.12930983304977417,
0.1742497980594635,
0.20062854886054993,
0.13612043857574463,
0.48394471406936646,
-0.305347740650177,
0.16831161081790924,
0.04879842698574066,
-0.13625815510749817,
-0.19133639335632324,
-0.027064673602581024,
-0.003872506320476532,
-0.0024007894098758698,
-0.24067233502864838,
0.14120610058307648,
0.16731484234333038,
-0.15981397032737732,
0.26883360743522644,
0.05650876462459564,
-0.40084710717201233,
-0.3568361699581146,
0.2250780165195465,
0.07037156820297241,
-0.02050398662686348,
-0.06025061383843422,
-0.37087398767471313,
0.05026465654373169,
-0.09157775342464447,
-0.07589195668697357,
-0.2881917357444763,
0.13132619857788086,
0.03164692968130112,
0.01376950740814209,
-0.11373988538980484,
0.012936722487211227,
0.13887423276901245,
0.2461186796426773,
0.2522352337837219,
0.4708394408226013,
0.20810092985630035,
0.10344908386468887,
-0.2539660930633545,
0.26267653703689575,
-0.2353573441505432,
0.24629531800746918,
0.11485452950000763,
0.1720193326473236,
-0.08905652910470963,
0.2400825321674347,
0.32567018270492554,
-0.29131194949150085,
-0.04360763728618622,
0.043660156428813934,
-0.08292066305875778,
-0.4827496409416199,
-0.4060520529747009,
0.702897310256958,
-0.07372477650642395,
-0.051217786967754364,
-0.16113150119781494,
0.34490805864334106,
0.1414860188961029,
0.08310912549495697,
-0.17983752489089966,
0.7128623723983765,
-0.026059884577989578,
-0.08675411343574524,
-0.020637979730963707,
-0.29773637652397156,
0.34502026438713074,
-0.7334874868392944,
0.019901219755411148,
-0.18304699659347534,
-0.2809674143791199,
-0.3574410080909729,
0.04780161380767822,
0.34536436200141907,
-0.04920075461268425,
0.014912061393260956,
0.12690716981887817,
-0.20489174127578735,
0.4694652855396271,
-0.12932494282722473,
0.22642865777015686,
-0.09291020780801773,
-0.17545486986637115,
-0.2145286351442337,
0.04665522277355194,
0.08978641778230667,
-0.06379994004964828,
-0.20293328166007996,
-0.2597827911376953,
0.2556483745574951,
0.30608803033828735,
-0.35100269317626953,
-0.04503893852233887,
0.41822949051856995,
0.03416568413376808,
-0.3161686956882477,
-0.14879216253757477,
0.2700742483139038,
0.2774662971496582,
0.20293959975242615,
0.06235326826572418,
-0.25120291113853455,
-0.1996423751115799,
0.006390172988176346,
-0.08797891438007355,
-0.02535572089254856,
0.24995367228984833,
0.13064849376678467,
-0.1130373626947403,
-0.30863696336746216,
0.4226536154747009,
-0.03451962396502495,
-0.0533139668405056,
0.19245101511478424,
-0.13932524621486664,
0.4286756217479706,
-0.396671324968338,
0.33902010321617126,
0.04761124402284622,
0.09428770840167999,
0.003331877291202545,
0.03529185429215431,
0.06170402839779854,
0.19004443287849426,
-0.06822051852941513,
0.06230351701378822,
-0.0750654861330986,
-0.0725627914071083,
-0.04519715532660484,
0.2119685858488083,
-0.06211286783218384,
-0.12347222864627838,
0.1946825087070465,
-0.27692872285842896,
-0.15506884455680847,
0.5693531036376953,
0.0888059139251709,
-0.10907004773616791,
0.03739618510007858,
0.06480330228805542,
0.4430708885192871,
-0.01412411779165268,
-0.28869107365608215,
-0.043935295194387436,
-0.206355482339859,
-0.347758948802948,
-0.3095429539680481,
-0.059756211936473846,
0.07331685721874237,
-0.0220143124461174,
0.031151922419667244,
0.12695060670375824,
-0.09190632402896881,
0.14344199001789093,
-0.21203488111495972,
-0.18707996606826782,
0.011330656707286835,
-0.07975766807794571,
-0.08081647753715515,
-0.21619749069213867,
0.2839895784854889,
-0.07393082231283188,
-0.04278898239135742,
-0.02855144999921322,
-0.07984054088592529,
-0.3370317220687866,
-0.010710760951042175,
-0.031042620539665222,
0.27454131841659546,
0.18110063672065735,
-0.15045127272605896,
-0.07093529403209686,
-0.46189936995506287,
-0.42022597789764404,
-0.11299586296081543,
-0.029274340718984604,
0.24338826537132263,
-0.14079870283603668,
-0.27325648069381714,
0.373898446559906,
-0.08325665444135666,
-0.2708451747894287,
0.0950506255030632,
0.5187231302261353,
0.5845826864242554,
-0.333457350730896,
0.12239439785480499,
0.014932338148355484,
0.005920976400375366,
0.14089033007621765,
0.2434849590063095,
0.40133222937583923,
-0.2438647300004959,
0.4934391379356384,
-0.21774879097938538,
0.49012091755867004,
0.10662038624286652,
0.44597959518432617,
-0.08582788705825806,
0.06334947794675827,
0.11483898758888245,
0.37597522139549255,
0.06570880115032196,
-0.3150530457496643,
-0.0379318967461586,
0.18868300318717957,
0.0073719993233680725,
0.13189338147640228,
0.06583033502101898,
0.30190375447273254,
0.12569978833198547,
-0.11934207379817963,
-0.07745891809463501,
0.310091108083725,
-0.10923590511083603,
0.11089342832565308,
0.6069819331169128,
-0.16656699776649475,
0.11431851983070374,
0.06055240333080292,
0.5802074074745178,
-0.07603569328784943,
0.44240427017211914,
0.01218167319893837,
0.11066542565822601,
0.36065179109573364,
0.18978506326675415,
0.19738207757472992,
-0.38653719425201416,
-0.05674726516008377,
-0.0319589301943779,
0.13418903946876526,
-0.13687171041965485,
-0.3544534742832184,
-0.22395265102386475,
-0.026341773569583893,
0.09933438897132874,
-0.22367238998413086,
0.09029612690210342,
0.13765838742256165,
0.6192547678947449,
-0.10376124083995819,
-0.16688397526741028,
-0.031061261892318726,
0.09806431829929352,
0.13490030169487,
-0.4356379508972168,
-0.29293307662010193,
0.051786430180072784,
0.19310952723026276,
0.07101037353277206,
0.40464842319488525,
0.22212865948677063,
0.1519107073545456,
-0.1599322259426117,
-0.36369308829307556,
-0.07420098781585693,
0.19302500784397125,
0.04509764909744263,
0.4192953109741211,
-0.14786666631698608,
0.17005077004432678,
-0.25658777356147766,
0.14823316037654877,
-0.11863584816455841,
-0.09776259958744049,
0.22635778784751892,
-0.23725487291812897,
0.03099897690117359,
0.3592595160007477,
0.1299724131822586,
-0.0007632598280906677,
0.06564924120903015,
0.4597104787826538,
-0.2722439765930176,
0.1801372617483139,
-0.38424426317214966,
0.27867311239242554,
0.19449543952941895,
-0.18392512202262878,
-0.0015503279864788055,
-0.25472915172576904,
-0.10222078859806061,
-0.16637304425239563,
0.598883330821991,
0.15842963755130768,
-0.04855283349752426,
-0.0011955536901950836,
0.002079404890537262,
-0.12777122855186462,
0.2060087025165558,
0.30519136786460876,
0.40719878673553467,
0.14508295059204102,
-0.22665926814079285,
-0.3779882788658142,
0.11048880219459534,
-0.02632156014442444,
-0.2073761224746704,
0.29243937134742737,
-0.10387295484542847,
0.0995185524225235,
0.40518856048583984,
0.33980709314346313,
-0.0016847513616085052,
0.06468173861503601,
0.10538230836391449,
-0.014686360955238342,
-0.10610950738191605,
0.03487002104520798,
0.2099602371454239,
-0.2724544405937195,
-0.27155065536499023,
0.3642929196357727,
0.014028117060661316,
-0.087450310587883,
0.19518092274665833,
0.2149263173341751,
-0.13332614302635193,
-0.6188991665840149,
0.4013168215751648,
-0.20527763664722443,
0.1303822100162506,
0.17351903021335602,
0.09032046049833298,
-0.003880459815263748,
0.2375790774822235,
-0.17908373475074768,
0.15509644150733948,
0.07492268085479736,
-0.02938404679298401,
-0.26341626048088074,
-0.19201304018497467,
-0.05574093014001846,
-0.01926385797560215,
-0.09904347360134125,
0.4420922100543976,
-0.2779609262943268,
-0.3157731294631958,
-0.33597204089164734,
0.03966515511274338,
0.09647736698389053,
-0.2639789283275604,
0.04920617863535881,
0.013667196035385132,
-0.028649702668190002,
0.16077262163162231,
0.22967031598091125,
-0.27520325779914856,
-0.02068522199988365,
-0.2834934890270233,
0.11969031393527985,
0.2447231411933899,
-0.0035442672669887543,
-0.13579875230789185,
0.012683048844337463,
0.4809204638004303,
0.026233870536088943,
0.5293393135070801,
0.06140951067209244,
-0.1455116868019104,
0.12161120772361755,
0.02070799469947815,
0.23473797738552094,
-0.3997967839241028,
-0.11609675735235214,
-0.16630829870700836,
-0.1770232915878296
] |
https://github.com/huggingface/datasets/issues/6134 | I noticed that this is actually covered by issue #5613, which for some reason I didn't see when I searched the issues in this repo the first time. | `datasets` cannot be installed alongside `apache-beam` | ### Describe the bug
If one installs `apache-beam` alongside `datasets` (which is required for the [wikipedia](https://huggingface.co/datasets/wikipedia#dataset-summary) dataset) in certain environments (such as a Google Colab notebook), they appear to install successfully, however, actually trying to do something such as importing the `load_dataset` method from `datasets` results in a crashing error.
I think the problem is that `apache-beam` version 2.49.0 requires `dill>=0.3.1.1,<0.3.2`, but the latest version of `multiprocess` (0.70.15) (on which `datasets` depends) requires `dill>=0.3.7,`, so this is causing the dependency resolver to use an older version of `multiprocess` which leads to the `datasets` crashing since it doesn't actually appear to be compatible with older versions.
### Steps to reproduce the bug
See this [Google Colab notebook](https://colab.research.google.com/drive/1PTeGlshamFcJZix_GiS3vMXX_YzAhGv0?usp=sharing) to easily reproduce the bug.
In some environments, I have been able to reproduce the bug by running the following in Bash:
```bash
$ pip install datasets apache-beam
```
then the following in a Python shell:
```python
from datasets import load_dataset
```
Here is my stacktrace from running on Google Colab:
<details>
<summary>stacktrace</summary>
```
[/usr/local/lib/python3.10/dist-packages/datasets/__init__.py](https://localhost:8080/#) in <module>
20 __version__ = "2.14.4"
21
---> 22 from .arrow_dataset import Dataset
23 from .arrow_reader import ReadInstruction
24 from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder
[/usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py](https://localhost:8080/#) in <module>
64
65 from . import config
---> 66 from .arrow_reader import ArrowReader
67 from .arrow_writer import ArrowWriter, OptimizedTypedSequence
68 from .data_files import sanitize_patterns
[/usr/local/lib/python3.10/dist-packages/datasets/arrow_reader.py](https://localhost:8080/#) in <module>
28 import pyarrow.parquet as pq
29
---> 30 from .download.download_config import DownloadConfig
31 from .naming import _split_re, filenames_for_dataset_split
32 from .table import InMemoryTable, MemoryMappedTable, Table, concat_tables
[/usr/local/lib/python3.10/dist-packages/datasets/download/__init__.py](https://localhost:8080/#) in <module>
7
8 from .download_config import DownloadConfig
----> 9 from .download_manager import DownloadManager, DownloadMode
10 from .streaming_download_manager import StreamingDownloadManager
[/usr/local/lib/python3.10/dist-packages/datasets/download/download_manager.py](https://localhost:8080/#) in <module>
33 from ..utils.info_utils import get_size_checksum_dict
34 from ..utils.logging import get_logger, is_progress_bar_enabled, tqdm
---> 35 from ..utils.py_utils import NestedDataStructure, map_nested, size_str
36 from .download_config import DownloadConfig
37
[/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py](https://localhost:8080/#) in <module>
38 import dill
39 import multiprocess
---> 40 import multiprocess.pool
41 import numpy as np
42 from packaging import version
[/usr/local/lib/python3.10/dist-packages/multiprocess/pool.py](https://localhost:8080/#) in <module>
607 #
608
--> 609 class ThreadPool(Pool):
610
611 from .dummy import Process
[/usr/local/lib/python3.10/dist-packages/multiprocess/pool.py](https://localhost:8080/#) in ThreadPool()
609 class ThreadPool(Pool):
610
--> 611 from .dummy import Process
612
613 def __init__(self, processes=None, initializer=None, initargs=()):
[/usr/local/lib/python3.10/dist-packages/multiprocess/dummy/__init__.py](https://localhost:8080/#) in <module>
85 #
86
---> 87 class Condition(threading._Condition):
88 # XXX
89 if sys.version_info < (3, 0):
AttributeError: module 'threading' has no attribute '_Condition'
```
</details>
I've also found that attempting to install these `datasets` and `apache-beam` in certain environments (e.g. via pip inside a conda env) simply causes pip to hang indefinitely.
### Expected behavior
I would expect to be able to import methods from `datasets` without crashing. I have tested that this is possible as long as I do not attempt to install `apache-beam`.
### Environment info
Google Colab | 28 | `datasets` cannot be installed alongside `apache-beam`
### Describe the bug
If one installs `apache-beam` alongside `datasets` (which is required for the [wikipedia](https://huggingface.co/datasets/wikipedia#dataset-summary) dataset) in certain environments (such as a Google Colab notebook), they appear to install successfully, however, actually trying to do something such as importing the `load_dataset` method from `datasets` results in a crashing error.
I think the problem is that `apache-beam` version 2.49.0 requires `dill>=0.3.1.1,<0.3.2`, but the latest version of `multiprocess` (0.70.15) (on which `datasets` depends) requires `dill>=0.3.7,`, so this is causing the dependency resolver to use an older version of `multiprocess` which leads to the `datasets` crashing since it doesn't actually appear to be compatible with older versions.
### Steps to reproduce the bug
See this [Google Colab notebook](https://colab.research.google.com/drive/1PTeGlshamFcJZix_GiS3vMXX_YzAhGv0?usp=sharing) to easily reproduce the bug.
In some environments, I have been able to reproduce the bug by running the following in Bash:
```bash
$ pip install datasets apache-beam
```
then the following in a Python shell:
```python
from datasets import load_dataset
```
Here is my stacktrace from running on Google Colab:
<details>
<summary>stacktrace</summary>
```
[/usr/local/lib/python3.10/dist-packages/datasets/__init__.py](https://localhost:8080/#) in <module>
20 __version__ = "2.14.4"
21
---> 22 from .arrow_dataset import Dataset
23 from .arrow_reader import ReadInstruction
24 from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder
[/usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py](https://localhost:8080/#) in <module>
64
65 from . import config
---> 66 from .arrow_reader import ArrowReader
67 from .arrow_writer import ArrowWriter, OptimizedTypedSequence
68 from .data_files import sanitize_patterns
[/usr/local/lib/python3.10/dist-packages/datasets/arrow_reader.py](https://localhost:8080/#) in <module>
28 import pyarrow.parquet as pq
29
---> 30 from .download.download_config import DownloadConfig
31 from .naming import _split_re, filenames_for_dataset_split
32 from .table import InMemoryTable, MemoryMappedTable, Table, concat_tables
[/usr/local/lib/python3.10/dist-packages/datasets/download/__init__.py](https://localhost:8080/#) in <module>
7
8 from .download_config import DownloadConfig
----> 9 from .download_manager import DownloadManager, DownloadMode
10 from .streaming_download_manager import StreamingDownloadManager
[/usr/local/lib/python3.10/dist-packages/datasets/download/download_manager.py](https://localhost:8080/#) in <module>
33 from ..utils.info_utils import get_size_checksum_dict
34 from ..utils.logging import get_logger, is_progress_bar_enabled, tqdm
---> 35 from ..utils.py_utils import NestedDataStructure, map_nested, size_str
36 from .download_config import DownloadConfig
37
[/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py](https://localhost:8080/#) in <module>
38 import dill
39 import multiprocess
---> 40 import multiprocess.pool
41 import numpy as np
42 from packaging import version
[/usr/local/lib/python3.10/dist-packages/multiprocess/pool.py](https://localhost:8080/#) in <module>
607 #
608
--> 609 class ThreadPool(Pool):
610
611 from .dummy import Process
[/usr/local/lib/python3.10/dist-packages/multiprocess/pool.py](https://localhost:8080/#) in ThreadPool()
609 class ThreadPool(Pool):
610
--> 611 from .dummy import Process
612
613 def __init__(self, processes=None, initializer=None, initargs=()):
[/usr/local/lib/python3.10/dist-packages/multiprocess/dummy/__init__.py](https://localhost:8080/#) in <module>
85 #
86
---> 87 class Condition(threading._Condition):
88 # XXX
89 if sys.version_info < (3, 0):
AttributeError: module 'threading' has no attribute '_Condition'
```
</details>
I've also found that attempting to install these `datasets` and `apache-beam` in certain environments (e.g. via pip inside a conda env) simply causes pip to hang indefinitely.
### Expected behavior
I would expect to be able to import methods from `datasets` without crashing. I have tested that this is possible as long as I do not attempt to install `apache-beam`.
### Environment info
Google Colab
I noticed that this is actually covered by issue #5613, which for some reason I didn't see when I searched the issues in this repo the first time. | [
-0.3785075843334198,
0.3001392185688019,
-0.01923738420009613,
0.3167867660522461,
0.0022398103028535843,
0.14671489596366882,
0.16304033994674683,
0.23114949464797974,
0.0433666929602623,
-0.03307116776704788,
-0.1871323436498642,
0.26805105805397034,
-0.08574722707271576,
-0.21021264791488647,
-0.0973762720823288,
-0.28910526633262634,
0.22393113374710083,
-0.04791572690010071,
-0.3423326313495636,
0.3217232823371887,
-0.0993783175945282,
0.2534685730934143,
-0.45918649435043335,
-0.041474342346191406,
-0.10656055808067322,
-0.12598817050457,
0.1243259385228157,
0.14738887548446655,
-0.2072276473045349,
-0.23827335238456726,
0.27960842847824097,
0.09410189092159271,
-0.037575557827949524,
0.455108106136322,
-0.00012318530934862792,
0.0668015331029892,
0.5051000118255615,
0.14771124720573425,
-0.4796501696109772,
-0.24749638140201569,
-0.26342862844467163,
-0.16737794876098633,
0.32988786697387695,
-0.01132512092590332,
0.19229581952095032,
-0.3116932213306427,
-0.037204064428806305,
-0.33833837509155273,
0.3225957751274109,
0.021499425172805786,
0.14967143535614014,
0.3481219410896301,
0.27979162335395813,
-0.17108535766601562,
0.3490109145641327,
-0.14158418774604797,
-0.21975432336330414,
0.022669371217489243,
0.09122449159622192,
-0.013252981007099152,
-0.15307559072971344,
0.10432958602905273,
-0.09210453182458878,
-0.12775442004203796,
0.25876373052597046,
-0.34225061535835266,
-0.30201804637908936,
-0.20986327528953552,
-0.07277640700340271,
0.017294801771640778,
0.5859023332595825,
-0.4280715882778168,
-0.24768763780593872,
-0.15513041615486145,
0.05302080884575844,
0.2654435634613037,
0.41911691427230835,
-0.10682862251996994,
-0.11283710598945618,
0.1724499762058258,
-0.10838767141103745,
-0.33879250288009644,
-0.04463884234428406,
0.27402788400650024,
-0.07092569768428802,
0.4396955072879791,
0.02388519048690796,
0.20861870050430298,
0.155196875333786,
-0.016330674290657043,
0.34444206953048706,
-0.1720341145992279,
0.062739297747612,
0.1206660270690918,
-0.5040982365608215,
0.11932287365198135,
-0.005533713847398758,
0.18086111545562744,
0.1246078833937645,
0.08660523593425751,
-0.19477173686027527,
-0.02917950600385666,
-0.22905051708221436,
0.15839917957782745,
0.14336098730564117,
0.1654716581106186,
0.19314652681350708,
-0.21269826591014862,
0.33501186966896057,
0.1778915822505951,
0.32389068603515625,
0.07691739499568939,
0.1256375014781952,
-0.5035163760185242,
-0.306377649307251,
-0.024957336485385895,
0.1814737766981125,
-0.1803593635559082,
-0.434354305267334,
-0.0677807629108429,
-0.3740973472595215,
-0.0065540410578250885,
0.1871059536933899,
0.15953557193279266,
0.27134978771209717,
0.6043230295181274,
0.23230889439582825,
0.18626756966114044,
-0.16674181818962097,
-0.16864843666553497,
0.058750785887241364,
0.08514125645160675,
-0.35913947224617004,
0.27511826157569885,
0.19743959605693817,
-0.086864173412323,
0.24631419777870178,
0.26653459668159485,
0.21671946346759796,
0.12189675867557526,
0.10820595920085907,
-0.0026564113795757294,
-0.34578901529312134,
0.3761182725429535,
0.165532648563385,
0.5428702235221863,
-0.1756628155708313,
0.06839129328727722,
0.03960882127285004,
0.07689516991376877,
-0.16886727511882782,
-0.03991007059812546,
-0.11669674515724182,
0.058527976274490356,
-0.2551681101322174,
0.27359598875045776,
-0.3060229420661926,
-0.1293373703956604,
0.022511309012770653,
-0.3309812545776367,
-0.05928165838122368,
-0.1832600235939026,
-0.14383794367313385,
-0.33952295780181885,
0.23125490546226501,
0.3427504301071167,
-0.3351978659629822,
0.13284167647361755,
-0.34067481756210327,
-0.11863848567008972,
-0.28981083631515503,
0.13723784685134888,
-0.22702351212501526,
0.17606565356254578,
-0.17315804958343506,
-0.2383304238319397,
0.32362100481987,
-0.4034793972969055,
-0.35833296179771423,
0.28365591168403625,
0.1332748383283615,
0.26566654443740845,
0.05157122015953064,
0.06406830251216888,
-0.0024772323668003082,
-0.0553249716758728,
-0.052279163151979446,
0.39278608560562134,
0.06163699924945831,
-0.2146773636341095,
-0.1891193836927414,
-0.0903233140707016,
-0.015748921781778336,
0.08658424019813538,
0.18069598078727722,
-0.14061760902404785,
0.05200628191232681,
0.24854789674282074,
0.18218688666820526,
0.041181329637765884,
0.026172183454036713,
0.49718189239501953,
-0.027626823633909225,
-0.031685248017311096,
0.10664744675159454,
-0.48232269287109375,
-0.6049897074699402,
0.31245672702789307,
0.13640081882476807,
-0.2010626196861267,
-0.13979430496692657,
-0.12078544497489929,
-0.3381323516368866,
0.18261480331420898,
-0.10857941210269928,
-0.14796140789985657,
-0.020210716873407364,
0.16142494976520538,
-0.14024104177951813,
0.06909831613302231,
-0.12315057218074799,
0.756953239440918,
0.1975017935037613,
0.025028720498085022,
-0.4579606056213379,
0.3233998417854309,
-0.2108692079782486,
-0.15649273991584778,
-0.08048347383737564,
0.07498036324977875,
0.12599092721939087,
-0.015011867508292198,
-0.13337181508541107,
0.6757471561431885,
0.1515386700630188,
0.06035371124744415,
-0.05987095087766647,
-0.11662453413009644,
0.278598815202713,
-0.34708651900291443,
0.1684277504682541,
-0.07749319821596146,
0.0389830507338047,
-0.01528436690568924,
0.17529284954071045,
-0.15183764696121216,
-0.06522946059703827,
0.27220892906188965,
0.18233078718185425,
0.2153991162776947,
0.15081100165843964,
0.1546555459499359,
-0.13017986714839935,
-0.1793312430381775,
0.21937040984630585,
0.31723088026046753,
0.23557054996490479,
-0.05799807608127594,
0.06295707076787949,
0.023617509752511978,
0.16836395859718323,
0.07370486110448837,
0.14809119701385498,
-0.1301397681236267,
-0.3914320766925812,
0.15767627954483032,
0.4367283284664154,
0.035354651510715485,
0.4361092448234558,
0.13706305623054504,
-0.05072615295648575,
0.04834374040365219,
-0.1987801045179367,
-0.13488861918449402,
-0.09856323152780533,
0.3549903631210327,
0.48595279455184937,
-0.08629783987998962,
0.14444515109062195,
0.16738642752170563,
0.03538966178894043,
-0.2833189070224762,
-0.10961350053548813,
0.05563545227050781,
-0.36071765422821045,
0.0676676481962204,
-0.4271906018257141,
-0.048642612993717194,
-0.4488072097301483,
-0.037001147866249084,
-0.2174612134695053,
-0.3930042088031769,
-0.06679684668779373,
0.39977800846099854,
-0.052289701998233795,
0.18519052863121033,
0.2560819983482361,
0.017221659421920776,
0.002849109470844269,
-0.061657629907131195,
-0.13436612486839294,
0.05043956637382507,
-0.11252670735120773,
0.024717051535844803,
0.34809377789497375,
0.2169731706380844,
0.2536817789077759,
0.24934861063957214,
-0.14507099986076355,
-0.3168228566646576,
-0.3699401021003723,
0.042361799627542496,
-0.07644146680831909,
0.2316485494375229,
0.14955660700798035,
0.032826054841279984,
-0.1250559389591217,
-0.16844740509986877,
0.06646352261304855,
-0.1349242925643921,
-0.17053374648094177,
-0.15489418804645538,
0.03919518366456032,
0.000302683562040329,
-0.13809041678905487,
-0.2253621220588684,
0.003785019740462303,
-0.4156495928764343,
-0.2251836508512497,
-0.03530571982264519,
-0.057311005890369415,
-0.12583163380622864,
0.18790492415428162,
-0.008678905665874481,
0.22446174919605255,
-0.007795572280883789,
0.21948178112506866,
0.29917994141578674,
0.22961917519569397,
-0.38079580664634705,
-0.21857737004756927,
0.00807207077741623,
0.05743668973445892,
-0.033485010266304016,
0.4531937837600708,
-0.2955520749092102,
-0.019130732864141464,
-0.3021503984928131,
0.17320036888122559,
-0.144130140542984,
0.015437735244631767,
0.23327529430389404,
0.3050896227359772,
0.14214059710502625,
-0.23515692353248596,
-0.11380358785390854,
-0.1627165675163269,
-0.3424986004829407,
0.33096200227737427,
0.15453490614891052,
0.21499046683311462,
0.03772030025720596,
1.160483479499817,
0.14861926436424255,
-0.057669203728437424,
0.30754053592681885,
0.316939115524292,
0.4358936548233032,
-0.2138383835554123,
-0.2913109362125397,
-0.13003529608249664,
0.06039927899837494,
0.20490047335624695,
0.031858235597610474,
0.005752310156822205,
-0.052109263837337494,
-0.3852079212665558,
0.07878934592008591,
-0.28054898977279663,
-0.025924332439899445,
0.013026362285017967,
-0.2890535295009613,
0.27566051483154297,
0.07680738717317581,
0.12826059758663177,
0.2983705401420593,
-0.03657428175210953,
0.21963167190551758,
0.10880385339260101,
-0.2116536647081375,
-0.04081510007381439,
0.4691336452960968,
0.04134415090084076,
-0.38392171263694763,
0.3986678123474121,
0.0016062669456005096,
0.29793813824653625,
-0.028039731085300446,
0.023123174905776978,
-0.07229641079902649,
-0.03057444468140602,
0.4668927788734436,
-0.45246759057044983,
-0.11054906249046326,
0.12831848859786987,
0.2542586326599121,
-0.8794147372245789,
-0.06718797981739044,
-0.13844838738441467,
0.12043596804141998,
0.2639496922492981,
0.018459439277648926,
-0.19557048380374908,
0.005426984280347824,
0.3664177358150482,
0.11180645227432251,
-0.015151552855968475,
-0.2391061931848526,
-0.3696891963481903,
-0.10721450299024582,
-0.18845804035663605,
-0.33713141083717346,
0.0009533166885375977,
0.18993860483169556,
-0.08704282343387604,
-0.0381864532828331,
-0.027644522488117218,
-0.30459290742874146,
0.011113334447145462,
0.09630052000284195,
0.23651796579360962,
-0.05643455311655998,
0.24902266263961792,
-0.04187345132231712,
0.30848366022109985,
0.2638213038444519,
0.35185331106185913,
0.0021261796355247498,
-0.1999296247959137,
0.16143667697906494,
0.045348092913627625,
0.1802923083305359,
0.3432268798351288,
-0.23175868391990662,
0.022030139341950417,
-0.19919492304325104,
-0.2243633270263672,
0.06506793200969696,
0.1019308790564537,
0.32161831855773926,
-0.0984245240688324,
-0.3180622160434723,
-0.23199552297592163,
0.402030885219574,
0.3787822127342224,
-0.2128576636314392,
0.24792763590812683,
0.13523076474666595,
-0.34251391887664795,
0.2702904939651489,
0.19067968428134918,
0.8612643480300903,
-0.18100281059741974,
-0.10488242655992508,
0.21031656861305237,
-0.13654875755310059,
0.6548124551773071,
-0.42908012866973877,
0.09611940383911133,
-0.09641788899898529,
-0.21390415728092194,
-0.09827885031700134,
-0.27535533905029297,
0.47883185744285583,
-0.1438525915145874,
-0.26813071966171265,
0.3466203808784485,
-0.027639880776405334,
0.141132652759552,
0.07595070451498032,
0.13764451444149017,
-0.044430967420339584,
-0.12783756852149963,
-0.04051261395215988,
0.06397238373756409,
-0.09177610278129578,
0.08441826701164246,
-0.38651174306869507,
0.12727470695972443,
-0.13592052459716797,
-0.14946188032627106,
-0.6027378439903259,
0.1651882827281952,
-0.061390433460474014,
0.3142293095588684,
-0.3771466016769409,
-0.2983797490596771,
0.4409085810184479,
0.32823216915130615,
0.21889083087444305,
0.1355765014886856,
-0.27891188859939575,
0.44002944231033325,
-0.38190385699272156,
-0.15445728600025177,
-0.01627267524600029,
0.007849771529436111,
0.3364245295524597,
0.023407623171806335,
-0.04111654311418533,
0.08698052167892456,
-0.0846300721168518,
-0.20731574296951294,
0.11580172181129456,
0.21587379276752472,
0.256215363740921,
0.07915230095386505,
-0.10449494421482086,
0.2254871428012848,
0.30425629019737244,
-0.26064160466194153,
0.06893214583396912,
-0.09363548457622528,
-0.013285141438245773,
0.05353535711765289,
-0.35968661308288574,
-0.17033997178077698,
0.019737238064408302,
0.5519068837165833,
0.24286526441574097,
-0.15315069258213043,
0.19455133378505707,
0.4830004870891571,
-0.18670062720775604,
-0.04664997756481171,
-0.07117433845996857,
0.13681566715240479,
-0.3848656117916107,
-0.12096746265888214,
-0.1601768434047699,
-0.04283267259597778,
-0.07276391237974167,
0.0621478445827961,
0.1546371430158615,
0.013818631879985332,
-0.2639068365097046,
-0.4193660616874695,
0.05006944388151169,
0.28790193796157837,
-0.09809985756874084,
0.02267717383801937,
-0.11098270118236542,
-0.09851039201021194,
0.20375657081604004,
-0.02365226484835148,
-0.1541021764278412,
-0.18137693405151367,
0.06796606630086899,
0.10368674993515015,
0.2118133306503296,
0.2228865772485733,
-0.041758425533771515,
-0.1153372973203659,
-0.031084556132555008,
0.11046788096427917,
-0.046230249106884,
-0.0835597887635231,
0.007210373878479004,
0.16840606927871704,
-0.06411812454462051,
0.010467585176229477,
-0.10811395943164825,
-0.39774712920188904,
-0.0006307866424322128,
-0.2412259578704834,
0.3367374837398529,
0.16109678149223328,
0.014737118035554886,
-0.15637633204460144,
0.11479850858449936,
0.3919098973274231,
-0.22461897134780884,
0.41039615869522095,
-0.13782596588134766,
0.31872114539146423,
0.17391403019428253,
0.2427915781736374,
0.3820391297340393,
-0.04573774337768555,
-0.27916237711906433,
-0.12226361036300659,
0.07003039866685867,
0.14005063474178314,
-0.007982201874256134,
-0.151179701089859,
-0.11328980326652527,
0.028103120625019073,
0.586715042591095,
0.30585914850234985,
-0.004006039351224899,
-0.2130827009677887,
0.14085188508033752,
0.05895062908530235,
-0.14366132020950317,
0.14455315470695496,
0.43755123019218445,
0.22528862953186035,
-0.09646999835968018,
0.1354614496231079,
0.1559607833623886,
0.034615591168403625,
0.07901063561439514,
0.30321651697158813,
0.022397682070732117,
0.25900790095329285,
0.30468833446502686,
0.08202914148569107,
0.35678398609161377,
0.15148869156837463,
-0.0029876921325922012,
-0.17175111174583435,
0.30302944779396057,
0.6016822457313538,
-0.24250434339046478,
0.5265451669692993,
0.19009438157081604,
-0.10665148496627808,
0.2469393014907837,
-0.2827337682247162,
0.2640312910079956,
0.20643845200538635,
0.25947874784469604,
-0.030803285539150238,
0.10605652630329132,
0.2570335865020752,
-0.0536530427634716,
-0.3046543598175049,
-0.28578871488571167,
0.09506332129240036,
-0.10457461327314377,
0.28626003861427307,
0.12834440171718597,
-0.251983106136322,
-0.2069191038608551,
0.09609857946634293,
0.1915549337863922,
-0.2973305881023407,
0.5678614377975464,
0.10801999270915985,
-0.1590447872877121,
-0.6163249015808105,
0.32729771733283997,
0.06144217029213905,
-0.1065729632973671,
0.000761181116104126,
0.28859469294548035,
0.06088119000196457,
-0.3147195279598236,
-0.12204626947641373,
0.4085176885128021,
0.1952751874923706,
0.3439914286136627,
-0.1552061140537262,
-0.15201729536056519,
0.04850113019347191,
0.11943838745355606,
-0.03915967792272568,
0.12418095767498016,
-0.1401456743478775,
0.1931871473789215,
0.4731890559196472,
0.09295067191123962,
-0.15230059623718262,
-0.21480903029441833,
0.21139925718307495,
0.22289806604385376,
-0.5349239706993103,
0.05080733820796013,
-0.4637610614299774,
-0.13835173845291138,
0.24980159103870392,
0.15286681056022644,
-0.440774142742157,
-0.05489015951752663,
0.1293260008096695,
-0.04749128222465515,
-0.1828421950340271,
-0.3322228491306305,
-0.0062556192278862,
0.027965638786554337,
0.5218700766563416,
0.39970290660858154,
0.27302974462509155,
-0.20189104974269867,
-0.555097222328186,
-0.569273054599762,
0.2537956237792969,
-0.40099966526031494,
0.03313640505075455,
-0.14812929928302765,
0.030822589993476868,
-0.0073110684752464294,
0.30902716517448425,
0.4955235719680786,
0.052372001111507416,
0.08395009487867355,
0.051438819617033005,
-0.5131396651268005,
-0.06222470477223396,
0.20061728358268738,
-0.439682275056839,
-0.20001021027565002,
-0.3208703398704529,
0.048232484608888626,
-0.15564513206481934,
-0.08165040612220764,
-0.10347416251897812,
-0.39887577295303345,
0.30495786666870117,
-0.36575639247894287,
0.5612490773200989,
0.04025153070688248,
0.4056408107280731,
0.1271248310804367,
-0.15800398588180542,
-0.31110909581184387,
-0.27232375741004944,
0.0453326441347599,
0.23889103531837463,
-0.08874955773353577,
0.4474141597747803,
-0.5138442516326904,
0.1493183821439743,
-0.2361152470111847,
0.4484960734844208,
-0.10010156035423279,
0.34883636236190796,
-0.35719311237335205,
-0.039872318506240845,
-0.4039599299430847,
0.2675095498561859,
0.03687647730112076,
-0.02448265813291073,
-0.04447734355926514,
0.2083468735218048,
-0.3738900125026703,
-0.2940328121185303,
0.18101850152015686,
-0.2828578054904938,
-0.2988886833190918,
-0.08258229494094849,
0.055016208440065384,
-0.07902209460735321,
-0.0801185593008995,
-0.7159703969955444,
-0.1750287264585495,
0.11379922926425934,
0.199350968003273,
-0.06500765681266785,
0.036706868559122086,
-0.15457341074943542,
0.0030405446887016296,
-0.10631120949983597,
0.0038882698863744736,
-0.07155060768127441,
-0.20736193656921387,
0.18379831314086914,
-0.21503102779388428
] |
https://github.com/huggingface/datasets/issues/6133 | It's roughly the same code between the two so we can expected roughly the same speed, could you share a benchmark ? | Dataset is slower after calling `to_iterable_dataset` | ### Describe the bug
Can anyone explain why looping over a dataset becomes slower after calling `to_iterable_dataset` to convert to `IterableDataset`
### Steps to reproduce the bug
Any dataset after converting to `IterableDataset`
### Expected behavior
Maybe it should be faster on big dataset? I only test on small dataset
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3 | 22 | Dataset is slower after calling `to_iterable_dataset`
### Describe the bug
Can anyone explain why looping over a dataset becomes slower after calling `to_iterable_dataset` to convert to `IterableDataset`
### Steps to reproduce the bug
Any dataset after converting to `IterableDataset`
### Expected behavior
Maybe it should be faster on big dataset? I only test on small dataset
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
It's roughly the same code between the two so we can expected roughly the same speed, could you share a benchmark ? | [
-0.21740469336509705,
-0.33230429887771606,
-0.06820902973413467,
0.25205811858177185,
0.2974810004234314,
0.08506955206394196,
0.2828558683395386,
0.20997700095176697,
-0.23656882345676422,
0.07266651093959808,
-0.08127926290035248,
0.6577728986740112,
0.018090564757585526,
-0.05060135945677757,
-0.09342484176158905,
-0.03963600471615791,
0.46814292669296265,
0.0410783514380455,
-0.36318138241767883,
-0.1188073381781578,
-0.2667195796966553,
0.10031008720397949,
-0.34792450070381165,
-0.1317143440246582,
-0.06253848969936371,
0.04384274780750275,
-0.024936020374298096,
0.24112382531166077,
0.04964211583137512,
-0.6462703943252563,
0.3014223277568817,
0.11614276468753815,
0.11851771175861359,
0.3200320899486542,
-0.00011253529373789206,
-0.09788550436496735,
0.060910992324352264,
0.14909783005714417,
-0.08278468251228333,
0.14166128635406494,
-0.08744172006845474,
-0.14939658343791962,
0.15608415007591248,
-0.14215363562107086,
-0.12115666270256042,
-0.21526853740215302,
-0.1099361851811409,
-0.26332592964172363,
0.029676634818315506,
0.12623170018196106,
0.20237594842910767,
0.31825917959213257,
-0.24702349305152893,
-0.18277548253536224,
-0.03413943946361542,
-0.07793032377958298,
-0.23900744318962097,
0.41810575127601624,
0.44850295782089233,
0.028532668948173523,
-0.021092519164085388,
0.11229496449232101,
-0.053641512989997864,
0.05834323912858963,
0.3703994154930115,
-0.1035999208688736,
-0.2905311584472656,
-0.15962694585323334,
0.02420615591108799,
0.06432843208312988,
0.43443915247917175,
-0.23209621012210846,
-0.21574054658412933,
-0.2218819260597229,
-0.22887082397937775,
-0.21061180531978607,
0.04502091184258461,
-0.33387085795402527,
0.07379502803087234,
-0.05890865996479988,
-0.2315092533826828,
-0.06931273639202118,
-0.1191025972366333,
-0.17209124565124512,
-0.07211629301309586,
0.17057636380195618,
-0.15958288311958313,
0.19178833067417145,
0.15610533952713013,
-0.05336546525359154,
0.32309839129447937,
-0.22196219861507416,
0.11002680659294128,
0.1829172968864441,
-0.5954957008361816,
-0.29081568121910095,
0.28908640146255493,
0.26957833766937256,
0.019714556634426117,
0.1659068912267685,
-0.07778288424015045,
0.0424032062292099,
-0.15529051423072815,
-0.22711452841758728,
0.33382436633110046,
0.14539185166358948,
-0.40841931104660034,
0.2701195478439331,
0.1929890513420105,
0.08181378245353699,
-0.35986950993537903,
-0.1353379637002945,
0.11578302085399628,
-0.23890109360218048,
0.5311475396156311,
-0.08018457889556885,
0.25701361894607544,
-0.34437334537506104,
-0.4675286114215851,
-0.08872553706169128,
-0.3014177680015564,
-0.125614196062088,
0.18685749173164368,
0.17015603184700012,
-0.14238089323043823,
0.04182525351643562,
-0.3195660710334778,
0.16162508726119995,
-0.2206811159849167,
0.15703606605529785,
-0.16678598523139954,
-0.15681768953800201,
-0.13906219601631165,
0.17129626870155334,
-0.014408513903617859,
-0.2980293035507202,
0.055237047374248505,
0.43657562136650085,
0.09162729978561401,
-0.07500499486923218,
0.1948973834514618,
-0.07937131822109222,
0.2300674021244049,
-0.022384870797395706,
-0.05726126581430435,
0.3540407717227936,
0.07347509264945984,
0.06592361629009247,
-0.20748785138130188,
0.3392772376537323,
-0.2821979522705078,
-0.279666543006897,
0.23372884094715118,
0.13391613960266113,
-0.21775396168231964,
-0.2110767960548401,
-0.30494990944862366,
0.23551654815673828,
-0.03341742977499962,
-0.12004309892654419,
0.17114850878715515,
-0.3077995777130127,
-0.20050889253616333,
-0.3404277563095093,
-0.0916391909122467,
0.16663190722465515,
-0.18774637579917908,
0.2634982466697693,
-0.04308874532580376,
-0.10381428897380829,
0.42700156569480896,
0.43487444519996643,
-0.23914209008216858,
0.4820815622806549,
-0.4204776883125305,
-0.02053016424179077,
0.2173817753791809,
-0.10938418656587601,
-0.5179456472396851,
0.28707611560821533,
-0.12156999856233597,
0.5641216039657593,
-0.12932710349559784,
0.21559831500053406,
0.06350240111351013,
-0.3048366606235504,
-0.08715372532606125,
0.16897030174732208,
0.03343764692544937,
0.11666245758533478,
-0.36073094606399536,
0.16907775402069092,
0.309588223695755,
-0.001643851399421692,
-0.052735552191734314,
0.4422159492969513,
-0.009076710790395737,
0.14389294385910034,
0.5165238976478577,
-0.3474298119544983,
-0.11923756450414658,
0.20217040181159973,
0.37027212977409363,
-0.15650059282779694,
0.19972166419029236,
-0.2977505922317505,
-0.023251894861459732,
0.20420877635478973,
0.048979371786117554,
-0.040235735476017,
0.10307285189628601,
-0.1551242172718048,
-0.38311532139778137,
-0.011099923402071,
-0.22854909300804138,
-0.11537875980138779,
0.06352873146533966,
0.08942760527133942,
0.22823485732078552,
-0.04723918437957764,
-0.07559053599834442,
0.35433974862098694,
-0.25749409198760986,
0.03959902748465538,
-0.23676413297653198,
0.2298896610736847,
0.33350303769111633,
-0.15151840448379517,
0.08028756082057953,
-0.0038834400475025177,
0.2106447070837021,
-0.2618710398674011,
-0.28644663095474243,
0.31147342920303345,
0.012562140822410583,
0.41373729705810547,
0.0868787169456482,
0.2058529257774353,
0.21749866008758545,
-0.17270240187644958,
0.23231558501720428,
0.10470815747976303,
0.14974871277809143,
-0.193435937166214,
-0.1042732298374176,
0.4549309015274048,
-0.253665566444397,
0.3149281144142151,
0.18710877001285553,
-0.2720453441143036,
-0.0010083690285682678,
0.1283133327960968,
-0.12902069091796875,
0.16292762756347656,
0.10730414092540741,
0.12548620998859406,
0.2595127820968628,
0.11418715119361877,
-0.41101735830307007,
0.3048297166824341,
0.6636823415756226,
-0.17143163084983826,
-0.25408923625946045,
0.16071639955043793,
-0.1386076658964157,
-0.17197293043136597,
-0.017163343727588654,
0.04395049810409546,
0.5998014807701111,
0.07506038248538971,
0.2562001347541809,
0.09023573994636536,
-0.23350957036018372,
-0.07324859499931335,
0.2704092264175415,
-0.10985205322504044,
0.5436371564865112,
0.01226135529577732,
0.28408142924308777,
-0.04902646690607071,
-0.42141395807266235,
-0.2835341989994049,
-0.20667371153831482,
0.33694887161254883,
-0.15543168783187866,
0.24554705619812012,
-0.23462450504302979,
-0.09723006188869476,
-0.03187955543398857,
-0.1753077507019043,
-0.057775188237428665,
-0.4070085883140564,
-0.2933630347251892,
0.42375752329826355,
0.2444593757390976,
-0.032188814133405685,
0.039273180067539215,
0.08699586242437363,
0.22696904838085175,
0.0989578440785408,
-0.269309937953949,
0.009820174425840378,
-0.24215146899223328,
0.06226731091737747,
0.14053300023078918,
-0.30138328671455383,
0.16397181153297424,
-0.1679006665945053,
0.0249655619263649,
-0.2987145185470581,
-0.33557283878326416,
-0.14983126521110535,
-0.20200997591018677,
0.2710287272930145,
0.10736893862485886,
0.14699402451515198,
0.1260688453912735,
0.0451522022485733,
0.266410231590271,
0.029654279351234436,
0.05795007944107056,
-0.15433409810066223,
-0.19037866592407227,
0.012624803930521011,
0.25200581550598145,
-0.0963013619184494,
-0.010276323184370995,
-0.16361425817012787,
0.30097389221191406,
0.08937673270702362,
0.1117977425456047,
0.0912945494055748,
-0.03991237282752991,
0.14972808957099915,
0.1717350035905838,
-0.03787378594279289,
-0.2641310393810272,
-0.22458896040916443,
0.3666423261165619,
-0.11989717185497284,
-0.12402865290641785,
-0.37235456705093384,
0.016706198453903198,
0.32497450709342957,
0.04926840215921402,
-0.5626208186149597,
-0.04116030037403107,
-0.5978049039840698,
0.2161504626274109,
-0.17979668080806732,
-0.19172780215740204,
0.07488003373146057,
-0.013809319585561752,
-0.08533932268619537,
-0.14668838679790497,
-0.22326582670211792,
-0.13030660152435303,
-0.08335445076227188,
-0.07684899866580963,
0.2005159854888916,
0.31825175881385803,
0.13993191719055176,
0.45386332273483276,
0.40860944986343384,
0.11480844020843506,
0.3471779227256775,
-0.1227189302444458,
0.16552641987800598,
-0.5350146293640137,
-0.44013166427612305,
-0.12595167756080627,
-0.24688507616519928,
-0.2546427845954895,
0.171240895986557,
-0.17177896201610565,
-0.34632816910743713,
0.1492672860622406,
-0.2850708067417145,
0.18405058979988098,
-0.11509368568658829,
-0.0008557513356208801,
-0.11773804575204849,
0.07548967748880386,
0.33012598752975464,
0.24582214653491974,
-0.34892380237579346,
0.0044658854603767395,
0.0955510139465332,
-0.11688810586929321,
0.2977941632270813,
-0.3639298379421234,
-0.502597451210022,
-0.25135138630867004,
-0.666107714176178,
0.1645515263080597,
-0.005234628915786743,
0.37259024381637573,
0.073244109749794,
-0.15795861184597015,
0.41551825404167175,
-0.04852684959769249,
0.6471270322799683,
-0.08056692779064178,
-0.2481970191001892,
0.2548556327819824,
-0.16411876678466797,
-0.30074429512023926,
-0.0523776076734066,
-0.2387741506099701,
0.6365163922309875,
0.20716726779937744,
0.655868411064148,
0.014495089650154114,
-0.28933778405189514,
0.3836033344268799,
0.31234481930732727,
0.1479257047176361,
-0.09655193984508514,
-0.170416921377182,
-0.2562316060066223,
0.0362708643078804,
0.19030000269412994,
-0.18755018711090088,
0.3314043879508972,
-0.26207834482192993,
-0.2717244029045105,
-0.19059444963932037,
-0.08227983862161636,
0.0517098642885685,
0.12965376675128937,
0.17955398559570312,
-0.10162092745304108,
0.43999671936035156,
-0.11212226003408432,
-0.13827553391456604,
0.20479848980903625,
0.45780307054519653,
-0.029732337221503258,
-0.2751774787902832,
-0.0799822062253952,
0.2746312618255615,
0.28341150283813477,
0.4460645914077759,
-0.10319565236568451,
0.14679041504859924,
-0.058055851608514786,
0.04897664114832878,
-0.44604870676994324,
-0.21879659593105316,
0.46145111322402954,
0.244235560297966,
-0.5711148381233215,
-0.311198890209198,
0.5485879778862,
0.2703021168708801,
-0.14863266050815582,
0.5495902299880981,
0.1531411111354828,
-0.1778896600008011,
0.23598018288612366,
-0.12350016087293625,
0.8571560382843018,
0.057889316231012344,
-0.04123467952013016,
0.4886696934700012,
0.03807039558887482,
0.24714252352714539,
-0.017477020621299744,
0.23481231927871704,
-0.35049352049827576,
-0.5228196978569031,
0.13348478078842163,
-0.27483540773391724,
0.23893103003501892,
-0.010469090193510056,
-0.12337315082550049,
0.2813212275505066,
-0.028620779514312744,
0.11099524796009064,
-0.1524568647146225,
0.14264705777168274,
-0.31974178552627563,
-0.05878329277038574,
-0.3781925141811371,
0.15588220953941345,
0.23240329325199127,
0.23814785480499268,
-0.03908580541610718,
-0.19710534811019897,
-0.10438428819179535,
0.1636301726102829,
-0.35692960023880005,
0.09248584508895874,
-0.030645620077848434,
-0.12740088999271393,
0.11424776911735535,
-0.4245572090148926,
0.17657434940338135,
0.15724477171897888,
0.5262405872344971,
0.027344873175024986,
-0.21408836543560028,
0.1713014543056488,
-0.17465177178382874,
0.38570326566696167,
0.2831858992576599,
-0.2024415284395218,
0.18739110231399536,
0.04597535729408264,
-0.0568697452545166,
-0.08473274111747742,
-0.040675971657037735,
-0.2698890268802643,
-0.12122111767530441,
0.14436325430870056,
-0.13217520713806152,
-0.5028496384620667,
-0.2285524308681488,
0.3273048996925354,
0.0360029935836792,
-0.391551673412323,
0.1543099582195282,
0.011887088418006897,
0.05442498251795769,
0.44019439816474915,
-0.13851380348205566,
-0.41785237193107605,
-0.13928724825382233,
0.20719972252845764,
0.32161596417427063,
0.15926916897296906,
0.42535269260406494,
-0.027233131229877472,
-0.3312332034111023,
-0.06974370032548904,
0.10891473293304443,
0.25041913986206055,
-0.2950274646282196,
0.43800318241119385,
-0.3381202816963196,
0.5244110822677612,
-0.2330794632434845,
-0.007933521643280983,
-0.2986288070678711,
0.043938666582107544,
-0.3758319616317749,
-0.12710441648960114,
-0.22858794033527374,
-0.005213245749473572,
0.13448196649551392,
0.24933642148971558,
-0.1907290816307068,
-0.15553049743175507,
-0.2826440632343292,
-0.06487402319908142,
-0.2655062973499298,
0.04827447235584259,
-0.10883738100528717,
0.0656839907169342,
0.003762291744351387,
-0.10346217453479767,
0.0755184143781662,
0.1760280728340149,
0.15996506810188293,
0.38757947087287903,
0.16128483414649963,
-0.2779197096824646,
0.10357166081666946,
0.16359156370162964,
-0.10225709527730942,
-0.6040148735046387,
0.033785346895456314,
0.010012678802013397,
-0.05951864272356033,
-0.33343952894210815,
0.26541492342948914,
0.12582194805145264,
0.032595016062259674,
-0.05276445671916008,
0.20237381756305695,
-0.16674339771270752,
0.19716289639472961,
0.05524185299873352,
0.02918454259634018,
0.14867185056209564,
0.061490654945373535,
0.20603948831558228,
0.08186474442481995,
-0.2741106450557709,
-0.10671065747737885,
0.040664155036211014,
0.32908642292022705,
0.007819786667823792,
0.38181325793266296,
-0.1980457454919815,
0.007223695516586304,
0.19185838103294373,
0.44586220383644104,
0.5142621397972107,
-0.16170059144496918,
-0.039160989224910736,
-0.09237581491470337,
0.1577511578798294,
-0.050688061863183975,
-0.2710760831832886,
0.23770849406719208,
-0.150794118642807,
-0.07183558493852615,
0.06576892733573914,
0.20419001579284668,
0.257281631231308,
0.3930166959762573,
-0.19046950340270996,
0.3668396472930908,
-0.23432360589504242,
0.1149182915687561,
0.23180712759494781,
0.19214129447937012,
-0.008385160937905312,
0.3673955202102661,
0.1978532373905182,
-0.015324156731367111,
0.6676933169364929,
0.023504197597503662,
0.1891344040632248,
0.17588794231414795,
0.13044947385787964,
0.15521129965782166,
-0.1308092474937439,
-0.20036472380161285,
0.24215587973594666,
-0.2614132761955261,
0.06893061101436615,
0.1980014443397522,
-0.043085385113954544,
-0.20051714777946472,
-0.18217740952968597,
-0.054777197539806366,
0.21396170556545258,
-0.31834790110588074,
-0.2754380702972412,
0.20958839356899261,
-0.06872503459453583,
-0.11536279320716858,
0.23477669060230255,
-0.33421236276626587,
-0.11738564074039459,
-0.04995362460613251,
-0.05932450294494629,
0.22964337468147278,
-0.4587746858596802,
0.223637193441391,
-0.13218410313129425,
0.3862469792366028,
-0.08226276189088821,
0.22375887632369995,
-0.024472534656524658,
-0.0061608366668224335,
-0.03571202978491783,
0.49377721548080444,
0.5652734637260437,
0.2854352295398712,
-0.11424869298934937,
0.039826005697250366,
-0.19230212271213531,
-0.18282991647720337,
0.3629661798477173,
0.24163897335529327,
-0.3011702597141266,
0.2627655267715454,
0.1268959939479828,
0.06806168705224991,
-0.09045271575450897,
0.06229894980788231,
0.07980039715766907,
0.07946392893791199,
-0.5953781604766846,
0.17524081468582153,
-0.2589963376522064,
-0.11010225862264633,
-0.08686964958906174,
0.028252385556697845,
-0.2224852442741394,
-0.1540174037218094,
0.23448804020881653,
-0.27619656920433044,
0.11941026896238327,
-0.07577580213546753,
0.0767197459936142,
-0.21827560663223267,
0.38236650824546814,
0.11432455480098724,
0.3038283884525299,
-0.33951640129089355,
-0.24852457642555237,
-0.18001888692378998,
-0.07538440823554993,
-0.06014178693294525,
0.09588293731212616,
0.09477581828832626,
0.2414422333240509,
-0.1471531093120575,
0.06394638121128082,
0.3984788954257965,
-0.08315545320510864,
-0.023509077727794647,
0.4028692841529846,
-0.07830782979726791,
-0.1285598874092102,
-0.29809483885765076,
-0.24791279435157776,
-0.18361446261405945,
-0.288055956363678,
0.42952683568000793,
-0.20167075097560883,
0.0069863200187683105,
-0.09592384099960327,
0.018170945346355438,
0.2255648970603943,
0.2043347954750061,
0.1826932579278946,
0.34268519282341003,
0.12946312129497528,
0.03996756672859192,
-0.052602991461753845,
-0.11720452457666397,
-0.2730350196361542,
-0.031786929816007614,
0.38136863708496094,
-0.20352037250995636,
0.004330947995185852,
0.032757602632045746,
-0.2702524662017822,
-0.11184071004390717,
0.09116876125335693,
0.13442696630954742,
0.08856853097677231,
-0.14056119322776794,
0.022494100034236908,
-0.21228554844856262,
0.13760870695114136,
0.0905286967754364,
0.2947808504104614,
0.3038724362850189,
0.30783504247665405,
-0.4216308295726776,
-0.12320413440465927,
0.39608126878738403,
-0.4047067165374756,
-0.34778547286987305,
0.027899425476789474,
-0.02930312603712082,
0.3548573851585388,
-0.19460372626781464,
-0.17298594117164612,
-0.04726700484752655,
0.5636595487594604,
-0.04868954047560692,
0.08704930543899536,
0.3756091296672821,
0.006014663726091385,
0.18483851850032806,
-0.055593982338905334,
0.38035503029823303,
0.012711944058537483,
-0.24781258404254913,
0.22848255932331085,
-0.17036861181259155
] |
https://github.com/huggingface/datasets/issues/6130 | What should be the behavior in this case ? Should it override the default config with the added parameter ? | default config name doesn't work when config kwargs are specified. | ### Describe the bug
https://github.com/huggingface/datasets/blob/12cfc1196e62847e2e8239fbd727a02cbc86ddec/src/datasets/builder.py#L518-L522
If `config_name` is `None`, `DEFAULT_CONFIG_NAME` should be select. But once users pass `config_kwargs` to their customized `BuilderConfig`, the logic is ignored, and dataset cannot select the default config from multiple configs.
### Steps to reproduce the bug
```python
import datasets
datasets.load_dataset('/dataset/with/multiple/config'') # Ok
datasets.load_dataset('/dataset/with/multiple/config', some_field_in_config='some') # Err
```
### Expected behavior
Default config behavior should be consistent.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3 | 20 | default config name doesn't work when config kwargs are specified.
### Describe the bug
https://github.com/huggingface/datasets/blob/12cfc1196e62847e2e8239fbd727a02cbc86ddec/src/datasets/builder.py#L518-L522
If `config_name` is `None`, `DEFAULT_CONFIG_NAME` should be select. But once users pass `config_kwargs` to their customized `BuilderConfig`, the logic is ignored, and dataset cannot select the default config from multiple configs.
### Steps to reproduce the bug
```python
import datasets
datasets.load_dataset('/dataset/with/multiple/config'') # Ok
datasets.load_dataset('/dataset/with/multiple/config', some_field_in_config='some') # Err
```
### Expected behavior
Default config behavior should be consistent.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
What should be the behavior in this case ? Should it override the default config with the added parameter ? | [
-0.10071884840726852,
-0.21733036637306213,
0.09942471235990524,
0.13833779096603394,
0.07441189140081406,
0.030461803078651428,
0.3864661753177643,
-0.03025026246905327,
0.007245421409606934,
0.36576059460639954,
0.24759340286254883,
0.5385408997535706,
0.15046490728855133,
0.09754510968923569,
-0.015341497957706451,
0.160074383020401,
-0.08525224775075912,
0.018427401781082153,
-0.12417779862880707,
0.07659083604812622,
-0.3951936662197113,
0.2644064128398895,
-0.1300012618303299,
0.0836750864982605,
-0.23246146738529205,
0.2102358341217041,
-0.026976007968187332,
0.2772386968135834,
0.12655626237392426,
-0.40239864587783813,
0.49835342168807983,
0.24349501729011536,
-0.22196590900421143,
0.3506086468696594,
-0.00012722023529931903,
0.03833065927028656,
0.4455793499946594,
0.005509495735168457,
-0.20114248991012573,
-0.17854245007038116,
-0.45568305253982544,
-0.08203981071710587,
0.05685826390981674,
-0.3204830288887024,
-0.05914080888032913,
0.012598957866430283,
0.06703855842351913,
-0.22151608765125275,
-0.03346532955765724,
0.019067231565713882,
0.08741351962089539,
0.06882717460393906,
-0.03836635500192642,
0.11085620522499084,
-0.35532355308532715,
0.06056980416178703,
-0.07359856367111206,
0.18993410468101501,
-0.24514365196228027,
0.009790666401386261,
0.14271697402000427,
-0.026867380365729332,
-0.09593799710273743,
-0.13125185668468475,
0.3784894645214081,
0.05487116053700447,
0.13059097528457642,
-0.16456204652786255,
0.246414452791214,
0.3466082811355591,
0.2489156574010849,
-0.469396710395813,
-0.08575886487960815,
-0.5209792256355286,
0.21375149488449097,
-0.014495253562927246,
0.4231342673301697,
0.008522894233465195,
-0.4321374297142029,
0.03390883654356003,
-0.20080089569091797,
-0.26449379324913025,
0.04089474678039551,
0.1923198401927948,
-0.367290735244751,
0.4579337239265442,
-0.13081902265548706,
0.24381087720394135,
-0.15774276852607727,
-0.08790145814418793,
-0.016885673627257347,
-0.7375202178955078,
-0.07771260291337967,
-0.04843902587890625,
-0.2035452425479889,
0.140823096036911,
0.28905507922172546,
0.27519166469573975,
0.26647844910621643,
-0.07665993273258209,
-0.014865664765238762,
0.19840717315673828,
0.365168035030365,
0.17493750154972076,
0.036293596029281616,
0.12017299234867096,
0.36947891116142273,
0.1396091878414154,
0.2453334778547287,
0.16140016913414001,
-0.19575577974319458,
0.1295899748802185,
0.20554044842720032,
-0.15611299872398376,
0.0023067742586135864,
-0.3755110204219818,
0.511831521987915,
0.04628206789493561,
0.021379701793193817,
0.14517036080360413,
0.01400677114725113,
-0.02575809508562088,
0.3034219741821289,
0.23108886182308197,
-0.30180907249450684,
-0.0010429536923766136,
-0.20756810903549194,
0.10167690366506577,
0.13354413211345673,
0.2357085943222046,
-0.21033787727355957,
-0.5151461362838745,
-0.05934016779065132,
0.09739473462104797,
0.08342230319976807,
-0.5489531755447388,
0.4892939329147339,
0.3481692969799042,
0.22078809142112732,
-0.09961220622062683,
-0.20137572288513184,
0.2791856825351715,
-0.09361854195594788,
0.2421422153711319,
-0.23274992406368256,
0.22648203372955322,
-0.009727586060762405,
-0.33110496401786804,
-0.1275550127029419,
0.1763700395822525,
-0.3023653030395508,
-0.295765221118927,
0.09209755808115005,
0.02726602554321289,
-0.37126803398132324,
0.03511318564414978,
-0.31460291147232056,
0.2870962917804718,
0.3294922113418579,
0.0021182894706726074,
0.03538651764392853,
-0.042245522141456604,
-0.004391267895698547,
-0.2915480136871338,
0.3863343894481659,
0.3660603165626526,
0.03055308759212494,
-0.2965332269668579,
0.1491186022758484,
0.07606059312820435,
-0.07490596175193787,
-0.3481608033180237,
-0.33103424310684204,
0.014903100207448006,
-0.2098691761493683,
0.049929410219192505,
0.370665967464447,
-0.03965079411864281,
-0.40139883756637573,
0.09158903360366821,
0.1655835509300232,
0.3129879832267761,
0.23757489025592804,
-0.15878596901893616,
-0.44103991985321045,
0.07453813403844833,
-0.06304498761892319,
0.2897641956806183,
0.11137748509645462,
0.053909093141555786,
-0.17858266830444336,
-0.42938241362571716,
-0.19991925358772278,
0.07910025119781494,
0.0006782392738386989,
0.21657976508140564,
-0.12154773622751236,
-0.21058376133441925,
0.3051568567752838,
0.06284467875957489,
-0.17675836384296417,
0.3548896014690399,
0.1856977939605713,
0.07490245252847672,
0.18405137956142426,
0.0037294328212738037,
-0.7010788917541504,
0.33463016152381897,
0.0679273009300232,
-0.17328381538391113,
-0.11716165393590927,
-0.31038346886634827,
-0.2141910046339035,
-0.07492072880268097,
-0.4859793186187744,
0.1512461006641388,
-0.02293301187455654,
0.6770856380462646,
-0.08974147588014603,
0.006620906293392181,
-0.40886640548706055,
0.25017204880714417,
-0.1077631488442421,
0.2790784239768982,
-0.4257611632347107,
0.17304182052612305,
0.12349782139062881,
-0.04797138273715973,
-0.34711217880249023,
0.12002447247505188,
0.10984084010124207,
-0.08406757563352585,
0.07833321392536163,
0.5673930048942566,
-0.10637722164392471,
0.20882859826087952,
-0.4344142973423004,
-0.1433868408203125,
0.027844002470374107,
0.21392536163330078,
-0.06692786514759064,
0.24497537314891815,
0.06357236206531525,
-0.0874703899025917,
-0.11489908397197723,
0.36180493235588074,
0.12622800469398499,
0.2894110083580017,
-0.12039189785718918,
-0.11212751269340515,
-0.1157139241695404,
-0.13598598539829254,
-0.377117395401001,
-0.2618686258792877,
-0.28029680252075195,
-0.2116013467311859,
0.5593776702880859,
0.1972176879644394,
-0.5280611515045166,
-0.19528326392173767,
0.3787155747413635,
0.14000804722309113,
-0.09793654084205627,
-0.06210606172680855,
0.07758483290672302,
0.1551939696073532,
0.19244053959846497,
0.2205435335636139,
0.4020181894302368,
0.12258678674697876,
-0.05491211637854576,
-0.010978730395436287,
-0.389011025428772,
-0.09658096730709076,
0.16670404374599457,
0.1963287591934204,
0.1189773753285408,
0.322784423828125,
0.11816282570362091,
-0.11700273305177689,
-0.2898263931274414,
-0.03385506197810173,
0.2446843981742859,
-0.14238645136356354,
-0.2622919976711273,
0.19695672392845154,
-0.24565455317497253,
-0.10582783073186874,
-0.16699373722076416,
-0.27639132738113403,
-0.37501516938209534,
-0.38689887523651123,
-0.23826400935649872,
0.13070136308670044,
-0.1551438271999359,
0.3027162551879883,
-0.12730063498020172,
0.20114196836948395,
-0.17980077862739563,
-0.5508205890655518,
-0.2573121190071106,
0.19954465329647064,
-0.281528502702713,
-0.1689106822013855,
-0.003617227077484131,
-0.33185556530952454,
-0.12293702363967896,
0.03412516415119171,
-0.24980270862579346,
0.012959081679582596,
-0.33230888843536377,
0.1695377677679062,
-0.034096330404281616,
0.6868131756782532,
0.2562101483345032,
-0.002501942217350006,
0.12404587864875793,
-0.31285616755485535,
0.3598383367061615,
0.5399432182312012,
0.17758172750473022,
0.08046817779541016,
0.2755855619907379,
-0.007458921521902084,
-0.12273824214935303,
0.07713810354471207,
0.08631129562854767,
-0.16517360508441925,
0.010590801946818829,
-0.01506207138299942,
0.039825189858675,
0.6059244275093079,
0.12996703386306763,
-0.03469102084636688,
-0.38749706745147705,
0.15518510341644287,
0.028987973928451538,
-0.36182713508605957,
0.29662513732910156,
-0.052453093230724335,
-0.06197919696569443,
-0.4124912619590759,
-0.09853189438581467,
0.3546496033668518,
-0.11716589331626892,
-0.5155327320098877,
-0.15275387465953827,
-0.32742801308631897,
0.5622498989105225,
0.07103772461414337,
0.2554727792739868,
-0.10992753505706787,
0.2749703526496887,
0.12613201141357422,
-0.2555968761444092,
-0.2936531901359558,
0.34654662013053894,
0.11902862787246704,
0.381175696849823,
0.5327795147895813,
0.1348952203989029,
-0.041426338255405426,
0.4308503568172455,
0.3245086669921875,
-0.1576479971408844,
0.33600154519081116,
-0.2719460129737854,
0.44738057255744934,
0.02650691196322441,
-0.43686988949775696,
-0.017002947628498077,
0.37233448028564453,
0.30545952916145325,
0.2839306592941284,
0.06457333266735077,
0.14427576959133148,
-0.2365916669368744,
-0.2745334506034851,
0.04286963492631912,
-0.3923065662384033,
-0.21851634979248047,
-0.15763725340366364,
0.12162639200687408,
0.3175120949745178,
0.21998679637908936,
-0.1459529995918274,
-0.09778289496898651,
-0.09093848615884781,
0.38602226972579956,
-0.2300626039505005,
0.11256721615791321,
-0.15754516422748566,
0.07048578560352325,
-0.14944422245025635,
0.18046149611473083,
-0.11751915514469147,
0.05903949961066246,
0.1765851527452469,
0.1097312793135643,
0.18328991532325745,
-0.036161500960588455,
0.5265011191368103,
-0.10130972415208817,
0.11800779402256012,
0.18040910363197327,
0.1610758900642395,
-0.325702428817749,
-0.1953524947166443,
0.20270895957946777,
0.0648222416639328,
0.11998976767063141,
0.26866859197616577,
-0.4567263126373291,
-0.300864577293396,
-0.013866396620869637,
0.20358964800834656,
-0.07835786044597626,
-0.21383260190486908,
-0.3616945147514343,
-0.23476651310920715,
0.11639591306447983,
-0.11908505111932755,
-0.22310364246368408,
0.3827180862426758,
-0.04651327058672905,
0.053267717361450195,
-0.20049943029880524,
-0.17059364914894104,
-0.016730450093746185,
0.28436553478240967,
0.2272568941116333,
-0.09051550924777985,
0.22395175695419312,
-0.09474915266036987,
0.005700298119336367,
0.1872813105583191,
0.44999876618385315,
-0.054142244160175323,
-0.19329017400741577,
-0.20631086826324463,
-0.06605983525514603,
0.4422389566898346,
0.3666991591453552,
-0.34281036257743835,
0.09877949953079224,
0.04820268228650093,
0.15020039677619934,
0.05656944215297699,
0.05401935055851936,
0.4164353311061859,
0.13032212853431702,
-0.23643530905246735,
-0.519017219543457,
0.6854928731918335,
-0.04970541596412659,
-0.22435861825942993,
0.45846760272979736,
0.5231421589851379,
-0.5117380023002625,
0.04674721509218216,
-0.2533668875694275,
0.6383657455444336,
0.524899959564209,
0.10144965350627899,
0.23494075238704681,
-0.08245374262332916,
0.22800475358963013,
0.28915250301361084,
0.1983303427696228,
-0.3687461018562317,
0.12016567587852478,
0.14172609150409698,
-0.07298769056797028,
0.5781959295272827,
0.328128457069397,
-0.08090204745531082,
0.13428230583667755,
-0.111138716340065,
0.3225857615470886,
-0.012372726574540138,
0.19269348680973053,
-0.4320618510246277,
-0.052903786301612854,
-0.3004709482192993,
-0.06937107443809509,
-0.1385187804698944,
0.27559614181518555,
0.12785404920578003,
-0.1719297617673874,
0.1384492814540863,
-0.23580478131771088,
-0.11297199130058289,
0.0056633129715919495,
-0.26059478521347046,
-0.1158064752817154,
0.37473616003990173,
-0.19837602972984314,
0.11456649750471115,
0.4142065644264221,
0.2524791955947876,
0.5148833990097046,
-0.19736815989017487,
0.15715646743774414,
-0.02213512361049652,
0.1512746661901474,
-0.04500657320022583,
0.03595247492194176,
0.3075026571750641,
0.056103065609931946,
-0.3842815160751343,
-0.07510533183813095,
-0.022461697459220886,
-0.05323386192321777,
-0.16119816899299622,
0.00642651692032814,
0.04185986518859863,
-0.32526805996894836,
-0.18230080604553223,
-0.10061745345592499,
0.3458772301673889,
-0.240706205368042,
0.04187020659446716,
-0.10770896077156067,
-0.1466864049434662,
0.5148407816886902,
-0.16605645418167114,
-0.20472373068332672,
-0.1756303906440735,
0.3017142713069916,
-0.2584347724914551,
-0.00849110633134842,
0.5199597477912903,
-0.44142845273017883,
0.008105911314487457,
0.09081976115703583,
0.35793790221214294,
0.10867632180452347,
-0.21626828610897064,
-0.03017871081829071,
0.1411472111940384,
-0.07685147225856781,
0.0547158382833004,
0.45105135440826416,
0.009240190498530865,
-0.034133415669202805,
-0.02635262906551361,
-0.0880512148141861,
-0.0341208279132843,
0.0718507319688797,
0.18863508105278015,
0.1863442361354828,
0.027941502630710602,
0.020121287554502487,
0.06599131971597672,
-0.04120723158121109,
-0.15887393057346344,
0.0047799088060855865,
-0.11551758646965027,
0.10078856348991394,
0.09867546707391739,
0.4048525094985962,
-0.049462251365184784,
-0.09597176313400269,
0.11530334502458572,
-0.22807057201862335,
-0.09695819765329361,
-0.08576139807701111,
-0.3503827154636383,
0.21245314180850983,
0.14347267150878906,
0.08306337147951126,
0.04580968618392944,
-0.30624157190322876,
-0.2007569819688797,
-0.209518164396286,
0.46364110708236694,
0.21489641070365906,
0.020729413256049156,
0.1368849128484726,
0.03924186900258064,
0.2280205488204956,
-0.05579992011189461,
-0.017793135717511177,
-0.20619331300258636,
-0.1115354597568512,
0.21581953763961792,
0.23137032985687256,
-0.45764267444610596,
0.108039490878582,
0.17243154346942902,
-0.05200367793440819,
-0.35339945554733276,
0.09464634954929352,
0.17864271998405457,
-0.39935311675071716,
-0.0018289387226104736,
0.1983061134815216,
0.3177965581417084,
0.35887235403060913,
-0.2020881474018097,
-0.16500627994537354,
0.17908066511154175,
0.019783055409789085,
-0.22198118269443512,
-0.1856856644153595,
0.21528181433677673,
0.09709230065345764,
0.365364134311676,
0.4309260845184326,
0.2716347873210907,
-0.1351061463356018,
0.02076234295964241,
-0.12538933753967285,
0.3605048954486847,
-0.08201728761196136,
0.36477652192115784,
0.6909011006355286,
-0.03509772568941116,
0.13601770997047424,
0.5130184292793274,
0.33423349261283875,
-0.05118701606988907,
0.5008969306945801,
0.09542869031429291,
0.009806543588638306,
0.06989635527133942,
-0.2786979377269745,
0.21166428923606873,
-0.39926719665527344,
0.4063541889190674,
-0.23347797989845276,
-0.45667943358421326,
0.04292544722557068,
0.06435119360685349,
0.20851808786392212,
-0.5079792737960815,
0.06941702961921692,
-0.08661490678787231,
0.043320417404174805,
-0.18698535859584808,
-0.5119518041610718,
-0.28024041652679443,
-0.2944986820220947,
0.11907243728637695,
-0.07751493901014328,
-0.05953282117843628,
-0.4034039378166199,
0.2906210124492645,
-0.15717610716819763,
-0.1568179428577423,
-0.23537001013755798,
0.07919901609420776,
-0.07486540079116821,
0.35283613204956055,
-0.16562801599502563,
0.4105294346809387,
0.06688772141933441,
-0.1842726171016693,
0.03456887602806091,
0.3123919367790222,
0.3286196291446686,
0.12927328050136566,
0.282544881105423,
-0.11162900924682617,
0.09288419038057327,
0.0491279736161232,
-0.172651469707489,
0.08687690645456314,
0.16574504971504211,
-0.04318377375602722,
0.3037091791629791,
0.06861136853694916,
-0.09586888551712036,
-0.22919535636901855,
0.3207569122314453,
0.2331058830022812,
-0.5774084329605103,
0.3428031802177429,
-0.17082756757736206,
-0.09653771668672562,
0.23420172929763794,
0.05015368387103081,
-0.4057298004627228,
-0.20044535398483276,
0.5194371938705444,
0.31061357259750366,
-0.0027002841234207153,
-0.2574702501296997,
0.017346300184726715,
0.10406216979026794,
0.3173975348472595,
-0.1598023772239685,
-0.10774902999401093,
-0.21405939757823944,
-0.0890943855047226,
-0.4728654623031616,
0.1110219806432724,
0.13003800809383392,
-0.1859232783317566,
0.1884513944387436,
-0.1365024745464325,
-0.06673906743526459,
-0.25514963269233704,
-0.013498835265636444,
0.1586225926876068,
0.2759278416633606,
0.04000692814588547,
-0.19312089681625366,
-0.29529422521591187,
-0.060213860124349594,
-0.17378298938274384,
0.07664430141448975,
-0.30968189239501953,
0.10917043685913086,
-0.21253296732902527,
-0.05517327040433884,
-0.1419506072998047,
0.25185349583625793,
0.35596075654029846,
-0.1604425013065338,
0.017570413649082184,
-0.10770102590322495,
0.21098484098911285,
0.050345540046691895,
-0.18490783870220184,
-0.2355334311723709,
-0.006976410746574402,
-0.35719048976898193,
0.12801983952522278,
-0.04904711991548538,
0.0935673862695694,
-0.16832879185676575,
-0.3568805456161499,
-0.13944625854492188,
-0.03553798794746399,
0.3812084197998047,
0.06141260266304016,
0.15727072954177856,
0.026195846498012543,
-0.20285893976688385,
-0.08335210382938385,
0.22393593192100525,
0.2519693374633789,
-0.06926038861274719,
0.32794785499572754,
-0.08921744674444199,
-0.44485923647880554,
0.7402093410491943,
-0.05244003236293793,
-0.37806856632232666,
-0.3766045868396759,
0.19468069076538086,
0.01267260778695345,
-0.1355932503938675,
-0.32241272926330566,
-0.005614370107650757,
0.5020325183868408,
-0.17643599212169647,
-0.20527295768260956,
0.11880183964967728,
-0.2561838924884796,
0.018206097185611725,
-0.12368223071098328,
0.052813202142715454,
0.131296768784523,
-0.249192476272583,
-0.0765877515077591,
-0.05023816227912903
] |
https://github.com/huggingface/datasets/issues/6130 | I know why it should be treated as a new config if overriding parameters are passed. But in some case, I just pass in some common fields like `data_dir`.
For example, I want to extend the FolderBasedBuilder as a multi-config version, the `data_dir` or `data_files` are always passed by user and should not be considered as overriding the default config. In current state, I cannot leverage the feature of default config since passing `data_dir` will disable the default config. | default config name doesn't work when config kwargs are specified. | ### Describe the bug
https://github.com/huggingface/datasets/blob/12cfc1196e62847e2e8239fbd727a02cbc86ddec/src/datasets/builder.py#L518-L522
If `config_name` is `None`, `DEFAULT_CONFIG_NAME` should be select. But once users pass `config_kwargs` to their customized `BuilderConfig`, the logic is ignored, and dataset cannot select the default config from multiple configs.
### Steps to reproduce the bug
```python
import datasets
datasets.load_dataset('/dataset/with/multiple/config'') # Ok
datasets.load_dataset('/dataset/with/multiple/config', some_field_in_config='some') # Err
```
### Expected behavior
Default config behavior should be consistent.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3 | 79 | default config name doesn't work when config kwargs are specified.
### Describe the bug
https://github.com/huggingface/datasets/blob/12cfc1196e62847e2e8239fbd727a02cbc86ddec/src/datasets/builder.py#L518-L522
If `config_name` is `None`, `DEFAULT_CONFIG_NAME` should be select. But once users pass `config_kwargs` to their customized `BuilderConfig`, the logic is ignored, and dataset cannot select the default config from multiple configs.
### Steps to reproduce the bug
```python
import datasets
datasets.load_dataset('/dataset/with/multiple/config'') # Ok
datasets.load_dataset('/dataset/with/multiple/config', some_field_in_config='some') # Err
```
### Expected behavior
Default config behavior should be consistent.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
I know why it should be treated as a new config if overriding parameters are passed. But in some case, I just pass in some common fields like `data_dir`.
For example, I want to extend the FolderBasedBuilder as a multi-config version, the `data_dir` or `data_files` are always passed by user and should not be considered as overriding the default config. In current state, I cannot leverage the feature of default config since passing `data_dir` will disable the default config. | [
-0.12708967924118042,
-0.21234175562858582,
0.1321590393781662,
0.14795851707458496,
0.12180255353450775,
-0.05246325582265854,
0.44281354546546936,
-0.0014078514650464058,
-0.013150438666343689,
0.35618332028388977,
0.21070024371147156,
0.5361368656158447,
0.08675235509872437,
0.0556660071015358,
-0.1000031903386116,
0.23843754827976227,
-0.11137665063142776,
-0.08930361270904541,
-0.02746991068124771,
0.04249613732099533,
-0.36987489461898804,
0.16919413208961487,
-0.028438374400138855,
0.12267963588237762,
-0.2720496654510498,
0.24323874711990356,
-0.0864805057644844,
0.23474904894828796,
0.026896245777606964,
-0.28358256816864014,
0.4229065179824829,
0.24028843641281128,
-0.21008263528347015,
0.2921684980392456,
-0.00012630775745492429,
0.112887442111969,
0.3716358542442322,
0.04965132474899292,
-0.32104194164276123,
-0.12976476550102234,
-0.3981051445007324,
-0.08468199521303177,
0.1046680435538292,
-0.306272029876709,
0.0038444101810455322,
0.02153584361076355,
-0.04439491033554077,
-0.17481380701065063,
-0.0012164711952209473,
0.03056378662586212,
0.07080608606338501,
-0.10937447845935822,
-0.12398383766412735,
0.06755854189395905,
-0.36737149953842163,
0.10447383671998978,
-0.15155655145645142,
0.23905296623706818,
-0.25145721435546875,
0.030684657394886017,
0.15421617031097412,
-0.05427992343902588,
-0.14201705157756805,
-0.10727682709693909,
0.30006417632102966,
0.029256809502840042,
0.203220397233963,
0.004012285731732845,
0.2678113281726837,
0.39504578709602356,
0.18213093280792236,
-0.47505301237106323,
-0.22887736558914185,
-0.5701954960823059,
0.2080819457769394,
0.003189951181411743,
0.38167643547058105,
0.006661064922809601,
-0.4312579929828644,
0.09642744064331055,
-0.20430666208267212,
-0.35713261365890503,
0.10659536719322205,
0.251772940158844,
-0.26793983578681946,
0.39576151967048645,
-0.11384917795658112,
0.2946498394012451,
-0.12239625304937363,
-0.05131709203124046,
0.003824148327112198,
-0.7774477601051331,
-0.02417914569377899,
-0.11374512314796448,
-0.19780611991882324,
0.12217926979064941,
0.2410869002342224,
0.19683487713336945,
0.27870461344718933,
0.030070509761571884,
0.0849849060177803,
0.23633985221385956,
0.29052162170410156,
0.1543670892715454,
0.0872621238231659,
0.006137281656265259,
0.3281736373901367,
0.1802264004945755,
0.2548350691795349,
0.027886930853128433,
-0.15825355052947998,
0.03765995427966118,
0.20993845164775848,
-0.07868002355098724,
-0.08915489912033081,
-0.2878691554069519,
0.5887454152107239,
0.066585972905159,
0.13356676697731018,
-0.040441494435071945,
0.10554930567741394,
-0.0345400869846344,
0.3699604868888855,
0.21728748083114624,
-0.2080354243516922,
-0.0007405290380120277,
-0.26191645860671997,
0.16491255164146423,
0.11831804364919662,
0.21318836510181427,
-0.1594085395336151,
-0.521894633769989,
-0.08406345546245575,
0.1259540319442749,
0.15561650693416595,
-0.5391488671302795,
0.45840272307395935,
0.3483527898788452,
0.2560179531574249,
-0.1288026124238968,
-0.1783190369606018,
0.19910912215709686,
-0.09975263476371765,
0.23377621173858643,
-0.2653834819793701,
0.25726842880249023,
0.07193046063184738,
-0.36015990376472473,
-0.18384429812431335,
0.12246597558259964,
-0.3510141968727112,
-0.3202018439769745,
0.10057365894317627,
-0.004913961514830589,
-0.3323371410369873,
0.08017721772193909,
-0.3292573094367981,
0.15777917206287384,
0.3269916772842407,
-0.01889839768409729,
0.02545974776148796,
0.0013030627742409706,
0.1134326383471489,
-0.2934454679489136,
0.32909151911735535,
0.33159613609313965,
0.06697697937488556,
-0.3113095164299011,
0.09956392645835876,
0.10934960097074509,
-0.05676618590950966,
-0.25411665439605713,
-0.46374350786209106,
0.009080424904823303,
-0.22648343443870544,
-0.05793101340532303,
0.4846291244029999,
0.017381496727466583,
-0.3381342887878418,
0.16088837385177612,
0.17081034183502197,
0.26964718103408813,
0.29914578795433044,
-0.19505301117897034,
-0.3713209927082062,
0.038826387375593185,
-0.10046525299549103,
0.2512941062450409,
0.06377820670604706,
0.07559375464916229,
-0.15104544162750244,
-0.4808904826641083,
-0.2286224663257599,
-0.020324572920799255,
0.0026427600532770157,
0.21267762780189514,
-0.13409924507141113,
-0.1671006679534912,
0.2584596872329712,
0.017336055636405945,
-0.13937197625637054,
0.33984026312828064,
0.08624626696109772,
0.07422172278165817,
0.17409884929656982,
-0.01134299486875534,
-0.7073282599449158,
0.34298816323280334,
0.20640617609024048,
-0.23084956407546997,
0.0009061992168426514,
-0.4144534468650818,
-0.12412621080875397,
-0.13298191130161285,
-0.3842494487762451,
0.20377814769744873,
-0.042005907744169235,
0.7381106615066528,
-0.18885178864002228,
-0.15118488669395447,
-0.4508816599845886,
0.2649700939655304,
-0.1317943036556244,
0.2204747051000595,
-0.338025838136673,
0.16488012671470642,
0.041195668280124664,
-0.07756321132183075,
-0.34670859575271606,
0.0874679759144783,
0.15604546666145325,
-0.011331882327795029,
0.09668871760368347,
0.5057815313339233,
0.02734581008553505,
0.184461310505867,
-0.4384298026561737,
-0.07679739594459534,
0.04913254827260971,
0.2832423746585846,
-0.021324509754776955,
0.21418261528015137,
0.03996365889906883,
-0.1098598837852478,
-0.1816292554140091,
0.357097327709198,
0.22035230696201324,
0.3093837797641754,
-0.050555430352687836,
-0.06091216579079628,
-0.1292610466480255,
-0.17889338731765747,
-0.42637383937835693,
-0.2550312876701355,
-0.3958075940608978,
-0.23872748017311096,
0.45035067200660706,
0.24770626425743103,
-0.49478083848953247,
-0.20236006379127502,
0.4671283960342407,
0.18804556131362915,
-0.08345977216959,
-0.03382197022438049,
0.06872965395450592,
0.13511833548545837,
0.16590999066829681,
0.2787964344024658,
0.3363006114959717,
0.11861271411180496,
0.03952319547533989,
-0.0657823234796524,
-0.3850139379501343,
-0.09893693029880524,
0.16626352071762085,
0.22467684745788574,
0.11637237668037415,
0.2946985960006714,
0.05204838886857033,
-0.10837383568286896,
-0.2987421751022339,
-0.007764875888824463,
0.3519629240036011,
-0.18138694763183594,
-0.3628004193305969,
0.2340157926082611,
-0.3028219938278198,
-0.06219038739800453,
-0.16403716802597046,
-0.3374174237251282,
-0.3009079694747925,
-0.33360227942466736,
-0.2535666227340698,
0.20490705966949463,
-0.08850834518671036,
0.306209921836853,
-0.14953449368476868,
0.26185256242752075,
-0.16725067794322968,
-0.5882622599601746,
-0.3208867013454437,
0.1942884624004364,
-0.2654135227203369,
-0.15880075097084045,
0.02504553273320198,
-0.3735983371734619,
-0.09792156517505646,
0.1754266917705536,
-0.22359822690486908,
-0.1758839190006256,
-0.30283063650131226,
0.17402943968772888,
-0.052302174270153046,
0.7031489610671997,
0.2814766764640808,
-0.05941290780901909,
0.08899027109146118,
-0.3583837151527405,
0.32620179653167725,
0.46713322401046753,
0.18598824739456177,
0.10021430999040604,
0.28853267431259155,
0.002045460045337677,
-0.2142065465450287,
0.06297511607408524,
0.15134534239768982,
-0.11747999489307404,
0.035745032131671906,
0.008984096348285675,
0.049425993114709854,
0.732491135597229,
0.1597977876663208,
-0.04602547362446785,
-0.34664878249168396,
0.2092173993587494,
-0.0212648157030344,
-0.2841801047325134,
0.21899157762527466,
-0.0815403163433075,
-0.07187452912330627,
-0.44395124912261963,
-0.05958184972405434,
0.32010695338249207,
-0.028404997661709785,
-0.39668676257133484,
-0.20146840810775757,
-0.2482149749994278,
0.4984768331050873,
0.12025861442089081,
0.25035908818244934,
-0.11007414758205414,
0.33434808254241943,
0.09984023123979568,
-0.2192808985710144,
-0.2600761950016022,
0.23303869366645813,
0.11568861454725266,
0.3255329430103302,
0.4884234070777893,
0.10786610841751099,
-0.00554356724023819,
0.5530831813812256,
0.3150423467159271,
-0.09004995226860046,
0.3289731740951538,
-0.3682926595211029,
0.432156503200531,
-0.004420235753059387,
-0.4723489582538605,
-0.016706284135580063,
0.31829026341438293,
0.28579244017601013,
0.18985535204410553,
0.08746174722909927,
0.16189968585968018,
-0.18416717648506165,
-0.11915367841720581,
0.00035506486892700195,
-0.44670382142066956,
-0.24756765365600586,
-0.17855535447597504,
0.016121091321110725,
0.33566659688949585,
0.22652611136436462,
-0.1872578263282776,
-0.056094665080308914,
-0.04672510549426079,
0.42517709732055664,
-0.2958757281303406,
0.06537915766239166,
-0.08756954967975616,
0.07671764492988586,
-0.05713730305433273,
0.14717531204223633,
-0.11490079760551453,
0.060648687183856964,
0.16862592101097107,
0.10265710204839706,
0.18732860684394836,
-0.023387771099805832,
0.5708750486373901,
-0.11073166131973267,
0.02124563604593277,
0.26200437545776367,
0.08675926923751831,
-0.33671584725379944,
-0.1587521731853485,
0.2043493688106537,
0.06924398243427277,
0.10301358252763748,
0.3505532741546631,
-0.46985137462615967,
-0.3642319440841675,
-0.05490633472800255,
0.19525009393692017,
-0.03354261815547943,
-0.053493913263082504,
-0.34718719124794006,
-0.24882470071315765,
-0.011310581117868423,
-0.23277202248573303,
-0.23278146982192993,
0.212349995970726,
-0.11807061731815338,
0.15090593695640564,
-0.2563494145870209,
-0.140192911028862,
0.023875832557678223,
0.27644142508506775,
0.19984139502048492,
-0.05601704493165016,
0.17213936150074005,
-0.09094347059726715,
0.04579181224107742,
0.22645215690135956,
0.4239307940006256,
-0.04870009422302246,
-0.10284453630447388,
-0.17936517298221588,
-0.10720419883728027,
0.41733795404434204,
0.3407665491104126,
-0.36858826875686646,
0.10889624059200287,
0.03772994130849838,
0.03145250678062439,
0.042943112552165985,
-0.01772977039217949,
0.38118353486061096,
0.05059477686882019,
-0.20103567838668823,
-0.6231722235679626,
0.6693130731582642,
0.03656620532274246,
-0.2879713773727417,
0.47580665349960327,
0.5632098913192749,
-0.4541066884994507,
0.06639847159385681,
-0.26027122139930725,
0.62498939037323,
0.4000176191329956,
0.1256762146949768,
0.2544308602809906,
-0.02292685955762863,
0.1779261827468872,
0.2933429479598999,
0.19759956002235413,
-0.252372682094574,
0.1459532380104065,
0.16154411435127258,
-0.09143277257680893,
0.6270204186439514,
0.393634170293808,
-0.09804479032754898,
0.09872587025165558,
-0.060984909534454346,
0.2559868395328522,
-0.006562031805515289,
0.32421866059303284,
-0.41138917207717896,
-0.05399574711918831,
-0.20506608486175537,
-0.05139618366956711,
-0.1416860818862915,
0.1912294328212738,
0.19722698628902435,
-0.17706045508384705,
0.04809346795082092,
-0.3538253903388977,
-0.022916443645954132,
-0.007726803421974182,
-0.18396316468715668,
-0.09120061993598938,
0.2831864058971405,
-0.1613815426826477,
0.08620651066303253,
0.3434506058692932,
0.2551001310348511,
0.4416232407093048,
-0.16092777252197266,
0.11270658671855927,
-0.048453815281391144,
0.16118592023849487,
-0.14008235931396484,
-0.05262882634997368,
0.29657092690467834,
0.09202231466770172,
-0.3526703119277954,
-0.13258682191371918,
-0.012843117117881775,
-0.14068275690078735,
-0.017345666885375977,
-0.00013830699026584625,
0.10945342481136322,
-0.36003920435905457,
-0.06229373812675476,
-0.14285391569137573,
0.21355682611465454,
-0.2650623321533203,
0.009463392198085785,
-0.13569007813930511,
-0.0708048865199089,
0.5044664144515991,
-0.08416294306516647,
-0.20412200689315796,
-0.14267447590827942,
0.308035284280777,
-0.21393300592899323,
0.0689106285572052,
0.5183621644973755,
-0.5551318526268005,
0.011795036494731903,
0.11572576314210892,
0.3683801591396332,
0.035328615456819534,
-0.10970981419086456,
-0.01973959058523178,
0.09602119028568268,
-0.060202911496162415,
0.18516971170902252,
0.41970309615135193,
0.003968322183936834,
0.0932493805885315,
-0.1508057415485382,
-0.06992344558238983,
0.005484350025653839,
0.12270002067089081,
0.11695116758346558,
0.23109862208366394,
0.0272584930062294,
0.05786865949630737,
0.04350995272397995,
-0.05410314351320267,
-0.1650586724281311,
0.015718869864940643,
-0.05076822638511658,
0.12020887434482574,
0.013970889151096344,
0.32917970418930054,
-0.08105800300836563,
-0.08005443215370178,
0.10269665718078613,
-0.27886101603507996,
-0.02627440355718136,
-0.05281949043273926,
-0.38216865062713623,
0.20973463356494904,
0.18677113950252533,
0.18455848097801208,
-0.017244748771190643,
-0.31555014848709106,
-0.22078266739845276,
-0.19510501623153687,
0.46833574771881104,
0.20057177543640137,
0.03808782994747162,
0.16553646326065063,
0.05830782651901245,
0.2077248990535736,
-0.09027319401502609,
-0.09497594833374023,
-0.2253219336271286,
-0.08360493183135986,
0.18549969792366028,
0.2660413086414337,
-0.44413813948631287,
0.11236649751663208,
0.05704154819250107,
-0.07351116091012955,
-0.2142999917268753,
0.07191838324069977,
0.17234301567077637,
-0.29767081141471863,
0.006645374000072479,
0.2668903172016144,
0.2692830562591553,
0.35536980628967285,
-0.1816917210817337,
-0.09546631574630737,
0.19451390206813812,
-0.03636418282985687,
-0.197320818901062,
-0.11043736338615417,
0.21807019412517548,
0.06581325083971024,
0.42949581146240234,
0.5798041820526123,
0.26113560795783997,
-0.16927862167358398,
0.046846140176057816,
-0.27302300930023193,
0.3692963421344757,
-0.10950659215450287,
0.37163710594177246,
0.7511556148529053,
-0.06073319911956787,
0.11357177793979645,
0.5591089725494385,
0.3653929829597473,
0.010487906634807587,
0.4948989450931549,
0.06913811713457108,
-0.04124661535024643,
0.0359438993036747,
-0.3025089502334595,
0.2007255107164383,
-0.42900875210762024,
0.5315926671028137,
-0.25878995656967163,
-0.3601438105106354,
0.010046958923339844,
-0.0340006984770298,
0.09127510339021683,
-0.5107479691505432,
0.11090204119682312,
-0.08378831297159195,
0.1024755984544754,
-0.14789816737174988,
-0.4809104800224304,
-0.3089633584022522,
-0.2772409915924072,
0.12835054099559784,
-0.19203099608421326,
-0.06353815644979477,
-0.3245384395122528,
0.34146004915237427,
-0.1340303122997284,
-0.11826831102371216,
-0.14141230285167694,
0.03856072202324867,
-0.08914103358983994,
0.3421352803707123,
-0.2480713576078415,
0.34967711567878723,
-0.009620368480682373,
-0.09694261848926544,
-0.0347890742123127,
0.3245347738265991,
0.28325679898262024,
0.13551919162273407,
0.23186828196048737,
-0.1434270292520523,
0.13983502984046936,
0.02819935232400894,
-0.17199809849262238,
0.1200740709900856,
0.24999818205833435,
0.0005029784515500069,
0.34879618883132935,
0.049899328500032425,
-0.08457019925117493,
-0.28241628408432007,
0.2939223647117615,
0.17548486590385437,
-0.6416180729866028,
0.3391419053077698,
-0.05643302574753761,
-0.10159409791231155,
0.4045189619064331,
0.05689389258623123,
-0.3944393992424011,
-0.288257896900177,
0.6269266605377197,
0.2536199986934662,
0.029670845717191696,
-0.2500063180923462,
0.010684430599212646,
0.2056187391281128,
0.30296117067337036,
-0.11357039958238602,
-0.14625541865825653,
-0.1894037127494812,
0.015115708112716675,
-0.416640043258667,
0.05421243607997894,
-0.004964789841324091,
-0.15510347485542297,
0.178242027759552,
-0.03218323737382889,
0.0385579839348793,
-0.18646268546581268,
-0.019261762499809265,
0.08634720742702484,
0.24846616387367249,
0.0479782409965992,
-0.10500314831733704,
-0.34077921509742737,
-0.0024459529668092728,
-0.12022886425256729,
0.10666335374116898,
-0.3909347355365753,
0.14209838211536407,
-0.1135280579328537,
-0.08240785449743271,
-0.1381225883960724,
0.21142707765102386,
0.47778576612472534,
-0.11173222213983536,
0.001959865912795067,
-0.09958450496196747,
0.20469582080841064,
0.06399311125278473,
-0.28551170229911804,
-0.2848067283630371,
0.02231292426586151,
-0.282309353351593,
0.04897439852356911,
-0.09422647953033447,
0.05025970935821533,
-0.2049551010131836,
-0.28726422786712646,
-0.18797896802425385,
-0.08742600679397583,
0.39534392952919006,
0.007239997386932373,
0.18330973386764526,
0.072176493704319,
-0.22692471742630005,
-0.11076147109270096,
0.18803063035011292,
0.2633112370967865,
-0.10013377666473389,
0.3639848828315735,
-0.07285856455564499,
-0.36659812927246094,
0.7575011253356934,
0.030471056699752808,
-0.3378751873970032,
-0.41578683257102966,
0.23496057093143463,
-0.11327798664569855,
-0.13380132615566254,
-0.3100593090057373,
0.0193340927362442,
0.5511842966079712,
-0.1107611358165741,
-0.21521435678005219,
0.0067222826182842255,
-0.23707009851932526,
-0.03518674522638321,
-0.16635987162590027,
0.05999891459941864,
-0.025113545358181,
-0.19302093982696533,
-0.04712526500225067,
-0.017269883304834366
] |
https://github.com/huggingface/datasets/issues/6130 | Thinking more about it I think the current behavior is the right one.
Provided parameters should be passed to instantiate a new BuilderConfig.
What's the error you're getting ? | default config name doesn't work when config kwargs are specified. | ### Describe the bug
https://github.com/huggingface/datasets/blob/12cfc1196e62847e2e8239fbd727a02cbc86ddec/src/datasets/builder.py#L518-L522
If `config_name` is `None`, `DEFAULT_CONFIG_NAME` should be select. But once users pass `config_kwargs` to their customized `BuilderConfig`, the logic is ignored, and dataset cannot select the default config from multiple configs.
### Steps to reproduce the bug
```python
import datasets
datasets.load_dataset('/dataset/with/multiple/config'') # Ok
datasets.load_dataset('/dataset/with/multiple/config', some_field_in_config='some') # Err
```
### Expected behavior
Default config behavior should be consistent.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3 | 29 | default config name doesn't work when config kwargs are specified.
### Describe the bug
https://github.com/huggingface/datasets/blob/12cfc1196e62847e2e8239fbd727a02cbc86ddec/src/datasets/builder.py#L518-L522
If `config_name` is `None`, `DEFAULT_CONFIG_NAME` should be select. But once users pass `config_kwargs` to their customized `BuilderConfig`, the logic is ignored, and dataset cannot select the default config from multiple configs.
### Steps to reproduce the bug
```python
import datasets
datasets.load_dataset('/dataset/with/multiple/config'') # Ok
datasets.load_dataset('/dataset/with/multiple/config', some_field_in_config='some') # Err
```
### Expected behavior
Default config behavior should be consistent.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
Thinking more about it I think the current behavior is the right one.
Provided parameters should be passed to instantiate a new BuilderConfig.
What's the error you're getting ? | [
-0.17760102450847626,
-0.22203543782234192,
0.10286201536655426,
0.12729883193969727,
0.16383600234985352,
-0.03337372839450836,
0.4383702874183655,
0.018997512757778168,
0.012134909629821777,
0.43914103507995605,
0.14752230048179626,
0.49687460064888,
0.14622309803962708,
0.13720016181468964,
-0.03187024965882301,
0.1406765580177307,
-0.11928529292345047,
0.09493722766637802,
-0.09924134612083435,
0.07744360715150833,
-0.29960665106773376,
0.2820234000682831,
-0.07764367759227753,
0.1564258635044098,
-0.2929704189300537,
0.207577183842659,
-0.10466231405735016,
0.23263712227344513,
0.010539516806602478,
-0.4376263916492462,
0.519411027431488,
0.24653640389442444,
-0.17442438006401062,
0.35577112436294556,
-0.00012050597433699295,
0.057491734623909,
0.464242547750473,
0.02133064717054367,
-0.30374231934547424,
-0.29449430108070374,
-0.3987392783164978,
-0.12941449880599976,
0.10211537033319473,
-0.3379333019256592,
-0.15082238614559174,
0.028105009347200394,
0.09245513379573822,
-0.18111872673034668,
0.04652935639023781,
0.03195210173726082,
0.15019088983535767,
0.05848030745983124,
0.0012311115860939026,
-0.056348346173763275,
-0.3956508934497833,
0.09046077728271484,
-0.07335801422595978,
0.2475740611553192,
-0.24612893164157867,
-0.05487432703375816,
0.0983494222164154,
-0.024996692314743996,
-0.10505448281764984,
-0.077297642827034,
0.3895484209060669,
0.14183872938156128,
0.14833904802799225,
-0.12971511483192444,
0.17401090264320374,
0.4497185945510864,
0.31602174043655396,
-0.5123251676559448,
-0.14335668087005615,
-0.5301716923713684,
0.19410784542560577,
-0.009426891803741455,
0.33931031823158264,
0.05985241383314133,
-0.5047526955604553,
0.06021231412887573,
-0.18791818618774414,
-0.2591743767261505,
0.07500112056732178,
0.11964359134435654,
-0.25938332080841064,
0.4683579206466675,
-0.13452842831611633,
0.1663653552532196,
-0.11343139410018921,
-0.0643666684627533,
-0.012932131066918373,
-0.6825820803642273,
-0.04765100032091141,
-0.0047264378517866135,
-0.22226522862911224,
0.11136197298765182,
0.2868845462799072,
0.3227198123931885,
0.22612810134887695,
-0.049857255071401596,
-0.0706164538860321,
0.13277313113212585,
0.3396471440792084,
0.15256795287132263,
-0.001265222206711769,
0.14102526009082794,
0.3867682218551636,
0.08208063244819641,
0.20773819088935852,
0.19995439052581787,
-0.2121562659740448,
0.06768574565649033,
0.17683495581150055,
-0.16832681000232697,
-0.046766333281993866,
-0.3188181519508362,
0.5047471523284912,
0.08978481590747833,
0.059848666191101074,
0.03461470082402229,
0.021778762340545654,
-0.07362831383943558,
0.34014347195625305,
0.32284921407699585,
-0.3055465817451477,
-0.044414881616830826,
-0.17683321237564087,
0.17341046035289764,
0.005542322993278503,
0.19337305426597595,
-0.27721738815307617,
-0.3583293557167053,
-0.05997087433934212,
0.046154893934726715,
0.09856835752725601,
-0.583264946937561,
0.43940412998199463,
0.342830091714859,
0.2522403597831726,
-0.08672348409891129,
-0.26312288641929626,
0.3329952359199524,
-0.17810654640197754,
0.20009766519069672,
-0.22536954283714294,
0.21014122664928436,
0.07229852676391602,
-0.4078019857406616,
-0.1798074096441269,
0.051563434302806854,
-0.3082941770553589,
-0.34376999735832214,
0.010171104222536087,
0.08726193010807037,
-0.3291228413581848,
0.053306322544813156,
-0.2569108307361603,
0.23184669017791748,
0.30974334478378296,
0.07329745590686798,
-0.07229605317115784,
-0.02167395129799843,
0.03128071129322052,
-0.3100604712963104,
0.4066174626350403,
0.3796469569206238,
0.044959887862205505,
-0.28361886739730835,
0.15381407737731934,
0.04335026815533638,
-0.09008726477622986,
-0.3378521502017975,
-0.3545137643814087,
0.1274467259645462,
-0.16907349228858948,
0.07945054769515991,
0.3104635179042816,
-0.02414786070585251,
-0.26733624935150146,
0.09631577134132385,
0.18103140592575073,
0.25303539633750916,
0.23018306493759155,
-0.176105797290802,
-0.3983994126319885,
0.03658169507980347,
-0.046219006180763245,
0.19960513710975647,
0.089830182492733,
0.12180719524621964,
-0.14831137657165527,
-0.4801497757434845,
-0.22486375272274017,
0.03406475484371185,
-0.04237857833504677,
0.24751585721969604,
-0.1394159197807312,
-0.2070663422346115,
0.2902589738368988,
-0.020285088568925858,
-0.15871550142765045,
0.30534517765045166,
0.22208236157894135,
0.08048586547374725,
0.12834222614765167,
0.01689916104078293,
-0.7010300755500793,
0.40006792545318604,
0.07719457894563675,
-0.05186603218317032,
-0.10084716975688934,
-0.2794642448425293,
-0.2084064483642578,
-0.05500155687332153,
-0.43043169379234314,
0.10284227877855301,
0.05371803417801857,
0.5730575323104858,
-0.05815012753009796,
-0.0025880560278892517,
-0.45468980073928833,
0.2966592609882355,
-0.052214935421943665,
0.25728848576545715,
-0.4493252635002136,
0.2445044219493866,
0.07772605121135712,
-0.06589681655168533,
-0.19460603594779968,
0.15920338034629822,
0.13372980058193207,
-0.01202709786593914,
0.08120013028383255,
0.5083467364311218,
-0.06969800591468811,
0.1890048384666443,
-0.3852837085723877,
-0.14925745129585266,
0.055803798139095306,
0.1766490340232849,
-0.042587749660015106,
0.18185824155807495,
0.07220013439655304,
-0.05624636262655258,
-0.1553717702627182,
0.40841713547706604,
0.20316673815250397,
0.2597413659095764,
-0.10236255079507828,
-0.06329374760389328,
-0.08178568631410599,
-0.14999158680438995,
-0.3279750943183899,
-0.2326282560825348,
-0.2348034530878067,
-0.2197965383529663,
0.49280720949172974,
0.21768300235271454,
-0.47915273904800415,
-0.2115592509508133,
0.35901308059692383,
0.16191139817237854,
-0.1294555366039276,
-0.07317951321601868,
0.14606429636478424,
0.1602158099412918,
0.21269023418426514,
0.19667592644691467,
0.38618606328964233,
0.16342966258525848,
-0.10058847069740295,
0.027457548305392265,
-0.453828901052475,
-0.10789097845554352,
0.1475888192653656,
0.10704738646745682,
0.16398316621780396,
0.18801379203796387,
0.05181350186467171,
-0.12675338983535767,
-0.31577515602111816,
-0.050023484975099564,
0.18689735233783722,
-0.07969312369823456,
-0.26058658957481384,
0.1424175500869751,
-0.233789324760437,
-0.11077642440795898,
-0.13554486632347107,
-0.3239944577217102,
-0.4031990170478821,
-0.3282056152820587,
-0.22222721576690674,
0.11054548621177673,
-0.09988289326429367,
0.34168490767478943,
-0.08853340148925781,
0.20810604095458984,
-0.20771631598472595,
-0.4092923104763031,
-0.29087379574775696,
0.10402791202068329,
-0.20846077799797058,
-0.10566413402557373,
0.028393231332302094,
-0.2774411737918854,
-0.0715591236948967,
0.09012109041213989,
-0.22171980142593384,
-0.024564100429415703,
-0.281974732875824,
0.19017909467220306,
-0.08286414295434952,
0.6769357919692993,
0.31345266103744507,
0.010361511260271072,
0.11456938087940216,
-0.33320412039756775,
0.4531593918800354,
0.49079185724258423,
0.08301718533039093,
0.09309211373329163,
0.2481473684310913,
-0.1214907243847847,
-0.08936142176389694,
0.052605196833610535,
0.03634815663099289,
-0.17751064896583557,
0.0571182481944561,
0.08258238434791565,
0.011705603450536728,
0.6262252330780029,
0.19306161999702454,
-0.08107881247997284,
-0.37139204144477844,
0.1937985122203827,
0.054600607603788376,
-0.353831946849823,
0.22805389761924744,
-0.09804260730743408,
-0.10414429754018784,
-0.37777185440063477,
-0.11111518740653992,
0.39820271730422974,
-0.2305268496274948,
-0.4601837992668152,
-0.15685930848121643,
-0.37879249453544617,
0.5014157295227051,
0.1690414845943451,
0.2989482283592224,
-0.09161029756069183,
0.29621466994285583,
0.03847745805978775,
-0.20756438374519348,
-0.3016022741794586,
0.3519366383552551,
0.08433160185813904,
0.3267100155353546,
0.48201778531074524,
0.13042676448822021,
-0.08136367797851562,
0.48815080523490906,
0.3967238664627075,
-0.16581115126609802,
0.30124908685684204,
-0.34623661637306213,
0.45413199067115784,
-0.06009456142783165,
-0.4944700002670288,
0.03156360611319542,
0.33948108553886414,
0.2535705268383026,
0.21373382210731506,
0.07688705623149872,
0.13432273268699646,
-0.3275895118713379,
-0.1091175451874733,
-0.008372239768505096,
-0.42914682626724243,
-0.31552445888519287,
-0.13001395761966705,
0.03366337716579437,
0.3132111430168152,
0.18910923600196838,
-0.151788130402565,
-0.09834274649620056,
-0.07849548012018204,
0.3104645609855652,
-0.26518046855926514,
0.053735896944999695,
-0.15097488462924957,
0.04995587840676308,
-0.17422015964984894,
0.18961483240127563,
-0.10773178935050964,
-0.033586591482162476,
0.16757237911224365,
0.11345025897026062,
0.2337685525417328,
0.008770272135734558,
0.46290045976638794,
-0.0671137273311615,
-0.005810676142573357,
0.23853211104869843,
0.12728239595890045,
-0.3387836813926697,
-0.14415299892425537,
0.2775746285915375,
0.061678145080804825,
0.08283117413520813,
0.2674862742424011,
-0.5568374991416931,
-0.35108640789985657,
-0.03865906596183777,
0.19784021377563477,
-0.08456908166408539,
-0.21337242424488068,
-0.3913264870643616,
-0.2516241669654846,
0.007971875369548798,
-0.13420072197914124,
-0.24995991587638855,
0.44144150614738464,
-0.05029090493917465,
0.15017083287239075,
-0.14471077919006348,
-0.17168885469436646,
0.034969352185726166,
0.2700203061103821,
0.240139439702034,
-0.08214174211025238,
0.21219630539417267,
-0.03810456767678261,
0.06533071398735046,
0.1250104159116745,
0.5132662653923035,
-0.09961453080177307,
-0.19844429194927216,
-0.18239441514015198,
-0.019999392330646515,
0.38756948709487915,
0.3862864375114441,
-0.31174421310424805,
0.025231720879673958,
0.11669491231441498,
0.20175349712371826,
-0.017133202403783798,
0.012036453932523727,
0.3472656309604645,
0.09731657058000565,
-0.2687259316444397,
-0.5210412740707397,
0.7011808156967163,
-0.13303056359291077,
-0.14154714345932007,
0.4364299476146698,
0.5283573865890503,
-0.442196786403656,
0.07780177146196365,
-0.21001817286014557,
0.687631368637085,
0.4455812871456146,
0.09152935445308685,
0.30338457226753235,
-0.09163570404052734,
0.29128050804138184,
0.23688483238220215,
0.20210358500480652,
-0.496111124753952,
0.12680557370185852,
0.14279238879680634,
-0.0714329183101654,
0.45982295274734497,
0.32531455159187317,
-0.07978426665067673,
0.022863391786813736,
-0.002714216709136963,
0.3046656847000122,
-0.05094118043780327,
0.28346455097198486,
-0.46697109937667847,
-0.16887731850147247,
-0.3139011263847351,
0.004520222544670105,
-0.13549014925956726,
0.33881691098213196,
0.10912853479385376,
-0.18617214262485504,
0.08980745077133179,
-0.2337932586669922,
-0.15298935770988464,
0.053349897265434265,
-0.25803080201148987,
-0.00741216167807579,
0.43809741735458374,
-0.1523173749446869,
0.04632530361413956,
0.39164304733276367,
0.3326917886734009,
0.45162612199783325,
-0.2512052059173584,
0.1759476214647293,
-0.07301461696624756,
0.16017532348632812,
-0.04787838086485863,
0.0035456642508506775,
0.33995190262794495,
0.03390919417142868,
-0.3595283031463623,
-0.08908206224441528,
-0.004073314368724823,
-0.06996332108974457,
-0.1442764699459076,
-0.04726520553231239,
0.01233532465994358,
-0.338191419839859,
-0.16536977887153625,
-0.11931911110877991,
0.3831484019756317,
-0.2501431703567505,
0.09428954124450684,
-0.039097655564546585,
-0.11029888689517975,
0.4612223207950592,
-0.1423383355140686,
-0.1769053339958191,
-0.15239167213439941,
0.31236088275909424,
-0.22514061629772186,
-0.0021590963006019592,
0.4502919912338257,
-0.34033361077308655,
-0.08666236698627472,
0.02891875058412552,
0.339819073677063,
0.1512630581855774,
-0.23525726795196533,
-0.027120836079120636,
0.1705881804227829,
-0.04162658751010895,
0.07322889566421509,
0.4763592481613159,
0.017736155539751053,
-0.041908297687768936,
0.03370538353919983,
-0.0497320219874382,
-0.050418052822351456,
0.1458614021539688,
0.16333302855491638,
0.27113476395606995,
0.003641955554485321,
0.0926351398229599,
0.12659740447998047,
-0.04782045632600784,
-0.24295437335968018,
0.005461446940898895,
-0.08350727707147598,
0.05909514054656029,
0.043547824025154114,
0.3039536476135254,
-0.05465104058384895,
-0.1564793437719345,
0.18203189969062805,
-0.21192236244678497,
-0.1635936051607132,
-0.1452351063489914,
-0.364040732383728,
0.17967870831489563,
0.18236501514911652,
0.14004483819007874,
0.03344850614666939,
-0.292589008808136,
-0.18585257232189178,
-0.2890852689743042,
0.4383106827735901,
0.24748440086841583,
-0.00845116376876831,
0.08180274814367294,
0.1095414087176323,
0.17521916329860687,
-0.03480951860547066,
-0.006216268986463547,
-0.13159850239753723,
-0.07126711308956146,
0.2664591670036316,
0.15544503927230835,
-0.48967018723487854,
0.09420593082904816,
0.24379423260688782,
0.005399079993367195,
-0.3303079307079315,
0.140712708234787,
0.18081089854240417,
-0.37050285935401917,
-0.0164659321308136,
0.17011460661888123,
0.374641090631485,
0.28743624687194824,
-0.2018066942691803,
-0.028554610908031464,
0.1885848343372345,
0.0791209265589714,
-0.27757811546325684,
-0.12057053297758102,
0.2703257203102112,
0.07926832884550095,
0.3466339111328125,
0.46664056181907654,
0.25406965613365173,
-0.09131443500518799,
-0.01323850080370903,
-0.11872537434101105,
0.34291040897369385,
-0.12995724380016327,
0.34654131531715393,
0.6207219958305359,
-0.031831078231334686,
0.15039870142936707,
0.5579295754432678,
0.3384783864021301,
0.0017134621739387512,
0.4903431534767151,
0.0481177382171154,
-0.018220825120806694,
-0.010576684027910233,
-0.19233256578445435,
0.1638081669807434,
-0.3753744065761566,
0.40999913215637207,
-0.2610258460044861,
-0.4194824695587158,
-0.09439483284950256,
-0.061959367245435715,
0.2629232704639435,
-0.5445921421051025,
0.046609971672296524,
-0.17709308862686157,
0.1476297676563263,
-0.185217022895813,
-0.4567996561527252,
-0.2662341296672821,
-0.29294025897979736,
0.17016060650348663,
-0.11512143164873123,
-0.02376394346356392,
-0.41589266061782837,
0.25243911147117615,
-0.1465410590171814,
-0.11042071878910065,
-0.2556794583797455,
0.07326817512512207,
-0.058985210955142975,
0.3155600428581238,
-0.17364469170570374,
0.30759552121162415,
0.039899908006191254,
-0.15129989385604858,
-0.0566399060189724,
0.36795514822006226,
0.4067763388156891,
0.17101803421974182,
0.19000929594039917,
-0.11885720491409302,
0.10678067803382874,
0.02305372804403305,
-0.16132140159606934,
0.06132477521896362,
0.17882084846496582,
-0.010538185015320778,
0.3196883797645569,
0.14322881400585175,
-0.1352306455373764,
-0.2969507873058319,
0.33206894993782043,
0.2709082067012787,
-0.5248106122016907,
0.29428550601005554,
-0.13558605313301086,
-0.06588967144489288,
0.20800092816352844,
0.08679169416427612,
-0.4502078890800476,
-0.15080119669437408,
0.49816471338272095,
0.20767411589622498,
0.06480932235717773,
-0.3117811381816864,
0.04901369661092758,
0.16084955632686615,
0.22543136775493622,
-0.11547505855560303,
-0.06306877732276917,
-0.28284797072410583,
-0.08335354924201965,
-0.503018856048584,
-0.0009704083204269409,
0.06235319375991821,
-0.17405161261558533,
0.13302819430828094,
-0.0429081991314888,
-0.036546289920806885,
-0.15287280082702637,
-0.09299022704362869,
0.16379401087760925,
0.2242600917816162,
0.021590840071439743,
-0.19440357387065887,
-0.3063771426677704,
-0.04800067096948624,
-0.16326256096363068,
0.07959599792957306,
-0.2511381506919861,
0.058171503245830536,
-0.24022901058197021,
-0.013661704957485199,
-0.11657962203025818,
0.30665674805641174,
0.3944208025932312,
-0.17885640263557434,
-0.05740884691476822,
-0.14876875281333923,
0.1845933198928833,
0.04456052929162979,
-0.1996264010667801,
-0.2995261549949646,
-0.06964796781539917,
-0.29794973134994507,
0.10610626637935638,
-0.0545525886118412,
0.15493451058864594,
-0.15796010196208954,
-0.2949511408805847,
-0.26475366950035095,
-0.031595803797245026,
0.41927623748779297,
0.05408400297164917,
0.139055073261261,
0.044402360916137695,
-0.1987728476524353,
-0.032087743282318115,
0.21788932383060455,
0.2603074014186859,
-0.0838988646864891,
0.3975673019886017,
-0.07561958581209183,
-0.49388831853866577,
0.7786546349525452,
-0.05855484679341316,
-0.37514472007751465,
-0.28619012236595154,
0.17341892421245575,
0.011065052822232246,
-0.12675020098686218,
-0.3033547103404999,
0.08205065131187439,
0.4857001304626465,
-0.2040622979402542,
-0.22220125794410706,
0.08592256158590317,
-0.2139420509338379,
0.02786111831665039,
-0.10170777887105942,
0.0651433914899826,
0.12526625394821167,
-0.218189537525177,
-0.09298669546842575,
-0.019469182938337326
] |
https://github.com/huggingface/datasets/issues/6130 | For example, this works to use default config with name '_all_':
```python
datasets.load_dataset("indonesian-nlp/librivox-indonesia", split="train")
```
while this failed to use default config
```python
datasets.load_dataset("indonesian-nlp/librivox-indonesia", split="train", data_dir='.')
```
After manually specifying it, it works again.
```python
datasets.load_dataset("indonesian-nlp/librivox-indonesia", "_all_", split="train", data_dir='.')
``` | default config name doesn't work when config kwargs are specified. | ### Describe the bug
https://github.com/huggingface/datasets/blob/12cfc1196e62847e2e8239fbd727a02cbc86ddec/src/datasets/builder.py#L518-L522
If `config_name` is `None`, `DEFAULT_CONFIG_NAME` should be select. But once users pass `config_kwargs` to their customized `BuilderConfig`, the logic is ignored, and dataset cannot select the default config from multiple configs.
### Steps to reproduce the bug
```python
import datasets
datasets.load_dataset('/dataset/with/multiple/config'') # Ok
datasets.load_dataset('/dataset/with/multiple/config', some_field_in_config='some') # Err
```
### Expected behavior
Default config behavior should be consistent.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3 | 40 | default config name doesn't work when config kwargs are specified.
### Describe the bug
https://github.com/huggingface/datasets/blob/12cfc1196e62847e2e8239fbd727a02cbc86ddec/src/datasets/builder.py#L518-L522
If `config_name` is `None`, `DEFAULT_CONFIG_NAME` should be select. But once users pass `config_kwargs` to their customized `BuilderConfig`, the logic is ignored, and dataset cannot select the default config from multiple configs.
### Steps to reproduce the bug
```python
import datasets
datasets.load_dataset('/dataset/with/multiple/config'') # Ok
datasets.load_dataset('/dataset/with/multiple/config', some_field_in_config='some') # Err
```
### Expected behavior
Default config behavior should be consistent.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
For example, this works to use default config with name '_all_':
```python
datasets.load_dataset("indonesian-nlp/librivox-indonesia", split="train")
```
while this failed to use default config
```python
datasets.load_dataset("indonesian-nlp/librivox-indonesia", split="train", data_dir='.')
```
After manually specifying it, it works again.
```python
datasets.load_dataset("indonesian-nlp/librivox-indonesia", "_all_", split="train", data_dir='.')
``` | [
-0.16069497168064117,
-0.18930847942829132,
0.122981496155262,
0.16191743314266205,
0.23092788457870483,
0.00657045841217041,
0.43682047724723816,
0.05664052441716194,
0.008178375661373138,
0.43072617053985596,
0.1161964163184166,
0.478816419839859,
0.16797824203968048,
0.14446407556533813,
-0.038254015147686005,
0.07004056870937347,
-0.12018141895532608,
0.09521991014480591,
-0.05762871727347374,
0.10184100270271301,
-0.31759217381477356,
0.3441040515899658,
-0.09323397278785706,
0.10711628943681717,
-0.28779178857803345,
0.3071931004524231,
-0.09037557989358902,
0.20761749148368835,
0.10216409713029861,
-0.43972933292388916,
0.5274351835250854,
0.18463927507400513,
-0.2018861472606659,
0.39090755581855774,
-0.0001232576760230586,
0.07433518022298813,
0.4297293424606323,
0.010778754949569702,
-0.3363496661186218,
-0.3417622447013855,
-0.3773655891418457,
-0.0664854422211647,
0.15137219429016113,
-0.3032870888710022,
-0.15082351863384247,
0.04621018469333649,
0.10273215919733047,
-0.29169514775276184,
-0.03367353603243828,
0.05344671756029129,
0.12374456226825714,
0.09356917440891266,
-0.03550761193037033,
-0.06319597363471985,
-0.35466843843460083,
0.04757475107908249,
-0.11410465091466904,
0.2131294459104538,
-0.2522084712982178,
-0.11455795168876648,
0.10157421231269836,
0.0015755891799926758,
-0.05749550089240074,
-0.019934363663196564,
0.2966062128543854,
0.06860986351966858,
0.04702231287956238,
-0.20475031435489655,
0.24343590438365936,
0.5492358207702637,
0.2889852523803711,
-0.48066622018814087,
-0.14979135990142822,
-0.49585843086242676,
0.22198493778705597,
-0.09785982221364975,
0.36984309554100037,
0.09791348874568939,
-0.4191868007183075,
0.04514607787132263,
-0.167031928896904,
-0.10777254402637482,
0.07635588943958282,
0.17902834713459015,
-0.362253874540329,
0.4697389602661133,
-0.11140099167823792,
0.1769823431968689,
-0.08897492289543152,
-0.07809969037771225,
-0.00737820565700531,
-0.6903951168060303,
-0.09308351576328278,
-0.034455087035894394,
-0.29874029755592346,
0.21499232947826385,
0.29594630002975464,
0.17066146433353424,
0.1878168284893036,
-0.07806693762540817,
-0.0036641694605350494,
0.18086102604866028,
0.3052464723587036,
0.11287501454353333,
0.02103036269545555,
0.17146022617816925,
0.3516618013381958,
0.17744973301887512,
0.2657766044139862,
0.24265243113040924,
-0.16083824634552002,
0.07019561529159546,
0.20797425508499146,
-0.16816355288028717,
-0.06444667279720306,
-0.28053146600723267,
0.4145969748497009,
0.03313747048377991,
0.00879579782485962,
0.06352105736732483,
-0.042666930705308914,
-0.05076110363006592,
0.3176480233669281,
0.31035304069519043,
-0.2725008726119995,
0.08363700658082962,
-0.23030820488929749,
0.22799083590507507,
0.058820053935050964,
0.18896158039569855,
-0.26208558678627014,
-0.3887806236743927,
-0.0785820260643959,
0.02864249050617218,
0.181487038731575,
-0.5611298680305481,
0.494270920753479,
0.3109254837036133,
0.19845044612884521,
-0.13370539247989655,
-0.23127323389053345,
0.17328162491321564,
-0.09336892515420914,
0.2473122775554657,
-0.15174995362758636,
0.2506474256515503,
0.050336822867393494,
-0.296140193939209,
-0.17398430407047272,
-0.010188708081841469,
-0.26727578043937683,
-0.3382428288459778,
0.03533605486154556,
0.05941767245531082,
-0.3519611656665802,
0.04725388437509537,
-0.2968318462371826,
0.2567635774612427,
0.2640227973461151,
0.1347767412662506,
-0.11169642210006714,
-0.12182752788066864,
-0.03034041076898575,
-0.2588246464729309,
0.41148561239242554,
0.3210270404815674,
0.0574292317032814,
-0.27715790271759033,
0.1416768729686737,
0.0016659125685691833,
-0.09192914515733719,
-0.2768968641757965,
-0.3267160654067993,
0.07184013724327087,
-0.2240065634250641,
0.058036282658576965,
0.2818087041378021,
-0.10149960219860077,
-0.3349316716194153,
0.09419065713882446,
0.19672250747680664,
0.2672629952430725,
0.21791425347328186,
-0.17127558588981628,
-0.35826021432876587,
0.08750133216381073,
-0.035323336720466614,
0.3362847864627838,
0.11599696427583694,
0.1449577361345291,
-0.1514587700366974,
-0.5042708516120911,
-0.21744383871555328,
0.11710794270038605,
0.05192484334111214,
0.18472729623317719,
-0.14201503992080688,
-0.177267923951149,
0.33400440216064453,
-0.05980638042092323,
-0.15755604207515717,
0.34553563594818115,
0.14704182744026184,
0.04448454827070236,
0.18965677917003632,
0.017798542976379395,
-0.7348968982696533,
0.4094902276992798,
0.10704174637794495,
-0.06525088846683502,
-0.1717757284641266,
-0.2830774188041687,
-0.20590753853321075,
-0.0920296460390091,
-0.49045878648757935,
0.1026657372713089,
0.020569302141666412,
0.6402956247329712,
-0.09716131538152695,
0.04772867262363434,
-0.35587078332901,
0.23765012621879578,
-0.04093882068991661,
0.21233467757701874,
-0.4450535178184509,
0.21708150207996368,
0.11987798660993576,
-0.06671897321939468,
-0.19111819565296173,
0.2378886491060257,
0.05662880837917328,
-0.05220261961221695,
-0.003648916259407997,
0.5388697385787964,
-0.031964968889951706,
0.21996623277664185,
-0.3879661560058594,
-0.13456745445728302,
0.052534304559230804,
0.17670445144176483,
-0.13123342394828796,
0.22354626655578613,
0.03292803838849068,
-0.06386445462703705,
-0.24116694927215576,
0.4140031337738037,
0.15668530762195587,
0.31248605251312256,
-0.07879538089036942,
-0.05348341912031174,
0.0009113326668739319,
-0.181122288107872,
-0.2938334345817566,
-0.2663835287094116,
-0.13923922181129456,
-0.2045927345752716,
0.5171707272529602,
0.20272155106067657,
-0.5161862373352051,
-0.24023643136024475,
0.38525184988975525,
0.17630060017108917,
-0.07473054528236389,
-0.0820731595158577,
0.09597426652908325,
0.16058915853500366,
0.1481146514415741,
0.17647285759449005,
0.39236700534820557,
0.13540296256542206,
-0.060162514448165894,
-0.04349331930279732,
-0.4169524610042572,
-0.15536852180957794,
0.13309285044670105,
0.12807390093803406,
0.14292553067207336,
0.275972843170166,
0.11554402112960815,
-0.0480559840798378,
-0.381766140460968,
-0.09662428498268127,
0.2192455232143402,
-0.06644560396671295,
-0.25084227323532104,
0.18301448225975037,
-0.3600841164588928,
-0.1292388141155243,
-0.09230159223079681,
-0.3074358105659485,
-0.3610101044178009,
-0.3681219220161438,
-0.30244648456573486,
0.11149987578392029,
-0.12471220642328262,
0.3518618941307068,
-0.20797616243362427,
0.15481068193912506,
-0.16166538000106812,
-0.455577552318573,
-0.2436334639787674,
0.08522620052099228,
-0.27195096015930176,
-0.13329148292541504,
0.07349107414484024,
-0.2984771132469177,
-0.10813043266534805,
0.08600044995546341,
-0.30400410294532776,
-0.061920732259750366,
-0.27014267444610596,
0.17569713294506073,
-0.0018649259582161903,
0.6456985473632812,
0.2712479829788208,
0.01374681293964386,
0.1414768397808075,
-0.33711475133895874,
0.42382290959358215,
0.5641768574714661,
0.101960189640522,
0.16857445240020752,
0.21383100748062134,
-0.06784933060407639,
-0.08865799754858017,
-0.004491269588470459,
0.04190893471240997,
-0.23260465264320374,
0.05745948106050491,
-0.05595412850379944,
0.03424958884716034,
0.6183664202690125,
0.11160828173160553,
-0.09788467735052109,
-0.4068538248538971,
0.19545847177505493,
0.05269523337483406,
-0.31019264459609985,
0.21324165165424347,
-0.05816088989377022,
-0.1632305234670639,
-0.40399521589279175,
-0.1622714400291443,
0.3807957172393799,
-0.1460648477077484,
-0.5499311685562134,
-0.11191286146640778,
-0.3656659424304962,
0.5492995977401733,
0.1758531779050827,
0.221178337931633,
-0.16441455483436584,
0.23025092482566833,
0.0993594378232956,
-0.21892574429512024,
-0.32479143142700195,
0.31447452306747437,
0.056419890373945236,
0.3608950972557068,
0.455515056848526,
0.1386869251728058,
-0.008375346660614014,
0.4159506857395172,
0.34779366850852966,
-0.1443137228488922,
0.3872515857219696,
-0.253806471824646,
0.40423890948295593,
-0.06957298517227173,
-0.4705697298049927,
0.09845446050167084,
0.3029573857784271,
0.3701378107070923,
0.20649954676628113,
0.026902753859758377,
0.0530569851398468,
-0.2827191650867462,
-0.10961131751537323,
0.027609683573246002,
-0.4083247780799866,
-0.22498221695423126,
-0.20468300580978394,
0.09790787845849991,
0.30793291330337524,
0.15179631114006042,
-0.07666467875242233,
-0.10216602683067322,
-0.07709440588951111,
0.2652161717414856,
-0.31741786003112793,
0.11351087689399719,
-0.21882590651512146,
0.05644689500331879,
-0.12166985124349594,
0.1358369141817093,
-0.14784695208072662,
0.09347730875015259,
0.12173616886138916,
0.12529334425926208,
0.16414175927639008,
0.04441086947917938,
0.547614336013794,
-0.019961481913924217,
0.028450649231672287,
0.279646635055542,
0.07402971386909485,
-0.33475175499916077,
-0.20364968478679657,
0.21198374032974243,
0.016049381345510483,
0.13139495253562927,
0.351533979177475,
-0.4896128177642822,
-0.35837507247924805,
-0.01906994730234146,
0.26833462715148926,
-0.06107252836227417,
-0.19053873419761658,
-0.3676830530166626,
-0.17625650763511658,
0.09374252706766129,
-0.07049375772476196,
-0.26134052872657776,
0.4847918748855591,
-0.10036511719226837,
0.12193848192691803,
-0.19354769587516785,
-0.20765608549118042,
-0.013526670634746552,
0.30162709951400757,
0.2679818570613861,
-0.019128117710351944,
0.27152836322784424,
-0.0023913318291306496,
0.0008044010028243065,
0.16877153515815735,
0.4654372036457062,
-0.10967707633972168,
-0.22887051105499268,
-0.10608310997486115,
-0.06582817435264587,
0.29998666048049927,
0.3789880573749542,
-0.3089974820613861,
0.05989578366279602,
0.027560696005821228,
0.16756325960159302,
0.002314530313014984,
0.06579852104187012,
0.37791043519973755,
0.029597073793411255,
-0.30701884627342224,
-0.4562849700450897,
0.6739221811294556,
-0.0687195211648941,
-0.17101144790649414,
0.39218664169311523,
0.414470911026001,
-0.47433608770370483,
0.1143353283405304,
-0.21589531004428864,
0.5965433120727539,
0.4111277163028717,
0.11219160258769989,
0.2938290536403656,
-0.11181016266345978,
0.24682064354419708,
0.30228346586227417,
0.22932356595993042,
-0.4508543014526367,
0.06508594751358032,
0.13279488682746887,
-0.045096613466739655,
0.4342031478881836,
0.2580256164073944,
-0.027247928082942963,
0.12982089817523956,
0.006504744291305542,
0.265656977891922,
-0.042096324265003204,
0.2601568102836609,
-0.45932814478874207,
-0.1960677206516266,
-0.3008294999599457,
-0.041625287383794785,
-0.1422879695892334,
0.32707586884498596,
0.1378164440393448,
-0.19565348327159882,
0.08337612450122833,
-0.1824403703212738,
-0.19892370700836182,
0.12342626601457596,
-0.27680426836013794,
0.03442491218447685,
0.3381044268608093,
-0.1900741159915924,
0.05461975187063217,
0.4282359182834625,
0.2886563539505005,
0.45025795698165894,
-0.22969862818717957,
0.17183759808540344,
0.0110652856528759,
0.16937431693077087,
-0.0038884729146957397,
-0.011456474661827087,
0.3189071714878082,
0.039740994572639465,
-0.33461976051330566,
-0.08767439424991608,
-0.012865934520959854,
0.02725212275981903,
-0.12894371151924133,
0.00301336869597435,
-0.0037474017590284348,
-0.22009113430976868,
-0.18532469868659973,
-0.14891403913497925,
0.397318959236145,
-0.2776390314102173,
0.06743472069501877,
-0.02315426990389824,
-0.11789287626743317,
0.47333377599716187,
-0.21506676077842712,
-0.27077925205230713,
-0.18584740161895752,
0.35061192512512207,
-0.26002153754234314,
0.014140963554382324,
0.5260259509086609,
-0.3222576677799225,
-0.03239098936319351,
0.043062418699264526,
0.3714902400970459,
0.16368946433067322,
-0.2922677993774414,
-0.043741464614868164,
0.12451423704624176,
-0.10235676914453506,
0.0374445877969265,
0.41287487745285034,
0.022631550207734108,
-0.11793719232082367,
0.0932939276099205,
-0.13336732983589172,
-0.04188300296664238,
0.11305977404117584,
0.13351337611675262,
0.2756381928920746,
-0.05907006561756134,
0.07544049620628357,
0.12551236152648926,
-0.014369341544806957,
-0.17940255999565125,
0.06576816737651825,
-0.10497305542230606,
0.12233241647481918,
-0.015202674083411694,
0.31720829010009766,
0.018623121082782745,
-0.16627080738544464,
0.15122252702713013,
-0.2307310253381729,
-0.15288178622722626,
-0.11547316610813141,
-0.41579341888427734,
0.17727972567081451,
0.16562363505363464,
0.1333906501531601,
0.05775967985391617,
-0.2901897430419922,
-0.09486979246139526,
-0.29260483384132385,
0.4095326066017151,
0.3110589385032654,
-0.013871993869543076,
0.09622122347354889,
0.09882372617721558,
0.23119133710861206,
0.03837352991104126,
0.0033360878005623817,
-0.16971246898174286,
-0.12370166182518005,
0.2889879047870636,
0.1891826093196869,
-0.5126205682754517,
0.10343903303146362,
0.1170780137181282,
-0.1187618151307106,
-0.43400445580482483,
0.10228760540485382,
0.14981672167778015,
-0.4039980173110962,
-0.0011570006608963013,
0.20711643993854523,
0.3461730480194092,
0.3561481535434723,
-0.2428615540266037,
-0.05437812954187393,
0.1601228415966034,
0.04753372073173523,
-0.23195070028305054,
-0.18411171436309814,
0.2379881590604782,
0.15096218883991241,
0.33707043528556824,
0.3546822965145111,
0.327820360660553,
-0.1467273086309433,
-0.002978123724460602,
-0.15491418540477753,
0.29874053597450256,
-0.126892551779747,
0.40072721242904663,
0.6480078101158142,
0.007087409496307373,
0.17183032631874084,
0.49471428990364075,
0.3301553726196289,
0.012664858251810074,
0.5165835618972778,
0.09821642935276031,
-0.0645175650715828,
0.014302588999271393,
-0.23212063312530518,
0.1679210066795349,
-0.42111778259277344,
0.35905978083610535,
-0.2515708804130554,
-0.5219039916992188,
-0.04626026004552841,
-0.033958591520786285,
0.26058492064476013,
-0.5548641085624695,
0.01260632649064064,
-0.18767333030700684,
0.08255840837955475,
-0.15526697039604187,
-0.4852454960346222,
-0.2730908691883087,
-0.24512167274951935,
0.07637825608253479,
-0.06034328043460846,
-0.05536676570773125,
-0.3413909375667572,
0.2587730288505554,
-0.08948947489261627,
-0.21473510563373566,
-0.31048113107681274,
0.035677939653396606,
0.021481499075889587,
0.35045325756073,
-0.1497466117143631,
0.3449447453022003,
0.07102648913860321,
-0.18526676297187805,
-0.044969696551561356,
0.3663298785686493,
0.3971329629421234,
0.1648152470588684,
0.21931150555610657,
-0.17402462661266327,
0.1256258189678192,
0.036593832075595856,
-0.1346297562122345,
0.029581017792224884,
0.2454209178686142,
0.028383396565914154,
0.402496337890625,
0.10716685652732849,
-0.12079713493585587,
-0.18845653533935547,
0.30743932723999023,
0.2852993309497833,
-0.5095683932304382,
0.3491881489753723,
-0.12657612562179565,
-0.0020973309874534607,
0.2357962727546692,
0.043148770928382874,
-0.4444176256656647,
-0.07099143415689468,
0.5036416053771973,
0.28758373856544495,
0.09308744966983795,
-0.27316543459892273,
0.03548146039247513,
0.2340622842311859,
0.2413792610168457,
-0.05921991169452667,
-0.13584432005882263,
-0.30766329169273376,
-0.047050148248672485,
-0.5167153477668762,
0.0636884868144989,
0.015366489067673683,
-0.06776699423789978,
0.17077583074569702,
-0.05301569029688835,
-0.0455983430147171,
-0.22003895044326782,
-0.05838946998119354,
0.12451212108135223,
0.2761799693107605,
0.07838359475135803,
-0.2820085287094116,
-0.30482783913612366,
-0.08049571514129639,
-0.1379723697900772,
0.050491511821746826,
-0.2859914302825928,
0.1365455687046051,
-0.21935606002807617,
-0.03786260262131691,
-0.11046469211578369,
0.200871080160141,
0.3906431496143341,
-0.14091423153877258,
-0.03475969284772873,
-0.1254386603832245,
0.21303921937942505,
0.0878438875079155,
-0.1512412130832672,
-0.35980308055877686,
-0.07766328752040863,
-0.2440289855003357,
0.13490444421768188,
-0.015488367527723312,
0.2053489238023758,
-0.1530948430299759,
-0.2752336263656616,
-0.20331063866615295,
0.03086842969059944,
0.32246625423431396,
0.05894957110285759,
0.11703108996152878,
0.02446279674768448,
-0.1000872254371643,
0.020336437970399857,
0.18827828764915466,
0.31731116771698,
-0.10420240461826324,
0.34381014108657837,
-0.10353279113769531,
-0.5149447917938232,
0.6854557394981384,
-0.062003299593925476,
-0.3471650779247284,
-0.28815758228302,
0.16508924961090088,
-0.0046587660908699036,
-0.03127819672226906,
-0.2996036410331726,
0.09376014769077301,
0.49562200903892517,
-0.23305518925189972,
-0.2937552034854889,
0.0534198097884655,
-0.19385547935962677,
0.07963240891695023,
-0.14962005615234375,
0.053170472383499146,
0.13184353709220886,
-0.303611159324646,
-0.05239327996969223,
0.0009973347187042236
] |
https://github.com/huggingface/datasets/issues/6130 | It should work if you explicitly ask for the config you want to override
```python
load_dataset('/dataset/with/multiple/config', 'name_of_the_default_config', some_field_in_config='some')
```
Alternatively you can have a BuilderConfig class that when instantiated returns a config with the right default values. In this case this code would instantiate this config with the default values except for the parameter to override:
```python
load_dataset('/dataset/with/multiple/config', some_field_in_config='some')
``` | default config name doesn't work when config kwargs are specified. | ### Describe the bug
https://github.com/huggingface/datasets/blob/12cfc1196e62847e2e8239fbd727a02cbc86ddec/src/datasets/builder.py#L518-L522
If `config_name` is `None`, `DEFAULT_CONFIG_NAME` should be select. But once users pass `config_kwargs` to their customized `BuilderConfig`, the logic is ignored, and dataset cannot select the default config from multiple configs.
### Steps to reproduce the bug
```python
import datasets
datasets.load_dataset('/dataset/with/multiple/config'') # Ok
datasets.load_dataset('/dataset/with/multiple/config', some_field_in_config='some') # Err
```
### Expected behavior
Default config behavior should be consistent.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3 | 60 | default config name doesn't work when config kwargs are specified.
### Describe the bug
https://github.com/huggingface/datasets/blob/12cfc1196e62847e2e8239fbd727a02cbc86ddec/src/datasets/builder.py#L518-L522
If `config_name` is `None`, `DEFAULT_CONFIG_NAME` should be select. But once users pass `config_kwargs` to their customized `BuilderConfig`, the logic is ignored, and dataset cannot select the default config from multiple configs.
### Steps to reproduce the bug
```python
import datasets
datasets.load_dataset('/dataset/with/multiple/config'') # Ok
datasets.load_dataset('/dataset/with/multiple/config', some_field_in_config='some') # Err
```
### Expected behavior
Default config behavior should be consistent.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
It should work if you explicitly ask for the config you want to override
```python
load_dataset('/dataset/with/multiple/config', 'name_of_the_default_config', some_field_in_config='some')
```
Alternatively you can have a BuilderConfig class that when instantiated returns a config with the right default values. In this case this code would instantiate this config with the default values except for the parameter to override:
```python
load_dataset('/dataset/with/multiple/config', some_field_in_config='some')
``` | [
-0.2387239784002304,
-0.2534017562866211,
0.09032666683197021,
0.07542908191680908,
0.2019164115190506,
-0.026733510196208954,
0.41875579953193665,
0.03140834718942642,
0.04826804995536804,
0.5022535920143127,
0.07890916615724564,
0.5601708292961121,
0.15124142169952393,
0.1664610505104065,
-0.05768752098083496,
0.15543383359909058,
-0.13368786871433258,
0.072550930082798,
-0.11222803592681885,
0.14952754974365234,
-0.3483598828315735,
0.2917088568210602,
-0.02120964229106903,
0.07410407066345215,
-0.2522522807121277,
0.21023385226726532,
-0.05610230565071106,
0.19381427764892578,
0.06818444281816483,
-0.4707713723182678,
0.5052056312561035,
0.32562822103500366,
-0.18849484622478485,
0.30759188532829285,
-0.00011525877198437229,
0.026181355118751526,
0.36865174770355225,
0.061346836388111115,
-0.3418385088443756,
-0.27670127153396606,
-0.3653549551963806,
-0.10990764200687408,
0.164847269654274,
-0.31146547198295593,
-0.15023492276668549,
-0.021121619269251823,
0.07975855469703674,
-0.1673019528388977,
0.015319950878620148,
-0.013544436544179916,
0.17274007201194763,
0.10488469898700714,
-0.03589462488889694,
-0.02633703500032425,
-0.4108128249645233,
-0.027570951730012894,
-0.03132181987166405,
0.26784491539001465,
-0.2803843021392822,
-0.04553288593888283,
0.1297488808631897,
0.0012266412377357483,
-0.11499045789241791,
-0.05186082422733307,
0.37508058547973633,
0.10678911209106445,
0.1467064470052719,
-0.1669568568468094,
0.1901153326034546,
0.4685497283935547,
0.24893729388713837,
-0.4961506724357605,
-0.16709250211715698,
-0.5221304893493652,
0.27639997005462646,
-0.05464960262179375,
0.3535838723182678,
0.03999337553977966,
-0.3989359736442566,
0.10275429487228394,
-0.20457112789154053,
-0.2231093794107437,
0.12682080268859863,
0.13105496764183044,
-0.35931897163391113,
0.42940816283226013,
-0.13185136020183563,
0.15620173513889313,
0.0024048909544944763,
-0.09954486042261124,
-0.047946587204933167,
-0.6444518566131592,
-0.04826667159795761,
-0.05103573948144913,
-0.193343847990036,
0.08443765342235565,
0.2797183692455292,
0.1780608594417572,
0.17593872547149658,
-0.006172005087137222,
0.01649574190378189,
0.2528884708881378,
0.2987177073955536,
0.16575324535369873,
-0.00890000443905592,
0.13719886541366577,
0.3367146849632263,
0.10783109068870544,
0.2414645552635193,
0.21855272352695465,
-0.1275104433298111,
0.054350655525922775,
0.256565660238266,
-0.15614154934883118,
-0.05222538858652115,
-0.26423054933547974,
0.44795048236846924,
0.06060127913951874,
0.0386725589632988,
0.02044329047203064,
0.08710617572069168,
-0.026817061007022858,
0.3033123314380646,
0.3252289891242981,
-0.28321361541748047,
0.05426749214529991,
-0.1996743083000183,
0.1723279356956482,
0.021222375333309174,
0.1919722557067871,
-0.282452255487442,
-0.41267287731170654,
0.02336271107196808,
0.1038525402545929,
0.16918498277664185,
-0.5959853529930115,
0.4417458176612854,
0.36930763721466064,
0.27331510186195374,
-0.08917666226625443,
-0.16676318645477295,
0.256168395280838,
-0.1186973825097084,
0.24905550479888916,
-0.167589470744133,
0.1936921775341034,
0.11295119673013687,
-0.37653183937072754,
-0.19585806131362915,
-0.02585749700665474,
-0.2528841197490692,
-0.3197001814842224,
0.053781360387802124,
0.144258052110672,
-0.3157693147659302,
0.01842973753809929,
-0.3374177813529968,
0.2509373724460602,
0.21070633828639984,
0.08982308208942413,
-0.07794923335313797,
-0.027449235320091248,
-0.0004277452826499939,
-0.27307748794555664,
0.44296780228614807,
0.2907104790210724,
0.06141652166843414,
-0.3280341327190399,
0.17674678564071655,
-0.0035509569570422173,
-0.12911204993724823,
-0.34882643818855286,
-0.3933560848236084,
0.035670410841703415,
-0.12575963139533997,
0.03377200663089752,
0.2815732955932617,
-0.07973452657461166,
-0.34224212169647217,
0.04381215572357178,
0.19129885733127594,
0.25339722633361816,
0.16632774472236633,
-0.18360351026058197,
-0.31393057107925415,
0.08960367739200592,
-0.08616777509450912,
0.32705119252204895,
0.16473552584648132,
0.13487394154071808,
-0.14928066730499268,
-0.46858423948287964,
-0.22574763000011444,
0.05911976099014282,
-0.024052321910858154,
0.1745687574148178,
-0.14538314938545227,
-0.22316527366638184,
0.24842742085456848,
-0.05808982253074646,
-0.19430407881736755,
0.3534126877784729,
0.11909216642379761,
0.025108657777309418,
0.12334007024765015,
-0.050326086580753326,
-0.6943249106407166,
0.3690994083881378,
0.056880608201026917,
-0.051292769610881805,
-0.12680917978286743,
-0.3326394259929657,
-0.12458576261997223,
-0.08194351196289062,
-0.46002355217933655,
0.0508321113884449,
0.11299751698970795,
0.6411363482475281,
-0.0800287202000618,
-0.024695027619600296,
-0.4297395646572113,
0.2903915047645569,
-0.04595860093832016,
0.26223883032798767,
-0.4265791177749634,
0.23075777292251587,
0.11265626549720764,
-0.0442955382168293,
-0.20545649528503418,
0.15211030840873718,
0.09850821644067764,
-0.0073739588260650635,
0.04474719986319542,
0.5567618012428284,
-0.10951857268810272,
0.1840175986289978,
-0.3700537085533142,
-0.1375230848789215,
0.06140803545713425,
0.1406370997428894,
-0.10286637395620346,
0.17992331087589264,
2.5331974029541016e-7,
-0.0130104199051857,
-0.20806102454662323,
0.4433985948562622,
0.19554786384105682,
0.2234145551919937,
-0.08606136590242386,
-0.045184195041656494,
0.006465554237365723,
-0.13903026282787323,
-0.31539589166641235,
-0.33957070112228394,
-0.29940542578697205,
-0.15710580348968506,
0.41301149129867554,
0.215501070022583,
-0.48200300335884094,
-0.142815962433815,
0.37626686692237854,
0.11923736333847046,
-0.1149924099445343,
-0.0855286717414856,
0.03089989721775055,
0.11788994073867798,
0.17499634623527527,
0.1768575757741928,
0.3345714807510376,
0.2304268628358841,
-0.07065003365278244,
-0.05826285481452942,
-0.4499855935573578,
-0.08430513739585876,
0.15002058446407318,
0.12740394473075867,
0.13525745272636414,
0.19977527856826782,
0.1931847631931305,
-0.10891897231340408,
-0.35985130071640015,
-0.06526580452919006,
0.1887083649635315,
-0.06763681769371033,
-0.2219480276107788,
0.16226260364055634,
-0.3188791871070862,
-0.049170710146427155,
-0.04667570814490318,
-0.3381783664226532,
-0.39786699414253235,
-0.38275694847106934,
-0.20434847474098206,
0.1678016036748886,
-0.09713822603225708,
0.3207443058490753,
-0.04392100125551224,
0.2254807949066162,
-0.2065940648317337,
-0.42976099252700806,
-0.26858848333358765,
0.12956637144088745,
-0.19952262938022614,
-0.06040556728839874,
0.001186966896057129,
-0.28431934118270874,
-0.049394793808460236,
0.09164722263813019,
-0.32603010535240173,
-0.07457739859819412,
-0.2349381297826767,
0.16037996113300323,
-0.04061104729771614,
0.6361407041549683,
0.3198455572128296,
0.04069763422012329,
0.09444840997457504,
-0.30699625611305237,
0.4006533622741699,
0.5199291110038757,
0.10936369001865387,
0.07678887248039246,
0.21274787187576294,
-0.0009546354413032532,
-0.12654319405555725,
0.03908234462141991,
0.05944443494081497,
-0.23339572548866272,
0.0354442372918129,
0.08432022482156754,
0.03128063306212425,
0.566174328327179,
0.1521162986755371,
-0.09098885953426361,
-0.44360360503196716,
0.19202649593353271,
-0.06458001583814621,
-0.33649763464927673,
0.24329431354999542,
-0.12290461361408234,
-0.0839846134185791,
-0.3800364136695862,
-0.14463981986045837,
0.38479483127593994,
-0.197717547416687,
-0.46426135301589966,
-0.23662662506103516,
-0.40306493639945984,
0.5264711976051331,
0.11806784570217133,
0.247024267911911,
-0.07262487709522247,
0.3268294930458069,
-0.02448086068034172,
-0.16376417875289917,
-0.30261677503585815,
0.2828309237957001,
0.09752680361270905,
0.27612003684043884,
0.39314916729927063,
0.09763860702514648,
-0.08985238522291183,
0.4417763650417328,
0.3194839060306549,
-0.16185817122459412,
0.26885583996772766,
-0.3075910210609436,
0.43666112422943115,
-0.07206039130687714,
-0.4327890872955322,
-0.030227942392230034,
0.30046480894088745,
0.38049349188804626,
0.24782024323940277,
0.018910106271505356,
0.14341306686401367,
-0.22458596527576447,
-0.1199803352355957,
0.030662901699543,
-0.43366020917892456,
-0.23042047023773193,
-0.12692295014858246,
0.03439144045114517,
0.28621524572372437,
0.17750629782676697,
-0.2080596387386322,
-0.07288090884685516,
-0.11450149118900299,
0.28155776858329773,
-0.2867925763130188,
0.048493072390556335,
-0.1247192919254303,
0.09921261668205261,
-0.19640995562076569,
0.17800076305866241,
-0.1492445170879364,
-0.0898590013384819,
0.2242913842201233,
0.11229239404201508,
0.18714982271194458,
-0.03308349475264549,
0.5011488199234009,
-0.05417802557349205,
0.0033583147451281548,
0.23590534925460815,
0.01675904542207718,
-0.3945205807685852,
-0.15734383463859558,
0.20882098376750946,
-0.009974908083677292,
0.030783485621213913,
0.3211730122566223,
-0.5035249590873718,
-0.38809463381767273,
0.00035144761204719543,
0.23422876000404358,
-0.13377849757671356,
-0.18519282341003418,
-0.35438665747642517,
-0.22723370790481567,
-0.004423707723617554,
-0.16716299951076508,
-0.26262935996055603,
0.490286648273468,
-0.10555040836334229,
0.11839105188846588,
-0.21456889808177948,
-0.16345536708831787,
0.04403194040060043,
0.3031235933303833,
0.29144924879074097,
-0.04804161190986633,
0.17696478962898254,
-0.021222487092018127,
0.02106720767915249,
0.17606501281261444,
0.5064483880996704,
-0.09933628141880035,
-0.19580543041229248,
-0.14920005202293396,
0.011785779148340225,
0.2733769118785858,
0.32867398858070374,
-0.3020586669445038,
0.1002221554517746,
0.14477244019508362,
0.24034848809242249,
-0.028806885704398155,
0.10603651404380798,
0.30120524764060974,
0.07596760988235474,
-0.2280142605304718,
-0.5305004119873047,
0.6882502436637878,
-0.10532129555940628,
-0.18335291743278503,
0.3824048638343811,
0.4853365123271942,
-0.43508002161979675,
0.10645822435617447,
-0.12843091785907745,
0.6529949903488159,
0.3451163172721863,
0.1563168466091156,
0.2974463403224945,
-0.045708637684583664,
0.2872764468193054,
0.19250309467315674,
0.23993293941020966,
-0.41413402557373047,
0.026070546358823776,
0.1602371335029602,
-0.04373863711953163,
0.44088834524154663,
0.3040156066417694,
-0.08019451051950455,
0.08061365783214569,
-0.010247230529785156,
0.282870888710022,
-0.06520922482013702,
0.29790475964546204,
-0.4678170680999756,
-0.2325751930475235,
-0.3043789565563202,
0.05039601027965546,
-0.1064445972442627,
0.18855905532836914,
0.16853371262550354,
-0.12444399297237396,
0.16099336743354797,
-0.20647484064102173,
-0.12780573964118958,
0.04473908990621567,
-0.24032406508922577,
-0.010697240009903908,
0.3731860816478729,
-0.1425202488899231,
0.016725637018680573,
0.37901824712753296,
0.24850115180015564,
0.4534662365913391,
-0.1984161138534546,
0.12647460401058197,
-0.05006369203329086,
0.14390607178211212,
-0.07749979943037033,
-0.0036163926124572754,
0.34883472323417664,
0.024447686970233917,
-0.3239673376083374,
-0.02738429605960846,
0.06396423280239105,
-0.01430000364780426,
-0.05216129124164581,
-0.015836607664823532,
-0.03666885942220688,
-0.32334738969802856,
-0.07414183020591736,
-0.12145918607711792,
0.3524641990661621,
-0.29393452405929565,
0.12665915489196777,
-0.1054152324795723,
-0.14951789379119873,
0.45867684483528137,
-0.11775031685829163,
-0.26440683007240295,
-0.20199117064476013,
0.37595534324645996,
-0.2321242094039917,
0.002476640045642853,
0.5408368110656738,
-0.3460066020488739,
-0.0898318812251091,
-0.015312053263187408,
0.26266351342201233,
0.14410732686519623,
-0.2011532336473465,
0.022516854107379913,
0.14585994184017181,
-0.053550347685813904,
0.0913534089922905,
0.43913355469703674,
0.021375587210059166,
-0.03258713334798813,
-0.017730712890625,
-0.09896861016750336,
-0.0804557055234909,
0.07796843349933624,
0.13308311998844147,
0.3107782304286957,
0.023430369794368744,
0.0996166318655014,
0.027676664292812347,
-0.01722162589430809,
-0.2898007333278656,
-0.0011094659566879272,
-0.16396918892860413,
0.046531349420547485,
0.003979450091719627,
0.30330681800842285,
0.009012363851070404,
-0.10518649220466614,
0.21292266249656677,
-0.2311716079711914,
-0.12825964391231537,
-0.213788703083992,
-0.4018595814704895,
0.14527735114097595,
0.0878557413816452,
0.07799462974071503,
0.048715990036726,
-0.21572253108024597,
-0.134123757481575,
-0.3003169894218445,
0.4673094153404236,
0.21253521740436554,
0.060303185135126114,
0.12607789039611816,
0.1242772787809372,
0.16595017910003662,
0.005248121917247772,
-0.0762714147567749,
-0.14901971817016602,
-0.08630134910345078,
0.2243274599313736,
0.19937221705913544,
-0.527553141117096,
0.08096297085285187,
0.2178412675857544,
-0.013361956924200058,
-0.30481916666030884,
0.08894683420658112,
0.1256609857082367,
-0.2870245575904846,
-0.05837194249033928,
0.18101046979427338,
0.39069944620132446,
0.2890942096710205,
-0.22179554402828217,
-0.05129857361316681,
0.18817779421806335,
0.11922793090343475,
-0.23705387115478516,
-0.17362740635871887,
0.20782186090946198,
0.048350002616643906,
0.4149509072303772,
0.42398637533187866,
0.2481459528207779,
-0.16056807339191437,
0.006243810057640076,
-0.146783709526062,
0.298647403717041,
-0.18116489052772522,
0.33159780502319336,
0.5914577841758728,
-0.04226846247911453,
0.08974862098693848,
0.6076432466506958,
0.38752901554107666,
0.08351513743400574,
0.43660449981689453,
0.07530645281076431,
-0.02394687384366989,
-0.03422122448682785,
-0.2522232234477997,
0.13352333009243011,
-0.41896992921829224,
0.4063367545604706,
-0.25556182861328125,
-0.3869885802268982,
-0.04194933921098709,
0.01667080447077751,
0.25551027059555054,
-0.5433564782142639,
0.00021313875913619995,
-0.14706173539161682,
0.2334100902080536,
-0.1527521163225174,
-0.4940628111362457,
-0.25414425134658813,
-0.22460761666297913,
0.1420210599899292,
-0.06426896154880524,
-0.06590834259986877,
-0.4431152939796448,
0.30687814950942993,
-0.13210538029670715,
-0.1365652084350586,
-0.2573111057281494,
0.10716703534126282,
-0.06448231637477875,
0.2783109247684479,
-0.16386032104492188,
0.27833759784698486,
0.06883461028337479,
-0.12252036482095718,
-0.0535745695233345,
0.4054889976978302,
0.31874150037765503,
0.07882048189640045,
0.20332376658916473,
-0.09725075960159302,
0.08298735320568085,
0.02365841716527939,
-0.20319634675979614,
-0.01572166197001934,
0.1711590588092804,
0.0052923839539289474,
0.34742286801338196,
0.20592376589775085,
-0.18807873129844666,
-0.28896838426589966,
0.3008423447608948,
0.319852352142334,
-0.47788500785827637,
0.2889839708805084,
0.0018619755282998085,
-0.02719738334417343,
0.27053433656692505,
0.08196184039115906,
-0.4366840124130249,
-0.11731265485286713,
0.529863715171814,
0.2692411243915558,
0.1170206367969513,
-0.2580692768096924,
0.07918473333120346,
0.21844689548015594,
0.28381484746932983,
-0.08864845335483551,
-0.09076057374477386,
-0.19069556891918182,
-0.010855033993721008,
-0.4432647228240967,
-0.002680644392967224,
0.04061466082930565,
-0.18969468772411346,
0.1572115421295166,
-0.04213305562734604,
0.017303431406617165,
-0.18135932087898254,
-0.005527615547180176,
0.1683913916349411,
0.21678604185581207,
0.028872666880488396,
-0.23495031893253326,
-0.33644968271255493,
-0.06741612404584885,
-0.12645721435546875,
0.10448351502418518,
-0.23578859865665436,
0.07557664811611176,
-0.20947429537773132,
0.045880965888500214,
-0.08507607132196426,
0.29216301441192627,
0.39624518156051636,
-0.21987773478031158,
-0.035101402550935745,
-0.08858966082334518,
0.1340910792350769,
-0.0035734474658966064,
-0.1886693686246872,
-0.2750283479690552,
-0.05083327367901802,
-0.35278239846229553,
0.07900139689445496,
-0.06317348033189774,
0.18013349175453186,
-0.1419682502746582,
-0.30419933795928955,
-0.22806797921657562,
-0.016886848956346512,
0.3773622512817383,
0.04880469664931297,
0.08720620721578598,
0.05900158733129501,
-0.06450901180505753,
-0.09467184543609619,
0.20549552142620087,
0.3013428747653961,
-0.10251492261886597,
0.36418983340263367,
-0.08880306780338287,
-0.4546545743942261,
0.7501703500747681,
-0.055863674730062485,
-0.3505484461784363,
-0.281289666891098,
0.1404714286327362,
0.0056547801941633224,
-0.07439395040273666,
-0.31615838408470154,
0.09861412644386292,
0.4799894392490387,
-0.20145036280155182,
-0.2953505218029022,
0.13558390736579895,
-0.21544939279556274,
0.043903231620788574,
-0.17374640703201294,
0.027875125408172607,
0.15310117602348328,
-0.24246525764465332,
-0.1809142827987671,
0.010846838355064392
] |
https://github.com/huggingface/datasets/issues/6130 | @lhoestq Yes. But it doesn't work for me.
Here's my dataset for example.
```
lass MyDatasetConfig(datasets.BuilderConfig):
def __init__(self, name: str, version: str, **kwargs):
self.option1 = kwargs.pop("option1", False)
self.option2 = kwargs.pop("option2", 5)
super().__init__(
name=name,
version=datasets.Version(version),
**kwargs)
class MyDataset(datasets.GeneratorBasedBuilder):
DEFAULT_CONFIG_NAME = "v1"
BUILDER_CONFIGS = [
UnifiedTtsDatasetConfig(
name="v1",
version="1.0.0",
description="Initial version of the dataset"
),
]
def _info(self) -> DatasetInfo:
_ = self.option1
....
```
Here it's okay to use `load_dataset('my_dataset.py')` for loading the default config `v1`.
But if I want to override the default values in config with `load_dataset('my_dataset.py', option2=3)`, it failed to find my default config `v1.
Unless I use `load_dataset('my_dataset.py', 'v1', option2=3)`
So according to your advice, how can I modify my dataset to be able to override default config without manually specifying it. | default config name doesn't work when config kwargs are specified. | ### Describe the bug
https://github.com/huggingface/datasets/blob/12cfc1196e62847e2e8239fbd727a02cbc86ddec/src/datasets/builder.py#L518-L522
If `config_name` is `None`, `DEFAULT_CONFIG_NAME` should be select. But once users pass `config_kwargs` to their customized `BuilderConfig`, the logic is ignored, and dataset cannot select the default config from multiple configs.
### Steps to reproduce the bug
```python
import datasets
datasets.load_dataset('/dataset/with/multiple/config'') # Ok
datasets.load_dataset('/dataset/with/multiple/config', some_field_in_config='some') # Err
```
### Expected behavior
Default config behavior should be consistent.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3 | 124 | default config name doesn't work when config kwargs are specified.
### Describe the bug
https://github.com/huggingface/datasets/blob/12cfc1196e62847e2e8239fbd727a02cbc86ddec/src/datasets/builder.py#L518-L522
If `config_name` is `None`, `DEFAULT_CONFIG_NAME` should be select. But once users pass `config_kwargs` to their customized `BuilderConfig`, the logic is ignored, and dataset cannot select the default config from multiple configs.
### Steps to reproduce the bug
```python
import datasets
datasets.load_dataset('/dataset/with/multiple/config'') # Ok
datasets.load_dataset('/dataset/with/multiple/config', some_field_in_config='some') # Err
```
### Expected behavior
Default config behavior should be consistent.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
@lhoestq Yes. But it doesn't work for me.
Here's my dataset for example.
```
lass MyDatasetConfig(datasets.BuilderConfig):
def __init__(self, name: str, version: str, **kwargs):
self.option1 = kwargs.pop("option1", False)
self.option2 = kwargs.pop("option2", 5)
super().__init__(
name=name,
version=datasets.Version(version),
**kwargs)
class MyDataset(datasets.GeneratorBasedBuilder):
DEFAULT_CONFIG_NAME = "v1"
BUILDER_CONFIGS = [
UnifiedTtsDatasetConfig(
name="v1",
version="1.0.0",
description="Initial version of the dataset"
),
]
def _info(self) -> DatasetInfo:
_ = self.option1
....
```
Here it's okay to use `load_dataset('my_dataset.py')` for loading the default config `v1`.
But if I want to override the default values in config with `load_dataset('my_dataset.py', option2=3)`, it failed to find my default config `v1.
Unless I use `load_dataset('my_dataset.py', 'v1', option2=3)`
So according to your advice, how can I modify my dataset to be able to override default config without manually specifying it. | [
-0.15546850860118866,
-0.19105125963687897,
0.12208302319049835,
0.1262056529521942,
0.1357688307762146,
0.009281337261199951,
0.397077351808548,
-0.008440805599093437,
0.03489021956920624,
0.3902091383934021,
0.17155346274375916,
0.4991089105606079,
0.17679984867572784,
0.03783909231424332,
-0.0665491595864296,
0.1806280016899109,
-0.07917780429124832,
0.09870252758264542,
-0.07273881882429123,
0.07470187544822693,
-0.30773696303367615,
0.321204274892807,
-0.1447068452835083,
0.12256571650505066,
-0.3020220696926117,
0.25631073117256165,
-0.10970458388328552,
0.19699811935424805,
0.054124750196933746,
-0.40393227338790894,
0.5037705898284912,
0.3118346631526947,
-0.16639098525047302,
0.31008005142211914,
-0.0001252050860784948,
0.03264936804771423,
0.4201834201812744,
0.02829594910144806,
-0.36031997203826904,
-0.1949358731508255,
-0.3423813283443451,
-0.09241466224193573,
0.09968136250972748,
-0.29497092962265015,
-0.15513315796852112,
0.07547535002231598,
0.12575210630893707,
-0.28852447867393494,
-0.012722071260213852,
0.016099929809570312,
0.10756345838308334,
0.053823940455913544,
-0.06705581396818161,
-0.09471922367811203,
-0.36847585439682007,
0.08894485235214233,
-0.12084001302719116,
0.28571048378944397,
-0.2581673562526703,
-0.10850416868925095,
0.09620745480060577,
0.02684798836708069,
-0.17365166544914246,
-0.06282687187194824,
0.3112756311893463,
0.12484922260046005,
0.13540339469909668,
-0.14507214725017548,
0.24407076835632324,
0.429338663816452,
0.22213809192180634,
-0.4624480903148651,
-0.18781939148902893,
-0.5243949294090271,
0.20455434918403625,
0.024023108184337616,
0.3497571647167206,
0.007687937468290329,
-0.47409725189208984,
0.09502972662448883,
-0.19358141720294952,
-0.21620404720306396,
0.09878766536712646,
0.17066866159439087,
-0.27233976125717163,
0.48616358637809753,
-0.13540902733802795,
0.19829235970973969,
-0.08248342573642731,
0.012594703584909439,
-0.03569138050079346,
-0.747749924659729,
-0.12258946895599365,
-0.04676885902881622,
-0.28605133295059204,
0.16023500263690948,
0.3106686770915985,
0.27503064274787903,
0.24413704872131348,
-0.10042236000299454,
-0.02048652619123459,
0.16536693274974823,
0.42669451236724854,
0.12740248441696167,
0.005682254210114479,
0.13998883962631226,
0.4217003583908081,
0.0740320086479187,
0.2380121797323227,
0.17526870965957642,
-0.23233233392238617,
0.07090584933757782,
0.22020988166332245,
-0.21578064560890198,
-0.014358289539813995,
-0.3637012243270874,
0.44460609555244446,
0.044753581285476685,
0.030901364982128143,
0.02812683954834938,
-0.06738077849149704,
-0.028943944722414017,
0.33815979957580566,
0.29968684911727905,
-0.2950301170349121,
0.037189096212387085,
-0.21358247101306915,
0.25025248527526855,
0.025373518466949463,
0.11018157005310059,
-0.2734263241291046,
-0.4716452956199646,
-0.07626275718212128,
0.13064022362232208,
0.14106646180152893,
-0.621597170829773,
0.4345731735229492,
0.37053266167640686,
0.12326879799365997,
-0.06597254425287247,
-0.22601386904716492,
0.19723819196224213,
-0.12302853912115097,
0.22766384482383728,
-0.18539157509803772,
0.32051903009414673,
0.12989576160907745,
-0.3941280245780945,
-0.16899389028549194,
0.012553660199046135,
-0.23625048995018005,
-0.2937133014202118,
0.07448043674230576,
0.03753289207816124,
-0.3924560546875,
0.03863368183374405,
-0.35611626505851746,
0.2788245379924774,
0.3082659840583801,
0.13914184272289276,
-0.08939103782176971,
-0.0899123027920723,
-0.026651956140995026,
-0.2925671339035034,
0.3892507553100586,
0.33208131790161133,
0.10092192888259888,
-0.22731858491897583,
0.03020300343632698,
0.05410420149564743,
-0.024399351328611374,
-0.3640150725841522,
-0.2787824869155884,
0.10890825092792511,
-0.23694196343421936,
0.13754688203334808,
0.42102378606796265,
0.05079135298728943,
-0.3527790307998657,
0.17903923988342285,
0.18602338433265686,
0.2862021327018738,
0.27035850286483765,
-0.21050813794136047,
-0.3393792510032654,
0.050773102790117264,
0.007052980363368988,
0.26773566007614136,
0.11020306497812271,
0.10440484434366226,
-0.19790878891944885,
-0.4660363793373108,
-0.2690722644329071,
0.10351097583770752,
-0.018405837938189507,
0.24558164179325104,
-0.1972908079624176,
-0.24799679219722748,
0.31747546792030334,
-0.010795751586556435,
-0.16410581767559052,
0.3291687071323395,
0.17884543538093567,
0.05486005172133446,
0.18412770330905914,
0.0678456723690033,
-0.7171313762664795,
0.41454195976257324,
0.12984704971313477,
-0.13154862821102142,
-0.16219522058963776,
-0.29560405015945435,
-0.18660017848014832,
-0.019246980547904968,
-0.45749762654304504,
0.06371606141328812,
-0.001987650990486145,
0.6734831929206848,
-0.012473009526729584,
0.02018725872039795,
-0.38341325521469116,
0.23546423017978668,
-0.13314920663833618,
0.22112113237380981,
-0.38858169317245483,
0.23485690355300903,
0.17146779596805573,
-0.13208582997322083,
-0.24599269032478333,
0.13063979148864746,
0.08834367245435715,
0.01265302300453186,
0.053301114588975906,
0.5009405016899109,
-0.007154151797294617,
0.1523112952709198,
-0.39835673570632935,
-0.158627450466156,
-0.03331324830651283,
0.13856452703475952,
-0.11167149245738983,
0.214480921626091,
0.025238607078790665,
0.01670818030834198,
-0.1489819586277008,
0.3800274133682251,
0.16658927500247955,
0.28779131174087524,
-0.18272103369235992,
-0.017008740454912186,
-0.01578027382493019,
-0.149952232837677,
-0.31979942321777344,
-0.24014964699745178,
-0.2750198245048523,
-0.1823805272579193,
0.4950457811355591,
0.19272032380104065,
-0.4993312954902649,
-0.14432615041732788,
0.4281059503555298,
0.20952977240085602,
-0.10054486989974976,
-0.06378510594367981,
0.010609589517116547,
0.1490989327430725,
0.17128098011016846,
0.21184705197811127,
0.4356701374053955,
0.1284395009279251,
-0.03676117584109306,
-0.08002801239490509,
-0.46936917304992676,
-0.17308837175369263,
0.19299361109733582,
0.10731738805770874,
0.14001667499542236,
0.26206040382385254,
0.08274148404598236,
-0.13585329055786133,
-0.353563129901886,
-0.03719361498951912,
0.21898899972438812,
-0.09821894764900208,
-0.19605602324008942,
0.20692694187164307,
-0.260574072599411,
-0.042446985840797424,
-0.09753349423408508,
-0.2931751608848572,
-0.2960679233074188,
-0.33986347913742065,
-0.2442018985748291,
0.24963253736495972,
-0.11882850527763367,
0.32635027170181274,
-0.1526814103126526,
0.14610835909843445,
-0.19312968850135803,
-0.5052558183670044,
-0.24588848650455475,
0.1425727903842926,
-0.30362191796302795,
-0.16292086243629456,
0.06934373080730438,
-0.3872421085834503,
-0.12452687323093414,
0.11165771633386612,
-0.2608639895915985,
-0.1213228851556778,
-0.29546552896499634,
0.16326847672462463,
-0.01567058265209198,
0.7013134360313416,
0.2893536686897278,
0.02253594622015953,
0.11195812374353409,
-0.31625911593437195,
0.42686620354652405,
0.4803043305873871,
0.11141978949308395,
0.11437518894672394,
0.257580429315567,
-0.05571868270635605,
-0.1434827446937561,
0.08741119503974915,
0.07434374839067459,
-0.16942870616912842,
0.036763422191143036,
-0.060427501797676086,
-0.031780216842889786,
0.6047505736351013,
0.1994985193014145,
-0.09402644634246826,
-0.3642355501651764,
0.21615655720233917,
0.031120572239160538,
-0.28814056515693665,
0.2927047908306122,
-0.011858362704515457,
-0.13167208433151245,
-0.37486135959625244,
-0.23957015573978424,
0.3600299060344696,
-0.11423890292644501,
-0.533031165599823,
-0.08465059101581573,
-0.3616883456707001,
0.5079155564308167,
0.24777548015117645,
0.22307157516479492,
-0.13855955004692078,
0.23779992759227753,
0.10013280808925629,
-0.19838497042655945,
-0.2614139914512634,
0.3594004511833191,
0.047574713826179504,
0.3591569662094116,
0.5057857632637024,
0.14830389618873596,
-0.04002636298537254,
0.4638954997062683,
0.33768969774246216,
-0.1386949121952057,
0.3398350775241852,
-0.25832098722457886,
0.3870566189289093,
-0.03317728266119957,
-0.4466181993484497,
-0.033580951392650604,
0.3177701234817505,
0.29938435554504395,
0.2221122682094574,
0.06163288652896881,
0.0966227576136589,
-0.2530090808868408,
-0.09691618382930756,
0.031018361449241638,
-0.430194616317749,
-0.2422412633895874,
-0.17062169313430786,
0.08428966999053955,
0.3281733989715576,
0.22040559351444244,
-0.07232173532247543,
-0.13177308440208435,
-0.1256786733865738,
0.2508152723312378,
-0.2671050429344177,
0.09797815978527069,
-0.10328934341669083,
0.05991378054022789,
-0.1178741455078125,
0.18327976763248444,
-0.14119456708431244,
0.0022832676768302917,
0.14796818792819977,
0.05729496479034424,
0.21747347712516785,
0.03400779888033867,
0.530083954334259,
-0.03462429344654083,
0.03372307866811752,
0.25442788004875183,
-0.00016110390424728394,
-0.3260652422904968,
-0.21365611255168915,
0.28287065029144287,
0.01893896982073784,
0.07337111234664917,
0.3214673697948456,
-0.5200830698013306,
-0.37148550152778625,
-0.1336844116449356,
0.18453198671340942,
-0.04851062223315239,
-0.18215681612491608,
-0.37294888496398926,
-0.13330593705177307,
0.09401111304759979,
-0.07974175363779068,
-0.23742428421974182,
0.4488269090652466,
-0.14331099390983582,
0.15002891421318054,
-0.24772274494171143,
-0.21075040102005005,
0.03818601369857788,
0.3678239583969116,
0.32747769355773926,
-0.07819759100675583,
0.2295764982700348,
-0.020511653274297714,
0.049690160900354385,
0.12370192259550095,
0.4021146893501282,
0.028009068220853806,
-0.1802830994129181,
-0.09806081652641296,
-0.06912357360124588,
0.39126908779144287,
0.36136263608932495,
-0.3461255431175232,
0.10411646962165833,
0.0355067178606987,
0.1537422239780426,
-0.02285386249423027,
0.06960292160511017,
0.37304309010505676,
0.02791554480791092,
-0.21267792582511902,
-0.5004714727401733,
0.7435424327850342,
-0.028208479285240173,
-0.1759984940290451,
0.4444181025028229,
0.49516981840133667,
-0.464897483587265,
0.029873423278331757,
-0.20082929730415344,
0.6208614706993103,
0.46212905645370483,
0.10694421082735062,
0.26175975799560547,
-0.10331229865550995,
0.2977643609046936,
0.27051103115081787,
0.23185181617736816,
-0.47611385583877563,
0.06585688889026642,
0.16110043227672577,
-0.06364582479000092,
0.5106801390647888,
0.33188483119010925,
-0.09800102561712265,
0.02826053276658058,
-0.02816396951675415,
0.32618892192840576,
-0.027716973796486855,
0.20961448550224304,
-0.4304594099521637,
-0.1612037569284439,
-0.3892686069011688,
-0.05459671840071678,
-0.09068676084280014,
0.317643940448761,
0.13638409972190857,
-0.21087872982025146,
0.01057666540145874,
-0.2021285593509674,
-0.12230504304170609,
0.10198204219341278,
-0.1757141649723053,
-0.03610635921359062,
0.504560649394989,
-0.1418284773826599,
0.028074093163013458,
0.4569843113422394,
0.3265027701854706,
0.4481540024280548,
-0.21510685980319977,
0.10284799337387085,
-0.05158771574497223,
0.15528462827205658,
-0.002876006066799164,
-0.014201119542121887,
0.33376115560531616,
0.05494135618209839,
-0.32501259446144104,
-0.015957552939653397,
0.007925063371658325,
-0.0553053542971611,
-0.17011094093322754,
-0.047470543533563614,
0.0212082676589489,
-0.2730274796485901,
-0.18299579620361328,
-0.15441057085990906,
0.37141847610473633,
-0.2589436173439026,
0.053033843636512756,
-0.023585740476846695,
-0.13523365557193756,
0.4705515205860138,
-0.22466450929641724,
-0.22256870567798615,
-0.17068630456924438,
0.3565887212753296,
-0.2392638474702835,
0.07738354802131653,
0.52668297290802,
-0.39817190170288086,
-0.01628918945789337,
0.02861582487821579,
0.32743144035339355,
0.0963907539844513,
-0.28764837980270386,
0.006411809474229813,
0.16590939462184906,
-0.10743219405412674,
0.08268877863883972,
0.4798665940761566,
-0.020762765780091286,
-0.08320785313844681,
0.01497841626405716,
-0.09075950086116791,
-0.04276826232671738,
0.05675135925412178,
0.13176926970481873,
0.2535317838191986,
-0.06345303356647491,
0.0030632056295871735,
0.07809028029441833,
-0.025020979344844818,
-0.1665901243686676,
-0.06514164805412292,
-0.07825259864330292,
0.04241785407066345,
-0.08331206440925598,
0.3535274863243103,
-0.03553147241473198,
-0.15459893643856049,
0.1530897319316864,
-0.19079343974590302,
-0.1251406967639923,
-0.10707230865955353,
-0.3859882056713104,
0.20263297855854034,
0.2078092098236084,
0.15010327100753784,
0.09258045256137848,
-0.25095659494400024,
-0.15459148585796356,
-0.2613130509853363,
0.4154767394065857,
0.224264994263649,
0.009452631697058678,
0.08745166659355164,
0.10278961062431335,
0.2782815992832184,
-0.056344181299209595,
-0.09750618785619736,
-0.20494775474071503,
-0.11488184332847595,
0.2617538869380951,
0.1137019693851471,
-0.47740739583969116,
0.09459076821804047,
0.1149754598736763,
-0.05599401891231537,
-0.33792170882225037,
0.017371227964758873,
0.1684596836566925,
-0.3786972165107727,
-0.055138327181339264,
0.2252027839422226,
0.3247739374637604,
0.33727768063545227,
-0.16552215814590454,
-0.15429532527923584,
0.16347390413284302,
0.03163463622331619,
-0.2519872784614563,
-0.13830816745758057,
0.23626519739627838,
0.1260187178850174,
0.2951964735984802,
0.4322493076324463,
0.23261357843875885,
-0.13588176667690277,
0.06831994652748108,
-0.14971058070659637,
0.2520483732223511,
-0.10412107408046722,
0.3579157590866089,
0.6725655198097229,
0.004199981689453125,
0.21624591946601868,
0.5796220898628235,
0.33676984906196594,
0.02206447720527649,
0.4739013910293579,
0.02830185741186142,
-0.12449181824922562,
-0.041460469365119934,
-0.2883470356464386,
0.17759668827056885,
-0.3565690517425537,
0.34935617446899414,
-0.2039097547531128,
-0.38523268699645996,
-0.07613281160593033,
-0.08235014975070953,
0.21181802451610565,
-0.5318730473518372,
0.05580287426710129,
-0.19512063264846802,
0.08482450991868973,
-0.17174819111824036,
-0.49798405170440674,
-0.3472672700881958,
-0.2464517503976822,
0.0744992196559906,
-0.09777741134166718,
-0.05996936932206154,
-0.3765716850757599,
0.34750765562057495,
-0.1665600687265396,
-0.12971732020378113,
-0.2713588774204254,
0.049394648522138596,
0.011991532519459724,
0.3210664987564087,
-0.1452690213918686,
0.3215091824531555,
0.013860676437616348,
-0.12360002100467682,
-0.002761389594525099,
0.3232457935810089,
0.35328245162963867,
0.17146393656730652,
0.2078791856765747,
-0.21459561586380005,
0.062126170843839645,
0.023879937827587128,
-0.2042473703622818,
0.1306411474943161,
0.17114800214767456,
-0.06551367044448853,
0.38795509934425354,
0.06637364625930786,
-0.1325415074825287,
-0.17100507020950317,
0.2913629412651062,
0.3308440148830414,
-0.4386249780654907,
0.4032822549343109,
-0.08931367099285126,
0.005992822349071503,
0.3048948049545288,
0.06270542740821838,
-0.3857864439487457,
-0.2533089518547058,
0.5242847800254822,
0.3039219379425049,
0.045887190848588943,
-0.3013814687728882,
0.02422591671347618,
0.19980227947235107,
0.17964234948158264,
-0.05271221697330475,
-0.10746775567531586,
-0.2839397192001343,
-0.08310794830322266,
-0.48816192150115967,
0.03984642028808594,
0.06138436868786812,
-0.1461334526538849,
0.16965645551681519,
-0.032510507851839066,
0.03495514765381813,
-0.18841122090816498,
-0.09029796719551086,
0.13853341341018677,
0.25646573305130005,
0.07866618037223816,
-0.22106584906578064,
-0.28890112042427063,
-0.1503957062959671,
-0.16279806196689606,
0.07001162320375443,
-0.30892807245254517,
0.1103697195649147,
-0.3164208233356476,
-0.024057962000370026,
-0.10371769964694977,
0.2732478976249695,
0.44082677364349365,
-0.09007570147514343,
-0.046645473688840866,
-0.15152408182621002,
0.1531081199645996,
0.11281856894493103,
-0.14760924875736237,
-0.31063708662986755,
0.0374513603746891,
-0.2923859655857086,
0.05121050029993057,
-0.0797927975654602,
0.24435320496559143,
-0.16346901655197144,
-0.1909516602754593,
-0.16715890169143677,
-0.009033989161252975,
0.42573392391204834,
0.04785732552409172,
0.15929216146469116,
0.08471126854419708,
-0.18521633744239807,
-0.013422463089227676,
0.23143024742603302,
0.22584053874015808,
-0.12561747431755066,
0.38600847125053406,
-0.1241035908460617,
-0.45299041271209717,
0.7254766821861267,
-0.09789551794528961,
-0.3830145597457886,
-0.27853843569755554,
0.149143248796463,
0.04836312308907509,
-0.027105677872896194,
-0.2220603972673416,
0.047287002205848694,
0.5130628347396851,
-0.20892387628555298,
-0.23023533821105957,
0.0899696946144104,
-0.09394603222608566,
0.09299544990062714,
-0.12045381963253021,
0.04038546234369278,
0.06385558843612671,
-0.16802465915679932,
-0.12311558425426483,
-0.03427552059292793
] |
https://github.com/huggingface/datasets/issues/6130 | @lhoestq The error is
```
def _info(self) -> DatasetInfo:
_ = self.option1 <-
....
AttributeError: 'BuilderConfig' object has no attribute 'option1'
```
which seems to find another unknown config.
You can try this line `datasets.load_dataset("indonesian-nlp/librivox-indonesia", split="train", data_dir='.')`, it's a multi-config dataset on HF hub and the error is the same.
My insights:
https://github.com/huggingface/datasets/blob/12cfc1196e62847e2e8239fbd727a02cbc86ddec/src/datasets/builder.py#L518
if `config_kwargs` is provided here, the if branch is skipped. | default config name doesn't work when config kwargs are specified. | ### Describe the bug
https://github.com/huggingface/datasets/blob/12cfc1196e62847e2e8239fbd727a02cbc86ddec/src/datasets/builder.py#L518-L522
If `config_name` is `None`, `DEFAULT_CONFIG_NAME` should be select. But once users pass `config_kwargs` to their customized `BuilderConfig`, the logic is ignored, and dataset cannot select the default config from multiple configs.
### Steps to reproduce the bug
```python
import datasets
datasets.load_dataset('/dataset/with/multiple/config'') # Ok
datasets.load_dataset('/dataset/with/multiple/config', some_field_in_config='some') # Err
```
### Expected behavior
Default config behavior should be consistent.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3 | 63 | default config name doesn't work when config kwargs are specified.
### Describe the bug
https://github.com/huggingface/datasets/blob/12cfc1196e62847e2e8239fbd727a02cbc86ddec/src/datasets/builder.py#L518-L522
If `config_name` is `None`, `DEFAULT_CONFIG_NAME` should be select. But once users pass `config_kwargs` to their customized `BuilderConfig`, the logic is ignored, and dataset cannot select the default config from multiple configs.
### Steps to reproduce the bug
```python
import datasets
datasets.load_dataset('/dataset/with/multiple/config'') # Ok
datasets.load_dataset('/dataset/with/multiple/config', some_field_in_config='some') # Err
```
### Expected behavior
Default config behavior should be consistent.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
@lhoestq The error is
```
def _info(self) -> DatasetInfo:
_ = self.option1 <-
....
AttributeError: 'BuilderConfig' object has no attribute 'option1'
```
which seems to find another unknown config.
You can try this line `datasets.load_dataset("indonesian-nlp/librivox-indonesia", split="train", data_dir='.')`, it's a multi-config dataset on HF hub and the error is the same.
My insights:
https://github.com/huggingface/datasets/blob/12cfc1196e62847e2e8239fbd727a02cbc86ddec/src/datasets/builder.py#L518
if `config_kwargs` is provided here, the if branch is skipped. | [
-0.14594551920890808,
-0.2705951929092407,
0.13886938989162445,
0.1655144989490509,
0.19108057022094727,
0.022060848772525787,
0.45360273122787476,
0.06476003676652908,
0.020564965903759003,
0.464612752199173,
0.06959917396306992,
0.4245510697364807,
0.173030823469162,
0.15137013792991638,
-0.011770026758313179,
0.08944327384233475,
-0.11453193426132202,
0.059547606855630875,
-0.0469449907541275,
0.04179343581199646,
-0.2830085754394531,
0.347857803106308,
-0.04929376393556595,
0.1776830404996872,
-0.3528555631637573,
0.251121461391449,
-0.13744236528873444,
0.22792041301727295,
0.08061278611421585,
-0.38941892981529236,
0.5021725296974182,
0.20019987225532532,
-0.16649819910526276,
0.3415969908237457,
-0.00012363919813651592,
0.08417896926403046,
0.4137573838233948,
-0.00026673823595046997,
-0.34138134121894836,
-0.33394551277160645,
-0.42168018221855164,
-0.022011786699295044,
0.06532470881938934,
-0.24553155899047852,
-0.1199796199798584,
0.14467734098434448,
0.11462225019931793,
-0.18864502012729645,
-0.06779627501964569,
0.061985380947589874,
0.1182844489812851,
0.07691332697868347,
-0.06551490724086761,
-0.1154659166932106,
-0.33762285113334656,
0.08379331231117249,
-0.10197515785694122,
0.20720943808555603,
-0.29778534173965454,
-0.150039404630661,
0.00841628760099411,
0.033405352383852005,
-0.035727497190237045,
-0.03406544402241707,
0.34102898836135864,
0.08755616843700409,
0.07580909132957458,
-0.1665220856666565,
0.20477041602134705,
0.5356478095054626,
0.20686396956443787,
-0.5078667402267456,
-0.14500564336776733,
-0.47970062494277954,
0.2233666479587555,
-0.03610290586948395,
0.3844693899154663,
0.11554376780986786,
-0.4667932391166687,
0.032419603317976,
-0.17291758954524994,
-0.2166854441165924,
0.10810897499322891,
0.14408238232135773,
-0.28698575496673584,
0.4860115647315979,
-0.10006530582904816,
0.20365244150161743,
-0.09812085330486298,
-0.007694890722632408,
-0.03639562800526619,
-0.718781054019928,
-0.08840863406658173,
-0.0036990903317928314,
-0.32374224066734314,
0.1764947474002838,
0.28505951166152954,
0.20094913244247437,
0.15588197112083435,
-0.11468058824539185,
-0.06726208329200745,
0.152154341340065,
0.2591927647590637,
0.15164044499397278,
-0.002213895320892334,
0.1683904230594635,
0.33346766233444214,
0.14253196120262146,
0.2079678773880005,
0.2424875646829605,
-0.15649813413619995,
0.0807928740978241,
0.11764173209667206,
-0.15946361422538757,
-0.10672317445278168,
-0.31635037064552307,
0.34104621410369873,
0.040114350616931915,
-0.01955236867070198,
0.08413302898406982,
-0.02992389351129532,
-0.01722412183880806,
0.34255117177963257,
0.3501148521900177,
-0.2951045036315918,
0.06524510681629181,
-0.24456782639026642,
0.20124642550945282,
0.02144993096590042,
0.17320531606674194,
-0.2749131917953491,
-0.3064822554588318,
-0.09010548144578934,
0.065342977643013,
0.09287252277135849,
-0.5742061138153076,
0.41653940081596375,
0.2865258455276489,
0.31094488501548767,
-0.12371210008859634,
-0.29930001497268677,
0.17435193061828613,
-0.1310294270515442,
0.24437469244003296,
-0.1922234743833542,
0.23340493440628052,
0.13992394506931305,
-0.32347771525382996,
-0.18839649856090546,
-0.06434671580791473,
-0.3413257896900177,
-0.3652617335319519,
-0.01117008551955223,
0.05080096423625946,
-0.3194195330142975,
0.04026701673865318,
-0.30588191747665405,
0.2303972989320755,
0.2259494811296463,
0.14589166641235352,
-0.04024304822087288,
-0.038955532014369965,
-0.01748035103082657,
-0.2370985895395279,
0.4181603789329529,
0.35487526655197144,
0.13361050188541412,
-0.34373563528060913,
0.19909636676311493,
0.01777198538184166,
-0.1029757708311081,
-0.3327775299549103,
-0.326715350151062,
0.10642123222351074,
-0.22704705595970154,
0.0786902904510498,
0.2911049723625183,
-0.16449397802352905,
-0.3000386357307434,
0.1472163051366806,
0.192570298910141,
0.2596687376499176,
0.23123595118522644,
-0.15449780225753784,
-0.430486798286438,
0.049507997930049896,
0.010597646236419678,
0.21817688643932343,
0.11621836572885513,
0.08867364376783371,
-0.16211065649986267,
-0.5526494383811951,
-0.32254359126091003,
0.12484560906887054,
0.08759906888008118,
0.19935190677642822,
-0.1477024257183075,
-0.12055887281894684,
0.3299597501754761,
0.023642806336283684,
-0.12410473823547363,
0.3731183409690857,
0.1759476661682129,
0.062299203127622604,
0.1621081531047821,
0.015330307185649872,
-0.6772500872612,
0.3986998200416565,
0.01653572916984558,
-0.010052544996142387,
-0.08566083759069443,
-0.26771169900894165,
-0.19412215054035187,
-0.0662757009267807,
-0.4724147915840149,
0.03208514302968979,
0.0219196155667305,
0.6094132661819458,
-0.10011627525091171,
-0.031351715326309204,
-0.4000900983810425,
0.39773789048194885,
0.022086694836616516,
0.20690646767616272,
-0.4180448651313782,
0.3148844242095947,
0.0990041121840477,
0.0006028749048709869,
-0.19464638829231262,
0.22018395364284515,
0.10909914970397949,
-0.0014369860291481018,
-0.007381752133369446,
0.5484434366226196,
-0.10162929445505142,
0.2278546839952469,
-0.28661173582077026,
-0.12744714319705963,
0.047515869140625,
0.17120307683944702,
-0.10343021899461746,
0.1679903268814087,
0.010477013885974884,
-0.0512862354516983,
-0.23320657014846802,
0.40683624148368835,
0.2252526581287384,
0.29482823610305786,
-0.07276399433612823,
-0.03536157310009003,
-0.0645098015666008,
-0.14896158874034882,
-0.2742878198623657,
-0.27578288316726685,
-0.11576695740222931,
-0.2765743136405945,
0.5442515015602112,
0.19001741707324982,
-0.46877139806747437,
-0.1980263739824295,
0.4179568290710449,
0.19316720962524414,
-0.095319002866745,
-0.059005700051784515,
0.0872604250907898,
0.15576040744781494,
0.2357485294342041,
0.17139336466789246,
0.3592050075531006,
0.12283895164728165,
-0.13048085570335388,
0.029133347794413567,
-0.49255573749542236,
-0.09980550408363342,
0.09639517962932587,
0.09649169445037842,
0.21297714114189148,
0.265932559967041,
0.06919896602630615,
-0.027898717671632767,
-0.35366982221603394,
-0.21586106717586517,
0.21393918991088867,
-0.036984026432037354,
-0.26943516731262207,
0.1872866451740265,
-0.3624182343482971,
-0.09410800039768219,
-0.08745454251766205,
-0.3250584900379181,
-0.4046980142593384,
-0.41774532198905945,
-0.2158193737268448,
0.11139212548732758,
-0.10666908323764801,
0.32033029198646545,
-0.2449626624584198,
0.17855851352214813,
-0.19191581010818481,
-0.3952021598815918,
-0.24724403023719788,
0.09656994789838791,
-0.2693413496017456,
-0.1506480872631073,
0.03896336257457733,
-0.32399091124534607,
-0.12828725576400757,
0.06965556740760803,
-0.2920966148376465,
-0.0610150583088398,
-0.2679237127304077,
0.2477540820837021,
-0.0019808164797723293,
0.5948997735977173,
0.3175092935562134,
-0.021254397928714752,
0.05081253498792648,
-0.3172260820865631,
0.46048229932785034,
0.5847643613815308,
0.088083416223526,
0.20156466960906982,
0.20918165147304535,
-0.09641630202531815,
-0.0682300552725792,
0.041980840265750885,
0.03368058055639267,
-0.21038968861103058,
0.022663917392492294,
-0.07052073627710342,
0.05669684708118439,
0.6537684798240662,
0.10074896365404129,
-0.011760536581277847,
-0.44595572352409363,
0.15807896852493286,
0.018218714743852615,
-0.3316587209701538,
0.20561861991882324,
-0.07482261955738068,
-0.13424715399742126,
-0.4296756982803345,
-0.11399944871664047,
0.39218178391456604,
-0.23105567693710327,
-0.5903975963592529,
-0.16585978865623474,
-0.326712042093277,
0.48331427574157715,
0.12265320867300034,
0.22639814019203186,
-0.12741240859031677,
0.2478533834218979,
0.07893846929073334,
-0.23180153965950012,
-0.20150728523731232,
0.36780402064323425,
0.07212166488170624,
0.38076290488243103,
0.397715300321579,
0.1222306564450264,
0.026876315474510193,
0.3798520267009735,
0.42321765422821045,
-0.058588773012161255,
0.40048450231552124,
-0.26725250482559204,
0.41740795969963074,
-0.0899352878332138,
-0.4683910310268402,
0.11683417856693268,
0.27915412187576294,
0.32572945952415466,
0.2650362551212311,
0.05275692418217659,
0.13312570750713348,
-0.29087644815444946,
-0.16544193029403687,
0.09364497661590576,
-0.4482933282852173,
-0.23489822447299957,
-0.2519354522228241,
0.035490091890096664,
0.3133963942527771,
0.1667148917913437,
-0.14656072854995728,
-0.12635864317417145,
0.015590619295835495,
0.3397967219352722,
-0.31454184651374817,
0.11929875612258911,
-0.13551966845989227,
0.0004937238991260529,
-0.1347329169511795,
0.12807458639144897,
-0.12985634803771973,
0.09352873265743256,
0.11028842628002167,
0.17771100997924805,
0.1717061698436737,
-0.0010086819529533386,
0.5386949181556702,
-0.03595738857984543,
0.029256539419293404,
0.26184844970703125,
0.07222673296928406,
-0.32516682147979736,
-0.22595718502998352,
0.17243441939353943,
0.06415670365095139,
0.022958803921937943,
0.4154558479785919,
-0.4961085915565491,
-0.4387093186378479,
0.0019420217722654343,
0.1595752239227295,
-0.05220300331711769,
-0.1727733314037323,
-0.33503443002700806,
-0.13524702191352844,
0.013949215412139893,
-0.10225385427474976,
-0.2646520733833313,
0.46766769886016846,
-0.09933556616306305,
0.17096054553985596,
-0.11091681569814682,
-0.16803762316703796,
0.03822000324726105,
0.2725245952606201,
0.19214282929897308,
-0.004123184829950333,
0.21813884377479553,
-0.03374745696783066,
0.07609661668539047,
0.14820802211761475,
0.5090395212173462,
-0.0679529458284378,
-0.20480501651763916,
-0.0671214833855629,
0.0025834105908870697,
0.2932787835597992,
0.4383165240287781,
-0.2795517146587372,
0.09709897637367249,
0.06753882020711899,
0.2793527841567993,
-0.059648141264915466,
0.03843986243009567,
0.324496328830719,
0.05526440590620041,
-0.2928381860256195,
-0.3984728157520294,
0.7551628351211548,
-0.14749467372894287,
-0.17310866713523865,
0.4520474970340729,
0.5597591996192932,
-0.42060157656669617,
0.08024908602237701,
-0.23620222508907318,
0.6737779378890991,
0.46549728512763977,
0.10997086763381958,
0.2956720292568207,
-0.17540721595287323,
0.18835337460041046,
0.17873120307922363,
0.182233065366745,
-0.44168201088905334,
0.07386171817779541,
0.10125617682933807,
-0.03430040180683136,
0.4534672498703003,
0.3008863925933838,
-0.0439111702144146,
0.10757067799568176,
0.0400564968585968,
0.3105603754520416,
-0.07209619879722595,
0.20648765563964844,
-0.5397163033485413,
-0.25990113615989685,
-0.2861156463623047,
-0.03204423934221268,
-0.1469385027885437,
0.4289926588535309,
0.130649134516716,
-0.15604671835899353,
0.03283415734767914,
-0.15516340732574463,
-0.21819335222244263,
0.09777151793241501,
-0.2724485695362091,
0.0324503593146801,
0.39257898926734924,
-0.08477868139743805,
0.03349024057388306,
0.34398603439331055,
0.3637835383415222,
0.4287089407444,
-0.25437837839126587,
0.1446644514799118,
-0.02378794178366661,
0.20261751115322113,
-0.02289971150457859,
-0.0383431538939476,
0.412733793258667,
0.02286035567522049,
-0.42305564880371094,
-0.09253992140293121,
-0.016954299062490463,
0.011421017348766327,
-0.0814945250749588,
-0.09029527008533478,
0.01708272472023964,
-0.18578492105007172,
-0.15416425466537476,
-0.11536115407943726,
0.3610716760158539,
-0.27144119143486023,
0.06295463442802429,
-0.038501396775245667,
-0.13868756592273712,
0.4241293966770172,
-0.12375214695930481,
-0.25297749042510986,
-0.18626916408538818,
0.3870134949684143,
-0.27076131105422974,
0.02367263287305832,
0.508229672908783,
-0.32727622985839844,
-0.06500167399644852,
0.0285746231675148,
0.3647245168685913,
0.24553219974040985,
-0.2922828197479248,
-0.08024466037750244,
0.06907939910888672,
-0.14354275166988373,
-0.010769419372081757,
0.4445611834526062,
0.04395480081439018,
-0.08602145314216614,
0.07762561738491058,
-0.14465734362602234,
-0.055107854306697845,
0.1670527458190918,
0.10845836997032166,
0.2502712309360504,
-0.09355423599481583,
0.11311157047748566,
0.15825212001800537,
0.056879863142967224,
-0.19189223647117615,
-0.02057424932718277,
-0.1885284036397934,
0.08170020580291748,
-0.06435415148735046,
0.3426658511161804,
0.02438851073384285,
-0.18955054879188538,
0.14626508951187134,
-0.22838924825191498,
-0.16786468029022217,
-0.1045101210474968,
-0.4472731053829193,
0.19972656667232513,
0.15453249216079712,
0.14195533096790314,
0.09920502454042435,
-0.24920782446861267,
-0.16725090146064758,
-0.2815620005130768,
0.44768035411834717,
0.31720060110092163,
-0.002926146611571312,
0.13590186834335327,
0.15022331476211548,
0.14476509392261505,
-0.013191387057304382,
-0.054600782692432404,
-0.043548114597797394,
-0.056988734751939774,
0.21441183984279633,
0.10039973258972168,
-0.5407044291496277,
0.10007500648498535,
0.14272862672805786,
-0.008976291865110397,
-0.39127880334854126,
0.09778628498315811,
0.15325893461704254,
-0.38089069724082947,
0.02992885559797287,
0.18450844287872314,
0.29358989000320435,
0.2420804351568222,
-0.19999819993972778,
-0.06327439099550247,
0.22610947489738464,
0.03976057469844818,
-0.270727276802063,
-0.15168821811676025,
0.2154078632593155,
0.05100980028510094,
0.3454321026802063,
0.3731865882873535,
0.31977421045303345,
-0.10454698652029037,
0.045281894505023956,
-0.10686467587947845,
0.30252280831336975,
-0.16745977103710175,
0.32893988490104675,
0.6299545764923096,
-0.0239618718624115,
0.2524755597114563,
0.4828592836856842,
0.2473963350057602,
-0.014571968466043472,
0.5180535912513733,
0.05006545037031174,
-0.0687100738286972,
0.009015100076794624,
-0.17356331646442413,
0.27089637517929077,
-0.3927956223487854,
0.3107367157936096,
-0.2933018207550049,
-0.4663413465023041,
-0.059610944241285324,
-0.13917267322540283,
0.2803032398223877,
-0.5749029517173767,
0.020370475947856903,
-0.17191192507743835,
0.14591631293296814,
-0.21317821741104126,
-0.4682283401489258,
-0.28516924381256104,
-0.24728229641914368,
0.007480233907699585,
-0.10750913619995117,
-0.01986776292324066,
-0.36726635694503784,
0.32309556007385254,
-0.07899244129657745,
-0.15677577257156372,
-0.22293609380722046,
0.04034837335348129,
0.04339117556810379,
0.4145362079143524,
-0.17013472318649292,
0.37683388590812683,
0.0447838231921196,
-0.14457514882087708,
-0.02395402081310749,
0.3804844915866852,
0.37521347403526306,
0.1620304137468338,
0.22657620906829834,
-0.19101296365261078,
0.17449620366096497,
0.005916982889175415,
-0.14177733659744263,
0.012280363589525223,
0.2362496554851532,
-0.005203024484217167,
0.36509209871292114,
0.0891122967004776,
-0.1342587172985077,
-0.22879928350448608,
0.24315205216407776,
0.2986639142036438,
-0.4619029760360718,
0.41271281242370605,
-0.15199212729930878,
0.00804194062948227,
0.2685468792915344,
0.05664452910423279,
-0.44291847944259644,
-0.07439643889665604,
0.4809584617614746,
0.22983238101005554,
0.11796242743730545,
-0.2645258605480194,
0.03232155740261078,
0.21306872367858887,
0.2592594623565674,
-0.07364297658205032,
-0.19419096410274506,
-0.28017744421958923,
-0.0613984540104866,
-0.5202189683914185,
0.01973005011677742,
0.0386895090341568,
-0.1581566035747528,
0.20894476771354675,
-0.07076623290777206,
-0.043797802180051804,
-0.24487976729869843,
-0.010268963873386383,
0.11596375703811646,
0.3170168399810791,
0.07485078275203705,
-0.290041983127594,
-0.2473042607307434,
-0.08721373975276947,
-0.07175181061029434,
0.0992603674530983,
-0.25471580028533936,
0.1539182960987091,
-0.10533460974693298,
-0.05543360114097595,
-0.053691234439611435,
0.2149428278207779,
0.3943707346916199,
-0.2579473853111267,
-0.0533624142408371,
-0.18747659027576447,
0.14900001883506775,
0.04914562404155731,
-0.1750291883945465,
-0.3136911392211914,
-0.037110015749931335,
-0.24788354337215424,
0.0715077668428421,
-0.11916237324476242,
0.21695050597190857,
-0.14729422330856323,
-0.36310699582099915,
-0.18195107579231262,
-0.003779888153076172,
0.35450321435928345,
0.11456506699323654,
0.08350466936826706,
0.10158460587263107,
-0.15079504251480103,
0.039917729794979095,
0.24391445517539978,
0.36268100142478943,
-0.056795068085193634,
0.37190309166908264,
-0.10838963091373444,
-0.521338939666748,
0.7156918048858643,
-0.033397674560546875,
-0.3432738780975342,
-0.28900831937789917,
0.19198662042617798,
-0.006494857370853424,
-0.0800427496433258,
-0.348764568567276,
0.093719482421875,
0.4463692009449005,
-0.18229959905147552,
-0.2574719190597534,
0.02964603155851364,
-0.2213420271873474,
0.08767536282539368,
-0.10044717788696289,
0.08382850140333176,
0.09361487627029419,
-0.26822298765182495,
-0.02318088710308075,
0.03432568907737732
] |
https://github.com/huggingface/datasets/issues/6130 | I see, you just have to set this class attribute to your builder class :)
```python
BUILDER_CONFIG_CLASS = MyDatasetConfig
``` | default config name doesn't work when config kwargs are specified. | ### Describe the bug
https://github.com/huggingface/datasets/blob/12cfc1196e62847e2e8239fbd727a02cbc86ddec/src/datasets/builder.py#L518-L522
If `config_name` is `None`, `DEFAULT_CONFIG_NAME` should be select. But once users pass `config_kwargs` to their customized `BuilderConfig`, the logic is ignored, and dataset cannot select the default config from multiple configs.
### Steps to reproduce the bug
```python
import datasets
datasets.load_dataset('/dataset/with/multiple/config'') # Ok
datasets.load_dataset('/dataset/with/multiple/config', some_field_in_config='some') # Err
```
### Expected behavior
Default config behavior should be consistent.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3 | 20 | default config name doesn't work when config kwargs are specified.
### Describe the bug
https://github.com/huggingface/datasets/blob/12cfc1196e62847e2e8239fbd727a02cbc86ddec/src/datasets/builder.py#L518-L522
If `config_name` is `None`, `DEFAULT_CONFIG_NAME` should be select. But once users pass `config_kwargs` to their customized `BuilderConfig`, the logic is ignored, and dataset cannot select the default config from multiple configs.
### Steps to reproduce the bug
```python
import datasets
datasets.load_dataset('/dataset/with/multiple/config'') # Ok
datasets.load_dataset('/dataset/with/multiple/config', some_field_in_config='some') # Err
```
### Expected behavior
Default config behavior should be consistent.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
I see, you just have to set this class attribute to your builder class :)
```python
BUILDER_CONFIG_CLASS = MyDatasetConfig
``` | [
-0.23081204295158386,
-0.1871139407157898,
0.10418521612882614,
0.1373593807220459,
0.2660263776779175,
0.04879021644592285,
0.4744296669960022,
0.07422877848148346,
0.0004663318395614624,
0.5087602138519287,
0.1025904193520546,
0.48535749316215515,
0.17570990324020386,
0.1579459309577942,
-0.019652359187602997,
0.11846095323562622,
-0.14913193881511688,
0.1587807834148407,
-0.11752662062644958,
0.1175660789012909,
-0.2690422534942627,
0.280656635761261,
-0.0470152273774147,
0.13976874947547913,
-0.2730157673358917,
0.1644766926765442,
-0.03916449844837189,
0.13490831851959229,
0.07474518567323685,
-0.4519966244697571,
0.5720052719116211,
0.32355549931526184,
-0.20289744436740875,
0.33902329206466675,
-0.00011873730545630679,
0.04661019146442413,
0.427365243434906,
0.018382251262664795,
-0.36365750432014465,
-0.27053672075271606,
-0.35508111119270325,
-0.10196138918399811,
0.19190752506256104,
-0.3415777087211609,
-0.2846682667732239,
0.07410132884979248,
0.12764298915863037,
-0.14539796113967896,
-0.0024159960448741913,
0.0667881965637207,
0.1643347591161728,
0.022354789078235626,
0.009732894599437714,
-0.13172569870948792,
-0.39279547333717346,
0.04676420986652374,
-0.09052396565675735,
0.24719683825969696,
-0.24119602143764496,
-0.03834615647792816,
0.09202072769403458,
0.05510042607784271,
-0.07992996275424957,
-0.03951295465230942,
0.39501848816871643,
0.13129417598247528,
0.17140360176563263,
-0.1231844574213028,
0.22878442704677582,
0.4601019620895386,
0.3079851269721985,
-0.5004410743713379,
-0.12637609243392944,
-0.512829065322876,
0.269052118062973,
0.040039919316768646,
0.34506261348724365,
0.04348308593034744,
-0.4411123991012573,
0.06255325675010681,
-0.19823241233825684,
-0.16883417963981628,
0.0234794020652771,
0.16218049824237823,
-0.24032141268253326,
0.4559496343135834,
-0.18106573820114136,
0.16352158784866333,
-0.08183532953262329,
-0.08434438705444336,
-0.004233963787555695,
-0.6222852468490601,
-0.09391321241855621,
-0.03234981372952461,
-0.1831994354724884,
0.06242692470550537,
0.31205493211746216,
0.2952579855918884,
0.17326754331588745,
-0.02800840139389038,
-0.10847563296556473,
0.1650044023990631,
0.38260751962661743,
0.13071338832378387,
-0.0069834645837545395,
0.136599600315094,
0.45186278223991394,
0.14507552981376648,
0.25319087505340576,
0.2775106728076935,
-0.22320276498794556,
0.043405111879110336,
0.22920091450214386,
-0.148799329996109,
-0.035511892288923264,
-0.30755379796028137,
0.45523446798324585,
0.052989646792411804,
0.02834777534008026,
-0.007149333134293556,
0.034700602293014526,
-0.011812388896942139,
0.3209760785102844,
0.38302338123321533,
-0.27444756031036377,
-0.055321499705314636,
-0.1751675009727478,
0.18176712095737457,
0.04570265859365463,
0.15735779702663422,
-0.31527650356292725,
-0.35758042335510254,
0.006564393639564514,
0.07335822284221649,
0.0979546308517456,
-0.5652204155921936,
0.44466090202331543,
0.3210013508796692,
0.2581091523170471,
-0.09451256692409515,
-0.22610293328762054,
0.28141701221466064,
-0.1298079937696457,
0.2671172022819519,
-0.21813061833381653,
0.24172291159629822,
0.12918047606945038,
-0.41654250025749207,
-0.22063332796096802,
-0.07678191363811493,
-0.2880611717700958,
-0.33911722898483276,
0.04723493009805679,
0.1187865138053894,
-0.28552260994911194,
0.0488986037671566,
-0.24641302227973938,
0.2700214385986328,
0.2549377679824829,
0.05839589238166809,
-0.06021178141236305,
-0.03586804121732712,
-0.026718080043792725,
-0.26098668575286865,
0.4121916890144348,
0.2722947597503662,
0.07242776453495026,
-0.32426753640174866,
0.15437628328800201,
0.012965381145477295,
-0.1333078294992447,
-0.4512360394001007,
-0.3483283519744873,
0.10799090564250946,
-0.19640851020812988,
0.09507133066654205,
0.32759228348731995,
-0.05752893537282944,
-0.36089274287223816,
0.08523857593536377,
0.2009463906288147,
0.19711291790008545,
0.2558761537075043,
-0.17680004239082336,
-0.3455023765563965,
0.038846682757139206,
-0.03846488147974014,
0.2615029215812683,
0.12895144522190094,
0.11190830171108246,
-0.12783555686473846,
-0.4612857401371002,
-0.22266313433647156,
0.0829944908618927,
-0.012212669476866722,
0.20461973547935486,
-0.14342539012432098,
-0.19220611453056335,
0.2686440050601959,
-0.12796948850154877,
-0.16518661379814148,
0.3020264506340027,
0.14434543251991272,
0.07212981581687927,
0.12436604499816895,
-0.08959662914276123,
-0.6722925901412964,
0.3690604567527771,
0.06184208393096924,
-0.04304269701242447,
-0.15974408388137817,
-0.341274619102478,
-0.1786806583404541,
-0.06268251687288284,
-0.49892276525497437,
-0.01728399470448494,
0.09550002217292786,
0.5428516268730164,
-0.03781875967979431,
-0.0013687536120414734,
-0.3479483127593994,
0.2557993233203888,
-0.09047690033912659,
0.24473993480205536,
-0.40551048517227173,
0.22195427119731903,
0.10833258926868439,
-0.04558299109339714,
-0.23326730728149414,
0.1719217598438263,
0.09785894304513931,
-0.029309771955013275,
0.022524267435073853,
0.45833736658096313,
-0.07249332964420319,
0.10782122611999512,
-0.3315832018852234,
-0.13316644728183746,
-0.024640392512083054,
0.14214766025543213,
-0.14989429712295532,
0.21813154220581055,
0.02062765136361122,
-0.048372965306043625,
-0.15664255619049072,
0.4572709798812866,
0.2278166115283966,
0.26494863629341125,
-0.11753874272108078,
-0.04513687640428543,
0.005086109042167664,
-0.11695746332406998,
-0.26828354597091675,
-0.2880944013595581,
-0.24112221598625183,
-0.20117869973182678,
0.4869857728481293,
0.19343861937522888,
-0.4507441818714142,
-0.17722821235656738,
0.3913450539112091,
0.1423490345478058,
-0.07285604625940323,
-0.04678948596119881,
-0.004014253616333008,
0.17526182532310486,
0.17358720302581787,
0.17801347374916077,
0.37906649708747864,
0.19713027775287628,
-0.07302485406398773,
-0.019897861406207085,
-0.4485892653465271,
-0.1297876089811325,
0.18149834871292114,
0.1199348121881485,
0.1734982430934906,
0.18148982524871826,
0.05524317920207977,
-0.11583152413368225,
-0.35514509677886963,
-0.09017930924892426,
0.1269567906856537,
-0.0744963213801384,
-0.22032895684242249,
0.16968002915382385,
-0.21705396473407745,
-0.09552260488271713,
-0.07382408529520035,
-0.3333181142807007,
-0.39072200655937195,
-0.2999113202095032,
-0.20378625392913818,
0.1225571483373642,
-0.1171301007270813,
0.32599905133247375,
-0.0865650326013565,
0.23235461115837097,
-0.16616368293762207,
-0.42997851967811584,
-0.25140321254730225,
0.10869807004928589,
-0.24384605884552002,
-0.08787646889686584,
0.013360049575567245,
-0.30225083231925964,
-0.07111096382141113,
0.06536263227462769,
-0.290480375289917,
-0.05814746022224426,
-0.3070085048675537,
0.14487595856189728,
-0.037496019154787064,
0.6459600925445557,
0.33057156205177307,
0.07785895466804504,
0.11324404180049896,
-0.30600449442863464,
0.4759715795516968,
0.45794254541397095,
0.08322707563638687,
0.06970679014921188,
0.1999494880437851,
-0.024102916941046715,
-0.09400299191474915,
0.05866966396570206,
0.028516171500086784,
-0.2320699691772461,
0.08155085146427155,
0.055146269500255585,
0.008296769112348557,
0.5145506262779236,
0.13320057094097137,
-0.030398989096283913,
-0.39445140957832336,
0.29396095871925354,
-0.008362893015146255,
-0.36276376247406006,
0.22315457463264465,
-0.10244136303663254,
-0.167936772108078,
-0.3825465142726898,
-0.19159293174743652,
0.39986276626586914,
-0.30430471897125244,
-0.4315639138221741,
-0.2914833426475525,
-0.3653036057949066,
0.47358521819114685,
0.19926832616329193,
0.2533881962299347,
-0.06785876303911209,
0.2578030824661255,
0.022328205406665802,
-0.14045608043670654,
-0.2906670868396759,
0.33572471141815186,
0.05683882161974907,
0.26695165038108826,
0.40956735610961914,
0.0953596979379654,
-0.07617800682783127,
0.46331435441970825,
0.3973047137260437,
-0.15348458290100098,
0.243185356259346,
-0.24393588304519653,
0.4394519329071045,
-0.10538697242736816,
-0.4849972128868103,
0.003952097147703171,
0.29314929246902466,
0.2881712317466736,
0.2548038959503174,
0.0371493324637413,
0.15028750896453857,
-0.27522963285446167,
-0.11248476803302765,
0.01568179577589035,
-0.4486938714981079,
-0.257844477891922,
-0.12775912880897522,
0.009440463036298752,
0.2657872140407562,
0.19879266619682312,
-0.12188221514225006,
-0.11289927363395691,
-0.025836927816271782,
0.3307061493396759,
-0.4054200053215027,
0.07318573445081711,
-0.10028473287820816,
-0.013368461281061172,
-0.16642530262470245,
0.20665813982486725,
-0.11143917590379715,
-0.06656929105520248,
0.14008581638336182,
0.09268403053283691,
0.25493133068084717,
0.049408476799726486,
0.5210736989974976,
-0.05822402983903885,
0.03727243095636368,
0.28575563430786133,
0.006395012140274048,
-0.29763033986091614,
-0.17056387662887573,
0.22657020390033722,
-0.013713385909795761,
0.10470610111951828,
0.24524685740470886,
-0.5187455415725708,
-0.39208707213401794,
-0.003311709500849247,
0.15243518352508545,
-0.06940533965826035,
-0.18916600942611694,
-0.3887883424758911,
-0.1987563669681549,
0.05115220695734024,
-0.058509472757577896,
-0.16384781897068024,
0.5542188882827759,
-0.04343897104263306,
0.08625633269548416,
-0.26214301586151123,
-0.2093999981880188,
-0.0073437802493572235,
0.2973347008228302,
0.2790791690349579,
-0.01237417757511139,
0.16693848371505737,
-0.00966452807188034,
0.041456401348114014,
0.15107260644435883,
0.5087603330612183,
-0.10056480020284653,
-0.25569263100624084,
-0.13189086318016052,
-0.0355522558093071,
0.33846044540405273,
0.353371798992157,
-0.33523446321487427,
0.035281747579574585,
0.05520446598529816,
0.2643846273422241,
-0.09432558715343475,
0.09895174205303192,
0.273628294467926,
0.11528683453798294,
-0.22553220391273499,
-0.49056994915008545,
0.716694176197052,
-0.13236184418201447,
-0.13174070417881012,
0.37447473406791687,
0.5112028121948242,
-0.5264975428581238,
0.0845731571316719,
-0.14531783759593964,
0.6693539619445801,
0.44801080226898193,
0.17870698869228363,
0.2511118948459625,
-0.09011462330818176,
0.31629571318626404,
0.18530917167663574,
0.23583990335464478,
-0.4825047254562378,
-0.0206599161028862,
0.12586383521556854,
-0.04971815273165703,
0.4510667622089386,
0.28870445489883423,
-0.07959020882844925,
0.057091258466243744,
0.009019121527671814,
0.3173823058605194,
-0.06531213223934174,
0.24490517377853394,
-0.41534432768821716,
-0.22127902507781982,
-0.3755565881729126,
0.012033749371767044,
-0.13283683359622955,
0.2988211214542389,
0.15316468477249146,
-0.16232532262802124,
0.08963027596473694,
-0.1925075650215149,
-0.1745702177286148,
0.04476187378168106,
-0.25053641200065613,
0.049994152039289474,
0.424047589302063,
-0.18326863646507263,
0.0720982551574707,
0.39468613266944885,
0.3259429335594177,
0.43624213337898254,
-0.24257241189479828,
0.18663863837718964,
-0.09644502401351929,
0.17357584834098816,
-0.11083687841892242,
-0.00590037927031517,
0.44676539301872253,
0.012793749570846558,
-0.23062728345394135,
-0.01884954422712326,
0.007647674530744553,
-0.02598089724779129,
-0.08487460017204285,
-0.05826512351632118,
-0.011383604258298874,
-0.3780055344104767,
-0.1421237289905548,
-0.17407341301441193,
0.4215407073497772,
-0.2875438928604126,
0.11836914718151093,
-0.020775064826011658,
-0.20025426149368286,
0.392062246799469,
-0.07143326103687286,
-0.26299113035202026,
-0.12699279189109802,
0.31505972146987915,
-0.18901975452899933,
-0.018354594707489014,
0.519931972026825,
-0.3563686013221741,
-0.07807613164186478,
-0.018583808094263077,
0.36401206254959106,
0.22841110825538635,
-0.18713830411434174,
0.05354645848274231,
0.2164229303598404,
-0.09292612969875336,
0.03354174643754959,
0.4440533518791199,
0.008807903155684471,
-0.029488731175661087,
-0.020512118935585022,
-0.10081809014081955,
-0.09092391282320023,
0.019160408526659012,
0.15111590921878815,
0.35473379492759705,
0.05252734571695328,
0.08877581357955933,
0.15944674611091614,
0.05068051069974899,
-0.24722778797149658,
-0.06883792579174042,
-0.20823165774345398,
0.053506653755903244,
0.004815060645341873,
0.31533104181289673,
0.014870673418045044,
-0.10206904262304306,
0.1805708110332489,
-0.2380988746881485,
-0.1820838898420334,
-0.18102213740348816,
-0.3846076726913452,
0.17840377986431122,
0.17763492465019226,
0.23948810994625092,
0.061994634568691254,
-0.21670392155647278,
-0.10460929572582245,
-0.29376721382141113,
0.44902920722961426,
0.14189013838768005,
0.034630075097084045,
0.16002225875854492,
0.13973087072372437,
0.15979278087615967,
-0.04548371583223343,
-0.09519553184509277,
-0.1467047929763794,
-0.048552099615335464,
0.25680863857269287,
0.0782606303691864,
-0.5182254314422607,
0.09808309376239777,
0.2675277292728424,
0.023145627230405807,
-0.34816867113113403,
0.028037380427122116,
0.09278901666402817,
-0.32243627309799194,
-0.04975777119398117,
0.20295189321041107,
0.3131062984466553,
0.27058836817741394,
-0.23202642798423767,
-0.0311654694378376,
0.2002948373556137,
0.09851785749197006,
-0.24692973494529724,
-0.10764031112194061,
0.27489468455314636,
0.019950468093156815,
0.3455065190792084,
0.3725970387458801,
0.1837979406118393,
-0.0711931586265564,
-0.0007894933223724365,
-0.12159253656864166,
0.24650181829929352,
-0.15890103578567505,
0.39019161462783813,
0.5628182291984558,
-0.02257397770881653,
0.14412398636341095,
0.6472165584564209,
0.3601546585559845,
0.0389910452067852,
0.5452191233634949,
0.012060616165399551,
0.011451264843344688,
-0.09469251334667206,
-0.2420281171798706,
0.15699836611747742,
-0.30335837602615356,
0.39948388934135437,
-0.24188709259033203,
-0.4124595522880554,
-0.1259690821170807,
-0.07210341095924377,
0.25229936838150024,
-0.6065072417259216,
-0.05560917407274246,
-0.14882192015647888,
0.10561728477478027,
-0.19734355807304382,
-0.47341233491897583,
-0.25746211409568787,
-0.19388481974601746,
0.1741069257259369,
-0.08198188245296478,
-0.007300123572349548,
-0.4247489869594574,
0.28796157240867615,
-0.17179492115974426,
-0.08649177104234695,
-0.28440728783607483,
0.07500571012496948,
-0.01326934713870287,
0.28299596905708313,
-0.16861353814601898,
0.276516854763031,
-0.021319277584552765,
-0.12416774779558182,
-0.06291046738624573,
0.347840815782547,
0.38284921646118164,
0.08108368515968323,
0.21439775824546814,
-0.17865107953548431,
0.06889326125383377,
-0.015617378056049347,
-0.2152106761932373,
0.01495986059308052,
0.20625269412994385,
-0.028480447828769684,
0.3336544334888458,
0.16184285283088684,
-0.16805194318294525,
-0.2704719603061676,
0.2604307532310486,
0.3165692985057831,
-0.49484938383102417,
0.34994596242904663,
-0.06886467337608337,
-0.08325859904289246,
0.19494639337062836,
0.09214823693037033,
-0.40140408277511597,
-0.11934997141361237,
0.47080543637275696,
0.21514980494976044,
0.09242338687181473,
-0.3321321904659271,
0.06366243958473206,
0.2536563575267792,
0.26803871989250183,
-0.11484944820404053,
-0.11377086490392685,
-0.2692992687225342,
-0.09470219910144806,
-0.43547701835632324,
0.01917990669608116,
0.12322979420423508,
-0.1550946980714798,
0.1507645845413208,
-0.02140560746192932,
-0.0202171690762043,
-0.19932283461093903,
-0.020016446709632874,
0.15822672843933105,
0.28265905380249023,
-0.007341435179114342,
-0.23149517178535461,
-0.3120150566101074,
-0.10068833827972412,
-0.12591303884983063,
0.10726384073495865,
-0.21677793562412262,
0.06292346119880676,
-0.27377793192863464,
0.0007057487964630127,
-0.0652596652507782,
0.3030848205089569,
0.3909011781215668,
-0.16965043544769287,
-0.03937254101037979,
-0.15497371554374695,
0.1984030157327652,
0.037150271236896515,
-0.09151244163513184,
-0.21858832240104675,
-0.015403971076011658,
-0.3275742530822754,
0.14367061853408813,
-0.060705866664648056,
0.2062196582555771,
-0.17589934170246124,
-0.29143986105918884,
-0.19393335282802582,
0.040419962257146835,
0.3999059200286865,
0.07830311357975006,
0.097795270383358,
0.08330796658992767,
-0.1454920470714569,
0.02448558434844017,
0.2340017408132553,
0.24706605076789856,
-0.11674471199512482,
0.3071497976779938,
-0.10936660319566727,
-0.5884498357772827,
0.7368584275245667,
-0.10760316997766495,
-0.42283928394317627,
-0.2833314836025238,
0.18222671747207642,
-0.037828441709280014,
-0.07421289384365082,
-0.3343542516231537,
0.12272697687149048,
0.46775439381599426,
-0.197724848985672,
-0.29131126403808594,
0.13896605372428894,
-0.17400841414928436,
0.1279563307762146,
-0.13660214841365814,
0.0755433440208435,
0.14304909110069275,
-0.17680007219314575,
-0.15525268018245697,
-0.07663782685995102
] |
https://github.com/huggingface/datasets/issues/6130 | So what does this attribute do? In most cases it's not used and the [documents for multi-config dataset](https://huggingface.co/docs/datasets/main/en/image_dataset#multiple-configurations) never mentioned that. | default config name doesn't work when config kwargs are specified. | ### Describe the bug
https://github.com/huggingface/datasets/blob/12cfc1196e62847e2e8239fbd727a02cbc86ddec/src/datasets/builder.py#L518-L522
If `config_name` is `None`, `DEFAULT_CONFIG_NAME` should be select. But once users pass `config_kwargs` to their customized `BuilderConfig`, the logic is ignored, and dataset cannot select the default config from multiple configs.
### Steps to reproduce the bug
```python
import datasets
datasets.load_dataset('/dataset/with/multiple/config'') # Ok
datasets.load_dataset('/dataset/with/multiple/config', some_field_in_config='some') # Err
```
### Expected behavior
Default config behavior should be consistent.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3 | 21 | default config name doesn't work when config kwargs are specified.
### Describe the bug
https://github.com/huggingface/datasets/blob/12cfc1196e62847e2e8239fbd727a02cbc86ddec/src/datasets/builder.py#L518-L522
If `config_name` is `None`, `DEFAULT_CONFIG_NAME` should be select. But once users pass `config_kwargs` to their customized `BuilderConfig`, the logic is ignored, and dataset cannot select the default config from multiple configs.
### Steps to reproduce the bug
```python
import datasets
datasets.load_dataset('/dataset/with/multiple/config'') # Ok
datasets.load_dataset('/dataset/with/multiple/config', some_field_in_config='some') # Err
```
### Expected behavior
Default config behavior should be consistent.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
So what does this attribute do? In most cases it's not used and the [documents for multi-config dataset](https://huggingface.co/docs/datasets/main/en/image_dataset#multiple-configurations) never mentioned that. | [
-0.1038767397403717,
-0.40731850266456604,
0.08251382410526276,
0.1635793000459671,
0.21165809035301208,
0.2138454169034958,
0.40020623803138733,
-0.19926854968070984,
0.02706824243068695,
0.4509633183479309,
0.10380767285823822,
0.3629632294178009,
0.17622721195220947,
0.15650160610675812,
-0.0640287846326828,
0.12173613160848618,
-0.04789479449391365,
0.04573451355099678,
0.004237985238432884,
0.058396026492118835,
-0.31202638149261475,
0.23298954963684082,
-0.11573860049247742,
0.047871679067611694,
-0.3829785883426666,
0.17272832989692688,
-0.08465708047151566,
0.1220950335264206,
0.055926963686943054,
-0.39597153663635254,
0.4119998812675476,
0.17652833461761475,
-0.3299877643585205,
0.2013833373785019,
-0.00012640448403544724,
0.049563780426979065,
0.48643481731414795,
-0.004782222211360931,
-0.3790758550167084,
-0.2581771910190582,
-0.4971383810043335,
-0.12515762448310852,
0.05049010366201401,
-0.2782254219055176,
0.05233962833881378,
0.12468647211790085,
0.25661277770996094,
-0.2794773578643799,
-0.1279529482126236,
-0.003974061459302902,
0.1205238476395607,
0.024587765336036682,
-0.01761721819639206,
-0.05505695566534996,
-0.4391682744026184,
0.09863313287496567,
-0.13231734931468964,
0.18715137243270874,
-0.35044240951538086,
-0.015703562647104263,
0.18606695532798767,
0.09319522976875305,
-0.05312791466712952,
0.0555124431848526,
0.3663305938243866,
0.19059042632579803,
0.06448359042406082,
-0.22011913359165192,
0.3191738724708557,
0.4487721621990204,
0.3455559015274048,
-0.42168352007865906,
-0.1422717422246933,
-0.4983465075492859,
0.29485833644866943,
0.07301037758588791,
0.3817826211452484,
0.19728171825408936,
-0.3605424165725708,
-0.018746422603726387,
-0.3640534281730652,
-0.18493987619876862,
0.04043342173099518,
0.15798485279083252,
-0.3220508396625519,
0.42674437165260315,
-0.20717006921768188,
0.33880358934402466,
0.05175106227397919,
0.0621260404586792,
-0.29212164878845215,
-0.6857892274856567,
0.010970639996230602,
-0.04861972853541374,
-0.18922817707061768,
0.22734247148036957,
0.24363522231578827,
0.23786285519599915,
0.17091241478919983,
0.03198644518852234,
-0.05346367508172989,
-0.003451787866652012,
0.337131142616272,
0.2537444531917572,
0.1085396260023117,
0.0680074542760849,
0.385599285364151,
0.0963965505361557,
0.22388343513011932,
0.06234759837388992,
-0.12561936676502228,
-0.03775550425052643,
0.1806565374135971,
-0.07883229851722717,
0.05969741940498352,
-0.40573638677597046,
0.42304983735084534,
0.10226957499980927,
-0.0641978532075882,
0.007075540721416473,
0.04243844002485275,
-0.02706301026046276,
0.31763607263565063,
0.24867795407772064,
-0.18930016458034515,
-0.0379912368953228,
-0.28127142786979675,
0.154296875,
0.14672884345054626,
0.18837082386016846,
-0.25509417057037354,
-0.379340797662735,
-0.049070093780756,
-0.009267579764127731,
0.0025440603494644165,
-0.5831588506698608,
0.4787544012069702,
0.2383507490158081,
0.36348751187324524,
-0.0814225971698761,
-0.1418371945619583,
0.110269695520401,
-0.006529003381729126,
0.44994500279426575,
-0.2610895335674286,
0.2647237479686737,
0.13307376205921173,
-0.3207775056362152,
-0.30131852626800537,
-0.08283623307943344,
-0.35074344277381897,
-0.35635697841644287,
0.037082962691783905,
0.033549435436725616,
-0.22852842509746552,
0.03336123004555702,
-0.38892102241516113,
0.25964200496673584,
0.3157889246940613,
0.10369706898927689,
0.15143415331840515,
-0.019072959199547768,
-0.10273446142673492,
-0.2818431258201599,
0.30044978857040405,
0.34660646319389343,
0.15539555251598358,
-0.3079794943332672,
0.15387754142284393,
-0.11104840040206909,
-0.09310925006866455,
-0.41869938373565674,
-0.34598782658576965,
-0.057934366166591644,
-0.19835244119167328,
0.14722058176994324,
0.23058921098709106,
-0.1151653453707695,
-0.16770298779010773,
0.12141688168048859,
0.25441086292266846,
0.24854885041713715,
0.24077145755290985,
-0.050754595547914505,
-0.4749758541584015,
0.12131784856319427,
-0.15581408143043518,
0.3201529383659363,
0.12326928973197937,
-0.03100450336933136,
0.020161129534244537,
-0.3007599711418152,
-0.2531247138977051,
0.07154164463281631,
-0.18682552874088287,
0.08928343653678894,
-0.04497269541025162,
-0.15190419554710388,
0.0730522871017456,
0.09716018289327621,
-0.10621307045221329,
0.2884713411331177,
0.011045735329389572,
0.04131223261356354,
0.16473780572414398,
0.0457690954208374,
-0.739008367061615,
0.4507552981376648,
0.1685999035835266,
-0.18379715085029602,
-0.13996586203575134,
-0.2287604659795761,
-0.1272907704114914,
0.07762067764997482,
-0.550419807434082,
-0.02585052140057087,
-0.04310576245188713,
0.6370052695274353,
-0.16144703328609467,
0.10640415549278259,
-0.5155907869338989,
0.33177846670150757,
-0.07144779711961746,
0.14123615622520447,
-0.46892625093460083,
0.1167832538485527,
0.13301298022270203,
0.14275521039962769,
-0.36828669905662537,
0.1252802610397339,
-0.07805091142654419,
-0.06990842521190643,
0.0500008687376976,
0.6432012915611267,
0.04306032508611679,
0.2555767893791199,
-0.2639680504798889,
-0.007856890559196472,
0.0734013244509697,
0.1503145843744278,
-0.03489115089178085,
0.1734090894460678,
0.0886763483285904,
-0.10523577034473419,
-0.22264747321605682,
0.3656977415084839,
0.1471029371023178,
0.3401644825935364,
-0.09779498726129532,
-0.00580250471830368,
-0.1364109218120575,
0.0007629320025444031,
-0.3127497434616089,
-0.2726460099220276,
-0.21331173181533813,
-0.3383680284023285,
0.5218374133110046,
0.1899695247411728,
-0.49597620964050293,
-0.2059970647096634,
0.2861385941505432,
0.059563443064689636,
-0.13835693895816803,
-0.09756220877170563,
0.014085755683481693,
0.028072960674762726,
0.1688091903924942,
0.2760910987854004,
0.5241504907608032,
0.07090069353580475,
0.00976906344294548,
-0.05200100690126419,
-0.48716017603874207,
-0.08659888803958893,
0.26615267992019653,
0.17768070101737976,
0.1729910969734192,
0.19217580556869507,
-0.07835246622562408,
-0.10456576198339462,
-0.3202744126319885,
-0.26773974299430847,
0.25933197140693665,
-0.0815008208155632,
-0.2650025486946106,
0.3120531439781189,
-0.2801809310913086,
-0.17908203601837158,
-0.10113503783941269,
-0.19165636599063873,
-0.4886036217212677,
-0.3588741421699524,
-0.2458912879228592,
-0.007373006548732519,
-0.11328719556331635,
0.2395724356174469,
-0.2750059962272644,
0.22247420251369476,
-0.09233276546001434,
-0.4519035816192627,
-0.2559414207935333,
0.08956584334373474,
-0.2216338813304901,
-0.14541979134082794,
-0.04060569405555725,
-0.30604878067970276,
-0.12637190520763397,
0.14792609214782715,
-0.259554386138916,
-0.08210298418998718,
-0.21968978643417358,
0.15498311817646027,
-0.03225983679294586,
0.5977697968482971,
0.33680927753448486,
0.001521926373243332,
-0.020226195454597473,
-0.20517578721046448,
0.4705464839935303,
0.5408556461334229,
0.008296333253383636,
0.13645142316818237,
0.20427636802196503,
-0.1687367707490921,
-0.11562307178974152,
0.1544806957244873,
0.025787031278014183,
-0.09180304408073425,
0.16347205638885498,
-0.045638035982847214,
0.029737062752246857,
0.7581833004951477,
0.13949234783649445,
0.0724797397851944,
-0.49226242303848267,
0.25910961627960205,
-0.038508184254169464,
-0.46014708280563354,
0.23446018993854523,
0.013767976313829422,
-0.1229863315820694,
-0.41600674390792847,
-0.03436119109392166,
0.3730018734931946,
-0.1383075714111328,
-0.48858579993247986,
-0.30372029542922974,
-0.32707831263542175,
0.4404289722442627,
0.0783541202545166,
0.2977784276008606,
-0.11707878857851028,
0.20766469836235046,
0.03642728179693222,
-0.20599770545959473,
-0.207261323928833,
0.32324185967445374,
0.09689806401729584,
0.28347471356391907,
0.48581552505493164,
-0.02909209206700325,
0.04986219108104706,
0.38103485107421875,
0.3942145109176636,
-0.0360807329416275,
0.3300902545452118,
-0.3278568387031555,
0.5195363163948059,
-0.10820663720369339,
-0.4683828353881836,
0.1765255331993103,
0.3120841979980469,
0.30462712049484253,
0.2669910788536072,
0.08038683980703354,
0.18652652204036713,
-0.2883111238479614,
-0.08742447942495346,
0.1025765985250473,
-0.2292189598083496,
-0.2377905398607254,
-0.11330544948577881,
0.11206202208995819,
0.16201025247573853,
0.06920918822288513,
-0.056293509900569916,
-0.05692053213715553,
-0.029902271926403046,
0.37131839990615845,
-0.3020607829093933,
0.16166672110557556,
-0.19908198714256287,
-0.08070135116577148,
-0.04221772775053978,
0.169631689786911,
-0.09217792749404907,
-0.0421682745218277,
0.18133142590522766,
-0.013140089809894562,
0.26281630992889404,
0.12274251878261566,
0.6191812753677368,
-0.0012469813227653503,
0.00011534371878951788,
0.18012824654579163,
-0.009214363992214203,
-0.28870320320129395,
-0.18424564599990845,
0.1336599737405777,
-0.0014857202768325806,
0.01639774814248085,
0.32036203145980835,
-0.41498520970344543,
-0.3499126136302948,
-0.06282735615968704,
0.16330179572105408,
0.003567643463611603,
-0.13943272829055786,
-0.46399641036987305,
-0.08802089095115662,
0.06283317506313324,
-0.13085582852363586,
-0.19379769265651703,
0.3330885171890259,
0.049762070178985596,
0.30348408222198486,
-0.18284647166728973,
-0.1358197033405304,
0.003172144293785095,
0.32860487699508667,
0.1816488802433014,
-0.08277483284473419,
0.16349756717681885,
0.14936044812202454,
-0.02772015705704689,
0.24312043190002441,
0.520592212677002,
-0.1024315282702446,
-0.190579354763031,
-0.11447104066610336,
0.04231450706720352,
0.4402749240398407,
0.27694442868232727,
-0.2767356038093567,
0.006118368357419968,
0.009109530597925186,
0.2081827074289322,
-0.01670745573937893,
0.03805888071656227,
0.3911702036857605,
0.04529251158237457,
-0.18506382405757904,
-0.45310884714126587,
0.804826021194458,
-0.10322535037994385,
-0.18659381568431854,
0.32975733280181885,
0.616772472858429,
-0.3301129937171936,
-0.1366031914949417,
-0.11715314537286758,
0.5904972553253174,
0.4329218864440918,
0.21833395957946777,
0.0871218889951706,
-0.11388525366783142,
0.2709357738494873,
0.20957310497760773,
0.16405990719795227,
-0.249806746840477,
0.06687214970588684,
0.06728778034448624,
-0.04695118963718414,
0.6250266432762146,
0.2666688859462738,
-0.07847432047128677,
0.006075665354728699,
0.07058778405189514,
0.27772077918052673,
-0.09238161891698837,
0.09054377675056458,
-0.4761098027229309,
-0.1409798562526703,
-0.10107649862766266,
-0.059239111840724945,
-0.0775831788778305,
0.3339308500289917,
0.2438749074935913,
-0.02580823190510273,
0.12853920459747314,
-0.16071389615535736,
-0.23076489567756653,
-0.0962459146976471,
-0.30943411588668823,
0.0911860391497612,
0.4654465615749359,
-0.21853813529014587,
0.03499438613653183,
0.4856903553009033,
0.18091343343257904,
0.24486152827739716,
-0.24553373456001282,
0.1905943751335144,
-0.011534333229064941,
0.13136768341064453,
-0.0841931402683258,
-0.09825848042964935,
0.43686866760253906,
0.03894350677728653,
-0.25858497619628906,
-0.07724182307720184,
0.008031878620386124,
0.0025962963700294495,
-0.0968644842505455,
0.11611036211252213,
0.0018207626417279243,
-0.14383366703987122,
-0.160705104470253,
-0.10767540335655212,
0.43959444761276245,
-0.22776633501052856,
0.013501761481165886,
-0.03317541629076004,
-0.13763518631458282,
0.4420219659805298,
-0.1820761114358902,
-0.3052350878715515,
-0.15642838180065155,
0.27915439009666443,
-0.30162513256073,
-0.057892076671123505,
0.46876925230026245,
-0.5045362114906311,
-0.10855773836374283,
0.07757626473903656,
0.4878591299057007,
0.08466693758964539,
-0.2780764400959015,
0.08311199396848679,
0.22765612602233887,
0.04707920551300049,
-0.013379789888858795,
0.40686917304992676,
-0.013969390653073788,
-0.023122895509004593,
0.009465806186199188,
-0.24065947532653809,
0.07417154312133789,
0.0467601902782917,
0.016289159655570984,
0.29060664772987366,
-0.08484096080064774,
-0.06352891772985458,
0.2724103331565857,
0.039779968559741974,
-0.15482258796691895,
-0.011138737201690674,
-0.11558781564235687,
0.08421777188777924,
0.1942436695098877,
0.3607359826564789,
0.060926176607608795,
-0.07560843974351883,
0.16171592473983765,
-0.37246817350387573,
-0.1480577290058136,
-0.09052293002605438,
-0.45647722482681274,
0.23331281542778015,
0.10380546003580093,
0.08195009082555771,
0.12497815489768982,
-0.27461183071136475,
-0.29495319724082947,
-0.28786030411720276,
0.39180147647857666,
0.30453789234161377,
-0.12049444764852524,
0.18697479367256165,
0.09319359809160233,
0.10997666418552399,
-0.006311185657978058,
-0.10599703341722488,
-0.1062377318739891,
-0.0051551274955272675,
0.27753621339797974,
0.1431291550397873,
-0.5333895683288574,
0.07970741391181946,
0.08873111009597778,
0.06952457129955292,
-0.349761039018631,
-0.17392250895500183,
0.12246279418468475,
-0.221390962600708,
0.10035443305969238,
0.05694868415594101,
0.3619619607925415,
0.34122607111930847,
-0.19910334050655365,
-0.1069393903017044,
0.21205434203147888,
-0.021205971017479897,
-0.19637304544448853,
-0.15319865942001343,
0.0927584171295166,
0.15380457043647766,
0.2573283612728119,
0.37336745858192444,
0.35237234830856323,
-0.022257409989833832,
-0.023924726992845535,
-0.20276875793933868,
0.3935023546218872,
-0.11117957532405853,
0.2460576742887497,
0.5556321144104004,
0.02252522110939026,
0.19821329414844513,
0.474824458360672,
0.43786749243736267,
0.11655247211456299,
0.46012598276138306,
0.015103641897439957,
0.03537922352552414,
0.08870828151702881,
-0.22956682741641998,
0.2334412932395935,
-0.36225974559783936,
0.44070589542388916,
-0.16270090639591217,
-0.5391298532485962,
0.012022126466035843,
-0.0028240233659744263,
0.24720177054405212,
-0.5832089781761169,
0.09638084471225739,
-0.11630532145500183,
0.13724057376384735,
-0.08932611346244812,
-0.5204437375068665,
-0.1725497543811798,
-0.2080995738506317,
0.01953001320362091,
-0.051769569516181946,
0.05879803001880646,
-0.4172542989253998,
0.553443431854248,
-0.1129189133644104,
-0.12207429111003876,
-0.2710476517677307,
0.0942012220621109,
0.015351802110671997,
0.2841598689556122,
-0.22647017240524292,
0.2343236654996872,
0.12932810187339783,
-0.06196216866374016,
0.10938936471939087,
0.3646855354309082,
0.48926326632499695,
-0.0024224501103162766,
0.3367694914340973,
-0.07036612182855606,
0.033787354826927185,
-0.031955111771821976,
-0.16592073440551758,
0.134989932179451,
0.22245821356773376,
-0.14888906478881836,
0.28300532698631287,
0.057264089584350586,
-0.05771900340914726,
-0.19757585227489471,
0.2025052309036255,
0.24915768206119537,
-0.6409034132957458,
0.29347991943359375,
-0.2876119613647461,
-0.040623947978019714,
0.17134913802146912,
0.22484637796878815,
-0.38088878989219666,
-0.24066787958145142,
0.39876776933670044,
0.2805333733558655,
0.016193751245737076,
-0.25381776690483093,
0.00206095352768898,
0.17122472822666168,
0.39245930314064026,
-0.021895743906497955,
-0.09177860617637634,
-0.16964107751846313,
-0.1219094842672348,
-0.44157421588897705,
0.05890257656574249,
0.07992468774318695,
-0.2282945066690445,
0.17969772219657898,
-0.00810961052775383,
-0.13283413648605347,
-0.23784425854682922,
0.11608217656612396,
0.0879628136754036,
0.28577232360839844,
0.09612080454826355,
-0.1275050789117813,
-0.32555273175239563,
-0.05378679931163788,
-0.11734519898891449,
0.03095152974128723,
-0.2173284888267517,
0.10582421720027924,
-0.2918233573436737,
-0.08668159693479538,
-0.13656021654605865,
0.2784644365310669,
0.3462523818016052,
-0.06801436841487885,
-0.01871415227651596,
-0.10748559981584549,
0.20088964700698853,
0.12356235086917877,
-0.1252433955669403,
-0.2593039572238922,
0.10775496065616608,
-0.1729828417301178,
0.11263134330511093,
0.005466977134346962,
0.12898844480514526,
-0.24026048183441162,
-0.39677664637565613,
-0.026204850524663925,
0.11189249157905579,
0.3126930594444275,
0.030155006796121597,
0.09383001923561096,
0.006715252995491028,
-0.30416253209114075,
0.010087486356496811,
0.21797862648963928,
0.1955891251564026,
-0.041180938482284546,
0.1787174940109253,
-0.14649493992328644,
-0.5074353218078613,
0.6833592653274536,
-0.03637997433543205,
-0.35958683490753174,
-0.28555354475975037,
0.12335115671157837,
-0.0869997888803482,
0.05138328671455383,
-0.5298313498497009,
0.1123342216014862,
0.5532034635543823,
-0.15838941931724548,
-0.3689180016517639,
0.1279582530260086,
-0.2223123162984848,
-0.026807256042957306,
-0.11233155429363251,
0.20764252543449402,
0.00592382438480854,
-0.2284204065799713,
-0.0017557740211486816,
0.013956829905509949
] |
https://github.com/huggingface/datasets/issues/6130 | It tells which builder config class to instantiate if additional config parameters are passed to load_dataset | default config name doesn't work when config kwargs are specified. | ### Describe the bug
https://github.com/huggingface/datasets/blob/12cfc1196e62847e2e8239fbd727a02cbc86ddec/src/datasets/builder.py#L518-L522
If `config_name` is `None`, `DEFAULT_CONFIG_NAME` should be select. But once users pass `config_kwargs` to their customized `BuilderConfig`, the logic is ignored, and dataset cannot select the default config from multiple configs.
### Steps to reproduce the bug
```python
import datasets
datasets.load_dataset('/dataset/with/multiple/config'') # Ok
datasets.load_dataset('/dataset/with/multiple/config', some_field_in_config='some') # Err
```
### Expected behavior
Default config behavior should be consistent.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3 | 16 | default config name doesn't work when config kwargs are specified.
### Describe the bug
https://github.com/huggingface/datasets/blob/12cfc1196e62847e2e8239fbd727a02cbc86ddec/src/datasets/builder.py#L518-L522
If `config_name` is `None`, `DEFAULT_CONFIG_NAME` should be select. But once users pass `config_kwargs` to their customized `BuilderConfig`, the logic is ignored, and dataset cannot select the default config from multiple configs.
### Steps to reproduce the bug
```python
import datasets
datasets.load_dataset('/dataset/with/multiple/config'') # Ok
datasets.load_dataset('/dataset/with/multiple/config', some_field_in_config='some') # Err
```
### Expected behavior
Default config behavior should be consistent.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
It tells which builder config class to instantiate if additional config parameters are passed to load_dataset | [
-0.19299033284187317,
-0.22648239135742188,
0.09661252051591873,
0.19210265576839447,
0.17225056886672974,
0.018309645354747772,
0.44974562525749207,
0.04452268034219742,
0.04450341314077377,
0.4569787383079529,
0.15882045030593872,
0.5114296078681946,
0.17513585090637207,
0.13504114747047424,
-0.021912887692451477,
0.1357124149799347,
-0.11048336327075958,
0.10459211468696594,
-0.11698748916387558,
0.10887016355991364,
-0.3087034821510315,
0.30500996112823486,
-0.10161272436380386,
0.08730509132146835,
-0.2763252854347229,
0.2688867449760437,
-0.051214978098869324,
0.19466976821422577,
0.051569417119026184,
-0.4197819232940674,
0.5323028564453125,
0.2442704141139984,
-0.19310227036476135,
0.3632360100746155,
-0.00012138074089307338,
0.0846855491399765,
0.4434366524219513,
0.03306131809949875,
-0.3580319583415985,
-0.2772279381752014,
-0.40694987773895264,
-0.1175885945558548,
0.1090763732790947,
-0.31851592659950256,
-0.1781974732875824,
0.040142182260751724,
0.09836488217115402,
-0.22462111711502075,
0.0052877627313137054,
0.043284498155117035,
0.13812154531478882,
0.08425752818584442,
-0.03964462876319885,
-0.08313347399234772,
-0.3720175325870514,
0.06435027718544006,
-0.08236809074878693,
0.2246980220079422,
-0.26203498244285583,
-0.08622816205024719,
0.08691145479679108,
0.04916195571422577,
-0.08788855373859406,
-0.07259610295295715,
0.32768741250038147,
0.10769975930452347,
0.15140865743160248,
-0.14274688065052032,
0.22581949830055237,
0.45888927578926086,
0.3076304793357849,
-0.466076135635376,
-0.10904760658740997,
-0.524179220199585,
0.22823676466941833,
0.037035755813121796,
0.3902706205844879,
0.019886881113052368,
-0.47748813033103943,
0.04689919203519821,
-0.19434118270874023,
-0.1743200421333313,
0.051084429025650024,
0.14586694538593292,
-0.2692491412162781,
0.46741941571235657,
-0.12933556735515594,
0.16579756140708923,
-0.09812143445014954,
-0.06497474759817123,
-0.0013918504118919373,
-0.6905062198638916,
-0.0777728483080864,
-0.03264809399843216,
-0.24135462939739227,
0.13433846831321716,
0.28586137294769287,
0.278913676738739,
0.2171701192855835,
-0.04640842229127884,
-0.041787173599004745,
0.13588932156562805,
0.3810022175312042,
0.14409099519252777,
0.00875229761004448,
0.11589515209197998,
0.41523563861846924,
0.13729235529899597,
0.22251497209072113,
0.23357830941677094,
-0.22741436958312988,
0.10151028633117676,
0.20288553833961487,
-0.14880068600177765,
-0.01694885641336441,
-0.3647622764110565,
0.4972313344478607,
0.05475248396396637,
0.02171751856803894,
0.05375480279326439,
0.009898215532302856,
-0.05612462759017944,
0.32774263620376587,
0.3508554995059967,
-0.27238398790359497,
0.024686232209205627,
-0.16439899802207947,
0.16036003828048706,
0.061605460941791534,
0.15652552247047424,
-0.2780049443244934,
-0.4073149561882019,
-0.04386318475008011,
0.0404711589217186,
0.10910432040691376,
-0.5452879667282104,
0.4655328392982483,
0.3415275812149048,
0.22331136465072632,
-0.10345892608165741,
-0.22751767933368683,
0.31075477600097656,
-0.1245330274105072,
0.26406314969062805,
-0.22777076065540314,
0.23203513026237488,
0.057942308485507965,
-0.3746352791786194,
-0.16837872564792633,
-0.015218880027532578,
-0.29492270946502686,
-0.2860860824584961,
0.05508168041706085,
0.08927984535694122,
-0.2926263213157654,
0.059100423008203506,
-0.28333619236946106,
0.24767737090587616,
0.30505675077438354,
0.06856849044561386,
-0.04036254435777664,
-0.058996595442295074,
0.01742716133594513,
-0.2881464958190918,
0.40394312143325806,
0.3464639186859131,
0.07890982925891876,
-0.32548266649246216,
0.13884003460407257,
0.010963963344693184,
-0.09569816291332245,
-0.3597165048122406,
-0.31843191385269165,
0.03380265459418297,
-0.21862688660621643,
0.07031594216823578,
0.3460426330566406,
-0.042988091707229614,
-0.3255595862865448,
0.149152010679245,
0.17650681734085083,
0.2665926516056061,
0.26569661498069763,
-0.16749286651611328,
-0.4496300518512726,
0.06910145282745361,
-0.019934922456741333,
0.2718138098716736,
0.09197936207056046,
0.10586554557085037,
-0.16003015637397766,
-0.4853249490261078,
-0.206994891166687,
0.0847490131855011,
0.004074957221746445,
0.18449267745018005,
-0.1520851105451584,
-0.1890992373228073,
0.2795727849006653,
-0.041964832693338394,
-0.19435089826583862,
0.3119039535522461,
0.15956026315689087,
0.05672493204474449,
0.17811091244220734,
-0.032868802547454834,
-0.7279646992683411,
0.39562511444091797,
0.07856626808643341,
-0.1063549742102623,
-0.13511517643928528,
-0.2851404845714569,
-0.20226280391216278,
-0.030101876705884933,
-0.44009947776794434,
0.10116779804229736,
0.04138829559087753,
0.6295332908630371,
-0.10063393414020538,
-0.0029872357845306396,
-0.40666723251342773,
0.2735740840435028,
-0.08787752687931061,
0.24424487352371216,
-0.45383232831954956,
0.18632015585899353,
0.11060068011283875,
-0.05476539582014084,
-0.24314147233963013,
0.1558799296617508,
0.07914498448371887,
-0.030430659651756287,
0.062185268849134445,
0.4951113164424896,
-0.060685593634843826,
0.18701276183128357,
-0.36947640776634216,
-0.1584688127040863,
-0.011700267903506756,
0.17358362674713135,
-0.12498939782381058,
0.2146390974521637,
0.058538712561130524,
-0.05019271373748779,
-0.14629584550857544,
0.40406516194343567,
0.20006822049617767,
0.28857964277267456,
-0.1096218153834343,
-0.08456286787986755,
-0.06753932684659958,
-0.16273179650306702,
-0.3016475439071655,
-0.26611965894699097,
-0.18320883810520172,
-0.2432498186826706,
0.5391408801078796,
0.22815288603305817,
-0.4901140630245209,
-0.21005485951900482,
0.4076736271381378,
0.1477709710597992,
-0.09412965923547745,
-0.10129068791866302,
0.06303463876247406,
0.14455491304397583,
0.16916055977344513,
0.1750095784664154,
0.36858195066452026,
0.17200341820716858,
-0.08654770255088806,
-0.04169311374425888,
-0.44365644454956055,
-0.13560645282268524,
0.18568220734596252,
0.11832167953252792,
0.14723145961761475,
0.235482320189476,
0.07156065106391907,
-0.10979129374027252,
-0.3400173783302307,
-0.058149076998233795,
0.1766854226589203,
-0.12114836275577545,
-0.27070027589797974,
0.20633171498775482,
-0.2643909454345703,
-0.10284479707479477,
-0.08871243894100189,
-0.3011492192745209,
-0.3799069821834564,
-0.33034300804138184,
-0.247550830245018,
0.12124873697757721,
-0.1141519546508789,
0.3404218852519989,
-0.128956139087677,
0.20065683126449585,
-0.16001956164836884,
-0.43268662691116333,
-0.31429263949394226,
0.09338617324829102,
-0.25126248598098755,
-0.11302909255027771,
0.04721850901842117,
-0.3440290093421936,
-0.07140954583883286,
0.0600992813706398,
-0.2859073877334595,
-0.031130319461226463,
-0.28713616728782654,
0.17191366851329803,
-0.025556806474924088,
0.678686797618866,
0.30546537041664124,
0.016811301931738853,
0.14282619953155518,
-0.30727699398994446,
0.43505701422691345,
0.5019671320915222,
0.07863065600395203,
0.1123632863163948,
0.22273005545139313,
-0.045674823224544525,
-0.10456331819295883,
0.035659059882164,
0.07318249344825745,
-0.1823902130126953,
0.04006674513220787,
0.02120964229106903,
-0.012493724003434181,
0.6105093359947205,
0.1599796563386917,
-0.04059355705976486,
-0.4106118977069855,
0.24425008893013,
0.039509110152721405,
-0.37105146050453186,
0.22899127006530762,
-0.03988156095147133,
-0.11292394995689392,
-0.40389150381088257,
-0.11903117597103119,
0.3690093457698822,
-0.20108279585838318,
-0.49296480417251587,
-0.17556238174438477,
-0.3537241220474243,
0.536561131477356,
0.18009209632873535,
0.24088963866233826,
-0.12257503718137741,
0.2542736828327179,
0.04443717747926712,
-0.21496112644672394,
-0.2883521020412445,
0.32968685030937195,
0.0319184809923172,
0.34168416261672974,
0.4304753243923187,
0.1260971575975418,
-0.055080845952034,
0.4728870093822479,
0.3566678762435913,
-0.17724233865737915,
0.31217771768569946,
-0.28000307083129883,
0.4295196533203125,
-0.06104978546500206,
-0.477897584438324,
0.0072671957314014435,
0.34665730595588684,
0.2872266173362732,
0.24815964698791504,
0.03905286639928818,
0.12471052259206772,
-0.3026270270347595,
-0.14360757172107697,
0.032959237694740295,
-0.4036945700645447,
-0.2917368710041046,
-0.1814810186624527,
0.024533919990062714,
0.2980470061302185,
0.19200271368026733,
-0.10824473202228546,
-0.10470256209373474,
-0.06812213361263275,
0.31578487157821655,
-0.3116123378276825,
0.07540412992238998,
-0.13789287209510803,
0.04213505610823631,
-0.11059590429067612,
0.17770043015480042,
-0.10796114802360535,
-0.002562236040830612,
0.1252361238002777,
0.10159432888031006,
0.22797620296478271,
0.024321366101503372,
0.5093199610710144,
-0.0665065124630928,
0.041949957609176636,
0.28150761127471924,
0.08060240745544434,
-0.3178803622722626,
-0.1594991534948349,
0.20893245935440063,
-0.0014263130724430084,
0.11746695637702942,
0.29624590277671814,
-0.5216398239135742,
-0.36571282148361206,
-0.013303406536579132,
0.2075730264186859,
-0.0438019223511219,
-0.20328205823898315,
-0.3860407769680023,
-0.179839089512825,
0.07138048857450485,
-0.0719357579946518,
-0.2332921028137207,
0.44966402649879456,
-0.05727951601147652,
0.10561525821685791,
-0.20642738044261932,
-0.2064405381679535,
0.02016383782029152,
0.3304990828037262,
0.23765388131141663,
-0.07811002433300018,
0.2318105399608612,
-0.04263164848089218,
0.03776724264025688,
0.1675260365009308,
0.4685090482234955,
-0.12257260829210281,
-0.2768041789531708,
-0.15475402772426605,
-0.0006148442625999451,
0.3699951171875,
0.35874807834625244,
-0.3458184599876404,
0.06404712796211243,
0.09233441948890686,
0.19966013729572296,
-0.01290179044008255,
0.06257805228233337,
0.33663636445999146,
0.09347833693027496,
-0.29611778259277344,
-0.4861348569393158,
0.7262404561042786,
-0.1268102377653122,
-0.15068620443344116,
0.41062474250793457,
0.4720904529094696,
-0.5034118294715881,
0.0834994688630104,
-0.23428310453891754,
0.615413248538971,
0.45610615611076355,
0.10283716022968292,
0.2979777157306671,
-0.06158895418047905,
0.2711966037750244,
0.2612802982330322,
0.21882100403308868,
-0.45299699902534485,
0.04466738924384117,
0.15036365389823914,
-0.06601668894290924,
0.4660942554473877,
0.33003467321395874,
-0.04984366521239281,
0.06248569115996361,
-0.01803506165742874,
0.3296447992324829,
-0.054799094796180725,
0.2507299780845642,
-0.43285128474235535,
-0.15110966563224792,
-0.37274664640426636,
-0.007260572165250778,
-0.1276654154062271,
0.3140636086463928,
0.13281792402267456,
-0.16571415960788727,
0.12551510334014893,
-0.22478684782981873,
-0.143837571144104,
0.10557037591934204,
-0.28289008140563965,
0.010460913181304932,
0.4199620485305786,
-0.1745711714029312,
0.034078970551490784,
0.4180814027786255,
0.279354453086853,
0.46346354484558105,
-0.23784299194812775,
0.1869608759880066,
-0.06872525811195374,
0.1511804312467575,
-0.06370869278907776,
-0.00001658499240875244,
0.37452781200408936,
0.04785902798175812,
-0.31199878454208374,
-0.08693598210811615,
-0.007838692516088486,
-0.05311495438218117,
-0.09358586370944977,
-0.008608859032392502,
0.009179546497762203,
-0.29316964745521545,
-0.15138652920722961,
-0.16245922446250916,
0.4071926772594452,
-0.2605530619621277,
0.09214326739311218,
-0.062386367470026016,
-0.12381339818239212,
0.43191665410995483,
-0.11344093084335327,
-0.2560268044471741,
-0.17343299090862274,
0.31816530227661133,
-0.22502149641513824,
0.006488248705863953,
0.5074014663696289,
-0.3689579963684082,
-0.07054129987955093,
-0.0068349167704582214,
0.35369837284088135,
0.18711376190185547,
-0.21782037615776062,
0.024469856172800064,
0.20682454109191895,
-0.0790252536535263,
0.06509186327457428,
0.41191771626472473,
0.02801736630499363,
-0.09562274813652039,
0.009311661124229431,
-0.10953367501497269,
-0.03307471424341202,
0.09374663978815079,
0.15263092517852783,
0.2841382622718811,
0.04032242298126221,
0.05564090609550476,
0.09361506253480911,
0.025072956457734108,
-0.2199249416589737,
-0.015466980636119843,
-0.1330282837152481,
0.0774383693933487,
0.019145268946886063,
0.3509364426136017,
-0.008890163153409958,
-0.13267770409584045,
0.1883002370595932,
-0.23925350606441498,
-0.14450199902057648,
-0.1438814103603363,
-0.37545523047447205,
0.18102681636810303,
0.15503504872322083,
0.19669710099697113,
0.03414997085928917,
-0.27322185039520264,
-0.12891827523708344,
-0.29928016662597656,
0.4450575113296509,
0.21594740450382233,
0.017756884917616844,
0.09083817899227142,
0.11502542346715927,
0.2345322221517563,
-0.03381288796663284,
-0.012309261597692966,
-0.19917377829551697,
-0.1119161993265152,
0.24542124569416046,
0.1496347188949585,
-0.4934229552745819,
0.09451965987682343,
0.224691703915596,
-0.025342684239149094,
-0.33597201108932495,
0.0665392056107521,
0.16295818984508514,
-0.34226036071777344,
-0.0502370223402977,
0.2049921602010727,
0.2730754613876343,
0.3126274049282074,
-0.2248479276895523,
-0.0666147768497467,
0.1421208679676056,
0.07570084184408188,
-0.25889474153518677,
-0.13402199745178223,
0.21909993886947632,
0.08028058707714081,
0.343198299407959,
0.39710211753845215,
0.25001418590545654,
-0.11140114068984985,
0.03868050500750542,
-0.13137437403202057,
0.3014317452907562,
-0.10000799596309662,
0.36139631271362305,
0.642343282699585,
0.01488051563501358,
0.1482793092727661,
0.5361401438713074,
0.3337589502334595,
-0.006116118282079697,
0.48189303278923035,
0.03290227800607681,
-0.008675096556544304,
-0.027740998193621635,
-0.2123170793056488,
0.14433935284614563,
-0.37184393405914307,
0.39989855885505676,
-0.22528661787509918,
-0.462338924407959,
-0.05363866314291954,
-0.03750821202993393,
0.22317272424697876,
-0.570033848285675,
0.052837975323200226,
-0.18998074531555176,
0.10172929614782333,
-0.20956489443778992,
-0.4907210171222687,
-0.2770341634750366,
-0.2651488780975342,
0.1273530125617981,
-0.06912024319171906,
-0.032666150480508804,
-0.384313702583313,
0.2830082178115845,
-0.14603425562381744,
-0.1176164299249649,
-0.2750067114830017,
0.04552511125802994,
0.02110189013183117,
0.29883527755737305,
-0.18594437837600708,
0.34205859899520874,
0.02820434607565403,
-0.14713019132614136,
-0.009978920221328735,
0.3256141245365143,
0.4021563231945038,
0.12989293038845062,
0.23271775245666504,
-0.1577378809452057,
0.11613130569458008,
0.010306090116500854,
-0.19956864416599274,
0.07679024338722229,
0.17598357796669006,
-0.030050328001379967,
0.31882187724113464,
0.13609760999679565,
-0.13947798311710358,
-0.26456859707832336,
0.3135072588920593,
0.2695044279098511,
-0.5306745767593384,
0.33271875977516174,
-0.17806223034858704,
-0.03794083744287491,
0.2111176699399948,
0.10624119639396667,
-0.38953694701194763,
-0.1425086110830307,
0.5097394585609436,
0.2625488340854645,
0.058082111179828644,
-0.2960108816623688,
0.05132522061467171,
0.20091474056243896,
0.2679068446159363,
-0.10557650029659271,
-0.13351963460445404,
-0.27725714445114136,
-0.06615433096885681,
-0.46902891993522644,
0.04351652413606644,
0.08450986444950104,
-0.10097990930080414,
0.14423738420009613,
-0.06259283423423767,
-0.013544265180826187,
-0.21454530954360962,
-0.02373591810464859,
0.18830779194831848,
0.2930769920349121,
0.029982957988977432,
-0.23786717653274536,
-0.31429797410964966,
-0.05809193477034569,
-0.18004733324050903,
0.1045556515455246,
-0.27615809440612793,
0.09709102660417557,
-0.259213387966156,
-0.022095248103141785,
-0.12361825257539749,
0.28829190135002136,
0.40390798449516296,
-0.1318151354789734,
-0.04107101634144783,
-0.12935039401054382,
0.21567581593990326,
0.053029030561447144,
-0.19471246004104614,
-0.28108513355255127,
-0.0685766264796257,
-0.29094937443733215,
0.12048237025737762,
-0.03556613624095917,
0.14313773810863495,
-0.1802278757095337,
-0.2992502748966217,
-0.1673591583967209,
-0.001943923532962799,
0.37364429235458374,
0.05753351002931595,
0.1240524873137474,
0.010654501616954803,
-0.179068922996521,
0.004654839634895325,
0.19101104140281677,
0.22187989950180054,
-0.08757346868515015,
0.3372972011566162,
-0.0771188959479332,
-0.524806559085846,
0.7484399676322937,
-0.054988376796245575,
-0.3832716941833496,
-0.3354097008705139,
0.1851118505001068,
-0.0354045070707798,
-0.08955593407154083,
-0.3235054314136505,
0.06488969922065735,
0.5041508078575134,
-0.20667794346809387,
-0.23910319805145264,
0.10673589259386063,
-0.1854412704706192,
0.1139487624168396,
-0.12811420857906342,
0.04387558251619339,
0.12466475367546082,
-0.2431410402059555,
-0.08511796593666077,
-0.04152338579297066
] |
https://github.com/huggingface/datasets/issues/6130 | @lhoestq maybe we can enhance the document to say something about the common attributes of `DatasetBuilder` | default config name doesn't work when config kwargs are specified. | ### Describe the bug
https://github.com/huggingface/datasets/blob/12cfc1196e62847e2e8239fbd727a02cbc86ddec/src/datasets/builder.py#L518-L522
If `config_name` is `None`, `DEFAULT_CONFIG_NAME` should be select. But once users pass `config_kwargs` to their customized `BuilderConfig`, the logic is ignored, and dataset cannot select the default config from multiple configs.
### Steps to reproduce the bug
```python
import datasets
datasets.load_dataset('/dataset/with/multiple/config'') # Ok
datasets.load_dataset('/dataset/with/multiple/config', some_field_in_config='some') # Err
```
### Expected behavior
Default config behavior should be consistent.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3 | 16 | default config name doesn't work when config kwargs are specified.
### Describe the bug
https://github.com/huggingface/datasets/blob/12cfc1196e62847e2e8239fbd727a02cbc86ddec/src/datasets/builder.py#L518-L522
If `config_name` is `None`, `DEFAULT_CONFIG_NAME` should be select. But once users pass `config_kwargs` to their customized `BuilderConfig`, the logic is ignored, and dataset cannot select the default config from multiple configs.
### Steps to reproduce the bug
```python
import datasets
datasets.load_dataset('/dataset/with/multiple/config'') # Ok
datasets.load_dataset('/dataset/with/multiple/config', some_field_in_config='some') # Err
```
### Expected behavior
Default config behavior should be consistent.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
@lhoestq maybe we can enhance the document to say something about the common attributes of `DatasetBuilder` | [
-0.19917616248130798,
-0.18726631999015808,
0.07228013873100281,
0.11664031445980072,
0.17154335975646973,
0.05313607305288315,
0.4100954234600067,
0.044482097029685974,
0.007123127579689026,
0.4756440818309784,
0.14925631880760193,
0.5220496654510498,
0.20773720741271973,
0.1288526952266693,
-0.05073601007461548,
0.1437697857618332,
-0.0998205691576004,
0.16208085417747498,
-0.11898963898420334,
0.10207435488700867,
-0.30989527702331543,
0.2747044861316681,
-0.1086844876408577,
0.11813811957836151,
-0.2833699584007263,
0.19942079484462738,
-0.05162231624126434,
0.14167986810207367,
0.04406102001667023,
-0.4323691427707672,
0.4995022416114807,
0.2678212523460388,
-0.22023117542266846,
0.35734042525291443,
-0.00011945475125685334,
0.06243084371089935,
0.4775235056877136,
0.04239527881145477,
-0.3376352787017822,
-0.29912909865379333,
-0.45327889919281006,
-0.13926354050636292,
0.08657589554786682,
-0.3157002627849579,
-0.1185278668999672,
0.04532402381300926,
0.15782304108142853,
-0.30048027634620667,
-0.011373095214366913,
0.07016605138778687,
0.1609536111354828,
0.0792720764875412,
0.008495606482028961,
-0.05786509811878204,
-0.3841983377933502,
0.1033773124217987,
-0.11308088898658752,
0.21862229704856873,
-0.25652623176574707,
-0.10596568882465363,
0.05986811965703964,
0.047183338552713394,
-0.07717627286911011,
-0.03682398796081543,
0.34943699836730957,
0.11214298009872437,
0.09495508670806885,
-0.1965133249759674,
0.2405415028333664,
0.45863860845565796,
0.3535531163215637,
-0.5328863263130188,
-0.14590346813201904,
-0.5042830109596252,
0.22474586963653564,
0.03315093368291855,
0.40337371826171875,
0.04593048244714737,
-0.4812234044075012,
0.053150974214076996,
-0.18574926257133484,
-0.1916683465242386,
0.040986254811286926,
0.10774736851453781,
-0.247149258852005,
0.4485715627670288,
-0.12740813195705414,
0.1434544175863266,
-0.09012913703918457,
-0.05336098372936249,
0.010008402168750763,
-0.7027702331542969,
-0.06151273474097252,
-0.05563631281256676,
-0.27807703614234924,
0.15896829962730408,
0.2801309823989868,
0.26099905371665955,
0.19907371699810028,
-0.07981880009174347,
-0.015878602862358093,
0.11279963701963425,
0.3400776982307434,
0.18099895119667053,
0.014984603971242905,
0.12878158688545227,
0.4180435836315155,
0.11120729148387909,
0.2597962021827698,
0.19820281863212585,
-0.21105045080184937,
0.10502706468105316,
0.19478294253349304,
-0.18640634417533875,
-0.017648838460445404,
-0.3426254987716675,
0.4961821138858795,
0.05680730938911438,
-0.010378316044807434,
0.0894584208726883,
0.047083780169487,
-0.07562321424484253,
0.28325098752975464,
0.31028661131858826,
-0.28312718868255615,
-0.002719433978199959,
-0.1935572624206543,
0.11789046227931976,
0.054471343755722046,
0.13721542060375214,
-0.2941792905330658,
-0.3619832396507263,
-0.06590864807367325,
0.026347916573286057,
0.07536329329013824,
-0.556904137134552,
0.4322779178619385,
0.32306331396102905,
0.23929479718208313,
-0.06032514572143555,
-0.2270607203245163,
0.23026685416698456,
-0.15187719464302063,
0.23992644250392914,
-0.19369646906852722,
0.22592979669570923,
0.05941973626613617,
-0.34777265787124634,
-0.1897643506526947,
-0.021405760198831558,
-0.26688912510871887,
-0.3120512366294861,
0.022386079654097557,
0.11150503903627396,
-0.33364245295524597,
0.05260608345270157,
-0.30818095803260803,
0.23916760087013245,
0.264762282371521,
0.07632047683000565,
-0.0451873280107975,
-0.04265521094202995,
-0.025576576590538025,
-0.2786639928817749,
0.3823716342449188,
0.35342979431152344,
0.06040579825639725,
-0.28955477476119995,
0.13190537691116333,
-0.026405368000268936,
-0.08636514097452164,
-0.3613549470901489,
-0.28408583998680115,
0.08201391994953156,
-0.2081775963306427,
0.11211852729320526,
0.31752169132232666,
-0.03782900795340538,
-0.3466338515281677,
0.15167558193206787,
0.1573028564453125,
0.25588271021842957,
0.2583766281604767,
-0.19082289934158325,
-0.3709871172904968,
0.05278775468468666,
-0.03495384752750397,
0.265460729598999,
0.08192912489175797,
0.11794884502887726,
-0.15127873420715332,
-0.4949291944503784,
-0.22912311553955078,
0.08155320584774017,
-0.015800418332219124,
0.18078570067882538,
-0.12951108813285828,
-0.21549266576766968,
0.2690431475639343,
-0.03861517831683159,
-0.17278411984443665,
0.34168025851249695,
0.15833929181098938,
0.05039559677243233,
0.147443488240242,
-0.011490501463413239,
-0.7139667272567749,
0.37978872656822205,
0.10723671317100525,
-0.07306766510009766,
-0.13051766157150269,
-0.3238060772418976,
-0.17871715128421783,
-0.019633129239082336,
-0.46033400297164917,
0.08296076953411102,
0.06262606382369995,
0.6174781918525696,
-0.07943137735128403,
0.04460935294628143,
-0.3782115578651428,
0.3001430630683899,
-0.09049676358699799,
0.2295818328857422,
-0.45157313346862793,
0.2143206000328064,
0.08658540993928909,
-0.023714851588010788,
-0.18412341177463531,
0.2141965925693512,
0.05092904344201088,
-0.01295192539691925,
0.03138241916894913,
0.5077753663063049,
-0.07311533391475677,
0.2424004077911377,
-0.3212432563304901,
-0.10619814693927765,
-0.0049829427152872086,
0.15947040915489197,
-0.1290128529071808,
0.23676636815071106,
0.04281114786863327,
-0.033582620322704315,
-0.18783771991729736,
0.367651104927063,
0.15238623321056366,
0.29648488759994507,
-0.07060786336660385,
-0.05635760724544525,
-0.060760971158742905,
-0.13853803277015686,
-0.28053387999534607,
-0.2291448712348938,
-0.15567517280578613,
-0.2582174241542816,
0.5351685285568237,
0.2503719925880432,
-0.5073283314704895,
-0.19063767790794373,
0.38239750266075134,
0.1665920466184616,
-0.05972214415669441,
-0.050121210515499115,
0.07639250159263611,
0.0915479063987732,
0.19773563742637634,
0.2230982929468155,
0.36798039078712463,
0.17492669820785522,
-0.0717136412858963,
-0.022965582087635994,
-0.4239365756511688,
-0.10735805332660675,
0.17705707252025604,
0.11534865200519562,
0.12647251784801483,
0.266817569732666,
0.046308327466249466,
-0.08708496391773224,
-0.30452924966812134,
-0.06795394420623779,
0.17940647900104523,
-0.028963563963770866,
-0.27379515767097473,
0.1590469479560852,
-0.2682466506958008,
-0.109222911298275,
-0.0743355005979538,
-0.21838979423046112,
-0.36820274591445923,
-0.3619192838668823,
-0.2422085851430893,
0.10397954285144806,
-0.11396808177232742,
0.34930384159088135,
-0.14631518721580505,
0.2031300961971283,
-0.17100539803504944,
-0.4011971950531006,
-0.29317745566368103,
0.09458193182945251,
-0.24953873455524445,
-0.09353463351726532,
0.06789331138134003,
-0.2887588143348694,
-0.03264288976788521,
0.038763150572776794,
-0.23244336247444153,
-0.10781139135360718,
-0.26868975162506104,
0.20308968424797058,
-0.041887037456035614,
0.6665334701538086,
0.3494206666946411,
0.0404009148478508,
0.121381014585495,
-0.3119390606880188,
0.4147474765777588,
0.4791796803474426,
0.057271018624305725,
0.07978937029838562,
0.2263079136610031,
-0.09425517916679382,
-0.06711701303720474,
0.015607602894306183,
0.03122459538280964,
-0.23452550172805786,
0.07531952857971191,
-0.024788644164800644,
0.030407005921006203,
0.5794300436973572,
0.15730619430541992,
-0.06516563892364502,
-0.4000683128833771,
0.2693580985069275,
0.04931694641709328,
-0.36577385663986206,
0.2548667788505554,
-0.045458968728780746,
-0.12265151739120483,
-0.39530110359191895,
-0.1260293573141098,
0.36231109499931335,
-0.1924201250076294,
-0.5333384275436401,
-0.1659667193889618,
-0.33387988805770874,
0.5192546248435974,
0.1568688452243805,
0.28958866000175476,
-0.133087620139122,
0.29098665714263916,
0.029734790325164795,
-0.19561666250228882,
-0.3016159236431122,
0.30725735425949097,
0.003597838804125786,
0.30243074893951416,
0.47479748725891113,
0.14549849927425385,
-0.05987256020307541,
0.42472371459007263,
0.3844318985939026,
-0.1692478060722351,
0.3016146719455719,
-0.30136775970458984,
0.4533540904521942,
-0.043785352259874344,
-0.5104312896728516,
0.04845532029867172,
0.32069259881973267,
0.3075130581855774,
0.2585752308368683,
0.026854246854782104,
0.14864949882030487,
-0.2696040868759155,
-0.15597116947174072,
0.020692579448223114,
-0.39242011308670044,
-0.251393586397171,
-0.18017028272151947,
0.07797551155090332,
0.26278364658355713,
0.15839603543281555,
-0.09034287929534912,
-0.08417277038097382,
-0.055956240743398666,
0.295103520154953,
-0.30173349380493164,
0.055605873465538025,
-0.15850336849689484,
0.057012394070625305,
-0.154218852519989,
0.18072164058685303,
-0.13084331154823303,
0.028589539229869843,
0.13703398406505585,
0.11618772894144058,
0.18479935824871063,
0.03816129267215729,
0.5183109045028687,
-0.0904908999800682,
0.021067511290311813,
0.26044732332229614,
0.08974951505661011,
-0.2577604055404663,
-0.14212572574615479,
0.23975244164466858,
0.08024895191192627,
0.09632176905870438,
0.2547973394393921,
-0.5175475478172302,
-0.3532346487045288,
0.02361951395869255,
0.1988566815853119,
-0.04712497442960739,
-0.21527652442455292,
-0.3685802221298218,
-0.1700061410665512,
0.05849713087081909,
-0.10334387421607971,
-0.2551940083503723,
0.42288097739219666,
-0.06413700431585312,
0.19682465493679047,
-0.22581064701080322,
-0.1788516342639923,
0.05578901618719101,
0.32257476449012756,
0.2648829519748688,
-0.08192750811576843,
0.2383240908384323,
0.005751495249569416,
0.024439502507448196,
0.1820201724767685,
0.49317264556884766,
-0.15754374861717224,
-0.26343855261802673,
-0.13221129775047302,
-0.047628581523895264,
0.3652668595314026,
0.3387535810470581,
-0.34426623582839966,
0.023708252236247063,
0.06347189843654633,
0.17870885133743286,
-0.054642073810100555,
0.06698407232761383,
0.35273581743240356,
0.12910982966423035,
-0.31383809447288513,
-0.5156744122505188,
0.7303816676139832,
-0.07047432661056519,
-0.1788555532693863,
0.40898025035858154,
0.528296709060669,
-0.4802734851837158,
0.06188998371362686,
-0.19886916875839233,
0.6167760491371155,
0.45145753026008606,
0.09498712420463562,
0.2578270435333252,
-0.12446895241737366,
0.28122204542160034,
0.19987061619758606,
0.15673339366912842,
-0.448101669549942,
0.01633089780807495,
0.12732303142547607,
-0.059727832674980164,
0.4730335474014282,
0.31036773324012756,
-0.0811268761754036,
0.0640886127948761,
0.037343353033065796,
0.3169589638710022,
-0.020212216302752495,
0.28134703636169434,
-0.4340079128742218,
-0.16379424929618835,
-0.3107290267944336,
0.002525005489587784,
-0.13334688544273376,
0.2934766709804535,
0.1448601484298706,
-0.1630445122718811,
0.11585195362567902,
-0.18957927823066711,
-0.2055007517337799,
0.05592024326324463,
-0.2662729322910309,
-0.006259322166442871,
0.3969324827194214,
-0.1757226139307022,
0.09473817050457001,
0.415377676486969,
0.3233065605163574,
0.4529677927494049,
-0.2702961266040802,
0.16056713461875916,
-0.04060443118214607,
0.1739436239004135,
-0.01491488330066204,
-0.007394067943096161,
0.33951878547668457,
0.04048878699541092,
-0.2904898524284363,
-0.09605598449707031,
-0.00821906328201294,
-0.022658437490463257,
-0.1250043511390686,
-0.02490225061774254,
-0.013765402138233185,
-0.30992424488067627,
-0.1910703331232071,
-0.17267552018165588,
0.3748454749584198,
-0.272555947303772,
0.10277976095676422,
-0.04865091294050217,
-0.12998279929161072,
0.4639149308204651,
-0.16997185349464417,
-0.2271028459072113,
-0.1615101844072342,
0.3101292550563812,
-0.2408490926027298,
-0.007166504859924316,
0.4754575490951538,
-0.35647767782211304,
-0.11710211634635925,
-0.020947802811861038,
0.3468834161758423,
0.18505722284317017,
-0.22253987193107605,
0.022387061268091202,
0.12446539103984833,
-0.09992138296365738,
0.005564887076616287,
0.40222257375717163,
0.04939325526356697,
-0.06836987286806107,
0.048905640840530396,
-0.115024134516716,
-0.052609883248806,
0.10489831864833832,
0.15289634466171265,
0.3020634949207306,
0.024348706007003784,
0.004637271165847778,
0.10255265235900879,
0.0019589178264141083,
-0.24351553618907928,
-0.01406143605709076,
-0.09883937239646912,
0.04587504267692566,
0.05398314818739891,
0.3560941517353058,
-0.003190811723470688,
-0.19887669384479523,
0.21005138754844666,
-0.2222762554883957,
-0.13665883243083954,
-0.16234466433525085,
-0.3623603582382202,
0.1739090085029602,
0.12056940793991089,
0.13873186707496643,
0.06759525835514069,
-0.26726001501083374,
-0.1775495707988739,
-0.28933537006378174,
0.4022473394870758,
0.23049798607826233,
0.004192568361759186,
0.09571830928325653,
0.11310333013534546,
0.18035399913787842,
-0.013005465269088745,
-0.033118776977062225,
-0.18669840693473816,
-0.05981265753507614,
0.24933242797851562,
0.17168274521827698,
-0.4754543900489807,
0.08742213994264603,
0.2207915335893631,
-0.011109456419944763,
-0.331555038690567,
0.06817343831062317,
0.17219239473342896,
-0.35464900732040405,
-0.02076856791973114,
0.23094183206558228,
0.31882134079933167,
0.31174007058143616,
-0.2698134481906891,
-0.048431046307086945,
0.16883224248886108,
0.10186512768268585,
-0.2846682369709015,
-0.17365655303001404,
0.2115192711353302,
0.0628347396850586,
0.3719004988670349,
0.39386576414108276,
0.284218966960907,
-0.11194794625043869,
-0.014328636229038239,
-0.12896497547626495,
0.3120250403881073,
-0.14552901685237885,
0.3684066832065582,
0.6386884450912476,
0.023871541023254395,
0.15778976678848267,
0.5080845952033997,
0.38827887177467346,
-0.012153919786214828,
0.499828577041626,
0.04687414690852165,
0.003159109503030777,
0.0542779415845871,
-0.20374739170074463,
0.1863473355770111,
-0.3819219470024109,
0.4306669235229492,
-0.24438056349754333,
-0.45426884293556213,
-0.05607795715332031,
-0.018226437270641327,
0.1846647560596466,
-0.5644993185997009,
0.07900746166706085,
-0.1885792315006256,
0.09004043787717819,
-0.194814994931221,
-0.47700726985931396,
-0.22979815304279327,
-0.26534873247146606,
0.12226924300193787,
-0.08478234708309174,
-0.04127899557352066,
-0.41558194160461426,
0.2858779728412628,
-0.16525129973888397,
-0.1145930290222168,
-0.2723239064216614,
0.13400819897651672,
-0.018267922103405,
0.3330528736114502,
-0.1806151270866394,
0.30898791551589966,
0.011936653405427933,
-0.14570489525794983,
-0.018669072538614273,
0.41712719202041626,
0.4705025255680084,
0.16735047101974487,
0.21752792596817017,
-0.17587418854236603,
0.0668439194560051,
-0.0042223744094371796,
-0.19342318177223206,
0.09676456451416016,
0.14463752508163452,
-0.05877108871936798,
0.34888404607772827,
0.14723247289657593,
-0.14875617623329163,
-0.24502576887607574,
0.3077867329120636,
0.21024160087108612,
-0.5040695071220398,
0.3289336562156677,
-0.1175413429737091,
-0.08054761588573456,
0.24447017908096313,
0.10724042356014252,
-0.3992239832878113,
-0.14802207052707672,
0.5643453598022461,
0.2765720784664154,
0.04799722135066986,
-0.3184202015399933,
0.06202740967273712,
0.21977730095386505,
0.2677544057369232,
-0.044047046452760696,
-0.07910865545272827,
-0.29174599051475525,
-0.05806570500135422,
-0.5192999839782715,
0.026921648532152176,
0.06590911746025085,
-0.21182548999786377,
0.16725853085517883,
-0.07137515395879745,
-0.0226166732609272,
-0.18329036235809326,
-0.014935381710529327,
0.19213847815990448,
0.261799693107605,
0.002832225989550352,
-0.2630534768104553,
-0.31663987040519714,
-0.04967120662331581,
-0.15831516683101654,
0.0948319062590599,
-0.30207476019859314,
0.13248741626739502,
-0.19742810726165771,
0.0029207244515419006,
-0.13605254888534546,
0.30403321981430054,
0.39532917737960815,
-0.16566863656044006,
-0.051725562661886215,
-0.1398007720708847,
0.17791172862052917,
0.021198898553848267,
-0.183246910572052,
-0.3007297217845917,
-0.029258225113153458,
-0.33190155029296875,
0.1526300609111786,
-0.026262516155838966,
0.14596998691558838,
-0.18022280931472778,
-0.3295086920261383,
-0.18098783493041992,
-0.0500892773270607,
0.35438501834869385,
0.08479680120944977,
0.07565166801214218,
0.04968160390853882,
-0.13457022607326508,
0.018567461520433426,
0.1611185222864151,
0.23710325360298157,
-0.08271428942680359,
0.3324531614780426,
-0.08673085272312164,
-0.5377072691917419,
0.7256041765213013,
-0.065993532538414,
-0.3793683648109436,
-0.31872016191482544,
0.17976275086402893,
0.016505666077136993,
-0.07178701460361481,
-0.36920827627182007,
0.07488472759723663,
0.5223485827445984,
-0.1991768777370453,
-0.24216488003730774,
0.09457303583621979,
-0.21406635642051697,
0.12403866648674011,
-0.12203474342823029,
0.08061657845973969,
0.08152207732200623,
-0.23128417134284973,
-0.07316654920578003,
-0.06723402440547943
] |
https://github.com/huggingface/datasets/issues/6128 | >
I tried this and got the following error:
```
Traceback (most recent call last):
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 324, in _compile
out_code = transform_code_object(code, transform)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/bytecode_transformation.py", line 445, in transform_code_object
transformations(instructions, code_options)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 311, in transform
tracer.run()
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1726, in run
super().run()
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 576, in run
and self.step()
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 540, in step
getattr(self, inst.opname)(inst)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1030, in LOAD_ATTR
result = BuiltinVariable(getattr).call_function(
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/variables/builtin.py", line 566, in call_function
result = handler(tx, *args, **kwargs)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/variables/builtin.py", line 931, in call_getattr
return obj.var_getattr(tx, name).add_options(options)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/variables/nn_module.py", line 124, in var_getattr
subobj = inspect.getattr_static(base, name)
File "/apps/Arch/software/Python/3.10.8-GCCcore-12.2.0/lib/python3.10/inspect.py", line 1777, in getattr_static
raise AttributeError(attr)
AttributeError: config
from user code:
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/peft/peft_model.py", line 909, in forward
if self.base_model.config.model_type == "mpt":
Set torch._dynamo.config.verbose=True for more information
You can suppress this exception and fall back to eager by setting:
torch._dynamo.config.suppress_errors = True
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/llm-copt/fine-tune/falcon/falcon_sft.py", line 228, in <module>
main()
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/llm-copt/fine-tune/falcon/falcon_sft.py", line 221, in main
trainer.train()
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/transformers/trainer.py", line 1539, in train
return inner_training_loop(
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/transformers/trainer.py", line 1809, in _inner_training_loop
tr_loss_step = self.training_step(model, inputs)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/transformers/trainer.py", line 2654, in training_step
loss = self.compute_loss(model, inputs)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/transformers/trainer.py", line 2679, in compute_loss
outputs = model(**inputs)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py", line 82, in forward
return self.dynamo_ctx(self._orig_mod.forward)(*args, **kwargs)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py", line 209, in _fn
return fn(*args, **kwargs)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/accelerate/utils/operations.py", line 581, in forward
return model_forward(*args, **kwargs)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/accelerate/utils/operations.py", line 569, in __call__
return convert_to_fp32(self.model_forward(*args, **kwargs))
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/amp/autocast_mode.py", line 14, in decorate_autocast
return func(*args, **kwargs)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py", line 337, in catch_errors
return callback(frame, cache_size, hooks)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 404, in _convert_frame
result = inner_convert(frame, cache_size, hooks)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 104, in _fn
return fn(*args, **kwargs)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 262, in _convert_frame_assert
return _compile(
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/utils.py", line 163, in time_wrapper
r = func(*args, **kwargs)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 394, in _compile
raise InternalTorchDynamoError() from e
torch._dynamo.exc.InternalTorchDynamoError
``` | IndexError: Invalid key: 88 is out of bounds for size 0 | ### Describe the bug
This bug generates when I use torch.compile(model) in my code, which seems to raise an error in datasets lib.
### Steps to reproduce the bug
I use the following code to fine-tune Falcon on my private dataset.
```python
import transformers
from transformers import (
AutoModelForCausalLM,
AutoTokenizer,
AutoConfig,
DataCollatorForSeq2Seq,
Trainer,
Seq2SeqTrainer,
HfArgumentParser,
Seq2SeqTrainingArguments,
BitsAndBytesConfig,
)
from peft import (
LoraConfig,
get_peft_model,
get_peft_model_state_dict,
prepare_model_for_int8_training,
set_peft_model_state_dict,
)
import torch
import os
import evaluate
import functools
from datasets import load_dataset
import bitsandbytes as bnb
import logging
import json
import copy
from typing import Dict, Optional, Sequence
from dataclasses import dataclass, field
# Lora settings
LORA_R = 8
LORA_ALPHA = 16
LORA_DROPOUT= 0.05
LORA_TARGET_MODULES = ["query_key_value"]
@dataclass
class ModelArguments:
model_name_or_path: Optional[str] = field(default="Salesforce/codegen2-7B")
@dataclass
class DataArguments:
data_path: str = field(default=None, metadata={"help": "Path to the training data."})
train_file: str = field(default=None, metadata={"help": "Path to the evaluation data."})
eval_file: str = field(default=None, metadata={"help": "Path to the evaluation data."})
cache_path: str = field(default=None, metadata={"help": "Path to the cache directory."})
num_proc: int = field(default=4, metadata={"help": "Number of processes to use for data preprocessing."})
@dataclass
class TrainingArguments(transformers.TrainingArguments):
# cache_dir: Optional[str] = field(default=None)
optim: str = field(default="adamw_torch")
model_max_length: int = field(
default=512,
metadata={"help": "Maximum sequence length. Sequences will be right padded (and possibly truncated)."},
)
is_lora: bool = field(default=True, metadata={"help": "Whether to use LORA."})
def tokenize(text, tokenizer, max_seq_len=512, add_eos_token=True):
result = tokenizer(
text,
truncation=True,
max_length=max_seq_len,
padding=False,
return_tensors=None,
)
if (
result["input_ids"][-1] != tokenizer.eos_token_id
and len(result["input_ids"]) < max_seq_len
and add_eos_token
):
result["input_ids"].append(tokenizer.eos_token_id)
result["attention_mask"].append(1)
if add_eos_token and len(result["input_ids"]) >= max_seq_len:
result["input_ids"][max_seq_len - 1] = tokenizer.eos_token_id
result["attention_mask"][max_seq_len - 1] = 1
result["labels"] = result["input_ids"].copy()
return result
def main():
parser = HfArgumentParser((ModelArguments, DataArguments, TrainingArguments))
model_args, data_args, training_args = parser.parse_args_into_dataclasses()
config = AutoConfig.from_pretrained(
model_args.model_name_or_path,
cache_dir=data_args.cache_path,
trust_remote_code=True,
)
if training_args.is_lora:
model = AutoModelForCausalLM.from_pretrained(
model_args.model_name_or_path,
cache_dir=data_args.cache_path,
torch_dtype=torch.float16,
trust_remote_code=True,
load_in_8bit=True,
quantization_config=BitsAndBytesConfig(
load_in_8bit=True,
llm_int8_threshold=6.0
),
)
model = prepare_model_for_int8_training(model)
config = LoraConfig(
r=LORA_R,
lora_alpha=LORA_ALPHA,
target_modules=LORA_TARGET_MODULES,
lora_dropout=LORA_DROPOUT,
bias="none",
task_type="CAUSAL_LM",
)
model = get_peft_model(model, config)
else:
model = AutoModelForCausalLM.from_pretrained(
model_args.model_name_or_path,
torch_dtype=torch.float16,
cache_dir=data_args.cache_path,
trust_remote_code=True,
)
model.config.use_cache = False
def print_trainable_parameters(model):
"""
Prints the number of trainable parameters in the model.
"""
trainable_params = 0
all_param = 0
for _, param in model.named_parameters():
all_param += param.numel()
if param.requires_grad:
trainable_params += param.numel()
print(
f"trainable params: {trainable_params} || all params: {all_param} || trainable%: {100 * trainable_params / all_param}"
)
print_trainable_parameters(model)
tokenizer = AutoTokenizer.from_pretrained(
model_args.model_name_or_path,
cache_dir=data_args.cache_path,
model_max_length=training_args.model_max_length,
padding_side="left",
use_fast=True,
trust_remote_code=True,
)
tokenizer.pad_token = tokenizer.eos_token
# Load dataset
def generate_and_tokenize_prompt(sample):
input_text = sample["input"]
target_text = sample["output"] + tokenizer.eos_token
full_text = input_text + target_text
tokenized_full_text = tokenize(full_text, tokenizer, max_seq_len=512)
tokenized_input_text = tokenize(input_text, tokenizer, max_seq_len=512)
input_len = len(tokenized_input_text["input_ids"]) - 1 # -1 for eos token
tokenized_full_text["labels"] = [-100] * input_len + tokenized_full_text["labels"][input_len:]
return tokenized_full_text
data_files = {}
if data_args.train_file is not None:
data_files["train"] = data_args.train_file
if data_args.eval_file is not None:
data_files["eval"] = data_args.eval_file
dataset = load_dataset(data_args.data_path, data_files=data_files)
train_dataset = dataset["train"]
eval_dataset = dataset["eval"]
train_dataset = train_dataset.map(generate_and_tokenize_prompt, num_proc=data_args.num_proc)
eval_dataset = eval_dataset.map(generate_and_tokenize_prompt, num_proc=data_args.num_proc)
data_collator = DataCollatorForSeq2Seq(tokenizer, pad_to_multiple_of=8, return_tensors="pt", padding=True)
# Evaluation metrics
def compute_metrics(eval_preds, tokenizer):
metric = evaluate.load('exact_match')
preds, labels = eval_preds
# In case the model returns more than the prediction logits
if isinstance(preds, tuple):
preds = preds[0]
decoded_preds = tokenizer.batch_decode(preds, skip_special_tokens=True, clean_up_tokenization_spaces=False)
# Replace -100s in the labels as we can't decode them
labels[labels == -100] = tokenizer.pad_token_id
decoded_labels = tokenizer.batch_decode(labels, skip_special_tokens=True, clean_up_tokenization_spaces=False)
# Some simple post-processing
decoded_preds = [pred.strip() for pred in decoded_preds]
decoded_labels = [label.strip() for label in decoded_labels]
result = metric.compute(predictions=decoded_preds, references=decoded_labels)
return {'exact_match': result['exact_match']}
compute_metrics_fn = functools.partial(compute_metrics, tokenizer=tokenizer)
model = torch.compile(model)
# Training
trainer = Trainer(
model=model,
train_dataset=train_dataset,
eval_dataset=eval_dataset,
args=training_args,
data_collator=data_collator,
compute_metrics=compute_metrics_fn,
)
trainer.train()
trainer.save_state()
trainer.save_model(output_dir=training_args.output_dir)
tokenizer.save_pretrained(save_directory=training_args.output_dir)
if __name__ == "__main__":
main()
```
When I didn't use `torch.cpmpile(model)`, my code worked well. But when I added this line to my code, It produced the following error:
```
Traceback (most recent call last):
File "falcon_sft.py", line 230, in <module>
main()
File "falcon_sft.py", line 223, in main
trainer.train()
File "python3.10/site-packages/transformers/trainer.py", line 1539, in train
return inner_training_loop(
File "python3.10/site-packages/transformers/trainer.py", line 1787, in _inner_training_loop
for step, inputs in enumerate(epoch_iterator):
File "python3.10/site-packages/accelerate/data_loader.py", line 384, in __iter__
current_batch = next(dataloader_iter)
File "python3.10/site-packages/torch/utils/data/dataloader.py", line 633, in __next__
data = self._next_data()
File "python3.10/site-packages/torch/utils/data/dataloader.py", line 677, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = self.dataset.__getitems__(possibly_batched_index)
File "python3.10/site-packages/datasets/arrow_dataset.py", line 2807, in __getitems__
batch = self.__getitem__(keys)
File "python3.10/site-packages/datasets/arrow_dataset.py", line 2803, in __getitem__
return self._getitem(key)
File "python3.10/site-packages/datasets/arrow_dataset.py", line 2787, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "python3.10/site-packages/datasets/formatting/formatting.py", line 583, in query_table
_check_valid_index_key(key, size)
File "python3.10/site-packages/datasets/formatting/formatting.py", line 536, in _check_valid_index_key
_check_valid_index_key(int(max(key)), size=size)
File "python3.10/site-packages/datasets/formatting/formatting.py", line 526, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 88 is out of bounds for size 0
```
So I'm confused about why this error was generated, and how to fix it. Is this error produced by datasets or `torch.compile`?
### Expected behavior
I want to use `torch.compile` in my code.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-4.18.0-425.19.2.el8_7.x86_64-x86_64-with-glibc2.28
- Python version: 3.10.8
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3 | 326 | IndexError: Invalid key: 88 is out of bounds for size 0
### Describe the bug
This bug generates when I use torch.compile(model) in my code, which seems to raise an error in datasets lib.
### Steps to reproduce the bug
I use the following code to fine-tune Falcon on my private dataset.
```python
import transformers
from transformers import (
AutoModelForCausalLM,
AutoTokenizer,
AutoConfig,
DataCollatorForSeq2Seq,
Trainer,
Seq2SeqTrainer,
HfArgumentParser,
Seq2SeqTrainingArguments,
BitsAndBytesConfig,
)
from peft import (
LoraConfig,
get_peft_model,
get_peft_model_state_dict,
prepare_model_for_int8_training,
set_peft_model_state_dict,
)
import torch
import os
import evaluate
import functools
from datasets import load_dataset
import bitsandbytes as bnb
import logging
import json
import copy
from typing import Dict, Optional, Sequence
from dataclasses import dataclass, field
# Lora settings
LORA_R = 8
LORA_ALPHA = 16
LORA_DROPOUT= 0.05
LORA_TARGET_MODULES = ["query_key_value"]
@dataclass
class ModelArguments:
model_name_or_path: Optional[str] = field(default="Salesforce/codegen2-7B")
@dataclass
class DataArguments:
data_path: str = field(default=None, metadata={"help": "Path to the training data."})
train_file: str = field(default=None, metadata={"help": "Path to the evaluation data."})
eval_file: str = field(default=None, metadata={"help": "Path to the evaluation data."})
cache_path: str = field(default=None, metadata={"help": "Path to the cache directory."})
num_proc: int = field(default=4, metadata={"help": "Number of processes to use for data preprocessing."})
@dataclass
class TrainingArguments(transformers.TrainingArguments):
# cache_dir: Optional[str] = field(default=None)
optim: str = field(default="adamw_torch")
model_max_length: int = field(
default=512,
metadata={"help": "Maximum sequence length. Sequences will be right padded (and possibly truncated)."},
)
is_lora: bool = field(default=True, metadata={"help": "Whether to use LORA."})
def tokenize(text, tokenizer, max_seq_len=512, add_eos_token=True):
result = tokenizer(
text,
truncation=True,
max_length=max_seq_len,
padding=False,
return_tensors=None,
)
if (
result["input_ids"][-1] != tokenizer.eos_token_id
and len(result["input_ids"]) < max_seq_len
and add_eos_token
):
result["input_ids"].append(tokenizer.eos_token_id)
result["attention_mask"].append(1)
if add_eos_token and len(result["input_ids"]) >= max_seq_len:
result["input_ids"][max_seq_len - 1] = tokenizer.eos_token_id
result["attention_mask"][max_seq_len - 1] = 1
result["labels"] = result["input_ids"].copy()
return result
def main():
parser = HfArgumentParser((ModelArguments, DataArguments, TrainingArguments))
model_args, data_args, training_args = parser.parse_args_into_dataclasses()
config = AutoConfig.from_pretrained(
model_args.model_name_or_path,
cache_dir=data_args.cache_path,
trust_remote_code=True,
)
if training_args.is_lora:
model = AutoModelForCausalLM.from_pretrained(
model_args.model_name_or_path,
cache_dir=data_args.cache_path,
torch_dtype=torch.float16,
trust_remote_code=True,
load_in_8bit=True,
quantization_config=BitsAndBytesConfig(
load_in_8bit=True,
llm_int8_threshold=6.0
),
)
model = prepare_model_for_int8_training(model)
config = LoraConfig(
r=LORA_R,
lora_alpha=LORA_ALPHA,
target_modules=LORA_TARGET_MODULES,
lora_dropout=LORA_DROPOUT,
bias="none",
task_type="CAUSAL_LM",
)
model = get_peft_model(model, config)
else:
model = AutoModelForCausalLM.from_pretrained(
model_args.model_name_or_path,
torch_dtype=torch.float16,
cache_dir=data_args.cache_path,
trust_remote_code=True,
)
model.config.use_cache = False
def print_trainable_parameters(model):
"""
Prints the number of trainable parameters in the model.
"""
trainable_params = 0
all_param = 0
for _, param in model.named_parameters():
all_param += param.numel()
if param.requires_grad:
trainable_params += param.numel()
print(
f"trainable params: {trainable_params} || all params: {all_param} || trainable%: {100 * trainable_params / all_param}"
)
print_trainable_parameters(model)
tokenizer = AutoTokenizer.from_pretrained(
model_args.model_name_or_path,
cache_dir=data_args.cache_path,
model_max_length=training_args.model_max_length,
padding_side="left",
use_fast=True,
trust_remote_code=True,
)
tokenizer.pad_token = tokenizer.eos_token
# Load dataset
def generate_and_tokenize_prompt(sample):
input_text = sample["input"]
target_text = sample["output"] + tokenizer.eos_token
full_text = input_text + target_text
tokenized_full_text = tokenize(full_text, tokenizer, max_seq_len=512)
tokenized_input_text = tokenize(input_text, tokenizer, max_seq_len=512)
input_len = len(tokenized_input_text["input_ids"]) - 1 # -1 for eos token
tokenized_full_text["labels"] = [-100] * input_len + tokenized_full_text["labels"][input_len:]
return tokenized_full_text
data_files = {}
if data_args.train_file is not None:
data_files["train"] = data_args.train_file
if data_args.eval_file is not None:
data_files["eval"] = data_args.eval_file
dataset = load_dataset(data_args.data_path, data_files=data_files)
train_dataset = dataset["train"]
eval_dataset = dataset["eval"]
train_dataset = train_dataset.map(generate_and_tokenize_prompt, num_proc=data_args.num_proc)
eval_dataset = eval_dataset.map(generate_and_tokenize_prompt, num_proc=data_args.num_proc)
data_collator = DataCollatorForSeq2Seq(tokenizer, pad_to_multiple_of=8, return_tensors="pt", padding=True)
# Evaluation metrics
def compute_metrics(eval_preds, tokenizer):
metric = evaluate.load('exact_match')
preds, labels = eval_preds
# In case the model returns more than the prediction logits
if isinstance(preds, tuple):
preds = preds[0]
decoded_preds = tokenizer.batch_decode(preds, skip_special_tokens=True, clean_up_tokenization_spaces=False)
# Replace -100s in the labels as we can't decode them
labels[labels == -100] = tokenizer.pad_token_id
decoded_labels = tokenizer.batch_decode(labels, skip_special_tokens=True, clean_up_tokenization_spaces=False)
# Some simple post-processing
decoded_preds = [pred.strip() for pred in decoded_preds]
decoded_labels = [label.strip() for label in decoded_labels]
result = metric.compute(predictions=decoded_preds, references=decoded_labels)
return {'exact_match': result['exact_match']}
compute_metrics_fn = functools.partial(compute_metrics, tokenizer=tokenizer)
model = torch.compile(model)
# Training
trainer = Trainer(
model=model,
train_dataset=train_dataset,
eval_dataset=eval_dataset,
args=training_args,
data_collator=data_collator,
compute_metrics=compute_metrics_fn,
)
trainer.train()
trainer.save_state()
trainer.save_model(output_dir=training_args.output_dir)
tokenizer.save_pretrained(save_directory=training_args.output_dir)
if __name__ == "__main__":
main()
```
When I didn't use `torch.cpmpile(model)`, my code worked well. But when I added this line to my code, It produced the following error:
```
Traceback (most recent call last):
File "falcon_sft.py", line 230, in <module>
main()
File "falcon_sft.py", line 223, in main
trainer.train()
File "python3.10/site-packages/transformers/trainer.py", line 1539, in train
return inner_training_loop(
File "python3.10/site-packages/transformers/trainer.py", line 1787, in _inner_training_loop
for step, inputs in enumerate(epoch_iterator):
File "python3.10/site-packages/accelerate/data_loader.py", line 384, in __iter__
current_batch = next(dataloader_iter)
File "python3.10/site-packages/torch/utils/data/dataloader.py", line 633, in __next__
data = self._next_data()
File "python3.10/site-packages/torch/utils/data/dataloader.py", line 677, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = self.dataset.__getitems__(possibly_batched_index)
File "python3.10/site-packages/datasets/arrow_dataset.py", line 2807, in __getitems__
batch = self.__getitem__(keys)
File "python3.10/site-packages/datasets/arrow_dataset.py", line 2803, in __getitem__
return self._getitem(key)
File "python3.10/site-packages/datasets/arrow_dataset.py", line 2787, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "python3.10/site-packages/datasets/formatting/formatting.py", line 583, in query_table
_check_valid_index_key(key, size)
File "python3.10/site-packages/datasets/formatting/formatting.py", line 536, in _check_valid_index_key
_check_valid_index_key(int(max(key)), size=size)
File "python3.10/site-packages/datasets/formatting/formatting.py", line 526, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 88 is out of bounds for size 0
```
So I'm confused about why this error was generated, and how to fix it. Is this error produced by datasets or `torch.compile`?
### Expected behavior
I want to use `torch.compile` in my code.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-4.18.0-425.19.2.el8_7.x86_64-x86_64-with-glibc2.28
- Python version: 3.10.8
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
>
I tried this and got the following error:
```
Traceback (most recent call last):
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 324, in _compile
out_code = transform_code_object(code, transform)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/bytecode_transformation.py", line 445, in transform_code_object
transformations(instructions, code_options)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 311, in transform
tracer.run()
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1726, in run
super().run()
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 576, in run
and self.step()
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 540, in step
getattr(self, inst.opname)(inst)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1030, in LOAD_ATTR
result = BuiltinVariable(getattr).call_function(
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/variables/builtin.py", line 566, in call_function
result = handler(tx, *args, **kwargs)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/variables/builtin.py", line 931, in call_getattr
return obj.var_getattr(tx, name).add_options(options)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/variables/nn_module.py", line 124, in var_getattr
subobj = inspect.getattr_static(base, name)
File "/apps/Arch/software/Python/3.10.8-GCCcore-12.2.0/lib/python3.10/inspect.py", line 1777, in getattr_static
raise AttributeError(attr)
AttributeError: config
from user code:
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/peft/peft_model.py", line 909, in forward
if self.base_model.config.model_type == "mpt":
Set torch._dynamo.config.verbose=True for more information
You can suppress this exception and fall back to eager by setting:
torch._dynamo.config.suppress_errors = True
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/llm-copt/fine-tune/falcon/falcon_sft.py", line 228, in <module>
main()
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/llm-copt/fine-tune/falcon/falcon_sft.py", line 221, in main
trainer.train()
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/transformers/trainer.py", line 1539, in train
return inner_training_loop(
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/transformers/trainer.py", line 1809, in _inner_training_loop
tr_loss_step = self.training_step(model, inputs)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/transformers/trainer.py", line 2654, in training_step
loss = self.compute_loss(model, inputs)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/transformers/trainer.py", line 2679, in compute_loss
outputs = model(**inputs)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py", line 82, in forward
return self.dynamo_ctx(self._orig_mod.forward)(*args, **kwargs)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py", line 209, in _fn
return fn(*args, **kwargs)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/accelerate/utils/operations.py", line 581, in forward
return model_forward(*args, **kwargs)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/accelerate/utils/operations.py", line 569, in __call__
return convert_to_fp32(self.model_forward(*args, **kwargs))
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/amp/autocast_mode.py", line 14, in decorate_autocast
return func(*args, **kwargs)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py", line 337, in catch_errors
return callback(frame, cache_size, hooks)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 404, in _convert_frame
result = inner_convert(frame, cache_size, hooks)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 104, in _fn
return fn(*args, **kwargs)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 262, in _convert_frame_assert
return _compile(
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/utils.py", line 163, in time_wrapper
r = func(*args, **kwargs)
File "/cephyr/NOBACKUP/groups/snic2021-23-24/LLM4-CodeOpt/env/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 394, in _compile
raise InternalTorchDynamoError() from e
torch._dynamo.exc.InternalTorchDynamoError
``` | [
-0.46058011054992676,
-0.27659863233566284,
-0.027295688167214394,
0.4731191098690033,
0.09124531596899033,
-0.04254941642284393,
0.31532663106918335,
0.47062352299690247,
0.08070381730794907,
0.04917040094733238,
-0.24383330345153809,
0.42413467168807983,
0.007434118539094925,
-0.19464325904846191,
-0.028579600155353546,
-0.07139323651790619,
-0.030137501657009125,
-0.21997325122356415,
-0.13224372267723083,
0.07525433599948883,
-0.3346567749977112,
0.05179881304502487,
-0.1862344741821289,
0.1558615267276764,
-0.1674307882785797,
-0.2024364322423935,
0.214699387550354,
0.21827556192874908,
0.034234076738357544,
-0.2886626422405243,
0.05428396910429001,
-0.4448647201061249,
0.2474967986345291,
0.33301305770874023,
-0.00011540776904439554,
0.05910855531692505,
0.3394177258014679,
-0.05944984778761864,
-0.279675155878067,
0.1587117612361908,
0.5210778713226318,
0.09580960869789124,
0.12458458542823792,
-0.26298788189888,
-0.22167415916919708,
0.09600616246461868,
-0.23276770114898682,
-0.44496190547943115,
0.3620017170906067,
0.5245478749275208,
0.22141462564468384,
0.2585132420063019,
0.21775439381599426,
-0.13633739948272705,
0.2028934359550476,
-0.01906983181834221,
-0.21759165823459625,
-0.2732481360435486,
0.06970334053039551,
0.31837716698646545,
-0.31286564469337463,
0.45688357949256897,
-0.07090825587511063,
-0.17019127309322357,
0.40274691581726074,
-0.22686222195625305,
-0.20793430507183075,
-0.4215354025363922,
0.23052385449409485,
-0.02293761819601059,
0.03744681552052498,
-0.2512529492378235,
-0.47210559248924255,
-0.19572027027606964,
-0.026295311748981476,
-0.3189235031604767,
0.2404043823480606,
0.27398908138275146,
-0.04698100686073303,
0.20479723811149597,
0.2487693727016449,
-0.045633453875780106,
0.047372639179229736,
-0.18157558143138885,
-0.059817809611558914,
0.3723050653934479,
-0.06990993022918701,
0.204074427485466,
0.27056118845939636,
-0.2898693382740021,
0.08446090668439865,
-0.061324361711740494,
-0.17138773202896118,
0.07065160572528839,
-0.35445499420166016,
0.003420308232307434,
0.1477145552635193,
-0.060966070741415024,
0.039040639996528625,
0.09318944811820984,
-0.06986325979232788,
0.12978176772594452,
0.3060275614261627,
-0.17163006961345673,
0.012997597455978394,
0.23888304829597473,
-0.003639429807662964,
0.47389939427375793,
0.18716387450695038,
-0.1757802516222,
0.04327951371669769,
-0.06246504932641983,
-0.1857019066810608,
-0.2960297167301178,
0.01901090145111084,
0.24785077571868896,
0.01922719180583954,
-0.12594780325889587,
-0.17747904360294342,
0.34355974197387695,
0.5080097317695618,
0.1440066397190094,
0.284271240234375,
0.41664278507232666,
0.043569210916757584,
-0.22920449078083038,
0.09051121771335602,
0.1440618485212326,
-0.3355613350868225,
-0.24233581125736237,
-0.19697147607803345,
0.06431984901428223,
-0.06043586879968643,
-0.4055723547935486,
-0.051849085837602615,
-0.4176328778266907,
0.11617672443389893,
-0.0976731926202774,
-0.07949857413768768,
-0.1268649399280548,
-0.06501927226781845,
-0.2602311372756958,
0.21905390918254852,
0.36025235056877136,
-0.24645467102527618,
0.14843213558197021,
0.11926637589931488,
-0.07888602465391159,
-0.1869661808013916,
0.2760986089706421,
-0.3778039216995239,
-0.5330355763435364,
-0.3523258864879608,
0.1517537534236908,
-0.05574341118335724,
0.26269102096557617,
0.23052933812141418,
0.24828504025936127,
0.38464677333831787,
-0.29962870478630066,
0.19368836283683777,
-0.2222442775964737,
-0.27215003967285156,
-0.1750384420156479,
0.34597790241241455,
0.3029908537864685,
-0.5095228552818298,
0.17598223686218262,
-0.25892215967178345,
0.034256741404533386,
-0.013109277933835983,
0.14526605606079102,
-0.17006051540374756,
0.08207058161497116,
-0.3627830743789673,
0.11699126660823822,
0.5876964330673218,
-0.2611349821090698,
-0.4782140254974365,
0.24538081884384155,
-0.18213608860969543,
-0.4134592115879059,
0.004021000117063522,
0.1796364188194275,
0.23312373459339142,
0.002830520272254944,
0.443403035402298,
0.07990843057632446,
-0.07360310107469559,
-0.06774363666772842,
-0.18386349081993103,
-0.16608953475952148,
0.4369402229785919,
0.07680461555719376,
0.28672486543655396,
-0.16165992617607117,
-0.04137902706861496,
0.01175118237733841,
-0.061409879475831985,
0.0617663711309433,
-0.19792884588241577,
0.2438398003578186,
0.1412965953350067,
-0.3158209025859833,
0.02329157292842865,
-0.16994065046310425,
-0.30626380443573,
0.2532976269721985,
-0.03557296469807625,
-0.14290481805801392,
-0.1345731019973755,
0.04576236754655838,
-0.06462369114160538,
0.2555595636367798,
-0.07530856132507324,
-0.3779144585132599,
0.10723134130239487,
-0.28965210914611816,
0.10632090270519257,
-0.2972109615802765,
-0.09295019507408142,
0.05876326560974121,
-0.044973067939281464,
0.18362565338611603,
-0.4133526682853699,
0.08944365382194519,
-0.3850754499435425,
-0.217631995677948,
-0.13044385612010956,
0.21411514282226562,
0.15200427174568176,
-0.027679892256855965,
-0.25753191113471985,
0.370042085647583,
0.12013466656208038,
-0.29570236802101135,
0.017745986580848694,
0.15121278166770935,
0.11096043139696121,
-0.22432033717632294,
0.13421788811683655,
0.5024381875991821,
0.05223488435149193,
0.03560160845518112,
0.0975232943892479,
0.4635348618030548,
0.15507195889949799,
0.3741542100906372,
-0.2467399537563324,
-0.09470902383327484,
-0.012140974402427673,
0.14277753233909607,
-0.0887807160615921,
0.04357686638832092,
0.02348833717405796,
-0.18520976603031158,
0.4910174012184143,
0.15451975166797638,
-0.12577331066131592,
-0.00045463070273399353,
0.07628103345632553,
0.12661781907081604,
0.2723517417907715,
0.229659304022789,
-0.18044781684875488,
0.09799869358539581,
0.18185700476169586,
-0.19504855573177338,
0.23537486791610718,
0.14124205708503723,
-0.19786325097084045,
0.1193401962518692,
-0.11344276368618011,
-0.013716038316488266,
0.3028005361557007,
0.0359349399805069,
-0.17664191126823425,
0.257424920797348,
0.1617496907711029,
0.03834092989563942,
-0.045899223536252975,
-0.2528499364852905,
-0.11889825761318207,
0.10123121738433838,
-0.41098248958587646,
0.2882310748100281,
0.050505660474300385,
0.09113896638154984,
-0.08605960756540298,
0.3568164110183716,
-0.24508197605609894,
-0.10891321301460266,
0.15749216079711914,
-0.03634179010987282,
-0.06857460737228394,
0.05969839543104172,
-0.4851211905479431,
-0.0019853413105010986,
0.44332242012023926,
-0.16094870865345,
0.06961658596992493,
-0.10907652974128723,
-0.15191085636615753,
-0.019336936995387077,
0.22826208174228668,
-0.36361992359161377,
0.19944864511489868,
0.22731924057006836,
0.18476267158985138,
0.01405305415391922,
-0.3859502077102661,
0.12721560895442963,
-0.12603667378425598,
0.38136792182922363,
0.25005075335502625,
-0.07109653204679489,
0.16557040810585022,
-0.2889568507671356,
0.27750715613365173,
-0.19888851046562195,
-0.15679164230823517,
0.013823069632053375,
-0.14415143430233002,
0.11382563412189484,
-0.22929488122463226,
-0.25450971722602844,
0.059180617332458496,
-0.4073662757873535,
-0.05502424016594887,
-0.2866050601005554,
0.18191489577293396,
0.5470845699310303,
0.4114663898944855,
0.08673185855150223,
-0.017021095380187035,
-0.11969759315252304,
-0.0905209630727768,
0.09554028511047363,
0.40600430965423584,
-0.04357697069644928,
-0.36526915431022644,
-0.035528652369976044,
-0.24070918560028076,
0.14448794722557068,
-0.23095391690731049,
-0.40576764941215515,
0.18763992190361023,
-0.2118019312620163,
0.2719842791557312,
-0.37768495082855225,
0.1753203570842743,
0.2610192596912384,
0.014517579227685928,
-0.09890908002853394,
-0.12926992774009705,
-0.33674293756484985,
-0.012020401656627655,
-0.04610751196742058,
0.2581484317779541,
-0.1472821980714798,
0.18557234108448029,
-0.1742396056652069,
0.9223641157150269,
0.11747198551893234,
-0.31989166140556335,
-0.02054857835173607,
-0.01950957626104355,
0.19322116672992706,
-0.1693120002746582,
-0.3886566162109375,
0.32202664017677307,
0.014534048736095428,
-0.2899017035961151,
0.15734604001045227,
-0.09964026510715485,
-0.2673209607601166,
-0.023821890354156494,
-0.11112800240516663,
-0.18855439126491547,
-0.2356203943490982,
0.35491693019866943,
-0.08908848464488983,
-0.1352604776620865,
-0.1897769272327423,
0.3167388439178467,
-0.3034159243106842,
0.08561074733734131,
0.21710170805454254,
-0.28447026014328003,
-0.00815468281507492,
-0.2150239199399948,
0.04862653464078903,
-0.42224758863449097,
-0.30178266763687134,
0.335486501455307,
-0.03488728031516075,
0.17119064927101135,
0.18967124819755554,
-0.2039755880832672,
0.04202153906226158,
-0.13661502301692963,
0.6925354599952698,
-0.11505292356014252,
-0.005426299292594194,
0.09750278294086456,
-0.10805243253707886,
-0.8682926297187805,
-0.12562966346740723,
-0.052323758602142334,
0.26526302099227905,
-0.01997658982872963,
0.2759293019771576,
-0.23149341344833374,
-0.10334819555282593,
-0.006559767760336399,
-0.0023622438311576843,
-0.10908711701631546,
-0.08592859655618668,
-0.2647952437400818,
-0.035789262503385544,
-0.31994539499282837,
0.35268139839172363,
0.14405231177806854,
0.2219143509864807,
-0.11983983963727951,
0.043545253574848175,
-0.23408088088035583,
-0.0927155613899231,
-0.038526736199855804,
-0.02468939870595932,
0.5121557712554932,
-0.04939361661672592,
0.15894632041454315,
0.02791234850883484,
0.16354435682296753,
-0.033596236258745193,
0.4854910671710968,
0.32776835560798645,
0.43104955554008484,
0.16507455706596375,
0.06913019716739655,
0.05472811684012413,
0.26406851410865784,
-0.20495787262916565,
-0.07602767646312714,
-0.01955064758658409,
0.310384601354599,
-0.17891961336135864,
-0.04850240424275398,
0.09782364219427109,
-0.030784718692302704,
-0.19163310527801514,
-0.07925207912921906,
0.1868201494216919,
0.08613163977861404,
0.025516927242279053,
0.28895583748817444,
-0.08208382874727249,
-0.14249998331069946,
0.48526105284690857,
0.4084721505641937,
0.9043242931365967,
-0.005295123904943466,
0.11206556856632233,
-0.11655785143375397,
0.051073431968688965,
0.08622228354215622,
-0.3118944466114044,
0.15388800203800201,
-0.5014591217041016,
-0.4820352792739868,
0.05614668130874634,
-0.10660945624113083,
-0.023525305092334747,
-0.11177991330623627,
-0.03780047968029976,
0.10025322437286377,
-0.20900776982307434,
0.19045892357826233,
-0.260787695646286,
-0.058224666863679886,
0.08524671196937561,
-0.13250041007995605,
-0.16676390171051025,
0.08112697303295135,
-0.17808479070663452,
0.2746461033821106,
-0.014167465269565582,
-0.08050292730331421,
-0.09720167517662048,
-0.480310320854187,
-0.22976233065128326,
0.10598644614219666,
-0.40612733364105225,
0.09960366785526276,
0.1914147138595581,
-0.3225056529045105,
0.2562887668609619,
0.31036806106567383,
0.1094387099146843,
0.28453874588012695,
-0.03432970121502876,
0.021037330850958824,
0.20663687586784363,
0.08017551898956299,
-0.051696475595235825,
-0.009664468467235565,
0.11453504115343094,
0.02955758571624756,
-0.06641937047243118,
0.13439546525478363,
-0.08193390816450119,
0.06643815338611603,
0.21161897480487823,
0.2698478698730469,
-0.0363130122423172,
-0.36552244424819946,
-0.23763330280780792,
-0.17220234870910645,
-0.0595875158905983,
-0.12809577584266663,
0.08576320856809616,
-0.03176460415124893,
-0.1973811388015747,
0.06289587914943695,
0.12752752006053925,
-0.36487746238708496,
-0.05807899311184883,
0.5833962559700012,
0.013264508917927742,
0.3081538677215576,
0.4073735177516937,
0.18558263778686523,
-0.10031959414482117,
-0.19282430410385132,
-0.012440480291843414,
0.5233457088470459,
-0.6791960000991821,
0.07605123519897461,
-0.28905168175697327,
-0.3067885935306549,
-0.033977288752794266,
0.28786125779151917,
0.257398784160614,
-0.020527664572000504,
-0.24511386454105377,
0.1262708306312561,
-0.5130403637886047,
0.2217998057603836,
-0.20455539226531982,
-0.00013209180906414986,
-0.2832317352294922,
0.0076509565114974976,
-0.08115286380052567,
0.026651976630091667,
-0.30528026819229126,
-0.020187582820653915,
-0.07099085301160812,
0.2096187174320221,
-0.09716442227363586,
-0.06588517129421234,
-0.14650166034698486,
0.06035000830888748,
0.05539045110344887,
0.19417959451675415,
-0.22422340512275696,
-0.24661919474601746,
-0.13327878713607788,
0.11535020172595978,
-0.08420594781637192,
-0.07255873829126358,
-0.15317504107952118,
-0.23286446928977966,
-0.15024705231189728,
-0.23998519778251648,
0.2224472314119339,
0.05282606929540634,
0.22945308685302734,
0.24177926778793335,
0.06884079426527023,
0.1651650369167328,
-0.07507605850696564,
0.10488945245742798,
0.061967432498931885,
0.5464033484458923,
0.14895983040332794,
0.1332889050245285,
0.002376202493906021,
-0.07251812517642975,
-0.4097539186477661,
0.09877435863018036,
-0.0790940523147583,
0.306883841753006,
-0.03226200118660927,
-0.26520052552223206,
-0.14794903993606567,
0.5163429379463196,
0.21842718124389648,
0.33036524057388306,
-0.10135558247566223,
0.010584205389022827,
-0.12058572471141815,
0.19846177101135254,
-0.1543055772781372,
0.014744773507118225,
-0.008126532658934593,
-0.1319584846496582,
0.09299011528491974,
0.4246247112751007,
0.16313356161117554,
0.10893887281417847,
0.27586910128593445,
0.16955731809139252,
0.14335264265537262,
0.18897856771945953,
0.22808249294757843,
0.7236438393592834,
-0.021813608705997467,
-0.1490297019481659,
0.5851725935935974,
-0.15577378869056702,
0.2793812155723572,
0.6296947598457336,
0.0764598622918129,
0.36272022128105164,
0.4686641991138458,
0.18488195538520813,
0.1354300081729889,
-0.3179926872253418,
0.1589048206806183,
-0.23661763966083527,
0.3237639367580414,
-0.18066318333148956,
-0.19542089104652405,
0.2005576640367508,
-0.05873074755072594,
-0.38185155391693115,
-0.07283855974674225,
0.20302359759807587,
-0.4103529155254364,
-0.16584551334381104,
0.07314988970756531,
-0.10289570689201355,
0.06586796045303345,
-0.04237043112516403,
0.006775582674890757,
0.004474183544516563,
0.3291354179382324,
0.09385494887828827,
-0.149447500705719,
-0.05240988731384277,
0.1043148934841156,
0.37979644536972046,
0.08075831085443497,
-0.2085520625114441,
0.4180576503276825,
0.3827959895133972,
-0.06600847840309143,
0.21268178522586823,
0.1125321239233017,
0.5991432666778564,
0.14017891883850098,
-0.5167805552482605,
-0.06933611631393433,
0.1902577430009842,
-0.15963849425315857,
-0.21813490986824036,
0.0028678011149168015,
-0.13709864020347595,
0.35113298892974854,
0.5019601583480835,
0.0894940197467804,
-0.20810401439666748,
-0.008420927450060844,
-0.12770923972129822,
0.3638957142829895,
-0.05490607023239136,
0.17944060266017914,
-0.11236564069986343,
-0.17165428400039673,
-0.19471941888332367,
-0.015904076397418976,
-0.17679527401924133,
0.1781477928161621,
0.4905378222465515,
-0.18546506762504578,
0.046488258987665176,
-0.09410600364208221,
0.08203265070915222,
-0.16815924644470215,
0.4135836362838745,
0.2866829037666321,
-0.03188556805253029,
-0.33434075117111206,
0.2658335566520691,
-0.363943874835968,
0.3209834694862366,
-0.09422720968723297,
0.06461802870035172,
0.1500149816274643,
0.3698657155036926,
-0.09828002005815506,
0.09823901951313019,
0.42964088916778564,
-0.44498226046562195,
0.3723081052303314,
0.40184342861175537,
-0.22128795087337494,
0.0412428081035614,
-0.5812980532646179,
0.035557664930820465,
0.12873825430870056,
-0.29677876830101013,
-0.042316898703575134,
-0.025434795767068863,
0.07290396094322205,
-0.054665543138980865,
-0.33274194598197937,
0.0412537083029747,
-0.16279396414756775,
0.7269923686981201,
-0.11474954336881638,
0.3409119248390198,
0.08445407450199127,
0.02718852460384369,
-0.2759213447570801,
0.0764964371919632,
-0.07518716901540756,
0.041668545454740524,
0.21945232152938843,
0.5663888454437256,
0.015544906258583069,
-0.2400248646736145,
-0.3383796215057373,
0.18476511538028717,
0.3487740755081177,
-0.09467925131320953,
-0.08575062453746796,
0.3060990571975708,
-0.2602578401565552,
-0.0559866800904274,
0.050794221460819244,
0.33203208446502686,
0.1876927763223648,
0.2945087254047394,
-0.016689717769622803,
-0.7438549995422363,
0.5063519477844238,
-0.11262653768062592,
-0.2887372076511383,
0.17895059287548065,
0.1855284869670868,
0.43677008152008057,
-0.04264841973781586,
-0.44756102561950684,
0.01832909882068634,
0.12047991156578064,
-0.21734993159770966,
-0.062398746609687805,
-0.17387521266937256,
-0.21270817518234253,
0.1909659206867218,
-0.08036695420742035,
0.20917262136936188,
-0.08296875655651093,
0.003757283091545105,
-0.10521669685840607,
-0.1948738843202591
] |
https://github.com/huggingface/datasets/issues/6128 | Hi @TomasAndersonFang,
I guess in this case it may be an issue with `transformers` (or `PyTorch`). I would recommend you open an issue on their repo. | IndexError: Invalid key: 88 is out of bounds for size 0 | ### Describe the bug
This bug generates when I use torch.compile(model) in my code, which seems to raise an error in datasets lib.
### Steps to reproduce the bug
I use the following code to fine-tune Falcon on my private dataset.
```python
import transformers
from transformers import (
AutoModelForCausalLM,
AutoTokenizer,
AutoConfig,
DataCollatorForSeq2Seq,
Trainer,
Seq2SeqTrainer,
HfArgumentParser,
Seq2SeqTrainingArguments,
BitsAndBytesConfig,
)
from peft import (
LoraConfig,
get_peft_model,
get_peft_model_state_dict,
prepare_model_for_int8_training,
set_peft_model_state_dict,
)
import torch
import os
import evaluate
import functools
from datasets import load_dataset
import bitsandbytes as bnb
import logging
import json
import copy
from typing import Dict, Optional, Sequence
from dataclasses import dataclass, field
# Lora settings
LORA_R = 8
LORA_ALPHA = 16
LORA_DROPOUT= 0.05
LORA_TARGET_MODULES = ["query_key_value"]
@dataclass
class ModelArguments:
model_name_or_path: Optional[str] = field(default="Salesforce/codegen2-7B")
@dataclass
class DataArguments:
data_path: str = field(default=None, metadata={"help": "Path to the training data."})
train_file: str = field(default=None, metadata={"help": "Path to the evaluation data."})
eval_file: str = field(default=None, metadata={"help": "Path to the evaluation data."})
cache_path: str = field(default=None, metadata={"help": "Path to the cache directory."})
num_proc: int = field(default=4, metadata={"help": "Number of processes to use for data preprocessing."})
@dataclass
class TrainingArguments(transformers.TrainingArguments):
# cache_dir: Optional[str] = field(default=None)
optim: str = field(default="adamw_torch")
model_max_length: int = field(
default=512,
metadata={"help": "Maximum sequence length. Sequences will be right padded (and possibly truncated)."},
)
is_lora: bool = field(default=True, metadata={"help": "Whether to use LORA."})
def tokenize(text, tokenizer, max_seq_len=512, add_eos_token=True):
result = tokenizer(
text,
truncation=True,
max_length=max_seq_len,
padding=False,
return_tensors=None,
)
if (
result["input_ids"][-1] != tokenizer.eos_token_id
and len(result["input_ids"]) < max_seq_len
and add_eos_token
):
result["input_ids"].append(tokenizer.eos_token_id)
result["attention_mask"].append(1)
if add_eos_token and len(result["input_ids"]) >= max_seq_len:
result["input_ids"][max_seq_len - 1] = tokenizer.eos_token_id
result["attention_mask"][max_seq_len - 1] = 1
result["labels"] = result["input_ids"].copy()
return result
def main():
parser = HfArgumentParser((ModelArguments, DataArguments, TrainingArguments))
model_args, data_args, training_args = parser.parse_args_into_dataclasses()
config = AutoConfig.from_pretrained(
model_args.model_name_or_path,
cache_dir=data_args.cache_path,
trust_remote_code=True,
)
if training_args.is_lora:
model = AutoModelForCausalLM.from_pretrained(
model_args.model_name_or_path,
cache_dir=data_args.cache_path,
torch_dtype=torch.float16,
trust_remote_code=True,
load_in_8bit=True,
quantization_config=BitsAndBytesConfig(
load_in_8bit=True,
llm_int8_threshold=6.0
),
)
model = prepare_model_for_int8_training(model)
config = LoraConfig(
r=LORA_R,
lora_alpha=LORA_ALPHA,
target_modules=LORA_TARGET_MODULES,
lora_dropout=LORA_DROPOUT,
bias="none",
task_type="CAUSAL_LM",
)
model = get_peft_model(model, config)
else:
model = AutoModelForCausalLM.from_pretrained(
model_args.model_name_or_path,
torch_dtype=torch.float16,
cache_dir=data_args.cache_path,
trust_remote_code=True,
)
model.config.use_cache = False
def print_trainable_parameters(model):
"""
Prints the number of trainable parameters in the model.
"""
trainable_params = 0
all_param = 0
for _, param in model.named_parameters():
all_param += param.numel()
if param.requires_grad:
trainable_params += param.numel()
print(
f"trainable params: {trainable_params} || all params: {all_param} || trainable%: {100 * trainable_params / all_param}"
)
print_trainable_parameters(model)
tokenizer = AutoTokenizer.from_pretrained(
model_args.model_name_or_path,
cache_dir=data_args.cache_path,
model_max_length=training_args.model_max_length,
padding_side="left",
use_fast=True,
trust_remote_code=True,
)
tokenizer.pad_token = tokenizer.eos_token
# Load dataset
def generate_and_tokenize_prompt(sample):
input_text = sample["input"]
target_text = sample["output"] + tokenizer.eos_token
full_text = input_text + target_text
tokenized_full_text = tokenize(full_text, tokenizer, max_seq_len=512)
tokenized_input_text = tokenize(input_text, tokenizer, max_seq_len=512)
input_len = len(tokenized_input_text["input_ids"]) - 1 # -1 for eos token
tokenized_full_text["labels"] = [-100] * input_len + tokenized_full_text["labels"][input_len:]
return tokenized_full_text
data_files = {}
if data_args.train_file is not None:
data_files["train"] = data_args.train_file
if data_args.eval_file is not None:
data_files["eval"] = data_args.eval_file
dataset = load_dataset(data_args.data_path, data_files=data_files)
train_dataset = dataset["train"]
eval_dataset = dataset["eval"]
train_dataset = train_dataset.map(generate_and_tokenize_prompt, num_proc=data_args.num_proc)
eval_dataset = eval_dataset.map(generate_and_tokenize_prompt, num_proc=data_args.num_proc)
data_collator = DataCollatorForSeq2Seq(tokenizer, pad_to_multiple_of=8, return_tensors="pt", padding=True)
# Evaluation metrics
def compute_metrics(eval_preds, tokenizer):
metric = evaluate.load('exact_match')
preds, labels = eval_preds
# In case the model returns more than the prediction logits
if isinstance(preds, tuple):
preds = preds[0]
decoded_preds = tokenizer.batch_decode(preds, skip_special_tokens=True, clean_up_tokenization_spaces=False)
# Replace -100s in the labels as we can't decode them
labels[labels == -100] = tokenizer.pad_token_id
decoded_labels = tokenizer.batch_decode(labels, skip_special_tokens=True, clean_up_tokenization_spaces=False)
# Some simple post-processing
decoded_preds = [pred.strip() for pred in decoded_preds]
decoded_labels = [label.strip() for label in decoded_labels]
result = metric.compute(predictions=decoded_preds, references=decoded_labels)
return {'exact_match': result['exact_match']}
compute_metrics_fn = functools.partial(compute_metrics, tokenizer=tokenizer)
model = torch.compile(model)
# Training
trainer = Trainer(
model=model,
train_dataset=train_dataset,
eval_dataset=eval_dataset,
args=training_args,
data_collator=data_collator,
compute_metrics=compute_metrics_fn,
)
trainer.train()
trainer.save_state()
trainer.save_model(output_dir=training_args.output_dir)
tokenizer.save_pretrained(save_directory=training_args.output_dir)
if __name__ == "__main__":
main()
```
When I didn't use `torch.cpmpile(model)`, my code worked well. But when I added this line to my code, It produced the following error:
```
Traceback (most recent call last):
File "falcon_sft.py", line 230, in <module>
main()
File "falcon_sft.py", line 223, in main
trainer.train()
File "python3.10/site-packages/transformers/trainer.py", line 1539, in train
return inner_training_loop(
File "python3.10/site-packages/transformers/trainer.py", line 1787, in _inner_training_loop
for step, inputs in enumerate(epoch_iterator):
File "python3.10/site-packages/accelerate/data_loader.py", line 384, in __iter__
current_batch = next(dataloader_iter)
File "python3.10/site-packages/torch/utils/data/dataloader.py", line 633, in __next__
data = self._next_data()
File "python3.10/site-packages/torch/utils/data/dataloader.py", line 677, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = self.dataset.__getitems__(possibly_batched_index)
File "python3.10/site-packages/datasets/arrow_dataset.py", line 2807, in __getitems__
batch = self.__getitem__(keys)
File "python3.10/site-packages/datasets/arrow_dataset.py", line 2803, in __getitem__
return self._getitem(key)
File "python3.10/site-packages/datasets/arrow_dataset.py", line 2787, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "python3.10/site-packages/datasets/formatting/formatting.py", line 583, in query_table
_check_valid_index_key(key, size)
File "python3.10/site-packages/datasets/formatting/formatting.py", line 536, in _check_valid_index_key
_check_valid_index_key(int(max(key)), size=size)
File "python3.10/site-packages/datasets/formatting/formatting.py", line 526, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 88 is out of bounds for size 0
```
So I'm confused about why this error was generated, and how to fix it. Is this error produced by datasets or `torch.compile`?
### Expected behavior
I want to use `torch.compile` in my code.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-4.18.0-425.19.2.el8_7.x86_64-x86_64-with-glibc2.28
- Python version: 3.10.8
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3 | 26 | IndexError: Invalid key: 88 is out of bounds for size 0
### Describe the bug
This bug generates when I use torch.compile(model) in my code, which seems to raise an error in datasets lib.
### Steps to reproduce the bug
I use the following code to fine-tune Falcon on my private dataset.
```python
import transformers
from transformers import (
AutoModelForCausalLM,
AutoTokenizer,
AutoConfig,
DataCollatorForSeq2Seq,
Trainer,
Seq2SeqTrainer,
HfArgumentParser,
Seq2SeqTrainingArguments,
BitsAndBytesConfig,
)
from peft import (
LoraConfig,
get_peft_model,
get_peft_model_state_dict,
prepare_model_for_int8_training,
set_peft_model_state_dict,
)
import torch
import os
import evaluate
import functools
from datasets import load_dataset
import bitsandbytes as bnb
import logging
import json
import copy
from typing import Dict, Optional, Sequence
from dataclasses import dataclass, field
# Lora settings
LORA_R = 8
LORA_ALPHA = 16
LORA_DROPOUT= 0.05
LORA_TARGET_MODULES = ["query_key_value"]
@dataclass
class ModelArguments:
model_name_or_path: Optional[str] = field(default="Salesforce/codegen2-7B")
@dataclass
class DataArguments:
data_path: str = field(default=None, metadata={"help": "Path to the training data."})
train_file: str = field(default=None, metadata={"help": "Path to the evaluation data."})
eval_file: str = field(default=None, metadata={"help": "Path to the evaluation data."})
cache_path: str = field(default=None, metadata={"help": "Path to the cache directory."})
num_proc: int = field(default=4, metadata={"help": "Number of processes to use for data preprocessing."})
@dataclass
class TrainingArguments(transformers.TrainingArguments):
# cache_dir: Optional[str] = field(default=None)
optim: str = field(default="adamw_torch")
model_max_length: int = field(
default=512,
metadata={"help": "Maximum sequence length. Sequences will be right padded (and possibly truncated)."},
)
is_lora: bool = field(default=True, metadata={"help": "Whether to use LORA."})
def tokenize(text, tokenizer, max_seq_len=512, add_eos_token=True):
result = tokenizer(
text,
truncation=True,
max_length=max_seq_len,
padding=False,
return_tensors=None,
)
if (
result["input_ids"][-1] != tokenizer.eos_token_id
and len(result["input_ids"]) < max_seq_len
and add_eos_token
):
result["input_ids"].append(tokenizer.eos_token_id)
result["attention_mask"].append(1)
if add_eos_token and len(result["input_ids"]) >= max_seq_len:
result["input_ids"][max_seq_len - 1] = tokenizer.eos_token_id
result["attention_mask"][max_seq_len - 1] = 1
result["labels"] = result["input_ids"].copy()
return result
def main():
parser = HfArgumentParser((ModelArguments, DataArguments, TrainingArguments))
model_args, data_args, training_args = parser.parse_args_into_dataclasses()
config = AutoConfig.from_pretrained(
model_args.model_name_or_path,
cache_dir=data_args.cache_path,
trust_remote_code=True,
)
if training_args.is_lora:
model = AutoModelForCausalLM.from_pretrained(
model_args.model_name_or_path,
cache_dir=data_args.cache_path,
torch_dtype=torch.float16,
trust_remote_code=True,
load_in_8bit=True,
quantization_config=BitsAndBytesConfig(
load_in_8bit=True,
llm_int8_threshold=6.0
),
)
model = prepare_model_for_int8_training(model)
config = LoraConfig(
r=LORA_R,
lora_alpha=LORA_ALPHA,
target_modules=LORA_TARGET_MODULES,
lora_dropout=LORA_DROPOUT,
bias="none",
task_type="CAUSAL_LM",
)
model = get_peft_model(model, config)
else:
model = AutoModelForCausalLM.from_pretrained(
model_args.model_name_or_path,
torch_dtype=torch.float16,
cache_dir=data_args.cache_path,
trust_remote_code=True,
)
model.config.use_cache = False
def print_trainable_parameters(model):
"""
Prints the number of trainable parameters in the model.
"""
trainable_params = 0
all_param = 0
for _, param in model.named_parameters():
all_param += param.numel()
if param.requires_grad:
trainable_params += param.numel()
print(
f"trainable params: {trainable_params} || all params: {all_param} || trainable%: {100 * trainable_params / all_param}"
)
print_trainable_parameters(model)
tokenizer = AutoTokenizer.from_pretrained(
model_args.model_name_or_path,
cache_dir=data_args.cache_path,
model_max_length=training_args.model_max_length,
padding_side="left",
use_fast=True,
trust_remote_code=True,
)
tokenizer.pad_token = tokenizer.eos_token
# Load dataset
def generate_and_tokenize_prompt(sample):
input_text = sample["input"]
target_text = sample["output"] + tokenizer.eos_token
full_text = input_text + target_text
tokenized_full_text = tokenize(full_text, tokenizer, max_seq_len=512)
tokenized_input_text = tokenize(input_text, tokenizer, max_seq_len=512)
input_len = len(tokenized_input_text["input_ids"]) - 1 # -1 for eos token
tokenized_full_text["labels"] = [-100] * input_len + tokenized_full_text["labels"][input_len:]
return tokenized_full_text
data_files = {}
if data_args.train_file is not None:
data_files["train"] = data_args.train_file
if data_args.eval_file is not None:
data_files["eval"] = data_args.eval_file
dataset = load_dataset(data_args.data_path, data_files=data_files)
train_dataset = dataset["train"]
eval_dataset = dataset["eval"]
train_dataset = train_dataset.map(generate_and_tokenize_prompt, num_proc=data_args.num_proc)
eval_dataset = eval_dataset.map(generate_and_tokenize_prompt, num_proc=data_args.num_proc)
data_collator = DataCollatorForSeq2Seq(tokenizer, pad_to_multiple_of=8, return_tensors="pt", padding=True)
# Evaluation metrics
def compute_metrics(eval_preds, tokenizer):
metric = evaluate.load('exact_match')
preds, labels = eval_preds
# In case the model returns more than the prediction logits
if isinstance(preds, tuple):
preds = preds[0]
decoded_preds = tokenizer.batch_decode(preds, skip_special_tokens=True, clean_up_tokenization_spaces=False)
# Replace -100s in the labels as we can't decode them
labels[labels == -100] = tokenizer.pad_token_id
decoded_labels = tokenizer.batch_decode(labels, skip_special_tokens=True, clean_up_tokenization_spaces=False)
# Some simple post-processing
decoded_preds = [pred.strip() for pred in decoded_preds]
decoded_labels = [label.strip() for label in decoded_labels]
result = metric.compute(predictions=decoded_preds, references=decoded_labels)
return {'exact_match': result['exact_match']}
compute_metrics_fn = functools.partial(compute_metrics, tokenizer=tokenizer)
model = torch.compile(model)
# Training
trainer = Trainer(
model=model,
train_dataset=train_dataset,
eval_dataset=eval_dataset,
args=training_args,
data_collator=data_collator,
compute_metrics=compute_metrics_fn,
)
trainer.train()
trainer.save_state()
trainer.save_model(output_dir=training_args.output_dir)
tokenizer.save_pretrained(save_directory=training_args.output_dir)
if __name__ == "__main__":
main()
```
When I didn't use `torch.cpmpile(model)`, my code worked well. But when I added this line to my code, It produced the following error:
```
Traceback (most recent call last):
File "falcon_sft.py", line 230, in <module>
main()
File "falcon_sft.py", line 223, in main
trainer.train()
File "python3.10/site-packages/transformers/trainer.py", line 1539, in train
return inner_training_loop(
File "python3.10/site-packages/transformers/trainer.py", line 1787, in _inner_training_loop
for step, inputs in enumerate(epoch_iterator):
File "python3.10/site-packages/accelerate/data_loader.py", line 384, in __iter__
current_batch = next(dataloader_iter)
File "python3.10/site-packages/torch/utils/data/dataloader.py", line 633, in __next__
data = self._next_data()
File "python3.10/site-packages/torch/utils/data/dataloader.py", line 677, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = self.dataset.__getitems__(possibly_batched_index)
File "python3.10/site-packages/datasets/arrow_dataset.py", line 2807, in __getitems__
batch = self.__getitem__(keys)
File "python3.10/site-packages/datasets/arrow_dataset.py", line 2803, in __getitem__
return self._getitem(key)
File "python3.10/site-packages/datasets/arrow_dataset.py", line 2787, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "python3.10/site-packages/datasets/formatting/formatting.py", line 583, in query_table
_check_valid_index_key(key, size)
File "python3.10/site-packages/datasets/formatting/formatting.py", line 536, in _check_valid_index_key
_check_valid_index_key(int(max(key)), size=size)
File "python3.10/site-packages/datasets/formatting/formatting.py", line 526, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 88 is out of bounds for size 0
```
So I'm confused about why this error was generated, and how to fix it. Is this error produced by datasets or `torch.compile`?
### Expected behavior
I want to use `torch.compile` in my code.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-4.18.0-425.19.2.el8_7.x86_64-x86_64-with-glibc2.28
- Python version: 3.10.8
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
Hi @TomasAndersonFang,
I guess in this case it may be an issue with `transformers` (or `PyTorch`). I would recommend you open an issue on their repo. | [
-0.46058011054992676,
-0.27659863233566284,
-0.027295688167214394,
0.4731191098690033,
0.09124531596899033,
-0.04254941642284393,
0.31532663106918335,
0.47062352299690247,
0.08070381730794907,
0.04917040094733238,
-0.24383330345153809,
0.42413467168807983,
0.007434118539094925,
-0.19464325904846191,
-0.028579600155353546,
-0.07139323651790619,
-0.030137501657009125,
-0.21997325122356415,
-0.13224372267723083,
0.07525433599948883,
-0.3346567749977112,
0.05179881304502487,
-0.1862344741821289,
0.1558615267276764,
-0.1674307882785797,
-0.2024364322423935,
0.214699387550354,
0.21827556192874908,
0.034234076738357544,
-0.2886626422405243,
0.05428396910429001,
-0.4448647201061249,
0.2474967986345291,
0.33301305770874023,
-0.00011540776904439554,
0.05910855531692505,
0.3394177258014679,
-0.05944984778761864,
-0.279675155878067,
0.1587117612361908,
0.5210778713226318,
0.09580960869789124,
0.12458458542823792,
-0.26298788189888,
-0.22167415916919708,
0.09600616246461868,
-0.23276770114898682,
-0.44496190547943115,
0.3620017170906067,
0.5245478749275208,
0.22141462564468384,
0.2585132420063019,
0.21775439381599426,
-0.13633739948272705,
0.2028934359550476,
-0.01906983181834221,
-0.21759165823459625,
-0.2732481360435486,
0.06970334053039551,
0.31837716698646545,
-0.31286564469337463,
0.45688357949256897,
-0.07090825587511063,
-0.17019127309322357,
0.40274691581726074,
-0.22686222195625305,
-0.20793430507183075,
-0.4215354025363922,
0.23052385449409485,
-0.02293761819601059,
0.03744681552052498,
-0.2512529492378235,
-0.47210559248924255,
-0.19572027027606964,
-0.026295311748981476,
-0.3189235031604767,
0.2404043823480606,
0.27398908138275146,
-0.04698100686073303,
0.20479723811149597,
0.2487693727016449,
-0.045633453875780106,
0.047372639179229736,
-0.18157558143138885,
-0.059817809611558914,
0.3723050653934479,
-0.06990993022918701,
0.204074427485466,
0.27056118845939636,
-0.2898693382740021,
0.08446090668439865,
-0.061324361711740494,
-0.17138773202896118,
0.07065160572528839,
-0.35445499420166016,
0.003420308232307434,
0.1477145552635193,
-0.060966070741415024,
0.039040639996528625,
0.09318944811820984,
-0.06986325979232788,
0.12978176772594452,
0.3060275614261627,
-0.17163006961345673,
0.012997597455978394,
0.23888304829597473,
-0.003639429807662964,
0.47389939427375793,
0.18716387450695038,
-0.1757802516222,
0.04327951371669769,
-0.06246504932641983,
-0.1857019066810608,
-0.2960297167301178,
0.01901090145111084,
0.24785077571868896,
0.01922719180583954,
-0.12594780325889587,
-0.17747904360294342,
0.34355974197387695,
0.5080097317695618,
0.1440066397190094,
0.284271240234375,
0.41664278507232666,
0.043569210916757584,
-0.22920449078083038,
0.09051121771335602,
0.1440618485212326,
-0.3355613350868225,
-0.24233581125736237,
-0.19697147607803345,
0.06431984901428223,
-0.06043586879968643,
-0.4055723547935486,
-0.051849085837602615,
-0.4176328778266907,
0.11617672443389893,
-0.0976731926202774,
-0.07949857413768768,
-0.1268649399280548,
-0.06501927226781845,
-0.2602311372756958,
0.21905390918254852,
0.36025235056877136,
-0.24645467102527618,
0.14843213558197021,
0.11926637589931488,
-0.07888602465391159,
-0.1869661808013916,
0.2760986089706421,
-0.3778039216995239,
-0.5330355763435364,
-0.3523258864879608,
0.1517537534236908,
-0.05574341118335724,
0.26269102096557617,
0.23052933812141418,
0.24828504025936127,
0.38464677333831787,
-0.29962870478630066,
0.19368836283683777,
-0.2222442775964737,
-0.27215003967285156,
-0.1750384420156479,
0.34597790241241455,
0.3029908537864685,
-0.5095228552818298,
0.17598223686218262,
-0.25892215967178345,
0.034256741404533386,
-0.013109277933835983,
0.14526605606079102,
-0.17006051540374756,
0.08207058161497116,
-0.3627830743789673,
0.11699126660823822,
0.5876964330673218,
-0.2611349821090698,
-0.4782140254974365,
0.24538081884384155,
-0.18213608860969543,
-0.4134592115879059,
0.004021000117063522,
0.1796364188194275,
0.23312373459339142,
0.002830520272254944,
0.443403035402298,
0.07990843057632446,
-0.07360310107469559,
-0.06774363666772842,
-0.18386349081993103,
-0.16608953475952148,
0.4369402229785919,
0.07680461555719376,
0.28672486543655396,
-0.16165992617607117,
-0.04137902706861496,
0.01175118237733841,
-0.061409879475831985,
0.0617663711309433,
-0.19792884588241577,
0.2438398003578186,
0.1412965953350067,
-0.3158209025859833,
0.02329157292842865,
-0.16994065046310425,
-0.30626380443573,
0.2532976269721985,
-0.03557296469807625,
-0.14290481805801392,
-0.1345731019973755,
0.04576236754655838,
-0.06462369114160538,
0.2555595636367798,
-0.07530856132507324,
-0.3779144585132599,
0.10723134130239487,
-0.28965210914611816,
0.10632090270519257,
-0.2972109615802765,
-0.09295019507408142,
0.05876326560974121,
-0.044973067939281464,
0.18362565338611603,
-0.4133526682853699,
0.08944365382194519,
-0.3850754499435425,
-0.217631995677948,
-0.13044385612010956,
0.21411514282226562,
0.15200427174568176,
-0.027679892256855965,
-0.25753191113471985,
0.370042085647583,
0.12013466656208038,
-0.29570236802101135,
0.017745986580848694,
0.15121278166770935,
0.11096043139696121,
-0.22432033717632294,
0.13421788811683655,
0.5024381875991821,
0.05223488435149193,
0.03560160845518112,
0.0975232943892479,
0.4635348618030548,
0.15507195889949799,
0.3741542100906372,
-0.2467399537563324,
-0.09470902383327484,
-0.012140974402427673,
0.14277753233909607,
-0.0887807160615921,
0.04357686638832092,
0.02348833717405796,
-0.18520976603031158,
0.4910174012184143,
0.15451975166797638,
-0.12577331066131592,
-0.00045463070273399353,
0.07628103345632553,
0.12661781907081604,
0.2723517417907715,
0.229659304022789,
-0.18044781684875488,
0.09799869358539581,
0.18185700476169586,
-0.19504855573177338,
0.23537486791610718,
0.14124205708503723,
-0.19786325097084045,
0.1193401962518692,
-0.11344276368618011,
-0.013716038316488266,
0.3028005361557007,
0.0359349399805069,
-0.17664191126823425,
0.257424920797348,
0.1617496907711029,
0.03834092989563942,
-0.045899223536252975,
-0.2528499364852905,
-0.11889825761318207,
0.10123121738433838,
-0.41098248958587646,
0.2882310748100281,
0.050505660474300385,
0.09113896638154984,
-0.08605960756540298,
0.3568164110183716,
-0.24508197605609894,
-0.10891321301460266,
0.15749216079711914,
-0.03634179010987282,
-0.06857460737228394,
0.05969839543104172,
-0.4851211905479431,
-0.0019853413105010986,
0.44332242012023926,
-0.16094870865345,
0.06961658596992493,
-0.10907652974128723,
-0.15191085636615753,
-0.019336936995387077,
0.22826208174228668,
-0.36361992359161377,
0.19944864511489868,
0.22731924057006836,
0.18476267158985138,
0.01405305415391922,
-0.3859502077102661,
0.12721560895442963,
-0.12603667378425598,
0.38136792182922363,
0.25005075335502625,
-0.07109653204679489,
0.16557040810585022,
-0.2889568507671356,
0.27750715613365173,
-0.19888851046562195,
-0.15679164230823517,
0.013823069632053375,
-0.14415143430233002,
0.11382563412189484,
-0.22929488122463226,
-0.25450971722602844,
0.059180617332458496,
-0.4073662757873535,
-0.05502424016594887,
-0.2866050601005554,
0.18191489577293396,
0.5470845699310303,
0.4114663898944855,
0.08673185855150223,
-0.017021095380187035,
-0.11969759315252304,
-0.0905209630727768,
0.09554028511047363,
0.40600430965423584,
-0.04357697069644928,
-0.36526915431022644,
-0.035528652369976044,
-0.24070918560028076,
0.14448794722557068,
-0.23095391690731049,
-0.40576764941215515,
0.18763992190361023,
-0.2118019312620163,
0.2719842791557312,
-0.37768495082855225,
0.1753203570842743,
0.2610192596912384,
0.014517579227685928,
-0.09890908002853394,
-0.12926992774009705,
-0.33674293756484985,
-0.012020401656627655,
-0.04610751196742058,
0.2581484317779541,
-0.1472821980714798,
0.18557234108448029,
-0.1742396056652069,
0.9223641157150269,
0.11747198551893234,
-0.31989166140556335,
-0.02054857835173607,
-0.01950957626104355,
0.19322116672992706,
-0.1693120002746582,
-0.3886566162109375,
0.32202664017677307,
0.014534048736095428,
-0.2899017035961151,
0.15734604001045227,
-0.09964026510715485,
-0.2673209607601166,
-0.023821890354156494,
-0.11112800240516663,
-0.18855439126491547,
-0.2356203943490982,
0.35491693019866943,
-0.08908848464488983,
-0.1352604776620865,
-0.1897769272327423,
0.3167388439178467,
-0.3034159243106842,
0.08561074733734131,
0.21710170805454254,
-0.28447026014328003,
-0.00815468281507492,
-0.2150239199399948,
0.04862653464078903,
-0.42224758863449097,
-0.30178266763687134,
0.335486501455307,
-0.03488728031516075,
0.17119064927101135,
0.18967124819755554,
-0.2039755880832672,
0.04202153906226158,
-0.13661502301692963,
0.6925354599952698,
-0.11505292356014252,
-0.005426299292594194,
0.09750278294086456,
-0.10805243253707886,
-0.8682926297187805,
-0.12562966346740723,
-0.052323758602142334,
0.26526302099227905,
-0.01997658982872963,
0.2759293019771576,
-0.23149341344833374,
-0.10334819555282593,
-0.006559767760336399,
-0.0023622438311576843,
-0.10908711701631546,
-0.08592859655618668,
-0.2647952437400818,
-0.035789262503385544,
-0.31994539499282837,
0.35268139839172363,
0.14405231177806854,
0.2219143509864807,
-0.11983983963727951,
0.043545253574848175,
-0.23408088088035583,
-0.0927155613899231,
-0.038526736199855804,
-0.02468939870595932,
0.5121557712554932,
-0.04939361661672592,
0.15894632041454315,
0.02791234850883484,
0.16354435682296753,
-0.033596236258745193,
0.4854910671710968,
0.32776835560798645,
0.43104955554008484,
0.16507455706596375,
0.06913019716739655,
0.05472811684012413,
0.26406851410865784,
-0.20495787262916565,
-0.07602767646312714,
-0.01955064758658409,
0.310384601354599,
-0.17891961336135864,
-0.04850240424275398,
0.09782364219427109,
-0.030784718692302704,
-0.19163310527801514,
-0.07925207912921906,
0.1868201494216919,
0.08613163977861404,
0.025516927242279053,
0.28895583748817444,
-0.08208382874727249,
-0.14249998331069946,
0.48526105284690857,
0.4084721505641937,
0.9043242931365967,
-0.005295123904943466,
0.11206556856632233,
-0.11655785143375397,
0.051073431968688965,
0.08622228354215622,
-0.3118944466114044,
0.15388800203800201,
-0.5014591217041016,
-0.4820352792739868,
0.05614668130874634,
-0.10660945624113083,
-0.023525305092334747,
-0.11177991330623627,
-0.03780047968029976,
0.10025322437286377,
-0.20900776982307434,
0.19045892357826233,
-0.260787695646286,
-0.058224666863679886,
0.08524671196937561,
-0.13250041007995605,
-0.16676390171051025,
0.08112697303295135,
-0.17808479070663452,
0.2746461033821106,
-0.014167465269565582,
-0.08050292730331421,
-0.09720167517662048,
-0.480310320854187,
-0.22976233065128326,
0.10598644614219666,
-0.40612733364105225,
0.09960366785526276,
0.1914147138595581,
-0.3225056529045105,
0.2562887668609619,
0.31036806106567383,
0.1094387099146843,
0.28453874588012695,
-0.03432970121502876,
0.021037330850958824,
0.20663687586784363,
0.08017551898956299,
-0.051696475595235825,
-0.009664468467235565,
0.11453504115343094,
0.02955758571624756,
-0.06641937047243118,
0.13439546525478363,
-0.08193390816450119,
0.06643815338611603,
0.21161897480487823,
0.2698478698730469,
-0.0363130122423172,
-0.36552244424819946,
-0.23763330280780792,
-0.17220234870910645,
-0.0595875158905983,
-0.12809577584266663,
0.08576320856809616,
-0.03176460415124893,
-0.1973811388015747,
0.06289587914943695,
0.12752752006053925,
-0.36487746238708496,
-0.05807899311184883,
0.5833962559700012,
0.013264508917927742,
0.3081538677215576,
0.4073735177516937,
0.18558263778686523,
-0.10031959414482117,
-0.19282430410385132,
-0.012440480291843414,
0.5233457088470459,
-0.6791960000991821,
0.07605123519897461,
-0.28905168175697327,
-0.3067885935306549,
-0.033977288752794266,
0.28786125779151917,
0.257398784160614,
-0.020527664572000504,
-0.24511386454105377,
0.1262708306312561,
-0.5130403637886047,
0.2217998057603836,
-0.20455539226531982,
-0.00013209180906414986,
-0.2832317352294922,
0.0076509565114974976,
-0.08115286380052567,
0.026651976630091667,
-0.30528026819229126,
-0.020187582820653915,
-0.07099085301160812,
0.2096187174320221,
-0.09716442227363586,
-0.06588517129421234,
-0.14650166034698486,
0.06035000830888748,
0.05539045110344887,
0.19417959451675415,
-0.22422340512275696,
-0.24661919474601746,
-0.13327878713607788,
0.11535020172595978,
-0.08420594781637192,
-0.07255873829126358,
-0.15317504107952118,
-0.23286446928977966,
-0.15024705231189728,
-0.23998519778251648,
0.2224472314119339,
0.05282606929540634,
0.22945308685302734,
0.24177926778793335,
0.06884079426527023,
0.1651650369167328,
-0.07507605850696564,
0.10488945245742798,
0.061967432498931885,
0.5464033484458923,
0.14895983040332794,
0.1332889050245285,
0.002376202493906021,
-0.07251812517642975,
-0.4097539186477661,
0.09877435863018036,
-0.0790940523147583,
0.306883841753006,
-0.03226200118660927,
-0.26520052552223206,
-0.14794903993606567,
0.5163429379463196,
0.21842718124389648,
0.33036524057388306,
-0.10135558247566223,
0.010584205389022827,
-0.12058572471141815,
0.19846177101135254,
-0.1543055772781372,
0.014744773507118225,
-0.008126532658934593,
-0.1319584846496582,
0.09299011528491974,
0.4246247112751007,
0.16313356161117554,
0.10893887281417847,
0.27586910128593445,
0.16955731809139252,
0.14335264265537262,
0.18897856771945953,
0.22808249294757843,
0.7236438393592834,
-0.021813608705997467,
-0.1490297019481659,
0.5851725935935974,
-0.15577378869056702,
0.2793812155723572,
0.6296947598457336,
0.0764598622918129,
0.36272022128105164,
0.4686641991138458,
0.18488195538520813,
0.1354300081729889,
-0.3179926872253418,
0.1589048206806183,
-0.23661763966083527,
0.3237639367580414,
-0.18066318333148956,
-0.19542089104652405,
0.2005576640367508,
-0.05873074755072594,
-0.38185155391693115,
-0.07283855974674225,
0.20302359759807587,
-0.4103529155254364,
-0.16584551334381104,
0.07314988970756531,
-0.10289570689201355,
0.06586796045303345,
-0.04237043112516403,
0.006775582674890757,
0.004474183544516563,
0.3291354179382324,
0.09385494887828827,
-0.149447500705719,
-0.05240988731384277,
0.1043148934841156,
0.37979644536972046,
0.08075831085443497,
-0.2085520625114441,
0.4180576503276825,
0.3827959895133972,
-0.06600847840309143,
0.21268178522586823,
0.1125321239233017,
0.5991432666778564,
0.14017891883850098,
-0.5167805552482605,
-0.06933611631393433,
0.1902577430009842,
-0.15963849425315857,
-0.21813490986824036,
0.0028678011149168015,
-0.13709864020347595,
0.35113298892974854,
0.5019601583480835,
0.0894940197467804,
-0.20810401439666748,
-0.008420927450060844,
-0.12770923972129822,
0.3638957142829895,
-0.05490607023239136,
0.17944060266017914,
-0.11236564069986343,
-0.17165428400039673,
-0.19471941888332367,
-0.015904076397418976,
-0.17679527401924133,
0.1781477928161621,
0.4905378222465515,
-0.18546506762504578,
0.046488258987665176,
-0.09410600364208221,
0.08203265070915222,
-0.16815924644470215,
0.4135836362838745,
0.2866829037666321,
-0.03188556805253029,
-0.33434075117111206,
0.2658335566520691,
-0.363943874835968,
0.3209834694862366,
-0.09422720968723297,
0.06461802870035172,
0.1500149816274643,
0.3698657155036926,
-0.09828002005815506,
0.09823901951313019,
0.42964088916778564,
-0.44498226046562195,
0.3723081052303314,
0.40184342861175537,
-0.22128795087337494,
0.0412428081035614,
-0.5812980532646179,
0.035557664930820465,
0.12873825430870056,
-0.29677876830101013,
-0.042316898703575134,
-0.025434795767068863,
0.07290396094322205,
-0.054665543138980865,
-0.33274194598197937,
0.0412537083029747,
-0.16279396414756775,
0.7269923686981201,
-0.11474954336881638,
0.3409119248390198,
0.08445407450199127,
0.02718852460384369,
-0.2759213447570801,
0.0764964371919632,
-0.07518716901540756,
0.041668545454740524,
0.21945232152938843,
0.5663888454437256,
0.015544906258583069,
-0.2400248646736145,
-0.3383796215057373,
0.18476511538028717,
0.3487740755081177,
-0.09467925131320953,
-0.08575062453746796,
0.3060990571975708,
-0.2602578401565552,
-0.0559866800904274,
0.050794221460819244,
0.33203208446502686,
0.1876927763223648,
0.2945087254047394,
-0.016689717769622803,
-0.7438549995422363,
0.5063519477844238,
-0.11262653768062592,
-0.2887372076511383,
0.17895059287548065,
0.1855284869670868,
0.43677008152008057,
-0.04264841973781586,
-0.44756102561950684,
0.01832909882068634,
0.12047991156578064,
-0.21734993159770966,
-0.062398746609687805,
-0.17387521266937256,
-0.21270817518234253,
0.1909659206867218,
-0.08036695420742035,
0.20917262136936188,
-0.08296875655651093,
0.003757283091545105,
-0.10521669685840607,
-0.1948738843202591
] |
https://github.com/huggingface/datasets/issues/6128 | @TomasAndersonFang were you able to find a solution to this issue? I would highly appreciate any help.
Thanks! | IndexError: Invalid key: 88 is out of bounds for size 0 | ### Describe the bug
This bug generates when I use torch.compile(model) in my code, which seems to raise an error in datasets lib.
### Steps to reproduce the bug
I use the following code to fine-tune Falcon on my private dataset.
```python
import transformers
from transformers import (
AutoModelForCausalLM,
AutoTokenizer,
AutoConfig,
DataCollatorForSeq2Seq,
Trainer,
Seq2SeqTrainer,
HfArgumentParser,
Seq2SeqTrainingArguments,
BitsAndBytesConfig,
)
from peft import (
LoraConfig,
get_peft_model,
get_peft_model_state_dict,
prepare_model_for_int8_training,
set_peft_model_state_dict,
)
import torch
import os
import evaluate
import functools
from datasets import load_dataset
import bitsandbytes as bnb
import logging
import json
import copy
from typing import Dict, Optional, Sequence
from dataclasses import dataclass, field
# Lora settings
LORA_R = 8
LORA_ALPHA = 16
LORA_DROPOUT= 0.05
LORA_TARGET_MODULES = ["query_key_value"]
@dataclass
class ModelArguments:
model_name_or_path: Optional[str] = field(default="Salesforce/codegen2-7B")
@dataclass
class DataArguments:
data_path: str = field(default=None, metadata={"help": "Path to the training data."})
train_file: str = field(default=None, metadata={"help": "Path to the evaluation data."})
eval_file: str = field(default=None, metadata={"help": "Path to the evaluation data."})
cache_path: str = field(default=None, metadata={"help": "Path to the cache directory."})
num_proc: int = field(default=4, metadata={"help": "Number of processes to use for data preprocessing."})
@dataclass
class TrainingArguments(transformers.TrainingArguments):
# cache_dir: Optional[str] = field(default=None)
optim: str = field(default="adamw_torch")
model_max_length: int = field(
default=512,
metadata={"help": "Maximum sequence length. Sequences will be right padded (and possibly truncated)."},
)
is_lora: bool = field(default=True, metadata={"help": "Whether to use LORA."})
def tokenize(text, tokenizer, max_seq_len=512, add_eos_token=True):
result = tokenizer(
text,
truncation=True,
max_length=max_seq_len,
padding=False,
return_tensors=None,
)
if (
result["input_ids"][-1] != tokenizer.eos_token_id
and len(result["input_ids"]) < max_seq_len
and add_eos_token
):
result["input_ids"].append(tokenizer.eos_token_id)
result["attention_mask"].append(1)
if add_eos_token and len(result["input_ids"]) >= max_seq_len:
result["input_ids"][max_seq_len - 1] = tokenizer.eos_token_id
result["attention_mask"][max_seq_len - 1] = 1
result["labels"] = result["input_ids"].copy()
return result
def main():
parser = HfArgumentParser((ModelArguments, DataArguments, TrainingArguments))
model_args, data_args, training_args = parser.parse_args_into_dataclasses()
config = AutoConfig.from_pretrained(
model_args.model_name_or_path,
cache_dir=data_args.cache_path,
trust_remote_code=True,
)
if training_args.is_lora:
model = AutoModelForCausalLM.from_pretrained(
model_args.model_name_or_path,
cache_dir=data_args.cache_path,
torch_dtype=torch.float16,
trust_remote_code=True,
load_in_8bit=True,
quantization_config=BitsAndBytesConfig(
load_in_8bit=True,
llm_int8_threshold=6.0
),
)
model = prepare_model_for_int8_training(model)
config = LoraConfig(
r=LORA_R,
lora_alpha=LORA_ALPHA,
target_modules=LORA_TARGET_MODULES,
lora_dropout=LORA_DROPOUT,
bias="none",
task_type="CAUSAL_LM",
)
model = get_peft_model(model, config)
else:
model = AutoModelForCausalLM.from_pretrained(
model_args.model_name_or_path,
torch_dtype=torch.float16,
cache_dir=data_args.cache_path,
trust_remote_code=True,
)
model.config.use_cache = False
def print_trainable_parameters(model):
"""
Prints the number of trainable parameters in the model.
"""
trainable_params = 0
all_param = 0
for _, param in model.named_parameters():
all_param += param.numel()
if param.requires_grad:
trainable_params += param.numel()
print(
f"trainable params: {trainable_params} || all params: {all_param} || trainable%: {100 * trainable_params / all_param}"
)
print_trainable_parameters(model)
tokenizer = AutoTokenizer.from_pretrained(
model_args.model_name_or_path,
cache_dir=data_args.cache_path,
model_max_length=training_args.model_max_length,
padding_side="left",
use_fast=True,
trust_remote_code=True,
)
tokenizer.pad_token = tokenizer.eos_token
# Load dataset
def generate_and_tokenize_prompt(sample):
input_text = sample["input"]
target_text = sample["output"] + tokenizer.eos_token
full_text = input_text + target_text
tokenized_full_text = tokenize(full_text, tokenizer, max_seq_len=512)
tokenized_input_text = tokenize(input_text, tokenizer, max_seq_len=512)
input_len = len(tokenized_input_text["input_ids"]) - 1 # -1 for eos token
tokenized_full_text["labels"] = [-100] * input_len + tokenized_full_text["labels"][input_len:]
return tokenized_full_text
data_files = {}
if data_args.train_file is not None:
data_files["train"] = data_args.train_file
if data_args.eval_file is not None:
data_files["eval"] = data_args.eval_file
dataset = load_dataset(data_args.data_path, data_files=data_files)
train_dataset = dataset["train"]
eval_dataset = dataset["eval"]
train_dataset = train_dataset.map(generate_and_tokenize_prompt, num_proc=data_args.num_proc)
eval_dataset = eval_dataset.map(generate_and_tokenize_prompt, num_proc=data_args.num_proc)
data_collator = DataCollatorForSeq2Seq(tokenizer, pad_to_multiple_of=8, return_tensors="pt", padding=True)
# Evaluation metrics
def compute_metrics(eval_preds, tokenizer):
metric = evaluate.load('exact_match')
preds, labels = eval_preds
# In case the model returns more than the prediction logits
if isinstance(preds, tuple):
preds = preds[0]
decoded_preds = tokenizer.batch_decode(preds, skip_special_tokens=True, clean_up_tokenization_spaces=False)
# Replace -100s in the labels as we can't decode them
labels[labels == -100] = tokenizer.pad_token_id
decoded_labels = tokenizer.batch_decode(labels, skip_special_tokens=True, clean_up_tokenization_spaces=False)
# Some simple post-processing
decoded_preds = [pred.strip() for pred in decoded_preds]
decoded_labels = [label.strip() for label in decoded_labels]
result = metric.compute(predictions=decoded_preds, references=decoded_labels)
return {'exact_match': result['exact_match']}
compute_metrics_fn = functools.partial(compute_metrics, tokenizer=tokenizer)
model = torch.compile(model)
# Training
trainer = Trainer(
model=model,
train_dataset=train_dataset,
eval_dataset=eval_dataset,
args=training_args,
data_collator=data_collator,
compute_metrics=compute_metrics_fn,
)
trainer.train()
trainer.save_state()
trainer.save_model(output_dir=training_args.output_dir)
tokenizer.save_pretrained(save_directory=training_args.output_dir)
if __name__ == "__main__":
main()
```
When I didn't use `torch.cpmpile(model)`, my code worked well. But when I added this line to my code, It produced the following error:
```
Traceback (most recent call last):
File "falcon_sft.py", line 230, in <module>
main()
File "falcon_sft.py", line 223, in main
trainer.train()
File "python3.10/site-packages/transformers/trainer.py", line 1539, in train
return inner_training_loop(
File "python3.10/site-packages/transformers/trainer.py", line 1787, in _inner_training_loop
for step, inputs in enumerate(epoch_iterator):
File "python3.10/site-packages/accelerate/data_loader.py", line 384, in __iter__
current_batch = next(dataloader_iter)
File "python3.10/site-packages/torch/utils/data/dataloader.py", line 633, in __next__
data = self._next_data()
File "python3.10/site-packages/torch/utils/data/dataloader.py", line 677, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = self.dataset.__getitems__(possibly_batched_index)
File "python3.10/site-packages/datasets/arrow_dataset.py", line 2807, in __getitems__
batch = self.__getitem__(keys)
File "python3.10/site-packages/datasets/arrow_dataset.py", line 2803, in __getitem__
return self._getitem(key)
File "python3.10/site-packages/datasets/arrow_dataset.py", line 2787, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "python3.10/site-packages/datasets/formatting/formatting.py", line 583, in query_table
_check_valid_index_key(key, size)
File "python3.10/site-packages/datasets/formatting/formatting.py", line 536, in _check_valid_index_key
_check_valid_index_key(int(max(key)), size=size)
File "python3.10/site-packages/datasets/formatting/formatting.py", line 526, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 88 is out of bounds for size 0
```
So I'm confused about why this error was generated, and how to fix it. Is this error produced by datasets or `torch.compile`?
### Expected behavior
I want to use `torch.compile` in my code.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-4.18.0-425.19.2.el8_7.x86_64-x86_64-with-glibc2.28
- Python version: 3.10.8
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3 | 18 | IndexError: Invalid key: 88 is out of bounds for size 0
### Describe the bug
This bug generates when I use torch.compile(model) in my code, which seems to raise an error in datasets lib.
### Steps to reproduce the bug
I use the following code to fine-tune Falcon on my private dataset.
```python
import transformers
from transformers import (
AutoModelForCausalLM,
AutoTokenizer,
AutoConfig,
DataCollatorForSeq2Seq,
Trainer,
Seq2SeqTrainer,
HfArgumentParser,
Seq2SeqTrainingArguments,
BitsAndBytesConfig,
)
from peft import (
LoraConfig,
get_peft_model,
get_peft_model_state_dict,
prepare_model_for_int8_training,
set_peft_model_state_dict,
)
import torch
import os
import evaluate
import functools
from datasets import load_dataset
import bitsandbytes as bnb
import logging
import json
import copy
from typing import Dict, Optional, Sequence
from dataclasses import dataclass, field
# Lora settings
LORA_R = 8
LORA_ALPHA = 16
LORA_DROPOUT= 0.05
LORA_TARGET_MODULES = ["query_key_value"]
@dataclass
class ModelArguments:
model_name_or_path: Optional[str] = field(default="Salesforce/codegen2-7B")
@dataclass
class DataArguments:
data_path: str = field(default=None, metadata={"help": "Path to the training data."})
train_file: str = field(default=None, metadata={"help": "Path to the evaluation data."})
eval_file: str = field(default=None, metadata={"help": "Path to the evaluation data."})
cache_path: str = field(default=None, metadata={"help": "Path to the cache directory."})
num_proc: int = field(default=4, metadata={"help": "Number of processes to use for data preprocessing."})
@dataclass
class TrainingArguments(transformers.TrainingArguments):
# cache_dir: Optional[str] = field(default=None)
optim: str = field(default="adamw_torch")
model_max_length: int = field(
default=512,
metadata={"help": "Maximum sequence length. Sequences will be right padded (and possibly truncated)."},
)
is_lora: bool = field(default=True, metadata={"help": "Whether to use LORA."})
def tokenize(text, tokenizer, max_seq_len=512, add_eos_token=True):
result = tokenizer(
text,
truncation=True,
max_length=max_seq_len,
padding=False,
return_tensors=None,
)
if (
result["input_ids"][-1] != tokenizer.eos_token_id
and len(result["input_ids"]) < max_seq_len
and add_eos_token
):
result["input_ids"].append(tokenizer.eos_token_id)
result["attention_mask"].append(1)
if add_eos_token and len(result["input_ids"]) >= max_seq_len:
result["input_ids"][max_seq_len - 1] = tokenizer.eos_token_id
result["attention_mask"][max_seq_len - 1] = 1
result["labels"] = result["input_ids"].copy()
return result
def main():
parser = HfArgumentParser((ModelArguments, DataArguments, TrainingArguments))
model_args, data_args, training_args = parser.parse_args_into_dataclasses()
config = AutoConfig.from_pretrained(
model_args.model_name_or_path,
cache_dir=data_args.cache_path,
trust_remote_code=True,
)
if training_args.is_lora:
model = AutoModelForCausalLM.from_pretrained(
model_args.model_name_or_path,
cache_dir=data_args.cache_path,
torch_dtype=torch.float16,
trust_remote_code=True,
load_in_8bit=True,
quantization_config=BitsAndBytesConfig(
load_in_8bit=True,
llm_int8_threshold=6.0
),
)
model = prepare_model_for_int8_training(model)
config = LoraConfig(
r=LORA_R,
lora_alpha=LORA_ALPHA,
target_modules=LORA_TARGET_MODULES,
lora_dropout=LORA_DROPOUT,
bias="none",
task_type="CAUSAL_LM",
)
model = get_peft_model(model, config)
else:
model = AutoModelForCausalLM.from_pretrained(
model_args.model_name_or_path,
torch_dtype=torch.float16,
cache_dir=data_args.cache_path,
trust_remote_code=True,
)
model.config.use_cache = False
def print_trainable_parameters(model):
"""
Prints the number of trainable parameters in the model.
"""
trainable_params = 0
all_param = 0
for _, param in model.named_parameters():
all_param += param.numel()
if param.requires_grad:
trainable_params += param.numel()
print(
f"trainable params: {trainable_params} || all params: {all_param} || trainable%: {100 * trainable_params / all_param}"
)
print_trainable_parameters(model)
tokenizer = AutoTokenizer.from_pretrained(
model_args.model_name_or_path,
cache_dir=data_args.cache_path,
model_max_length=training_args.model_max_length,
padding_side="left",
use_fast=True,
trust_remote_code=True,
)
tokenizer.pad_token = tokenizer.eos_token
# Load dataset
def generate_and_tokenize_prompt(sample):
input_text = sample["input"]
target_text = sample["output"] + tokenizer.eos_token
full_text = input_text + target_text
tokenized_full_text = tokenize(full_text, tokenizer, max_seq_len=512)
tokenized_input_text = tokenize(input_text, tokenizer, max_seq_len=512)
input_len = len(tokenized_input_text["input_ids"]) - 1 # -1 for eos token
tokenized_full_text["labels"] = [-100] * input_len + tokenized_full_text["labels"][input_len:]
return tokenized_full_text
data_files = {}
if data_args.train_file is not None:
data_files["train"] = data_args.train_file
if data_args.eval_file is not None:
data_files["eval"] = data_args.eval_file
dataset = load_dataset(data_args.data_path, data_files=data_files)
train_dataset = dataset["train"]
eval_dataset = dataset["eval"]
train_dataset = train_dataset.map(generate_and_tokenize_prompt, num_proc=data_args.num_proc)
eval_dataset = eval_dataset.map(generate_and_tokenize_prompt, num_proc=data_args.num_proc)
data_collator = DataCollatorForSeq2Seq(tokenizer, pad_to_multiple_of=8, return_tensors="pt", padding=True)
# Evaluation metrics
def compute_metrics(eval_preds, tokenizer):
metric = evaluate.load('exact_match')
preds, labels = eval_preds
# In case the model returns more than the prediction logits
if isinstance(preds, tuple):
preds = preds[0]
decoded_preds = tokenizer.batch_decode(preds, skip_special_tokens=True, clean_up_tokenization_spaces=False)
# Replace -100s in the labels as we can't decode them
labels[labels == -100] = tokenizer.pad_token_id
decoded_labels = tokenizer.batch_decode(labels, skip_special_tokens=True, clean_up_tokenization_spaces=False)
# Some simple post-processing
decoded_preds = [pred.strip() for pred in decoded_preds]
decoded_labels = [label.strip() for label in decoded_labels]
result = metric.compute(predictions=decoded_preds, references=decoded_labels)
return {'exact_match': result['exact_match']}
compute_metrics_fn = functools.partial(compute_metrics, tokenizer=tokenizer)
model = torch.compile(model)
# Training
trainer = Trainer(
model=model,
train_dataset=train_dataset,
eval_dataset=eval_dataset,
args=training_args,
data_collator=data_collator,
compute_metrics=compute_metrics_fn,
)
trainer.train()
trainer.save_state()
trainer.save_model(output_dir=training_args.output_dir)
tokenizer.save_pretrained(save_directory=training_args.output_dir)
if __name__ == "__main__":
main()
```
When I didn't use `torch.cpmpile(model)`, my code worked well. But when I added this line to my code, It produced the following error:
```
Traceback (most recent call last):
File "falcon_sft.py", line 230, in <module>
main()
File "falcon_sft.py", line 223, in main
trainer.train()
File "python3.10/site-packages/transformers/trainer.py", line 1539, in train
return inner_training_loop(
File "python3.10/site-packages/transformers/trainer.py", line 1787, in _inner_training_loop
for step, inputs in enumerate(epoch_iterator):
File "python3.10/site-packages/accelerate/data_loader.py", line 384, in __iter__
current_batch = next(dataloader_iter)
File "python3.10/site-packages/torch/utils/data/dataloader.py", line 633, in __next__
data = self._next_data()
File "python3.10/site-packages/torch/utils/data/dataloader.py", line 677, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = self.dataset.__getitems__(possibly_batched_index)
File "python3.10/site-packages/datasets/arrow_dataset.py", line 2807, in __getitems__
batch = self.__getitem__(keys)
File "python3.10/site-packages/datasets/arrow_dataset.py", line 2803, in __getitem__
return self._getitem(key)
File "python3.10/site-packages/datasets/arrow_dataset.py", line 2787, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "python3.10/site-packages/datasets/formatting/formatting.py", line 583, in query_table
_check_valid_index_key(key, size)
File "python3.10/site-packages/datasets/formatting/formatting.py", line 536, in _check_valid_index_key
_check_valid_index_key(int(max(key)), size=size)
File "python3.10/site-packages/datasets/formatting/formatting.py", line 526, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 88 is out of bounds for size 0
```
So I'm confused about why this error was generated, and how to fix it. Is this error produced by datasets or `torch.compile`?
### Expected behavior
I want to use `torch.compile` in my code.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-4.18.0-425.19.2.el8_7.x86_64-x86_64-with-glibc2.28
- Python version: 3.10.8
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
@TomasAndersonFang were you able to find a solution to this issue? I would highly appreciate any help.
Thanks! | [
-0.46058011054992676,
-0.27659863233566284,
-0.027295688167214394,
0.4731191098690033,
0.09124531596899033,
-0.04254941642284393,
0.31532663106918335,
0.47062352299690247,
0.08070381730794907,
0.04917040094733238,
-0.24383330345153809,
0.42413467168807983,
0.007434118539094925,
-0.19464325904846191,
-0.028579600155353546,
-0.07139323651790619,
-0.030137501657009125,
-0.21997325122356415,
-0.13224372267723083,
0.07525433599948883,
-0.3346567749977112,
0.05179881304502487,
-0.1862344741821289,
0.1558615267276764,
-0.1674307882785797,
-0.2024364322423935,
0.214699387550354,
0.21827556192874908,
0.034234076738357544,
-0.2886626422405243,
0.05428396910429001,
-0.4448647201061249,
0.2474967986345291,
0.33301305770874023,
-0.00011540776904439554,
0.05910855531692505,
0.3394177258014679,
-0.05944984778761864,
-0.279675155878067,
0.1587117612361908,
0.5210778713226318,
0.09580960869789124,
0.12458458542823792,
-0.26298788189888,
-0.22167415916919708,
0.09600616246461868,
-0.23276770114898682,
-0.44496190547943115,
0.3620017170906067,
0.5245478749275208,
0.22141462564468384,
0.2585132420063019,
0.21775439381599426,
-0.13633739948272705,
0.2028934359550476,
-0.01906983181834221,
-0.21759165823459625,
-0.2732481360435486,
0.06970334053039551,
0.31837716698646545,
-0.31286564469337463,
0.45688357949256897,
-0.07090825587511063,
-0.17019127309322357,
0.40274691581726074,
-0.22686222195625305,
-0.20793430507183075,
-0.4215354025363922,
0.23052385449409485,
-0.02293761819601059,
0.03744681552052498,
-0.2512529492378235,
-0.47210559248924255,
-0.19572027027606964,
-0.026295311748981476,
-0.3189235031604767,
0.2404043823480606,
0.27398908138275146,
-0.04698100686073303,
0.20479723811149597,
0.2487693727016449,
-0.045633453875780106,
0.047372639179229736,
-0.18157558143138885,
-0.059817809611558914,
0.3723050653934479,
-0.06990993022918701,
0.204074427485466,
0.27056118845939636,
-0.2898693382740021,
0.08446090668439865,
-0.061324361711740494,
-0.17138773202896118,
0.07065160572528839,
-0.35445499420166016,
0.003420308232307434,
0.1477145552635193,
-0.060966070741415024,
0.039040639996528625,
0.09318944811820984,
-0.06986325979232788,
0.12978176772594452,
0.3060275614261627,
-0.17163006961345673,
0.012997597455978394,
0.23888304829597473,
-0.003639429807662964,
0.47389939427375793,
0.18716387450695038,
-0.1757802516222,
0.04327951371669769,
-0.06246504932641983,
-0.1857019066810608,
-0.2960297167301178,
0.01901090145111084,
0.24785077571868896,
0.01922719180583954,
-0.12594780325889587,
-0.17747904360294342,
0.34355974197387695,
0.5080097317695618,
0.1440066397190094,
0.284271240234375,
0.41664278507232666,
0.043569210916757584,
-0.22920449078083038,
0.09051121771335602,
0.1440618485212326,
-0.3355613350868225,
-0.24233581125736237,
-0.19697147607803345,
0.06431984901428223,
-0.06043586879968643,
-0.4055723547935486,
-0.051849085837602615,
-0.4176328778266907,
0.11617672443389893,
-0.0976731926202774,
-0.07949857413768768,
-0.1268649399280548,
-0.06501927226781845,
-0.2602311372756958,
0.21905390918254852,
0.36025235056877136,
-0.24645467102527618,
0.14843213558197021,
0.11926637589931488,
-0.07888602465391159,
-0.1869661808013916,
0.2760986089706421,
-0.3778039216995239,
-0.5330355763435364,
-0.3523258864879608,
0.1517537534236908,
-0.05574341118335724,
0.26269102096557617,
0.23052933812141418,
0.24828504025936127,
0.38464677333831787,
-0.29962870478630066,
0.19368836283683777,
-0.2222442775964737,
-0.27215003967285156,
-0.1750384420156479,
0.34597790241241455,
0.3029908537864685,
-0.5095228552818298,
0.17598223686218262,
-0.25892215967178345,
0.034256741404533386,
-0.013109277933835983,
0.14526605606079102,
-0.17006051540374756,
0.08207058161497116,
-0.3627830743789673,
0.11699126660823822,
0.5876964330673218,
-0.2611349821090698,
-0.4782140254974365,
0.24538081884384155,
-0.18213608860969543,
-0.4134592115879059,
0.004021000117063522,
0.1796364188194275,
0.23312373459339142,
0.002830520272254944,
0.443403035402298,
0.07990843057632446,
-0.07360310107469559,
-0.06774363666772842,
-0.18386349081993103,
-0.16608953475952148,
0.4369402229785919,
0.07680461555719376,
0.28672486543655396,
-0.16165992617607117,
-0.04137902706861496,
0.01175118237733841,
-0.061409879475831985,
0.0617663711309433,
-0.19792884588241577,
0.2438398003578186,
0.1412965953350067,
-0.3158209025859833,
0.02329157292842865,
-0.16994065046310425,
-0.30626380443573,
0.2532976269721985,
-0.03557296469807625,
-0.14290481805801392,
-0.1345731019973755,
0.04576236754655838,
-0.06462369114160538,
0.2555595636367798,
-0.07530856132507324,
-0.3779144585132599,
0.10723134130239487,
-0.28965210914611816,
0.10632090270519257,
-0.2972109615802765,
-0.09295019507408142,
0.05876326560974121,
-0.044973067939281464,
0.18362565338611603,
-0.4133526682853699,
0.08944365382194519,
-0.3850754499435425,
-0.217631995677948,
-0.13044385612010956,
0.21411514282226562,
0.15200427174568176,
-0.027679892256855965,
-0.25753191113471985,
0.370042085647583,
0.12013466656208038,
-0.29570236802101135,
0.017745986580848694,
0.15121278166770935,
0.11096043139696121,
-0.22432033717632294,
0.13421788811683655,
0.5024381875991821,
0.05223488435149193,
0.03560160845518112,
0.0975232943892479,
0.4635348618030548,
0.15507195889949799,
0.3741542100906372,
-0.2467399537563324,
-0.09470902383327484,
-0.012140974402427673,
0.14277753233909607,
-0.0887807160615921,
0.04357686638832092,
0.02348833717405796,
-0.18520976603031158,
0.4910174012184143,
0.15451975166797638,
-0.12577331066131592,
-0.00045463070273399353,
0.07628103345632553,
0.12661781907081604,
0.2723517417907715,
0.229659304022789,
-0.18044781684875488,
0.09799869358539581,
0.18185700476169586,
-0.19504855573177338,
0.23537486791610718,
0.14124205708503723,
-0.19786325097084045,
0.1193401962518692,
-0.11344276368618011,
-0.013716038316488266,
0.3028005361557007,
0.0359349399805069,
-0.17664191126823425,
0.257424920797348,
0.1617496907711029,
0.03834092989563942,
-0.045899223536252975,
-0.2528499364852905,
-0.11889825761318207,
0.10123121738433838,
-0.41098248958587646,
0.2882310748100281,
0.050505660474300385,
0.09113896638154984,
-0.08605960756540298,
0.3568164110183716,
-0.24508197605609894,
-0.10891321301460266,
0.15749216079711914,
-0.03634179010987282,
-0.06857460737228394,
0.05969839543104172,
-0.4851211905479431,
-0.0019853413105010986,
0.44332242012023926,
-0.16094870865345,
0.06961658596992493,
-0.10907652974128723,
-0.15191085636615753,
-0.019336936995387077,
0.22826208174228668,
-0.36361992359161377,
0.19944864511489868,
0.22731924057006836,
0.18476267158985138,
0.01405305415391922,
-0.3859502077102661,
0.12721560895442963,
-0.12603667378425598,
0.38136792182922363,
0.25005075335502625,
-0.07109653204679489,
0.16557040810585022,
-0.2889568507671356,
0.27750715613365173,
-0.19888851046562195,
-0.15679164230823517,
0.013823069632053375,
-0.14415143430233002,
0.11382563412189484,
-0.22929488122463226,
-0.25450971722602844,
0.059180617332458496,
-0.4073662757873535,
-0.05502424016594887,
-0.2866050601005554,
0.18191489577293396,
0.5470845699310303,
0.4114663898944855,
0.08673185855150223,
-0.017021095380187035,
-0.11969759315252304,
-0.0905209630727768,
0.09554028511047363,
0.40600430965423584,
-0.04357697069644928,
-0.36526915431022644,
-0.035528652369976044,
-0.24070918560028076,
0.14448794722557068,
-0.23095391690731049,
-0.40576764941215515,
0.18763992190361023,
-0.2118019312620163,
0.2719842791557312,
-0.37768495082855225,
0.1753203570842743,
0.2610192596912384,
0.014517579227685928,
-0.09890908002853394,
-0.12926992774009705,
-0.33674293756484985,
-0.012020401656627655,
-0.04610751196742058,
0.2581484317779541,
-0.1472821980714798,
0.18557234108448029,
-0.1742396056652069,
0.9223641157150269,
0.11747198551893234,
-0.31989166140556335,
-0.02054857835173607,
-0.01950957626104355,
0.19322116672992706,
-0.1693120002746582,
-0.3886566162109375,
0.32202664017677307,
0.014534048736095428,
-0.2899017035961151,
0.15734604001045227,
-0.09964026510715485,
-0.2673209607601166,
-0.023821890354156494,
-0.11112800240516663,
-0.18855439126491547,
-0.2356203943490982,
0.35491693019866943,
-0.08908848464488983,
-0.1352604776620865,
-0.1897769272327423,
0.3167388439178467,
-0.3034159243106842,
0.08561074733734131,
0.21710170805454254,
-0.28447026014328003,
-0.00815468281507492,
-0.2150239199399948,
0.04862653464078903,
-0.42224758863449097,
-0.30178266763687134,
0.335486501455307,
-0.03488728031516075,
0.17119064927101135,
0.18967124819755554,
-0.2039755880832672,
0.04202153906226158,
-0.13661502301692963,
0.6925354599952698,
-0.11505292356014252,
-0.005426299292594194,
0.09750278294086456,
-0.10805243253707886,
-0.8682926297187805,
-0.12562966346740723,
-0.052323758602142334,
0.26526302099227905,
-0.01997658982872963,
0.2759293019771576,
-0.23149341344833374,
-0.10334819555282593,
-0.006559767760336399,
-0.0023622438311576843,
-0.10908711701631546,
-0.08592859655618668,
-0.2647952437400818,
-0.035789262503385544,
-0.31994539499282837,
0.35268139839172363,
0.14405231177806854,
0.2219143509864807,
-0.11983983963727951,
0.043545253574848175,
-0.23408088088035583,
-0.0927155613899231,
-0.038526736199855804,
-0.02468939870595932,
0.5121557712554932,
-0.04939361661672592,
0.15894632041454315,
0.02791234850883484,
0.16354435682296753,
-0.033596236258745193,
0.4854910671710968,
0.32776835560798645,
0.43104955554008484,
0.16507455706596375,
0.06913019716739655,
0.05472811684012413,
0.26406851410865784,
-0.20495787262916565,
-0.07602767646312714,
-0.01955064758658409,
0.310384601354599,
-0.17891961336135864,
-0.04850240424275398,
0.09782364219427109,
-0.030784718692302704,
-0.19163310527801514,
-0.07925207912921906,
0.1868201494216919,
0.08613163977861404,
0.025516927242279053,
0.28895583748817444,
-0.08208382874727249,
-0.14249998331069946,
0.48526105284690857,
0.4084721505641937,
0.9043242931365967,
-0.005295123904943466,
0.11206556856632233,
-0.11655785143375397,
0.051073431968688965,
0.08622228354215622,
-0.3118944466114044,
0.15388800203800201,
-0.5014591217041016,
-0.4820352792739868,
0.05614668130874634,
-0.10660945624113083,
-0.023525305092334747,
-0.11177991330623627,
-0.03780047968029976,
0.10025322437286377,
-0.20900776982307434,
0.19045892357826233,
-0.260787695646286,
-0.058224666863679886,
0.08524671196937561,
-0.13250041007995605,
-0.16676390171051025,
0.08112697303295135,
-0.17808479070663452,
0.2746461033821106,
-0.014167465269565582,
-0.08050292730331421,
-0.09720167517662048,
-0.480310320854187,
-0.22976233065128326,
0.10598644614219666,
-0.40612733364105225,
0.09960366785526276,
0.1914147138595581,
-0.3225056529045105,
0.2562887668609619,
0.31036806106567383,
0.1094387099146843,
0.28453874588012695,
-0.03432970121502876,
0.021037330850958824,
0.20663687586784363,
0.08017551898956299,
-0.051696475595235825,
-0.009664468467235565,
0.11453504115343094,
0.02955758571624756,
-0.06641937047243118,
0.13439546525478363,
-0.08193390816450119,
0.06643815338611603,
0.21161897480487823,
0.2698478698730469,
-0.0363130122423172,
-0.36552244424819946,
-0.23763330280780792,
-0.17220234870910645,
-0.0595875158905983,
-0.12809577584266663,
0.08576320856809616,
-0.03176460415124893,
-0.1973811388015747,
0.06289587914943695,
0.12752752006053925,
-0.36487746238708496,
-0.05807899311184883,
0.5833962559700012,
0.013264508917927742,
0.3081538677215576,
0.4073735177516937,
0.18558263778686523,
-0.10031959414482117,
-0.19282430410385132,
-0.012440480291843414,
0.5233457088470459,
-0.6791960000991821,
0.07605123519897461,
-0.28905168175697327,
-0.3067885935306549,
-0.033977288752794266,
0.28786125779151917,
0.257398784160614,
-0.020527664572000504,
-0.24511386454105377,
0.1262708306312561,
-0.5130403637886047,
0.2217998057603836,
-0.20455539226531982,
-0.00013209180906414986,
-0.2832317352294922,
0.0076509565114974976,
-0.08115286380052567,
0.026651976630091667,
-0.30528026819229126,
-0.020187582820653915,
-0.07099085301160812,
0.2096187174320221,
-0.09716442227363586,
-0.06588517129421234,
-0.14650166034698486,
0.06035000830888748,
0.05539045110344887,
0.19417959451675415,
-0.22422340512275696,
-0.24661919474601746,
-0.13327878713607788,
0.11535020172595978,
-0.08420594781637192,
-0.07255873829126358,
-0.15317504107952118,
-0.23286446928977966,
-0.15024705231189728,
-0.23998519778251648,
0.2224472314119339,
0.05282606929540634,
0.22945308685302734,
0.24177926778793335,
0.06884079426527023,
0.1651650369167328,
-0.07507605850696564,
0.10488945245742798,
0.061967432498931885,
0.5464033484458923,
0.14895983040332794,
0.1332889050245285,
0.002376202493906021,
-0.07251812517642975,
-0.4097539186477661,
0.09877435863018036,
-0.0790940523147583,
0.306883841753006,
-0.03226200118660927,
-0.26520052552223206,
-0.14794903993606567,
0.5163429379463196,
0.21842718124389648,
0.33036524057388306,
-0.10135558247566223,
0.010584205389022827,
-0.12058572471141815,
0.19846177101135254,
-0.1543055772781372,
0.014744773507118225,
-0.008126532658934593,
-0.1319584846496582,
0.09299011528491974,
0.4246247112751007,
0.16313356161117554,
0.10893887281417847,
0.27586910128593445,
0.16955731809139252,
0.14335264265537262,
0.18897856771945953,
0.22808249294757843,
0.7236438393592834,
-0.021813608705997467,
-0.1490297019481659,
0.5851725935935974,
-0.15577378869056702,
0.2793812155723572,
0.6296947598457336,
0.0764598622918129,
0.36272022128105164,
0.4686641991138458,
0.18488195538520813,
0.1354300081729889,
-0.3179926872253418,
0.1589048206806183,
-0.23661763966083527,
0.3237639367580414,
-0.18066318333148956,
-0.19542089104652405,
0.2005576640367508,
-0.05873074755072594,
-0.38185155391693115,
-0.07283855974674225,
0.20302359759807587,
-0.4103529155254364,
-0.16584551334381104,
0.07314988970756531,
-0.10289570689201355,
0.06586796045303345,
-0.04237043112516403,
0.006775582674890757,
0.004474183544516563,
0.3291354179382324,
0.09385494887828827,
-0.149447500705719,
-0.05240988731384277,
0.1043148934841156,
0.37979644536972046,
0.08075831085443497,
-0.2085520625114441,
0.4180576503276825,
0.3827959895133972,
-0.06600847840309143,
0.21268178522586823,
0.1125321239233017,
0.5991432666778564,
0.14017891883850098,
-0.5167805552482605,
-0.06933611631393433,
0.1902577430009842,
-0.15963849425315857,
-0.21813490986824036,
0.0028678011149168015,
-0.13709864020347595,
0.35113298892974854,
0.5019601583480835,
0.0894940197467804,
-0.20810401439666748,
-0.008420927450060844,
-0.12770923972129822,
0.3638957142829895,
-0.05490607023239136,
0.17944060266017914,
-0.11236564069986343,
-0.17165428400039673,
-0.19471941888332367,
-0.015904076397418976,
-0.17679527401924133,
0.1781477928161621,
0.4905378222465515,
-0.18546506762504578,
0.046488258987665176,
-0.09410600364208221,
0.08203265070915222,
-0.16815924644470215,
0.4135836362838745,
0.2866829037666321,
-0.03188556805253029,
-0.33434075117111206,
0.2658335566520691,
-0.363943874835968,
0.3209834694862366,
-0.09422720968723297,
0.06461802870035172,
0.1500149816274643,
0.3698657155036926,
-0.09828002005815506,
0.09823901951313019,
0.42964088916778564,
-0.44498226046562195,
0.3723081052303314,
0.40184342861175537,
-0.22128795087337494,
0.0412428081035614,
-0.5812980532646179,
0.035557664930820465,
0.12873825430870056,
-0.29677876830101013,
-0.042316898703575134,
-0.025434795767068863,
0.07290396094322205,
-0.054665543138980865,
-0.33274194598197937,
0.0412537083029747,
-0.16279396414756775,
0.7269923686981201,
-0.11474954336881638,
0.3409119248390198,
0.08445407450199127,
0.02718852460384369,
-0.2759213447570801,
0.0764964371919632,
-0.07518716901540756,
0.041668545454740524,
0.21945232152938843,
0.5663888454437256,
0.015544906258583069,
-0.2400248646736145,
-0.3383796215057373,
0.18476511538028717,
0.3487740755081177,
-0.09467925131320953,
-0.08575062453746796,
0.3060990571975708,
-0.2602578401565552,
-0.0559866800904274,
0.050794221460819244,
0.33203208446502686,
0.1876927763223648,
0.2945087254047394,
-0.016689717769622803,
-0.7438549995422363,
0.5063519477844238,
-0.11262653768062592,
-0.2887372076511383,
0.17895059287548065,
0.1855284869670868,
0.43677008152008057,
-0.04264841973781586,
-0.44756102561950684,
0.01832909882068634,
0.12047991156578064,
-0.21734993159770966,
-0.062398746609687805,
-0.17387521266937256,
-0.21270817518234253,
0.1909659206867218,
-0.08036695420742035,
0.20917262136936188,
-0.08296875655651093,
0.003757283091545105,
-0.10521669685840607,
-0.1948738843202591
] |
https://github.com/huggingface/datasets/issues/6126 | Our CI did not catch this issue because with current implementation, stored token in `HfFolder` (which always exists) is used by default. | Private datasets do not load when passing token | ### Describe the bug
Since the release of `datasets` 2.14, private/gated datasets do not load when passing `token`: they raise `EmptyDatasetError`.
This is a non-planned backward incompatible breaking change.
Note that private datasets do load if instead `download_config` is passed:
```python
from datasets import DownloadConfig, load_dataset
ds = load_dataset("albertvillanova/tmp-private", split="train", download_config=DownloadConfig(token="<MY-TOKEN>"))
ds
```
gives
```
Dataset({
features: ['text'],
num_rows: 4
})
```
### Steps to reproduce the bug
```python
from datasets import load_dataset
ds = load_dataset("albertvillanova/tmp-private", split="train", token="<MY-TOKEN>")
```
gives
```
---------------------------------------------------------------------------
EmptyDatasetError Traceback (most recent call last)
[<ipython-input-2-25b48732107a>](https://localhost:8080/#) in <cell line: 3>()
1 from datasets import load_dataset
2
----> 3 ds = load_dataset("albertvillanova/tmp-private", split="train", token="<MY-TOKEN>")
5 frames
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2107
2108 # Create a dataset builder
-> 2109 builder_instance = load_dataset_builder(
2110 path=path,
2111 name=name,
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, token, use_auth_token, storage_options, **config_kwargs)
1793 download_config = download_config.copy() if download_config else DownloadConfig()
1794 download_config.storage_options.update(storage_options)
-> 1795 dataset_module = dataset_module_factory(
1796 path,
1797 revision=revision,
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1484 raise ConnectionError(f"Couldn't reach the Hugging Face Hub for dataset '{path}': {e1}") from None
1485 if isinstance(e1, EmptyDatasetError):
-> 1486 raise e1 from None
1487 if isinstance(e1, FileNotFoundError):
1488 raise FileNotFoundError(
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1474 download_config=download_config,
1475 download_mode=download_mode,
-> 1476 ).get_module()
1477 except (
1478 Exception
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in get_module(self)
1030 sanitize_patterns(self.data_files)
1031 if self.data_files is not None
-> 1032 else get_data_patterns(base_path, download_config=self.download_config)
1033 )
1034 data_files = DataFilesDict.from_patterns(
[/usr/local/lib/python3.10/dist-packages/datasets/data_files.py](https://localhost:8080/#) in get_data_patterns(base_path, download_config)
457 return _get_data_files_patterns(resolver)
458 except FileNotFoundError:
--> 459 raise EmptyDatasetError(f"The directory at {base_path} doesn't contain any data files") from None
460
461
EmptyDatasetError: The directory at hf://datasets/albertvillanova/tmp-private@79b9e4fe79670a9a050d6ebc385464891915a71d doesn't contain any data files
```
### Expected behavior
The dataset should load.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.109+-x86_64-with-glibc2.35
- Python version: 3.10.12
- Huggingface_hub version: 0.16.4
- PyArrow version: 9.0.0
- Pandas version: 1.5.3 | 22 | Private datasets do not load when passing token
### Describe the bug
Since the release of `datasets` 2.14, private/gated datasets do not load when passing `token`: they raise `EmptyDatasetError`.
This is a non-planned backward incompatible breaking change.
Note that private datasets do load if instead `download_config` is passed:
```python
from datasets import DownloadConfig, load_dataset
ds = load_dataset("albertvillanova/tmp-private", split="train", download_config=DownloadConfig(token="<MY-TOKEN>"))
ds
```
gives
```
Dataset({
features: ['text'],
num_rows: 4
})
```
### Steps to reproduce the bug
```python
from datasets import load_dataset
ds = load_dataset("albertvillanova/tmp-private", split="train", token="<MY-TOKEN>")
```
gives
```
---------------------------------------------------------------------------
EmptyDatasetError Traceback (most recent call last)
[<ipython-input-2-25b48732107a>](https://localhost:8080/#) in <cell line: 3>()
1 from datasets import load_dataset
2
----> 3 ds = load_dataset("albertvillanova/tmp-private", split="train", token="<MY-TOKEN>")
5 frames
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2107
2108 # Create a dataset builder
-> 2109 builder_instance = load_dataset_builder(
2110 path=path,
2111 name=name,
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, token, use_auth_token, storage_options, **config_kwargs)
1793 download_config = download_config.copy() if download_config else DownloadConfig()
1794 download_config.storage_options.update(storage_options)
-> 1795 dataset_module = dataset_module_factory(
1796 path,
1797 revision=revision,
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1484 raise ConnectionError(f"Couldn't reach the Hugging Face Hub for dataset '{path}': {e1}") from None
1485 if isinstance(e1, EmptyDatasetError):
-> 1486 raise e1 from None
1487 if isinstance(e1, FileNotFoundError):
1488 raise FileNotFoundError(
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1474 download_config=download_config,
1475 download_mode=download_mode,
-> 1476 ).get_module()
1477 except (
1478 Exception
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in get_module(self)
1030 sanitize_patterns(self.data_files)
1031 if self.data_files is not None
-> 1032 else get_data_patterns(base_path, download_config=self.download_config)
1033 )
1034 data_files = DataFilesDict.from_patterns(
[/usr/local/lib/python3.10/dist-packages/datasets/data_files.py](https://localhost:8080/#) in get_data_patterns(base_path, download_config)
457 return _get_data_files_patterns(resolver)
458 except FileNotFoundError:
--> 459 raise EmptyDatasetError(f"The directory at {base_path} doesn't contain any data files") from None
460
461
EmptyDatasetError: The directory at hf://datasets/albertvillanova/tmp-private@79b9e4fe79670a9a050d6ebc385464891915a71d doesn't contain any data files
```
### Expected behavior
The dataset should load.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.109+-x86_64-with-glibc2.35
- Python version: 3.10.12
- Huggingface_hub version: 0.16.4
- PyArrow version: 9.0.0
- Pandas version: 1.5.3
Our CI did not catch this issue because with current implementation, stored token in `HfFolder` (which always exists) is used by default. | [
-0.2845437526702881,
0.2692788243293762,
0.007149573415517807,
0.2665907144546509,
-0.10046811401844025,
-0.15131212770938873,
0.7414763569831848,
0.44546371698379517,
0.05207190662622452,
0.13438205420970917,
-0.27614763379096985,
0.3271932899951935,
-0.0666486993432045,
0.08730252087116241,
-0.08271321654319763,
0.057688865810632706,
0.0989764928817749,
0.004633624106645584,
0.015685532242059708,
-0.1799987554550171,
-0.23695991933345795,
0.09173416346311569,
-0.4222349524497986,
-0.06108812615275383,
-0.048359766602516174,
0.0667991116642952,
-0.037994999438524246,
0.27254217863082886,
0.02362028881907463,
-0.244316965341568,
0.17272788286209106,
0.1973472535610199,
0.29006755352020264,
0.4758729636669159,
-0.00011340743367327377,
0.12023936212062836,
0.38616490364074707,
-0.0026372671127319336,
-0.4156370759010315,
-0.14814762771129608,
-0.3543234169483185,
-0.24434086680412292,
0.0645318329334259,
-0.2994106113910675,
0.025298938155174255,
-0.3630382716655731,
-0.2933838367462158,
-0.21186959743499756,
0.5325554013252258,
0.33624696731567383,
0.19474118947982788,
0.4816657602787018,
-0.09494853019714355,
-0.3599725365638733,
0.010293399915099144,
0.18322095274925232,
-0.07013905793428421,
-0.16961775720119476,
-0.08556883037090302,
0.01412065327167511,
-0.16758020222187042,
0.13124430179595947,
-0.2703803777694702,
0.0728313997387886,
0.26841291785240173,
-0.0862671434879303,
-0.20444947481155396,
-0.18129701912403107,
0.08632921427488327,
0.09059425443410873,
0.5652399063110352,
-0.11139295995235443,
-0.37199172377586365,
-0.3396744728088379,
-0.1141413152217865,
-0.2315060794353485,
0.19506683945655823,
0.0020715706050395966,
-0.16032879054546356,
0.26575785875320435,
-0.1759784072637558,
-0.004582636058330536,
-0.14868131279945374,
0.21459448337554932,
-0.29439228773117065,
0.42745938897132874,
0.0530766062438488,
-0.017085805535316467,
-0.24515873193740845,
-0.3446761667728424,
0.3123401999473572,
-0.36924344301223755,
0.02779204584658146,
0.11609573662281036,
-0.1253339946269989,
0.0046663954854011536,
0.08458814024925232,
0.03532276675105095,
0.2122286856174469,
0.42568373680114746,
-0.5480858683586121,
0.11698529124259949,
0.03831513598561287,
0.02986743487417698,
0.10932490229606628,
-0.031479813158512115,
0.17751774191856384,
0.493145227432251,
0.2521374523639679,
0.1586087942123413,
-0.0153827965259552,
0.027016732841730118,
-0.22777041792869568,
0.19825729727745056,
-0.024317454546689987,
-0.20011858642101288,
0.4383528530597687,
-0.14964470267295837,
-0.28817716240882874,
0.031724121421575546,
-0.17025989294052124,
0.0012445971369743347,
0.12449643015861511,
0.43234580755233765,
0.06046978011727333,
-0.0746048241853714,
-0.15180471539497375,
-0.0324898436665535,
-0.06714785844087601,
-0.4224548041820526,
-0.2572757303714752,
-0.4142446517944336,
0.13034279644489288,
0.1453564465045929,
0.3386017382144928,
0.30105164647102356,
0.1880253106355667,
0.17613430321216583,
-0.12665802240371704,
0.13723346590995789,
0.17489776015281677,
-0.08791317045688629,
0.014831330627202988,
0.37130677700042725,
0.07739921659231186,
0.16653022170066833,
0.1101921945810318,
-0.524702787399292,
0.07750429213047028,
0.21605828404426575,
-0.1693878322839737,
-0.2706519067287445,
0.011707890778779984,
0.1743885576725006,
-0.45691031217575073,
0.032041434198617935,
-0.4484345018863678,
0.1617152988910675,
0.013597846031188965,
-0.05286011844873428,
0.026437032967805862,
-0.2122350037097931,
-0.18154799938201904,
-0.1614294946193695,
0.4929291009902954,
0.8280561566352844,
-0.2983015179634094,
-0.17122770845890045,
-0.4232342839241028,
-0.09174196422100067,
0.15455262362957,
0.23528188467025757,
-0.2584000825881958,
0.24631890654563904,
-0.3159591853618622,
0.36456412076950073,
0.2966328263282776,
-0.2986393868923187,
-0.48248758912086487,
0.3479890525341034,
-0.1193859875202179,
0.38041189312934875,
-0.06716090440750122,
-0.12713943421840668,
0.8165304660797119,
-0.021444808691740036,
0.3981725871562958,
0.3055804371833801,
-0.024720782414078712,
-0.11758261919021606,
-0.19691070914268494,
-0.030084241181612015,
0.27666619420051575,
0.13844020664691925,
0.3247433006763458,
0.2704528272151947,
0.11533665657043457,
0.46044251322746277,
0.37768909335136414,
-0.03020261973142624,
0.02244703471660614,
-0.15262196958065033,
0.5215052962303162,
0.24215641617774963,
0.03827289864420891,
-0.0305524542927742,
-0.5126548409461975,
0.26927128434181213,
0.11622625589370728,
-0.048814352601766586,
-0.1047874391078949,
-0.22094687819480896,
-0.30304867029190063,
-0.04345057159662247,
-0.20835374295711517,
-0.16023686528205872,
0.13890968263149261,
0.24068865180015564,
-0.27151769399642944,
0.031509608030319214,
-0.09553255140781403,
0.5116479992866516,
-0.37386617064476013,
0.29621878266334534,
0.11121304333209991,
0.2752622961997986,
0.25341084599494934,
-0.18087367713451385,
-0.06269849836826324,
0.06624652445316315,
0.296430379152298,
0.0185626819729805,
-0.1344311237335205,
0.30144810676574707,
0.2958719730377197,
-0.20541110634803772,
-0.10979399085044861,
0.02940480411052704,
0.09342382848262787,
-0.10072316229343414,
0.053331635892391205,
0.27946147322654724,
0.13848525285720825,
-0.055180687457323074,
-0.12418058514595032,
0.3588772714138031,
0.24071872234344482,
0.05474952608346939,
-0.0496639683842659,
0.014429628849029541,
0.1496964693069458,
0.05693652480840683,
-0.15482866764068604,
-0.12722444534301758,
-0.12676112353801727,
-0.20859728753566742,
0.23893001675605774,
-0.012462902814149857,
-0.07199157029390335,
0.06845587491989136,
-0.06404683738946915,
-0.018499433994293213,
0.12695001065731049,
0.04165263473987579,
-0.23811250925064087,
0.08875782787799835,
0.40265101194381714,
0.48682865500450134,
0.5058358907699585,
0.22742557525634766,
0.04904123768210411,
0.010548043996095657,
0.005344025790691376,
-0.13266585767269135,
0.1862861067056656,
0.03689711168408394,
-0.2345586121082306,
-0.04461496323347092,
0.06012440472841263,
-0.002895282581448555,
-0.05384742096066475,
-0.28326696157455444,
0.1325158178806305,
0.22327864170074463,
-0.5339159965515137,
-0.08545684814453125,
-0.26175209879875183,
-0.15527349710464478,
0.14736950397491455,
-0.01942368596792221,
-0.0808832123875618,
-0.16458171606063843,
-0.19517895579338074,
0.3096106946468353,
0.0686672180891037,
0.1748289167881012,
-0.49517756700515747,
0.32736220955848694,
0.044862695038318634,
-0.3597956895828247,
-0.056895919144153595,
0.06273025274276733,
-0.2902003824710846,
0.07826332002878189,
0.3849770426750183,
0.08847305178642273,
0.20911382138729095,
-0.16552269458770752,
-0.08329303562641144,
-0.30197402834892273,
-0.4882733225822449,
-0.0849277600646019,
-0.18450449407100677,
0.4447186291217804,
-0.16504999995231628,
0.14468815922737122,
-0.02747713029384613,
-0.0247020460665226,
0.19434067606925964,
0.04897398501634598,
-0.20727679133415222,
-0.12667664885520935,
-0.06986989080905914,
0.010737400501966476,
-0.26522207260131836,
-0.37951985001564026,
-0.2829377353191376,
-0.26874101161956787,
0.18270395696163177,
-0.08254227042198181,
-0.0011730529367923737,
0.25109022855758667,
-0.017970435321331024,
0.16305899620056152,
0.05561062693595886,
-0.1392427235841751,
-0.03934558480978012,
-0.12059293687343597,
0.33410748839378357,
-0.3164423108100891,
-0.1701647788286209,
-0.01190359890460968,
0.0036448240280151367,
0.04560769721865654,
-0.01624598354101181,
-0.5137472152709961,
0.08906548470258713,
-0.27617311477661133,
0.5607284903526306,
-0.12029354274272919,
-0.38600024580955505,
0.10751691460609436,
0.07140834629535675,
0.0047736577689647675,
-0.3152489960193634,
-0.34518635272979736,
0.03948809206485748,
-0.4597577452659607,
0.06613625586032867,
-0.11825735867023468,
0.1557842642068863,
0.11728295683860779,
0.7086595296859741,
0.04662638157606125,
-0.0026469663716852665,
0.23332349956035614,
0.022633535787463188,
0.36119940876960754,
-0.10783322900533676,
-0.40313273668289185,
-0.05266907811164856,
0.24006997048854828,
-0.019883714616298676,
0.12307475507259369,
-0.05864962935447693,
-0.264652281999588,
-0.12413542717695236,
-0.34714895486831665,
-0.3437904119491577,
-0.24294975399971008,
-0.16573140025138855,
0.11741331219673157,
0.2104864865541458,
0.20693951845169067,
0.221048042178154,
-0.3099481463432312,
-0.2034260779619217,
-0.13360488414764404,
0.2514742612838745,
0.06613904237747192,
0.15604476630687714,
-0.25828713178634644,
0.2880263924598694,
-0.10274046659469604,
0.3630017638206482,
-0.036083780229091644,
0.5825210213661194,
-0.23618650436401367,
-0.05970263481140137,
-0.06222359463572502,
0.0919463112950325,
0.42601123452186584,
0.1749562919139862,
0.11313147097826004,
0.2863757610321045,
-0.08091872930526733,
-0.262525737285614,
-0.2012823224067688,
-0.19438014924526215,
-0.11453631520271301,
0.3750898838043213,
0.6615280508995056,
-0.1146693304181099,
-0.2504792809486389,
-0.05491601303219795,
0.04837402328848839,
-0.14531704783439636,
-0.18150681257247925,
-0.10522900521755219,
-0.13843536376953125,
-0.2226940542459488,
0.20868946611881256,
0.03976105898618698,
0.3909664750099182,
-0.3778473734855652,
-0.19659829139709473,
-0.1917109489440918,
-0.04336452856659889,
0.26457443833351135,
0.0927933007478714,
0.33177778124809265,
0.07683105766773224,
0.3402482271194458,
0.18283861875534058,
0.16814525425434113,
0.4696311950683594,
0.21140135824680328,
0.14270803332328796,
-0.3802623152732849,
-0.019428158178925514,
0.019506432116031647,
-0.016081511974334717,
0.3611188530921936,
-0.1707642525434494,
0.11699342727661133,
0.1413966566324234,
0.06970334053039551,
-0.03469866141676903,
0.35550886392593384,
0.00705476850271225,
-0.10761119425296783,
-0.1389244943857193,
-0.42165297269821167,
-0.007596217095851898,
0.11851155757904053,
-0.03161543607711792,
0.09883186221122742,
0.2193494439125061,
-0.3480055630207062,
0.15845201909542084,
-0.1770247220993042,
0.5610306859016418,
0.13698598742485046,
0.1385156810283661,
0.40359923243522644,
0.15127073228359222,
0.18752345442771912,
-0.22449946403503418,
-0.10990190505981445,
-0.12286721915006638,
-0.11786450445652008,
0.010603047907352448,
-0.05799046531319618,
0.21147620677947998,
-0.06216723471879959,
-0.038341641426086426,
0.3089026212692261,
-0.03812786936759949,
0.532660722732544,
0.21060186624526978,
0.04450216889381409,
-0.047532819211483,
0.04742543399333954,
-0.35256147384643555,
0.18948659300804138,
-0.01627231575548649,
0.07128424197435379,
-0.05706077441573143,
-0.2541767954826355,
-0.14516590535640717,
-0.1984197348356247,
-0.2958343029022217,
0.056392960250377655,
-0.057830728590488434,
0.12741437554359436,
0.0478852242231369,
-0.1940680295228958,
0.2210160195827484,
0.2556121349334717,
0.17058998346328735,
0.22467240691184998,
-0.34194156527519226,
0.07218623161315918,
-0.27801233530044556,
0.16817159950733185,
-0.012935524806380272,
0.025679457932710648,
0.21821478009223938,
-0.03209095448255539,
-0.3084633946418762,
0.17101654410362244,
-0.13710898160934448,
-0.2974109649658203,
-0.34367620944976807,
0.1521512120962143,
0.4781986474990845,
-0.41433829069137573,
0.12404188513755798,
-0.20632298290729523,
0.10111726820468903,
-0.22696423530578613,
0.15565645694732666,
-0.0568653829395771,
0.03962570056319237,
0.13231036067008972,
0.028415698558092117,
-0.31739354133605957,
-0.0640326738357544,
0.5458431839942932,
-0.17518742382526398,
-0.17909826338291168,
0.6487785577774048,
-0.03923935443162918,
0.004130765795707703,
-0.2304890751838684,
0.3483535945415497,
-0.011146066710352898,
-0.2275283932685852,
0.12147998809814453,
-0.04515484720468521,
0.2920098304748535,
-0.1343490481376648,
0.11424809694290161,
0.04098084196448326,
-0.16531430184841156,
0.07878291606903076,
-0.3160043954849243,
-0.17758764326572418,
0.2893836200237274,
-0.5369856953620911,
0.08496394753456116,
0.07973838597536087,
0.18999159336090088,
0.014432564377784729,
-0.3264477252960205,
-0.32711777091026306,
0.1957581639289856,
-0.1043592318892479,
0.10572194308042526,
0.09175797551870346,
0.0347546823322773,
0.010077513754367828,
-0.08502396941184998,
0.11011716723442078,
0.11345228552818298,
-0.1355544775724411,
-0.25023916363716125,
-0.19111746549606323,
0.12317709624767303,
0.0775594711303711,
-0.06167513504624367,
-0.055991917848587036,
-0.1522318422794342,
-0.053703423589468,
-0.09305956959724426,
0.36955389380455017,
0.14841574430465698,
0.018773779273033142,
0.15339170396327972,
0.300423264503479,
0.507394552230835,
-0.2402694821357727,
0.10777024924755096,
0.1497294306755066,
-0.056152574717998505,
-0.10809043049812317,
0.19118215143680573,
-0.15046261250972748,
0.039357371628284454,
-0.2094326913356781,
0.004434775561094284,
0.19653275609016418,
0.18865160644054413,
0.3339882493019104,
-0.38910603523254395,
0.07388314604759216,
0.0885208398103714,
-0.1270572394132614,
0.15106362104415894,
-0.17428220808506012,
-0.038719382137060165,
0.42163482308387756,
0.22241081297397614,
-0.09813587367534637,
0.02054847776889801,
0.18087947368621826,
0.3149508237838745,
-0.024270281195640564,
0.1088908314704895,
0.05636593699455261,
-0.3148227632045746,
-0.009957768023014069,
0.12965773046016693,
0.12420237809419632,
0.13639339804649353,
0.11386445164680481,
0.45975080132484436,
-0.1619085967540741,
0.13113579154014587,
0.0660303458571434,
-0.014071551151573658,
-0.08029252290725708,
0.8988839983940125,
-0.22436031699180603,
0.4074941575527191,
0.030397731810808182,
0.039091289043426514,
0.09726522862911224,
-0.6985108256340027,
-0.21427983045578003,
-0.05441521108150482,
-0.007361516356468201,
0.060829006135463715,
-0.2923765182495117,
0.04129385948181152,
0.02868098020553589,
-0.0874343067407608,
-0.10704222321510315,
-0.018980592489242554,
-0.25120750069618225,
-0.08251640200614929,
-0.12938956916332245,
-0.2040594220161438,
-0.14729413390159607,
-0.1571212112903595,
0.06340783834457397,
-0.28873497247695923,
-0.07393743842840195,
-0.04750536382198334,
-0.2672598659992218,
-0.4673945903778076,
-0.1540500372648239,
0.3910534083843231,
-0.09949997067451477,
-0.27229034900665283,
0.18082375824451447,
0.13996946811676025,
-0.17519401013851166,
0.2032659947872162,
0.036555126309394836,
0.3927079141139984,
0.33654487133026123,
0.11311185359954834,
-0.00881991907954216,
0.06839632987976074,
-0.08951470255851746,
-0.05382370948791504,
0.32571130990982056,
0.018409622833132744,
0.01881876215338707,
0.1188163012266159,
0.15775474905967712,
-0.14908279478549957,
0.013177745044231415,
0.06812439858913422,
0.147878035902977,
-0.4115777313709259,
0.6753382086753845,
-0.014006948098540306,
-0.035210058093070984,
-0.07902685552835464,
-0.013069555163383484,
-0.17682966589927673,
0.15439696609973907,
0.4685194492340088,
0.5160109996795654,
0.13145557045936584,
-0.06462574005126953,
0.05696434900164604,
-0.27369779348373413,
0.018211692571640015,
0.2814217507839203,
0.12152883410453796,
-0.27276408672332764,
-0.10952982306480408,
-0.5426763296127319,
0.21436794102191925,
-0.19485068321228027,
0.03525610268115997,
0.07518143951892853,
0.17126160860061646,
0.034354787319898605,
-0.0045303902588784695,
0.008310392498970032,
-0.18820546567440033,
0.139938086271286,
-0.00018130429089069366,
-0.35037705302238464,
0.15781879425048828,
-0.1407383680343628,
0.09081344306468964,
-0.05974877253174782,
-0.34398791193962097,
0.24760836362838745,
-0.46930354833602905,
0.05932067334651947,
0.09167651832103729,
-0.1657373011112213,
0.3439353108406067,
0.04435603320598602,
0.44294169545173645,
-0.06856614351272583,
0.5454875230789185,
0.18930351734161377,
-0.006011530756950378,
-0.48485514521598816,
-0.11298957467079163,
-0.06665646284818649,
-0.019816331565380096,
-0.0484277568757534,
0.4261566996574402,
-0.11922357231378555,
0.09364233165979385,
-0.10235899686813354,
0.5386843085289001,
0.0681702196598053,
-0.30353426933288574,
-0.014957446604967117,
0.27618956565856934,
-0.2686639726161957,
0.09203465282917023,
-0.22059455513954163,
0.1756274700164795,
-0.13644734025001526,
0.2609393894672394,
-0.28115302324295044,
-0.44798147678375244,
0.6067176461219788,
-0.9213750958442688,
-0.274496853351593,
-0.3013049364089966,
0.33413374423980713,
0.2956402599811554,
-0.33133310079574585,
-0.31565582752227783,
0.037909135222435,
0.4488331377506256,
-0.22370590269565582,
-0.1739804446697235,
0.07295959442853928,
0.05988955870270729,
0.2671825587749481,
-0.0992252305150032,
0.1554233580827713,
-0.21189753711223602,
-0.13566854596138,
0.2832014262676239,
-0.2477751523256302
] |
https://github.com/huggingface/datasets/issues/6126 | I can confirm this and have the same problem (and just went almost crazy because I couldn't figure out the source of this problem because on another computer everything worked well even with `DownloadMode.FORCE_REDOWNLOAD`). | Private datasets do not load when passing token | ### Describe the bug
Since the release of `datasets` 2.14, private/gated datasets do not load when passing `token`: they raise `EmptyDatasetError`.
This is a non-planned backward incompatible breaking change.
Note that private datasets do load if instead `download_config` is passed:
```python
from datasets import DownloadConfig, load_dataset
ds = load_dataset("albertvillanova/tmp-private", split="train", download_config=DownloadConfig(token="<MY-TOKEN>"))
ds
```
gives
```
Dataset({
features: ['text'],
num_rows: 4
})
```
### Steps to reproduce the bug
```python
from datasets import load_dataset
ds = load_dataset("albertvillanova/tmp-private", split="train", token="<MY-TOKEN>")
```
gives
```
---------------------------------------------------------------------------
EmptyDatasetError Traceback (most recent call last)
[<ipython-input-2-25b48732107a>](https://localhost:8080/#) in <cell line: 3>()
1 from datasets import load_dataset
2
----> 3 ds = load_dataset("albertvillanova/tmp-private", split="train", token="<MY-TOKEN>")
5 frames
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2107
2108 # Create a dataset builder
-> 2109 builder_instance = load_dataset_builder(
2110 path=path,
2111 name=name,
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, token, use_auth_token, storage_options, **config_kwargs)
1793 download_config = download_config.copy() if download_config else DownloadConfig()
1794 download_config.storage_options.update(storage_options)
-> 1795 dataset_module = dataset_module_factory(
1796 path,
1797 revision=revision,
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1484 raise ConnectionError(f"Couldn't reach the Hugging Face Hub for dataset '{path}': {e1}") from None
1485 if isinstance(e1, EmptyDatasetError):
-> 1486 raise e1 from None
1487 if isinstance(e1, FileNotFoundError):
1488 raise FileNotFoundError(
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1474 download_config=download_config,
1475 download_mode=download_mode,
-> 1476 ).get_module()
1477 except (
1478 Exception
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in get_module(self)
1030 sanitize_patterns(self.data_files)
1031 if self.data_files is not None
-> 1032 else get_data_patterns(base_path, download_config=self.download_config)
1033 )
1034 data_files = DataFilesDict.from_patterns(
[/usr/local/lib/python3.10/dist-packages/datasets/data_files.py](https://localhost:8080/#) in get_data_patterns(base_path, download_config)
457 return _get_data_files_patterns(resolver)
458 except FileNotFoundError:
--> 459 raise EmptyDatasetError(f"The directory at {base_path} doesn't contain any data files") from None
460
461
EmptyDatasetError: The directory at hf://datasets/albertvillanova/tmp-private@79b9e4fe79670a9a050d6ebc385464891915a71d doesn't contain any data files
```
### Expected behavior
The dataset should load.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.109+-x86_64-with-glibc2.35
- Python version: 3.10.12
- Huggingface_hub version: 0.16.4
- PyArrow version: 9.0.0
- Pandas version: 1.5.3 | 34 | Private datasets do not load when passing token
### Describe the bug
Since the release of `datasets` 2.14, private/gated datasets do not load when passing `token`: they raise `EmptyDatasetError`.
This is a non-planned backward incompatible breaking change.
Note that private datasets do load if instead `download_config` is passed:
```python
from datasets import DownloadConfig, load_dataset
ds = load_dataset("albertvillanova/tmp-private", split="train", download_config=DownloadConfig(token="<MY-TOKEN>"))
ds
```
gives
```
Dataset({
features: ['text'],
num_rows: 4
})
```
### Steps to reproduce the bug
```python
from datasets import load_dataset
ds = load_dataset("albertvillanova/tmp-private", split="train", token="<MY-TOKEN>")
```
gives
```
---------------------------------------------------------------------------
EmptyDatasetError Traceback (most recent call last)
[<ipython-input-2-25b48732107a>](https://localhost:8080/#) in <cell line: 3>()
1 from datasets import load_dataset
2
----> 3 ds = load_dataset("albertvillanova/tmp-private", split="train", token="<MY-TOKEN>")
5 frames
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2107
2108 # Create a dataset builder
-> 2109 builder_instance = load_dataset_builder(
2110 path=path,
2111 name=name,
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, token, use_auth_token, storage_options, **config_kwargs)
1793 download_config = download_config.copy() if download_config else DownloadConfig()
1794 download_config.storage_options.update(storage_options)
-> 1795 dataset_module = dataset_module_factory(
1796 path,
1797 revision=revision,
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1484 raise ConnectionError(f"Couldn't reach the Hugging Face Hub for dataset '{path}': {e1}") from None
1485 if isinstance(e1, EmptyDatasetError):
-> 1486 raise e1 from None
1487 if isinstance(e1, FileNotFoundError):
1488 raise FileNotFoundError(
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1474 download_config=download_config,
1475 download_mode=download_mode,
-> 1476 ).get_module()
1477 except (
1478 Exception
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in get_module(self)
1030 sanitize_patterns(self.data_files)
1031 if self.data_files is not None
-> 1032 else get_data_patterns(base_path, download_config=self.download_config)
1033 )
1034 data_files = DataFilesDict.from_patterns(
[/usr/local/lib/python3.10/dist-packages/datasets/data_files.py](https://localhost:8080/#) in get_data_patterns(base_path, download_config)
457 return _get_data_files_patterns(resolver)
458 except FileNotFoundError:
--> 459 raise EmptyDatasetError(f"The directory at {base_path} doesn't contain any data files") from None
460
461
EmptyDatasetError: The directory at hf://datasets/albertvillanova/tmp-private@79b9e4fe79670a9a050d6ebc385464891915a71d doesn't contain any data files
```
### Expected behavior
The dataset should load.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.109+-x86_64-with-glibc2.35
- Python version: 3.10.12
- Huggingface_hub version: 0.16.4
- PyArrow version: 9.0.0
- Pandas version: 1.5.3
I can confirm this and have the same problem (and just went almost crazy because I couldn't figure out the source of this problem because on another computer everything worked well even with `DownloadMode.FORCE_REDOWNLOAD`). | [
-0.2845437526702881,
0.2692788243293762,
0.007149573415517807,
0.2665907144546509,
-0.10046811401844025,
-0.15131212770938873,
0.7414763569831848,
0.44546371698379517,
0.05207190662622452,
0.13438205420970917,
-0.27614763379096985,
0.3271932899951935,
-0.0666486993432045,
0.08730252087116241,
-0.08271321654319763,
0.057688865810632706,
0.0989764928817749,
0.004633624106645584,
0.015685532242059708,
-0.1799987554550171,
-0.23695991933345795,
0.09173416346311569,
-0.4222349524497986,
-0.06108812615275383,
-0.048359766602516174,
0.0667991116642952,
-0.037994999438524246,
0.27254217863082886,
0.02362028881907463,
-0.244316965341568,
0.17272788286209106,
0.1973472535610199,
0.29006755352020264,
0.4758729636669159,
-0.00011340743367327377,
0.12023936212062836,
0.38616490364074707,
-0.0026372671127319336,
-0.4156370759010315,
-0.14814762771129608,
-0.3543234169483185,
-0.24434086680412292,
0.0645318329334259,
-0.2994106113910675,
0.025298938155174255,
-0.3630382716655731,
-0.2933838367462158,
-0.21186959743499756,
0.5325554013252258,
0.33624696731567383,
0.19474118947982788,
0.4816657602787018,
-0.09494853019714355,
-0.3599725365638733,
0.010293399915099144,
0.18322095274925232,
-0.07013905793428421,
-0.16961775720119476,
-0.08556883037090302,
0.01412065327167511,
-0.16758020222187042,
0.13124430179595947,
-0.2703803777694702,
0.0728313997387886,
0.26841291785240173,
-0.0862671434879303,
-0.20444947481155396,
-0.18129701912403107,
0.08632921427488327,
0.09059425443410873,
0.5652399063110352,
-0.11139295995235443,
-0.37199172377586365,
-0.3396744728088379,
-0.1141413152217865,
-0.2315060794353485,
0.19506683945655823,
0.0020715706050395966,
-0.16032879054546356,
0.26575785875320435,
-0.1759784072637558,
-0.004582636058330536,
-0.14868131279945374,
0.21459448337554932,
-0.29439228773117065,
0.42745938897132874,
0.0530766062438488,
-0.017085805535316467,
-0.24515873193740845,
-0.3446761667728424,
0.3123401999473572,
-0.36924344301223755,
0.02779204584658146,
0.11609573662281036,
-0.1253339946269989,
0.0046663954854011536,
0.08458814024925232,
0.03532276675105095,
0.2122286856174469,
0.42568373680114746,
-0.5480858683586121,
0.11698529124259949,
0.03831513598561287,
0.02986743487417698,
0.10932490229606628,
-0.031479813158512115,
0.17751774191856384,
0.493145227432251,
0.2521374523639679,
0.1586087942123413,
-0.0153827965259552,
0.027016732841730118,
-0.22777041792869568,
0.19825729727745056,
-0.024317454546689987,
-0.20011858642101288,
0.4383528530597687,
-0.14964470267295837,
-0.28817716240882874,
0.031724121421575546,
-0.17025989294052124,
0.0012445971369743347,
0.12449643015861511,
0.43234580755233765,
0.06046978011727333,
-0.0746048241853714,
-0.15180471539497375,
-0.0324898436665535,
-0.06714785844087601,
-0.4224548041820526,
-0.2572757303714752,
-0.4142446517944336,
0.13034279644489288,
0.1453564465045929,
0.3386017382144928,
0.30105164647102356,
0.1880253106355667,
0.17613430321216583,
-0.12665802240371704,
0.13723346590995789,
0.17489776015281677,
-0.08791317045688629,
0.014831330627202988,
0.37130677700042725,
0.07739921659231186,
0.16653022170066833,
0.1101921945810318,
-0.524702787399292,
0.07750429213047028,
0.21605828404426575,
-0.1693878322839737,
-0.2706519067287445,
0.011707890778779984,
0.1743885576725006,
-0.45691031217575073,
0.032041434198617935,
-0.4484345018863678,
0.1617152988910675,
0.013597846031188965,
-0.05286011844873428,
0.026437032967805862,
-0.2122350037097931,
-0.18154799938201904,
-0.1614294946193695,
0.4929291009902954,
0.8280561566352844,
-0.2983015179634094,
-0.17122770845890045,
-0.4232342839241028,
-0.09174196422100067,
0.15455262362957,
0.23528188467025757,
-0.2584000825881958,
0.24631890654563904,
-0.3159591853618622,
0.36456412076950073,
0.2966328263282776,
-0.2986393868923187,
-0.48248758912086487,
0.3479890525341034,
-0.1193859875202179,
0.38041189312934875,
-0.06716090440750122,
-0.12713943421840668,
0.8165304660797119,
-0.021444808691740036,
0.3981725871562958,
0.3055804371833801,
-0.024720782414078712,
-0.11758261919021606,
-0.19691070914268494,
-0.030084241181612015,
0.27666619420051575,
0.13844020664691925,
0.3247433006763458,
0.2704528272151947,
0.11533665657043457,
0.46044251322746277,
0.37768909335136414,
-0.03020261973142624,
0.02244703471660614,
-0.15262196958065033,
0.5215052962303162,
0.24215641617774963,
0.03827289864420891,
-0.0305524542927742,
-0.5126548409461975,
0.26927128434181213,
0.11622625589370728,
-0.048814352601766586,
-0.1047874391078949,
-0.22094687819480896,
-0.30304867029190063,
-0.04345057159662247,
-0.20835374295711517,
-0.16023686528205872,
0.13890968263149261,
0.24068865180015564,
-0.27151769399642944,
0.031509608030319214,
-0.09553255140781403,
0.5116479992866516,
-0.37386617064476013,
0.29621878266334534,
0.11121304333209991,
0.2752622961997986,
0.25341084599494934,
-0.18087367713451385,
-0.06269849836826324,
0.06624652445316315,
0.296430379152298,
0.0185626819729805,
-0.1344311237335205,
0.30144810676574707,
0.2958719730377197,
-0.20541110634803772,
-0.10979399085044861,
0.02940480411052704,
0.09342382848262787,
-0.10072316229343414,
0.053331635892391205,
0.27946147322654724,
0.13848525285720825,
-0.055180687457323074,
-0.12418058514595032,
0.3588772714138031,
0.24071872234344482,
0.05474952608346939,
-0.0496639683842659,
0.014429628849029541,
0.1496964693069458,
0.05693652480840683,
-0.15482866764068604,
-0.12722444534301758,
-0.12676112353801727,
-0.20859728753566742,
0.23893001675605774,
-0.012462902814149857,
-0.07199157029390335,
0.06845587491989136,
-0.06404683738946915,
-0.018499433994293213,
0.12695001065731049,
0.04165263473987579,
-0.23811250925064087,
0.08875782787799835,
0.40265101194381714,
0.48682865500450134,
0.5058358907699585,
0.22742557525634766,
0.04904123768210411,
0.010548043996095657,
0.005344025790691376,
-0.13266585767269135,
0.1862861067056656,
0.03689711168408394,
-0.2345586121082306,
-0.04461496323347092,
0.06012440472841263,
-0.002895282581448555,
-0.05384742096066475,
-0.28326696157455444,
0.1325158178806305,
0.22327864170074463,
-0.5339159965515137,
-0.08545684814453125,
-0.26175209879875183,
-0.15527349710464478,
0.14736950397491455,
-0.01942368596792221,
-0.0808832123875618,
-0.16458171606063843,
-0.19517895579338074,
0.3096106946468353,
0.0686672180891037,
0.1748289167881012,
-0.49517756700515747,
0.32736220955848694,
0.044862695038318634,
-0.3597956895828247,
-0.056895919144153595,
0.06273025274276733,
-0.2902003824710846,
0.07826332002878189,
0.3849770426750183,
0.08847305178642273,
0.20911382138729095,
-0.16552269458770752,
-0.08329303562641144,
-0.30197402834892273,
-0.4882733225822449,
-0.0849277600646019,
-0.18450449407100677,
0.4447186291217804,
-0.16504999995231628,
0.14468815922737122,
-0.02747713029384613,
-0.0247020460665226,
0.19434067606925964,
0.04897398501634598,
-0.20727679133415222,
-0.12667664885520935,
-0.06986989080905914,
0.010737400501966476,
-0.26522207260131836,
-0.37951985001564026,
-0.2829377353191376,
-0.26874101161956787,
0.18270395696163177,
-0.08254227042198181,
-0.0011730529367923737,
0.25109022855758667,
-0.017970435321331024,
0.16305899620056152,
0.05561062693595886,
-0.1392427235841751,
-0.03934558480978012,
-0.12059293687343597,
0.33410748839378357,
-0.3164423108100891,
-0.1701647788286209,
-0.01190359890460968,
0.0036448240280151367,
0.04560769721865654,
-0.01624598354101181,
-0.5137472152709961,
0.08906548470258713,
-0.27617311477661133,
0.5607284903526306,
-0.12029354274272919,
-0.38600024580955505,
0.10751691460609436,
0.07140834629535675,
0.0047736577689647675,
-0.3152489960193634,
-0.34518635272979736,
0.03948809206485748,
-0.4597577452659607,
0.06613625586032867,
-0.11825735867023468,
0.1557842642068863,
0.11728295683860779,
0.7086595296859741,
0.04662638157606125,
-0.0026469663716852665,
0.23332349956035614,
0.022633535787463188,
0.36119940876960754,
-0.10783322900533676,
-0.40313273668289185,
-0.05266907811164856,
0.24006997048854828,
-0.019883714616298676,
0.12307475507259369,
-0.05864962935447693,
-0.264652281999588,
-0.12413542717695236,
-0.34714895486831665,
-0.3437904119491577,
-0.24294975399971008,
-0.16573140025138855,
0.11741331219673157,
0.2104864865541458,
0.20693951845169067,
0.221048042178154,
-0.3099481463432312,
-0.2034260779619217,
-0.13360488414764404,
0.2514742612838745,
0.06613904237747192,
0.15604476630687714,
-0.25828713178634644,
0.2880263924598694,
-0.10274046659469604,
0.3630017638206482,
-0.036083780229091644,
0.5825210213661194,
-0.23618650436401367,
-0.05970263481140137,
-0.06222359463572502,
0.0919463112950325,
0.42601123452186584,
0.1749562919139862,
0.11313147097826004,
0.2863757610321045,
-0.08091872930526733,
-0.262525737285614,
-0.2012823224067688,
-0.19438014924526215,
-0.11453631520271301,
0.3750898838043213,
0.6615280508995056,
-0.1146693304181099,
-0.2504792809486389,
-0.05491601303219795,
0.04837402328848839,
-0.14531704783439636,
-0.18150681257247925,
-0.10522900521755219,
-0.13843536376953125,
-0.2226940542459488,
0.20868946611881256,
0.03976105898618698,
0.3909664750099182,
-0.3778473734855652,
-0.19659829139709473,
-0.1917109489440918,
-0.04336452856659889,
0.26457443833351135,
0.0927933007478714,
0.33177778124809265,
0.07683105766773224,
0.3402482271194458,
0.18283861875534058,
0.16814525425434113,
0.4696311950683594,
0.21140135824680328,
0.14270803332328796,
-0.3802623152732849,
-0.019428158178925514,
0.019506432116031647,
-0.016081511974334717,
0.3611188530921936,
-0.1707642525434494,
0.11699342727661133,
0.1413966566324234,
0.06970334053039551,
-0.03469866141676903,
0.35550886392593384,
0.00705476850271225,
-0.10761119425296783,
-0.1389244943857193,
-0.42165297269821167,
-0.007596217095851898,
0.11851155757904053,
-0.03161543607711792,
0.09883186221122742,
0.2193494439125061,
-0.3480055630207062,
0.15845201909542084,
-0.1770247220993042,
0.5610306859016418,
0.13698598742485046,
0.1385156810283661,
0.40359923243522644,
0.15127073228359222,
0.18752345442771912,
-0.22449946403503418,
-0.10990190505981445,
-0.12286721915006638,
-0.11786450445652008,
0.010603047907352448,
-0.05799046531319618,
0.21147620677947998,
-0.06216723471879959,
-0.038341641426086426,
0.3089026212692261,
-0.03812786936759949,
0.532660722732544,
0.21060186624526978,
0.04450216889381409,
-0.047532819211483,
0.04742543399333954,
-0.35256147384643555,
0.18948659300804138,
-0.01627231575548649,
0.07128424197435379,
-0.05706077441573143,
-0.2541767954826355,
-0.14516590535640717,
-0.1984197348356247,
-0.2958343029022217,
0.056392960250377655,
-0.057830728590488434,
0.12741437554359436,
0.0478852242231369,
-0.1940680295228958,
0.2210160195827484,
0.2556121349334717,
0.17058998346328735,
0.22467240691184998,
-0.34194156527519226,
0.07218623161315918,
-0.27801233530044556,
0.16817159950733185,
-0.012935524806380272,
0.025679457932710648,
0.21821478009223938,
-0.03209095448255539,
-0.3084633946418762,
0.17101654410362244,
-0.13710898160934448,
-0.2974109649658203,
-0.34367620944976807,
0.1521512120962143,
0.4781986474990845,
-0.41433829069137573,
0.12404188513755798,
-0.20632298290729523,
0.10111726820468903,
-0.22696423530578613,
0.15565645694732666,
-0.0568653829395771,
0.03962570056319237,
0.13231036067008972,
0.028415698558092117,
-0.31739354133605957,
-0.0640326738357544,
0.5458431839942932,
-0.17518742382526398,
-0.17909826338291168,
0.6487785577774048,
-0.03923935443162918,
0.004130765795707703,
-0.2304890751838684,
0.3483535945415497,
-0.011146066710352898,
-0.2275283932685852,
0.12147998809814453,
-0.04515484720468521,
0.2920098304748535,
-0.1343490481376648,
0.11424809694290161,
0.04098084196448326,
-0.16531430184841156,
0.07878291606903076,
-0.3160043954849243,
-0.17758764326572418,
0.2893836200237274,
-0.5369856953620911,
0.08496394753456116,
0.07973838597536087,
0.18999159336090088,
0.014432564377784729,
-0.3264477252960205,
-0.32711777091026306,
0.1957581639289856,
-0.1043592318892479,
0.10572194308042526,
0.09175797551870346,
0.0347546823322773,
0.010077513754367828,
-0.08502396941184998,
0.11011716723442078,
0.11345228552818298,
-0.1355544775724411,
-0.25023916363716125,
-0.19111746549606323,
0.12317709624767303,
0.0775594711303711,
-0.06167513504624367,
-0.055991917848587036,
-0.1522318422794342,
-0.053703423589468,
-0.09305956959724426,
0.36955389380455017,
0.14841574430465698,
0.018773779273033142,
0.15339170396327972,
0.300423264503479,
0.507394552230835,
-0.2402694821357727,
0.10777024924755096,
0.1497294306755066,
-0.056152574717998505,
-0.10809043049812317,
0.19118215143680573,
-0.15046261250972748,
0.039357371628284454,
-0.2094326913356781,
0.004434775561094284,
0.19653275609016418,
0.18865160644054413,
0.3339882493019104,
-0.38910603523254395,
0.07388314604759216,
0.0885208398103714,
-0.1270572394132614,
0.15106362104415894,
-0.17428220808506012,
-0.038719382137060165,
0.42163482308387756,
0.22241081297397614,
-0.09813587367534637,
0.02054847776889801,
0.18087947368621826,
0.3149508237838745,
-0.024270281195640564,
0.1088908314704895,
0.05636593699455261,
-0.3148227632045746,
-0.009957768023014069,
0.12965773046016693,
0.12420237809419632,
0.13639339804649353,
0.11386445164680481,
0.45975080132484436,
-0.1619085967540741,
0.13113579154014587,
0.0660303458571434,
-0.014071551151573658,
-0.08029252290725708,
0.8988839983940125,
-0.22436031699180603,
0.4074941575527191,
0.030397731810808182,
0.039091289043426514,
0.09726522862911224,
-0.6985108256340027,
-0.21427983045578003,
-0.05441521108150482,
-0.007361516356468201,
0.060829006135463715,
-0.2923765182495117,
0.04129385948181152,
0.02868098020553589,
-0.0874343067407608,
-0.10704222321510315,
-0.018980592489242554,
-0.25120750069618225,
-0.08251640200614929,
-0.12938956916332245,
-0.2040594220161438,
-0.14729413390159607,
-0.1571212112903595,
0.06340783834457397,
-0.28873497247695923,
-0.07393743842840195,
-0.04750536382198334,
-0.2672598659992218,
-0.4673945903778076,
-0.1540500372648239,
0.3910534083843231,
-0.09949997067451477,
-0.27229034900665283,
0.18082375824451447,
0.13996946811676025,
-0.17519401013851166,
0.2032659947872162,
0.036555126309394836,
0.3927079141139984,
0.33654487133026123,
0.11311185359954834,
-0.00881991907954216,
0.06839632987976074,
-0.08951470255851746,
-0.05382370948791504,
0.32571130990982056,
0.018409622833132744,
0.01881876215338707,
0.1188163012266159,
0.15775474905967712,
-0.14908279478549957,
0.013177745044231415,
0.06812439858913422,
0.147878035902977,
-0.4115777313709259,
0.6753382086753845,
-0.014006948098540306,
-0.035210058093070984,
-0.07902685552835464,
-0.013069555163383484,
-0.17682966589927673,
0.15439696609973907,
0.4685194492340088,
0.5160109996795654,
0.13145557045936584,
-0.06462574005126953,
0.05696434900164604,
-0.27369779348373413,
0.018211692571640015,
0.2814217507839203,
0.12152883410453796,
-0.27276408672332764,
-0.10952982306480408,
-0.5426763296127319,
0.21436794102191925,
-0.19485068321228027,
0.03525610268115997,
0.07518143951892853,
0.17126160860061646,
0.034354787319898605,
-0.0045303902588784695,
0.008310392498970032,
-0.18820546567440033,
0.139938086271286,
-0.00018130429089069366,
-0.35037705302238464,
0.15781879425048828,
-0.1407383680343628,
0.09081344306468964,
-0.05974877253174782,
-0.34398791193962097,
0.24760836362838745,
-0.46930354833602905,
0.05932067334651947,
0.09167651832103729,
-0.1657373011112213,
0.3439353108406067,
0.04435603320598602,
0.44294169545173645,
-0.06856614351272583,
0.5454875230789185,
0.18930351734161377,
-0.006011530756950378,
-0.48485514521598816,
-0.11298957467079163,
-0.06665646284818649,
-0.019816331565380096,
-0.0484277568757534,
0.4261566996574402,
-0.11922357231378555,
0.09364233165979385,
-0.10235899686813354,
0.5386843085289001,
0.0681702196598053,
-0.30353426933288574,
-0.014957446604967117,
0.27618956565856934,
-0.2686639726161957,
0.09203465282917023,
-0.22059455513954163,
0.1756274700164795,
-0.13644734025001526,
0.2609393894672394,
-0.28115302324295044,
-0.44798147678375244,
0.6067176461219788,
-0.9213750958442688,
-0.274496853351593,
-0.3013049364089966,
0.33413374423980713,
0.2956402599811554,
-0.33133310079574585,
-0.31565582752227783,
0.037909135222435,
0.4488331377506256,
-0.22370590269565582,
-0.1739804446697235,
0.07295959442853928,
0.05988955870270729,
0.2671825587749481,
-0.0992252305150032,
0.1554233580827713,
-0.21189753711223602,
-0.13566854596138,
0.2832014262676239,
-0.2477751523256302
] |
https://github.com/huggingface/datasets/issues/6126 | We are planning to do a patch release today, after the merge of the fix:
- #6127
In the meantime, the problem can be circumvented by passing `download_config` instead:
```python
from datasets import DownloadConfig, load_dataset
load_dataset("<DATASET-NAME>", split="train", download_config=DownloadConfig(token="<TOKEN>"))
``` | Private datasets do not load when passing token | ### Describe the bug
Since the release of `datasets` 2.14, private/gated datasets do not load when passing `token`: they raise `EmptyDatasetError`.
This is a non-planned backward incompatible breaking change.
Note that private datasets do load if instead `download_config` is passed:
```python
from datasets import DownloadConfig, load_dataset
ds = load_dataset("albertvillanova/tmp-private", split="train", download_config=DownloadConfig(token="<MY-TOKEN>"))
ds
```
gives
```
Dataset({
features: ['text'],
num_rows: 4
})
```
### Steps to reproduce the bug
```python
from datasets import load_dataset
ds = load_dataset("albertvillanova/tmp-private", split="train", token="<MY-TOKEN>")
```
gives
```
---------------------------------------------------------------------------
EmptyDatasetError Traceback (most recent call last)
[<ipython-input-2-25b48732107a>](https://localhost:8080/#) in <cell line: 3>()
1 from datasets import load_dataset
2
----> 3 ds = load_dataset("albertvillanova/tmp-private", split="train", token="<MY-TOKEN>")
5 frames
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2107
2108 # Create a dataset builder
-> 2109 builder_instance = load_dataset_builder(
2110 path=path,
2111 name=name,
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, token, use_auth_token, storage_options, **config_kwargs)
1793 download_config = download_config.copy() if download_config else DownloadConfig()
1794 download_config.storage_options.update(storage_options)
-> 1795 dataset_module = dataset_module_factory(
1796 path,
1797 revision=revision,
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1484 raise ConnectionError(f"Couldn't reach the Hugging Face Hub for dataset '{path}': {e1}") from None
1485 if isinstance(e1, EmptyDatasetError):
-> 1486 raise e1 from None
1487 if isinstance(e1, FileNotFoundError):
1488 raise FileNotFoundError(
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1474 download_config=download_config,
1475 download_mode=download_mode,
-> 1476 ).get_module()
1477 except (
1478 Exception
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in get_module(self)
1030 sanitize_patterns(self.data_files)
1031 if self.data_files is not None
-> 1032 else get_data_patterns(base_path, download_config=self.download_config)
1033 )
1034 data_files = DataFilesDict.from_patterns(
[/usr/local/lib/python3.10/dist-packages/datasets/data_files.py](https://localhost:8080/#) in get_data_patterns(base_path, download_config)
457 return _get_data_files_patterns(resolver)
458 except FileNotFoundError:
--> 459 raise EmptyDatasetError(f"The directory at {base_path} doesn't contain any data files") from None
460
461
EmptyDatasetError: The directory at hf://datasets/albertvillanova/tmp-private@79b9e4fe79670a9a050d6ebc385464891915a71d doesn't contain any data files
```
### Expected behavior
The dataset should load.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.109+-x86_64-with-glibc2.35
- Python version: 3.10.12
- Huggingface_hub version: 0.16.4
- PyArrow version: 9.0.0
- Pandas version: 1.5.3 | 39 | Private datasets do not load when passing token
### Describe the bug
Since the release of `datasets` 2.14, private/gated datasets do not load when passing `token`: they raise `EmptyDatasetError`.
This is a non-planned backward incompatible breaking change.
Note that private datasets do load if instead `download_config` is passed:
```python
from datasets import DownloadConfig, load_dataset
ds = load_dataset("albertvillanova/tmp-private", split="train", download_config=DownloadConfig(token="<MY-TOKEN>"))
ds
```
gives
```
Dataset({
features: ['text'],
num_rows: 4
})
```
### Steps to reproduce the bug
```python
from datasets import load_dataset
ds = load_dataset("albertvillanova/tmp-private", split="train", token="<MY-TOKEN>")
```
gives
```
---------------------------------------------------------------------------
EmptyDatasetError Traceback (most recent call last)
[<ipython-input-2-25b48732107a>](https://localhost:8080/#) in <cell line: 3>()
1 from datasets import load_dataset
2
----> 3 ds = load_dataset("albertvillanova/tmp-private", split="train", token="<MY-TOKEN>")
5 frames
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2107
2108 # Create a dataset builder
-> 2109 builder_instance = load_dataset_builder(
2110 path=path,
2111 name=name,
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, token, use_auth_token, storage_options, **config_kwargs)
1793 download_config = download_config.copy() if download_config else DownloadConfig()
1794 download_config.storage_options.update(storage_options)
-> 1795 dataset_module = dataset_module_factory(
1796 path,
1797 revision=revision,
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1484 raise ConnectionError(f"Couldn't reach the Hugging Face Hub for dataset '{path}': {e1}") from None
1485 if isinstance(e1, EmptyDatasetError):
-> 1486 raise e1 from None
1487 if isinstance(e1, FileNotFoundError):
1488 raise FileNotFoundError(
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1474 download_config=download_config,
1475 download_mode=download_mode,
-> 1476 ).get_module()
1477 except (
1478 Exception
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in get_module(self)
1030 sanitize_patterns(self.data_files)
1031 if self.data_files is not None
-> 1032 else get_data_patterns(base_path, download_config=self.download_config)
1033 )
1034 data_files = DataFilesDict.from_patterns(
[/usr/local/lib/python3.10/dist-packages/datasets/data_files.py](https://localhost:8080/#) in get_data_patterns(base_path, download_config)
457 return _get_data_files_patterns(resolver)
458 except FileNotFoundError:
--> 459 raise EmptyDatasetError(f"The directory at {base_path} doesn't contain any data files") from None
460
461
EmptyDatasetError: The directory at hf://datasets/albertvillanova/tmp-private@79b9e4fe79670a9a050d6ebc385464891915a71d doesn't contain any data files
```
### Expected behavior
The dataset should load.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.109+-x86_64-with-glibc2.35
- Python version: 3.10.12
- Huggingface_hub version: 0.16.4
- PyArrow version: 9.0.0
- Pandas version: 1.5.3
We are planning to do a patch release today, after the merge of the fix:
- #6127
In the meantime, the problem can be circumvented by passing `download_config` instead:
```python
from datasets import DownloadConfig, load_dataset
load_dataset("<DATASET-NAME>", split="train", download_config=DownloadConfig(token="<TOKEN>"))
``` | [
-0.2845437526702881,
0.2692788243293762,
0.007149573415517807,
0.2665907144546509,
-0.10046811401844025,
-0.15131212770938873,
0.7414763569831848,
0.44546371698379517,
0.05207190662622452,
0.13438205420970917,
-0.27614763379096985,
0.3271932899951935,
-0.0666486993432045,
0.08730252087116241,
-0.08271321654319763,
0.057688865810632706,
0.0989764928817749,
0.004633624106645584,
0.015685532242059708,
-0.1799987554550171,
-0.23695991933345795,
0.09173416346311569,
-0.4222349524497986,
-0.06108812615275383,
-0.048359766602516174,
0.0667991116642952,
-0.037994999438524246,
0.27254217863082886,
0.02362028881907463,
-0.244316965341568,
0.17272788286209106,
0.1973472535610199,
0.29006755352020264,
0.4758729636669159,
-0.00011340743367327377,
0.12023936212062836,
0.38616490364074707,
-0.0026372671127319336,
-0.4156370759010315,
-0.14814762771129608,
-0.3543234169483185,
-0.24434086680412292,
0.0645318329334259,
-0.2994106113910675,
0.025298938155174255,
-0.3630382716655731,
-0.2933838367462158,
-0.21186959743499756,
0.5325554013252258,
0.33624696731567383,
0.19474118947982788,
0.4816657602787018,
-0.09494853019714355,
-0.3599725365638733,
0.010293399915099144,
0.18322095274925232,
-0.07013905793428421,
-0.16961775720119476,
-0.08556883037090302,
0.01412065327167511,
-0.16758020222187042,
0.13124430179595947,
-0.2703803777694702,
0.0728313997387886,
0.26841291785240173,
-0.0862671434879303,
-0.20444947481155396,
-0.18129701912403107,
0.08632921427488327,
0.09059425443410873,
0.5652399063110352,
-0.11139295995235443,
-0.37199172377586365,
-0.3396744728088379,
-0.1141413152217865,
-0.2315060794353485,
0.19506683945655823,
0.0020715706050395966,
-0.16032879054546356,
0.26575785875320435,
-0.1759784072637558,
-0.004582636058330536,
-0.14868131279945374,
0.21459448337554932,
-0.29439228773117065,
0.42745938897132874,
0.0530766062438488,
-0.017085805535316467,
-0.24515873193740845,
-0.3446761667728424,
0.3123401999473572,
-0.36924344301223755,
0.02779204584658146,
0.11609573662281036,
-0.1253339946269989,
0.0046663954854011536,
0.08458814024925232,
0.03532276675105095,
0.2122286856174469,
0.42568373680114746,
-0.5480858683586121,
0.11698529124259949,
0.03831513598561287,
0.02986743487417698,
0.10932490229606628,
-0.031479813158512115,
0.17751774191856384,
0.493145227432251,
0.2521374523639679,
0.1586087942123413,
-0.0153827965259552,
0.027016732841730118,
-0.22777041792869568,
0.19825729727745056,
-0.024317454546689987,
-0.20011858642101288,
0.4383528530597687,
-0.14964470267295837,
-0.28817716240882874,
0.031724121421575546,
-0.17025989294052124,
0.0012445971369743347,
0.12449643015861511,
0.43234580755233765,
0.06046978011727333,
-0.0746048241853714,
-0.15180471539497375,
-0.0324898436665535,
-0.06714785844087601,
-0.4224548041820526,
-0.2572757303714752,
-0.4142446517944336,
0.13034279644489288,
0.1453564465045929,
0.3386017382144928,
0.30105164647102356,
0.1880253106355667,
0.17613430321216583,
-0.12665802240371704,
0.13723346590995789,
0.17489776015281677,
-0.08791317045688629,
0.014831330627202988,
0.37130677700042725,
0.07739921659231186,
0.16653022170066833,
0.1101921945810318,
-0.524702787399292,
0.07750429213047028,
0.21605828404426575,
-0.1693878322839737,
-0.2706519067287445,
0.011707890778779984,
0.1743885576725006,
-0.45691031217575073,
0.032041434198617935,
-0.4484345018863678,
0.1617152988910675,
0.013597846031188965,
-0.05286011844873428,
0.026437032967805862,
-0.2122350037097931,
-0.18154799938201904,
-0.1614294946193695,
0.4929291009902954,
0.8280561566352844,
-0.2983015179634094,
-0.17122770845890045,
-0.4232342839241028,
-0.09174196422100067,
0.15455262362957,
0.23528188467025757,
-0.2584000825881958,
0.24631890654563904,
-0.3159591853618622,
0.36456412076950073,
0.2966328263282776,
-0.2986393868923187,
-0.48248758912086487,
0.3479890525341034,
-0.1193859875202179,
0.38041189312934875,
-0.06716090440750122,
-0.12713943421840668,
0.8165304660797119,
-0.021444808691740036,
0.3981725871562958,
0.3055804371833801,
-0.024720782414078712,
-0.11758261919021606,
-0.19691070914268494,
-0.030084241181612015,
0.27666619420051575,
0.13844020664691925,
0.3247433006763458,
0.2704528272151947,
0.11533665657043457,
0.46044251322746277,
0.37768909335136414,
-0.03020261973142624,
0.02244703471660614,
-0.15262196958065033,
0.5215052962303162,
0.24215641617774963,
0.03827289864420891,
-0.0305524542927742,
-0.5126548409461975,
0.26927128434181213,
0.11622625589370728,
-0.048814352601766586,
-0.1047874391078949,
-0.22094687819480896,
-0.30304867029190063,
-0.04345057159662247,
-0.20835374295711517,
-0.16023686528205872,
0.13890968263149261,
0.24068865180015564,
-0.27151769399642944,
0.031509608030319214,
-0.09553255140781403,
0.5116479992866516,
-0.37386617064476013,
0.29621878266334534,
0.11121304333209991,
0.2752622961997986,
0.25341084599494934,
-0.18087367713451385,
-0.06269849836826324,
0.06624652445316315,
0.296430379152298,
0.0185626819729805,
-0.1344311237335205,
0.30144810676574707,
0.2958719730377197,
-0.20541110634803772,
-0.10979399085044861,
0.02940480411052704,
0.09342382848262787,
-0.10072316229343414,
0.053331635892391205,
0.27946147322654724,
0.13848525285720825,
-0.055180687457323074,
-0.12418058514595032,
0.3588772714138031,
0.24071872234344482,
0.05474952608346939,
-0.0496639683842659,
0.014429628849029541,
0.1496964693069458,
0.05693652480840683,
-0.15482866764068604,
-0.12722444534301758,
-0.12676112353801727,
-0.20859728753566742,
0.23893001675605774,
-0.012462902814149857,
-0.07199157029390335,
0.06845587491989136,
-0.06404683738946915,
-0.018499433994293213,
0.12695001065731049,
0.04165263473987579,
-0.23811250925064087,
0.08875782787799835,
0.40265101194381714,
0.48682865500450134,
0.5058358907699585,
0.22742557525634766,
0.04904123768210411,
0.010548043996095657,
0.005344025790691376,
-0.13266585767269135,
0.1862861067056656,
0.03689711168408394,
-0.2345586121082306,
-0.04461496323347092,
0.06012440472841263,
-0.002895282581448555,
-0.05384742096066475,
-0.28326696157455444,
0.1325158178806305,
0.22327864170074463,
-0.5339159965515137,
-0.08545684814453125,
-0.26175209879875183,
-0.15527349710464478,
0.14736950397491455,
-0.01942368596792221,
-0.0808832123875618,
-0.16458171606063843,
-0.19517895579338074,
0.3096106946468353,
0.0686672180891037,
0.1748289167881012,
-0.49517756700515747,
0.32736220955848694,
0.044862695038318634,
-0.3597956895828247,
-0.056895919144153595,
0.06273025274276733,
-0.2902003824710846,
0.07826332002878189,
0.3849770426750183,
0.08847305178642273,
0.20911382138729095,
-0.16552269458770752,
-0.08329303562641144,
-0.30197402834892273,
-0.4882733225822449,
-0.0849277600646019,
-0.18450449407100677,
0.4447186291217804,
-0.16504999995231628,
0.14468815922737122,
-0.02747713029384613,
-0.0247020460665226,
0.19434067606925964,
0.04897398501634598,
-0.20727679133415222,
-0.12667664885520935,
-0.06986989080905914,
0.010737400501966476,
-0.26522207260131836,
-0.37951985001564026,
-0.2829377353191376,
-0.26874101161956787,
0.18270395696163177,
-0.08254227042198181,
-0.0011730529367923737,
0.25109022855758667,
-0.017970435321331024,
0.16305899620056152,
0.05561062693595886,
-0.1392427235841751,
-0.03934558480978012,
-0.12059293687343597,
0.33410748839378357,
-0.3164423108100891,
-0.1701647788286209,
-0.01190359890460968,
0.0036448240280151367,
0.04560769721865654,
-0.01624598354101181,
-0.5137472152709961,
0.08906548470258713,
-0.27617311477661133,
0.5607284903526306,
-0.12029354274272919,
-0.38600024580955505,
0.10751691460609436,
0.07140834629535675,
0.0047736577689647675,
-0.3152489960193634,
-0.34518635272979736,
0.03948809206485748,
-0.4597577452659607,
0.06613625586032867,
-0.11825735867023468,
0.1557842642068863,
0.11728295683860779,
0.7086595296859741,
0.04662638157606125,
-0.0026469663716852665,
0.23332349956035614,
0.022633535787463188,
0.36119940876960754,
-0.10783322900533676,
-0.40313273668289185,
-0.05266907811164856,
0.24006997048854828,
-0.019883714616298676,
0.12307475507259369,
-0.05864962935447693,
-0.264652281999588,
-0.12413542717695236,
-0.34714895486831665,
-0.3437904119491577,
-0.24294975399971008,
-0.16573140025138855,
0.11741331219673157,
0.2104864865541458,
0.20693951845169067,
0.221048042178154,
-0.3099481463432312,
-0.2034260779619217,
-0.13360488414764404,
0.2514742612838745,
0.06613904237747192,
0.15604476630687714,
-0.25828713178634644,
0.2880263924598694,
-0.10274046659469604,
0.3630017638206482,
-0.036083780229091644,
0.5825210213661194,
-0.23618650436401367,
-0.05970263481140137,
-0.06222359463572502,
0.0919463112950325,
0.42601123452186584,
0.1749562919139862,
0.11313147097826004,
0.2863757610321045,
-0.08091872930526733,
-0.262525737285614,
-0.2012823224067688,
-0.19438014924526215,
-0.11453631520271301,
0.3750898838043213,
0.6615280508995056,
-0.1146693304181099,
-0.2504792809486389,
-0.05491601303219795,
0.04837402328848839,
-0.14531704783439636,
-0.18150681257247925,
-0.10522900521755219,
-0.13843536376953125,
-0.2226940542459488,
0.20868946611881256,
0.03976105898618698,
0.3909664750099182,
-0.3778473734855652,
-0.19659829139709473,
-0.1917109489440918,
-0.04336452856659889,
0.26457443833351135,
0.0927933007478714,
0.33177778124809265,
0.07683105766773224,
0.3402482271194458,
0.18283861875534058,
0.16814525425434113,
0.4696311950683594,
0.21140135824680328,
0.14270803332328796,
-0.3802623152732849,
-0.019428158178925514,
0.019506432116031647,
-0.016081511974334717,
0.3611188530921936,
-0.1707642525434494,
0.11699342727661133,
0.1413966566324234,
0.06970334053039551,
-0.03469866141676903,
0.35550886392593384,
0.00705476850271225,
-0.10761119425296783,
-0.1389244943857193,
-0.42165297269821167,
-0.007596217095851898,
0.11851155757904053,
-0.03161543607711792,
0.09883186221122742,
0.2193494439125061,
-0.3480055630207062,
0.15845201909542084,
-0.1770247220993042,
0.5610306859016418,
0.13698598742485046,
0.1385156810283661,
0.40359923243522644,
0.15127073228359222,
0.18752345442771912,
-0.22449946403503418,
-0.10990190505981445,
-0.12286721915006638,
-0.11786450445652008,
0.010603047907352448,
-0.05799046531319618,
0.21147620677947998,
-0.06216723471879959,
-0.038341641426086426,
0.3089026212692261,
-0.03812786936759949,
0.532660722732544,
0.21060186624526978,
0.04450216889381409,
-0.047532819211483,
0.04742543399333954,
-0.35256147384643555,
0.18948659300804138,
-0.01627231575548649,
0.07128424197435379,
-0.05706077441573143,
-0.2541767954826355,
-0.14516590535640717,
-0.1984197348356247,
-0.2958343029022217,
0.056392960250377655,
-0.057830728590488434,
0.12741437554359436,
0.0478852242231369,
-0.1940680295228958,
0.2210160195827484,
0.2556121349334717,
0.17058998346328735,
0.22467240691184998,
-0.34194156527519226,
0.07218623161315918,
-0.27801233530044556,
0.16817159950733185,
-0.012935524806380272,
0.025679457932710648,
0.21821478009223938,
-0.03209095448255539,
-0.3084633946418762,
0.17101654410362244,
-0.13710898160934448,
-0.2974109649658203,
-0.34367620944976807,
0.1521512120962143,
0.4781986474990845,
-0.41433829069137573,
0.12404188513755798,
-0.20632298290729523,
0.10111726820468903,
-0.22696423530578613,
0.15565645694732666,
-0.0568653829395771,
0.03962570056319237,
0.13231036067008972,
0.028415698558092117,
-0.31739354133605957,
-0.0640326738357544,
0.5458431839942932,
-0.17518742382526398,
-0.17909826338291168,
0.6487785577774048,
-0.03923935443162918,
0.004130765795707703,
-0.2304890751838684,
0.3483535945415497,
-0.011146066710352898,
-0.2275283932685852,
0.12147998809814453,
-0.04515484720468521,
0.2920098304748535,
-0.1343490481376648,
0.11424809694290161,
0.04098084196448326,
-0.16531430184841156,
0.07878291606903076,
-0.3160043954849243,
-0.17758764326572418,
0.2893836200237274,
-0.5369856953620911,
0.08496394753456116,
0.07973838597536087,
0.18999159336090088,
0.014432564377784729,
-0.3264477252960205,
-0.32711777091026306,
0.1957581639289856,
-0.1043592318892479,
0.10572194308042526,
0.09175797551870346,
0.0347546823322773,
0.010077513754367828,
-0.08502396941184998,
0.11011716723442078,
0.11345228552818298,
-0.1355544775724411,
-0.25023916363716125,
-0.19111746549606323,
0.12317709624767303,
0.0775594711303711,
-0.06167513504624367,
-0.055991917848587036,
-0.1522318422794342,
-0.053703423589468,
-0.09305956959724426,
0.36955389380455017,
0.14841574430465698,
0.018773779273033142,
0.15339170396327972,
0.300423264503479,
0.507394552230835,
-0.2402694821357727,
0.10777024924755096,
0.1497294306755066,
-0.056152574717998505,
-0.10809043049812317,
0.19118215143680573,
-0.15046261250972748,
0.039357371628284454,
-0.2094326913356781,
0.004434775561094284,
0.19653275609016418,
0.18865160644054413,
0.3339882493019104,
-0.38910603523254395,
0.07388314604759216,
0.0885208398103714,
-0.1270572394132614,
0.15106362104415894,
-0.17428220808506012,
-0.038719382137060165,
0.42163482308387756,
0.22241081297397614,
-0.09813587367534637,
0.02054847776889801,
0.18087947368621826,
0.3149508237838745,
-0.024270281195640564,
0.1088908314704895,
0.05636593699455261,
-0.3148227632045746,
-0.009957768023014069,
0.12965773046016693,
0.12420237809419632,
0.13639339804649353,
0.11386445164680481,
0.45975080132484436,
-0.1619085967540741,
0.13113579154014587,
0.0660303458571434,
-0.014071551151573658,
-0.08029252290725708,
0.8988839983940125,
-0.22436031699180603,
0.4074941575527191,
0.030397731810808182,
0.039091289043426514,
0.09726522862911224,
-0.6985108256340027,
-0.21427983045578003,
-0.05441521108150482,
-0.007361516356468201,
0.060829006135463715,
-0.2923765182495117,
0.04129385948181152,
0.02868098020553589,
-0.0874343067407608,
-0.10704222321510315,
-0.018980592489242554,
-0.25120750069618225,
-0.08251640200614929,
-0.12938956916332245,
-0.2040594220161438,
-0.14729413390159607,
-0.1571212112903595,
0.06340783834457397,
-0.28873497247695923,
-0.07393743842840195,
-0.04750536382198334,
-0.2672598659992218,
-0.4673945903778076,
-0.1540500372648239,
0.3910534083843231,
-0.09949997067451477,
-0.27229034900665283,
0.18082375824451447,
0.13996946811676025,
-0.17519401013851166,
0.2032659947872162,
0.036555126309394836,
0.3927079141139984,
0.33654487133026123,
0.11311185359954834,
-0.00881991907954216,
0.06839632987976074,
-0.08951470255851746,
-0.05382370948791504,
0.32571130990982056,
0.018409622833132744,
0.01881876215338707,
0.1188163012266159,
0.15775474905967712,
-0.14908279478549957,
0.013177745044231415,
0.06812439858913422,
0.147878035902977,
-0.4115777313709259,
0.6753382086753845,
-0.014006948098540306,
-0.035210058093070984,
-0.07902685552835464,
-0.013069555163383484,
-0.17682966589927673,
0.15439696609973907,
0.4685194492340088,
0.5160109996795654,
0.13145557045936584,
-0.06462574005126953,
0.05696434900164604,
-0.27369779348373413,
0.018211692571640015,
0.2814217507839203,
0.12152883410453796,
-0.27276408672332764,
-0.10952982306480408,
-0.5426763296127319,
0.21436794102191925,
-0.19485068321228027,
0.03525610268115997,
0.07518143951892853,
0.17126160860061646,
0.034354787319898605,
-0.0045303902588784695,
0.008310392498970032,
-0.18820546567440033,
0.139938086271286,
-0.00018130429089069366,
-0.35037705302238464,
0.15781879425048828,
-0.1407383680343628,
0.09081344306468964,
-0.05974877253174782,
-0.34398791193962097,
0.24760836362838745,
-0.46930354833602905,
0.05932067334651947,
0.09167651832103729,
-0.1657373011112213,
0.3439353108406067,
0.04435603320598602,
0.44294169545173645,
-0.06856614351272583,
0.5454875230789185,
0.18930351734161377,
-0.006011530756950378,
-0.48485514521598816,
-0.11298957467079163,
-0.06665646284818649,
-0.019816331565380096,
-0.0484277568757534,
0.4261566996574402,
-0.11922357231378555,
0.09364233165979385,
-0.10235899686813354,
0.5386843085289001,
0.0681702196598053,
-0.30353426933288574,
-0.014957446604967117,
0.27618956565856934,
-0.2686639726161957,
0.09203465282917023,
-0.22059455513954163,
0.1756274700164795,
-0.13644734025001526,
0.2609393894672394,
-0.28115302324295044,
-0.44798147678375244,
0.6067176461219788,
-0.9213750958442688,
-0.274496853351593,
-0.3013049364089966,
0.33413374423980713,
0.2956402599811554,
-0.33133310079574585,
-0.31565582752227783,
0.037909135222435,
0.4488331377506256,
-0.22370590269565582,
-0.1739804446697235,
0.07295959442853928,
0.05988955870270729,
0.2671825587749481,
-0.0992252305150032,
0.1554233580827713,
-0.21189753711223602,
-0.13566854596138,
0.2832014262676239,
-0.2477751523256302
] |
https://github.com/huggingface/datasets/issues/6126 | > We are planning to do a patch release today, after the merge of the fix:
>
> * [Fix authentication issues #6127](https://github.com/huggingface/datasets/pull/6127)
>
>
> In the meantime, the problem can be circumvented by passing `download_config` instead:
>
> ```python
> from datasets import DownloadConfig, load_dataset
>
> load_dataset("<DATASET-NAME>", split="train", download_config=DownloadConfig(token="<TOKEN>"))
> ```
This did not work for me (there was some other error with the split being an unexpected size 0). Downgrading to 2.13 fixed it.... | Private datasets do not load when passing token | ### Describe the bug
Since the release of `datasets` 2.14, private/gated datasets do not load when passing `token`: they raise `EmptyDatasetError`.
This is a non-planned backward incompatible breaking change.
Note that private datasets do load if instead `download_config` is passed:
```python
from datasets import DownloadConfig, load_dataset
ds = load_dataset("albertvillanova/tmp-private", split="train", download_config=DownloadConfig(token="<MY-TOKEN>"))
ds
```
gives
```
Dataset({
features: ['text'],
num_rows: 4
})
```
### Steps to reproduce the bug
```python
from datasets import load_dataset
ds = load_dataset("albertvillanova/tmp-private", split="train", token="<MY-TOKEN>")
```
gives
```
---------------------------------------------------------------------------
EmptyDatasetError Traceback (most recent call last)
[<ipython-input-2-25b48732107a>](https://localhost:8080/#) in <cell line: 3>()
1 from datasets import load_dataset
2
----> 3 ds = load_dataset("albertvillanova/tmp-private", split="train", token="<MY-TOKEN>")
5 frames
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2107
2108 # Create a dataset builder
-> 2109 builder_instance = load_dataset_builder(
2110 path=path,
2111 name=name,
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, token, use_auth_token, storage_options, **config_kwargs)
1793 download_config = download_config.copy() if download_config else DownloadConfig()
1794 download_config.storage_options.update(storage_options)
-> 1795 dataset_module = dataset_module_factory(
1796 path,
1797 revision=revision,
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1484 raise ConnectionError(f"Couldn't reach the Hugging Face Hub for dataset '{path}': {e1}") from None
1485 if isinstance(e1, EmptyDatasetError):
-> 1486 raise e1 from None
1487 if isinstance(e1, FileNotFoundError):
1488 raise FileNotFoundError(
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1474 download_config=download_config,
1475 download_mode=download_mode,
-> 1476 ).get_module()
1477 except (
1478 Exception
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in get_module(self)
1030 sanitize_patterns(self.data_files)
1031 if self.data_files is not None
-> 1032 else get_data_patterns(base_path, download_config=self.download_config)
1033 )
1034 data_files = DataFilesDict.from_patterns(
[/usr/local/lib/python3.10/dist-packages/datasets/data_files.py](https://localhost:8080/#) in get_data_patterns(base_path, download_config)
457 return _get_data_files_patterns(resolver)
458 except FileNotFoundError:
--> 459 raise EmptyDatasetError(f"The directory at {base_path} doesn't contain any data files") from None
460
461
EmptyDatasetError: The directory at hf://datasets/albertvillanova/tmp-private@79b9e4fe79670a9a050d6ebc385464891915a71d doesn't contain any data files
```
### Expected behavior
The dataset should load.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.109+-x86_64-with-glibc2.35
- Python version: 3.10.12
- Huggingface_hub version: 0.16.4
- PyArrow version: 9.0.0
- Pandas version: 1.5.3 | 78 | Private datasets do not load when passing token
### Describe the bug
Since the release of `datasets` 2.14, private/gated datasets do not load when passing `token`: they raise `EmptyDatasetError`.
This is a non-planned backward incompatible breaking change.
Note that private datasets do load if instead `download_config` is passed:
```python
from datasets import DownloadConfig, load_dataset
ds = load_dataset("albertvillanova/tmp-private", split="train", download_config=DownloadConfig(token="<MY-TOKEN>"))
ds
```
gives
```
Dataset({
features: ['text'],
num_rows: 4
})
```
### Steps to reproduce the bug
```python
from datasets import load_dataset
ds = load_dataset("albertvillanova/tmp-private", split="train", token="<MY-TOKEN>")
```
gives
```
---------------------------------------------------------------------------
EmptyDatasetError Traceback (most recent call last)
[<ipython-input-2-25b48732107a>](https://localhost:8080/#) in <cell line: 3>()
1 from datasets import load_dataset
2
----> 3 ds = load_dataset("albertvillanova/tmp-private", split="train", token="<MY-TOKEN>")
5 frames
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2107
2108 # Create a dataset builder
-> 2109 builder_instance = load_dataset_builder(
2110 path=path,
2111 name=name,
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, token, use_auth_token, storage_options, **config_kwargs)
1793 download_config = download_config.copy() if download_config else DownloadConfig()
1794 download_config.storage_options.update(storage_options)
-> 1795 dataset_module = dataset_module_factory(
1796 path,
1797 revision=revision,
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1484 raise ConnectionError(f"Couldn't reach the Hugging Face Hub for dataset '{path}': {e1}") from None
1485 if isinstance(e1, EmptyDatasetError):
-> 1486 raise e1 from None
1487 if isinstance(e1, FileNotFoundError):
1488 raise FileNotFoundError(
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1474 download_config=download_config,
1475 download_mode=download_mode,
-> 1476 ).get_module()
1477 except (
1478 Exception
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in get_module(self)
1030 sanitize_patterns(self.data_files)
1031 if self.data_files is not None
-> 1032 else get_data_patterns(base_path, download_config=self.download_config)
1033 )
1034 data_files = DataFilesDict.from_patterns(
[/usr/local/lib/python3.10/dist-packages/datasets/data_files.py](https://localhost:8080/#) in get_data_patterns(base_path, download_config)
457 return _get_data_files_patterns(resolver)
458 except FileNotFoundError:
--> 459 raise EmptyDatasetError(f"The directory at {base_path} doesn't contain any data files") from None
460
461
EmptyDatasetError: The directory at hf://datasets/albertvillanova/tmp-private@79b9e4fe79670a9a050d6ebc385464891915a71d doesn't contain any data files
```
### Expected behavior
The dataset should load.
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-5.15.109+-x86_64-with-glibc2.35
- Python version: 3.10.12
- Huggingface_hub version: 0.16.4
- PyArrow version: 9.0.0
- Pandas version: 1.5.3
> We are planning to do a patch release today, after the merge of the fix:
>
> * [Fix authentication issues #6127](https://github.com/huggingface/datasets/pull/6127)
>
>
> In the meantime, the problem can be circumvented by passing `download_config` instead:
>
> ```python
> from datasets import DownloadConfig, load_dataset
>
> load_dataset("<DATASET-NAME>", split="train", download_config=DownloadConfig(token="<TOKEN>"))
> ```
This did not work for me (there was some other error with the split being an unexpected size 0). Downgrading to 2.13 fixed it.... | [
-0.2845437526702881,
0.2692788243293762,
0.007149573415517807,
0.2665907144546509,
-0.10046811401844025,
-0.15131212770938873,
0.7414763569831848,
0.44546371698379517,
0.05207190662622452,
0.13438205420970917,
-0.27614763379096985,
0.3271932899951935,
-0.0666486993432045,
0.08730252087116241,
-0.08271321654319763,
0.057688865810632706,
0.0989764928817749,
0.004633624106645584,
0.015685532242059708,
-0.1799987554550171,
-0.23695991933345795,
0.09173416346311569,
-0.4222349524497986,
-0.06108812615275383,
-0.048359766602516174,
0.0667991116642952,
-0.037994999438524246,
0.27254217863082886,
0.02362028881907463,
-0.244316965341568,
0.17272788286209106,
0.1973472535610199,
0.29006755352020264,
0.4758729636669159,
-0.00011340743367327377,
0.12023936212062836,
0.38616490364074707,
-0.0026372671127319336,
-0.4156370759010315,
-0.14814762771129608,
-0.3543234169483185,
-0.24434086680412292,
0.0645318329334259,
-0.2994106113910675,
0.025298938155174255,
-0.3630382716655731,
-0.2933838367462158,
-0.21186959743499756,
0.5325554013252258,
0.33624696731567383,
0.19474118947982788,
0.4816657602787018,
-0.09494853019714355,
-0.3599725365638733,
0.010293399915099144,
0.18322095274925232,
-0.07013905793428421,
-0.16961775720119476,
-0.08556883037090302,
0.01412065327167511,
-0.16758020222187042,
0.13124430179595947,
-0.2703803777694702,
0.0728313997387886,
0.26841291785240173,
-0.0862671434879303,
-0.20444947481155396,
-0.18129701912403107,
0.08632921427488327,
0.09059425443410873,
0.5652399063110352,
-0.11139295995235443,
-0.37199172377586365,
-0.3396744728088379,
-0.1141413152217865,
-0.2315060794353485,
0.19506683945655823,
0.0020715706050395966,
-0.16032879054546356,
0.26575785875320435,
-0.1759784072637558,
-0.004582636058330536,
-0.14868131279945374,
0.21459448337554932,
-0.29439228773117065,
0.42745938897132874,
0.0530766062438488,
-0.017085805535316467,
-0.24515873193740845,
-0.3446761667728424,
0.3123401999473572,
-0.36924344301223755,
0.02779204584658146,
0.11609573662281036,
-0.1253339946269989,
0.0046663954854011536,
0.08458814024925232,
0.03532276675105095,
0.2122286856174469,
0.42568373680114746,
-0.5480858683586121,
0.11698529124259949,
0.03831513598561287,
0.02986743487417698,
0.10932490229606628,
-0.031479813158512115,
0.17751774191856384,
0.493145227432251,
0.2521374523639679,
0.1586087942123413,
-0.0153827965259552,
0.027016732841730118,
-0.22777041792869568,
0.19825729727745056,
-0.024317454546689987,
-0.20011858642101288,
0.4383528530597687,
-0.14964470267295837,
-0.28817716240882874,
0.031724121421575546,
-0.17025989294052124,
0.0012445971369743347,
0.12449643015861511,
0.43234580755233765,
0.06046978011727333,
-0.0746048241853714,
-0.15180471539497375,
-0.0324898436665535,
-0.06714785844087601,
-0.4224548041820526,
-0.2572757303714752,
-0.4142446517944336,
0.13034279644489288,
0.1453564465045929,
0.3386017382144928,
0.30105164647102356,
0.1880253106355667,
0.17613430321216583,
-0.12665802240371704,
0.13723346590995789,
0.17489776015281677,
-0.08791317045688629,
0.014831330627202988,
0.37130677700042725,
0.07739921659231186,
0.16653022170066833,
0.1101921945810318,
-0.524702787399292,
0.07750429213047028,
0.21605828404426575,
-0.1693878322839737,
-0.2706519067287445,
0.011707890778779984,
0.1743885576725006,
-0.45691031217575073,
0.032041434198617935,
-0.4484345018863678,
0.1617152988910675,
0.013597846031188965,
-0.05286011844873428,
0.026437032967805862,
-0.2122350037097931,
-0.18154799938201904,
-0.1614294946193695,
0.4929291009902954,
0.8280561566352844,
-0.2983015179634094,
-0.17122770845890045,
-0.4232342839241028,
-0.09174196422100067,
0.15455262362957,
0.23528188467025757,
-0.2584000825881958,
0.24631890654563904,
-0.3159591853618622,
0.36456412076950073,
0.2966328263282776,
-0.2986393868923187,
-0.48248758912086487,
0.3479890525341034,
-0.1193859875202179,
0.38041189312934875,
-0.06716090440750122,
-0.12713943421840668,
0.8165304660797119,
-0.021444808691740036,
0.3981725871562958,
0.3055804371833801,
-0.024720782414078712,
-0.11758261919021606,
-0.19691070914268494,
-0.030084241181612015,
0.27666619420051575,
0.13844020664691925,
0.3247433006763458,
0.2704528272151947,
0.11533665657043457,
0.46044251322746277,
0.37768909335136414,
-0.03020261973142624,
0.02244703471660614,
-0.15262196958065033,
0.5215052962303162,
0.24215641617774963,
0.03827289864420891,
-0.0305524542927742,
-0.5126548409461975,
0.26927128434181213,
0.11622625589370728,
-0.048814352601766586,
-0.1047874391078949,
-0.22094687819480896,
-0.30304867029190063,
-0.04345057159662247,
-0.20835374295711517,
-0.16023686528205872,
0.13890968263149261,
0.24068865180015564,
-0.27151769399642944,
0.031509608030319214,
-0.09553255140781403,
0.5116479992866516,
-0.37386617064476013,
0.29621878266334534,
0.11121304333209991,
0.2752622961997986,
0.25341084599494934,
-0.18087367713451385,
-0.06269849836826324,
0.06624652445316315,
0.296430379152298,
0.0185626819729805,
-0.1344311237335205,
0.30144810676574707,
0.2958719730377197,
-0.20541110634803772,
-0.10979399085044861,
0.02940480411052704,
0.09342382848262787,
-0.10072316229343414,
0.053331635892391205,
0.27946147322654724,
0.13848525285720825,
-0.055180687457323074,
-0.12418058514595032,
0.3588772714138031,
0.24071872234344482,
0.05474952608346939,
-0.0496639683842659,
0.014429628849029541,
0.1496964693069458,
0.05693652480840683,
-0.15482866764068604,
-0.12722444534301758,
-0.12676112353801727,
-0.20859728753566742,
0.23893001675605774,
-0.012462902814149857,
-0.07199157029390335,
0.06845587491989136,
-0.06404683738946915,
-0.018499433994293213,
0.12695001065731049,
0.04165263473987579,
-0.23811250925064087,
0.08875782787799835,
0.40265101194381714,
0.48682865500450134,
0.5058358907699585,
0.22742557525634766,
0.04904123768210411,
0.010548043996095657,
0.005344025790691376,
-0.13266585767269135,
0.1862861067056656,
0.03689711168408394,
-0.2345586121082306,
-0.04461496323347092,
0.06012440472841263,
-0.002895282581448555,
-0.05384742096066475,
-0.28326696157455444,
0.1325158178806305,
0.22327864170074463,
-0.5339159965515137,
-0.08545684814453125,
-0.26175209879875183,
-0.15527349710464478,
0.14736950397491455,
-0.01942368596792221,
-0.0808832123875618,
-0.16458171606063843,
-0.19517895579338074,
0.3096106946468353,
0.0686672180891037,
0.1748289167881012,
-0.49517756700515747,
0.32736220955848694,
0.044862695038318634,
-0.3597956895828247,
-0.056895919144153595,
0.06273025274276733,
-0.2902003824710846,
0.07826332002878189,
0.3849770426750183,
0.08847305178642273,
0.20911382138729095,
-0.16552269458770752,
-0.08329303562641144,
-0.30197402834892273,
-0.4882733225822449,
-0.0849277600646019,
-0.18450449407100677,
0.4447186291217804,
-0.16504999995231628,
0.14468815922737122,
-0.02747713029384613,
-0.0247020460665226,
0.19434067606925964,
0.04897398501634598,
-0.20727679133415222,
-0.12667664885520935,
-0.06986989080905914,
0.010737400501966476,
-0.26522207260131836,
-0.37951985001564026,
-0.2829377353191376,
-0.26874101161956787,
0.18270395696163177,
-0.08254227042198181,
-0.0011730529367923737,
0.25109022855758667,
-0.017970435321331024,
0.16305899620056152,
0.05561062693595886,
-0.1392427235841751,
-0.03934558480978012,
-0.12059293687343597,
0.33410748839378357,
-0.3164423108100891,
-0.1701647788286209,
-0.01190359890460968,
0.0036448240280151367,
0.04560769721865654,
-0.01624598354101181,
-0.5137472152709961,
0.08906548470258713,
-0.27617311477661133,
0.5607284903526306,
-0.12029354274272919,
-0.38600024580955505,
0.10751691460609436,
0.07140834629535675,
0.0047736577689647675,
-0.3152489960193634,
-0.34518635272979736,
0.03948809206485748,
-0.4597577452659607,
0.06613625586032867,
-0.11825735867023468,
0.1557842642068863,
0.11728295683860779,
0.7086595296859741,
0.04662638157606125,
-0.0026469663716852665,
0.23332349956035614,
0.022633535787463188,
0.36119940876960754,
-0.10783322900533676,
-0.40313273668289185,
-0.05266907811164856,
0.24006997048854828,
-0.019883714616298676,
0.12307475507259369,
-0.05864962935447693,
-0.264652281999588,
-0.12413542717695236,
-0.34714895486831665,
-0.3437904119491577,
-0.24294975399971008,
-0.16573140025138855,
0.11741331219673157,
0.2104864865541458,
0.20693951845169067,
0.221048042178154,
-0.3099481463432312,
-0.2034260779619217,
-0.13360488414764404,
0.2514742612838745,
0.06613904237747192,
0.15604476630687714,
-0.25828713178634644,
0.2880263924598694,
-0.10274046659469604,
0.3630017638206482,
-0.036083780229091644,
0.5825210213661194,
-0.23618650436401367,
-0.05970263481140137,
-0.06222359463572502,
0.0919463112950325,
0.42601123452186584,
0.1749562919139862,
0.11313147097826004,
0.2863757610321045,
-0.08091872930526733,
-0.262525737285614,
-0.2012823224067688,
-0.19438014924526215,
-0.11453631520271301,
0.3750898838043213,
0.6615280508995056,
-0.1146693304181099,
-0.2504792809486389,
-0.05491601303219795,
0.04837402328848839,
-0.14531704783439636,
-0.18150681257247925,
-0.10522900521755219,
-0.13843536376953125,
-0.2226940542459488,
0.20868946611881256,
0.03976105898618698,
0.3909664750099182,
-0.3778473734855652,
-0.19659829139709473,
-0.1917109489440918,
-0.04336452856659889,
0.26457443833351135,
0.0927933007478714,
0.33177778124809265,
0.07683105766773224,
0.3402482271194458,
0.18283861875534058,
0.16814525425434113,
0.4696311950683594,
0.21140135824680328,
0.14270803332328796,
-0.3802623152732849,
-0.019428158178925514,
0.019506432116031647,
-0.016081511974334717,
0.3611188530921936,
-0.1707642525434494,
0.11699342727661133,
0.1413966566324234,
0.06970334053039551,
-0.03469866141676903,
0.35550886392593384,
0.00705476850271225,
-0.10761119425296783,
-0.1389244943857193,
-0.42165297269821167,
-0.007596217095851898,
0.11851155757904053,
-0.03161543607711792,
0.09883186221122742,
0.2193494439125061,
-0.3480055630207062,
0.15845201909542084,
-0.1770247220993042,
0.5610306859016418,
0.13698598742485046,
0.1385156810283661,
0.40359923243522644,
0.15127073228359222,
0.18752345442771912,
-0.22449946403503418,
-0.10990190505981445,
-0.12286721915006638,
-0.11786450445652008,
0.010603047907352448,
-0.05799046531319618,
0.21147620677947998,
-0.06216723471879959,
-0.038341641426086426,
0.3089026212692261,
-0.03812786936759949,
0.532660722732544,
0.21060186624526978,
0.04450216889381409,
-0.047532819211483,
0.04742543399333954,
-0.35256147384643555,
0.18948659300804138,
-0.01627231575548649,
0.07128424197435379,
-0.05706077441573143,
-0.2541767954826355,
-0.14516590535640717,
-0.1984197348356247,
-0.2958343029022217,
0.056392960250377655,
-0.057830728590488434,
0.12741437554359436,
0.0478852242231369,
-0.1940680295228958,
0.2210160195827484,
0.2556121349334717,
0.17058998346328735,
0.22467240691184998,
-0.34194156527519226,
0.07218623161315918,
-0.27801233530044556,
0.16817159950733185,
-0.012935524806380272,
0.025679457932710648,
0.21821478009223938,
-0.03209095448255539,
-0.3084633946418762,
0.17101654410362244,
-0.13710898160934448,
-0.2974109649658203,
-0.34367620944976807,
0.1521512120962143,
0.4781986474990845,
-0.41433829069137573,
0.12404188513755798,
-0.20632298290729523,
0.10111726820468903,
-0.22696423530578613,
0.15565645694732666,
-0.0568653829395771,
0.03962570056319237,
0.13231036067008972,
0.028415698558092117,
-0.31739354133605957,
-0.0640326738357544,
0.5458431839942932,
-0.17518742382526398,
-0.17909826338291168,
0.6487785577774048,
-0.03923935443162918,
0.004130765795707703,
-0.2304890751838684,
0.3483535945415497,
-0.011146066710352898,
-0.2275283932685852,
0.12147998809814453,
-0.04515484720468521,
0.2920098304748535,
-0.1343490481376648,
0.11424809694290161,
0.04098084196448326,
-0.16531430184841156,
0.07878291606903076,
-0.3160043954849243,
-0.17758764326572418,
0.2893836200237274,
-0.5369856953620911,
0.08496394753456116,
0.07973838597536087,
0.18999159336090088,
0.014432564377784729,
-0.3264477252960205,
-0.32711777091026306,
0.1957581639289856,
-0.1043592318892479,
0.10572194308042526,
0.09175797551870346,
0.0347546823322773,
0.010077513754367828,
-0.08502396941184998,
0.11011716723442078,
0.11345228552818298,
-0.1355544775724411,
-0.25023916363716125,
-0.19111746549606323,
0.12317709624767303,
0.0775594711303711,
-0.06167513504624367,
-0.055991917848587036,
-0.1522318422794342,
-0.053703423589468,
-0.09305956959724426,
0.36955389380455017,
0.14841574430465698,
0.018773779273033142,
0.15339170396327972,
0.300423264503479,
0.507394552230835,
-0.2402694821357727,
0.10777024924755096,
0.1497294306755066,
-0.056152574717998505,
-0.10809043049812317,
0.19118215143680573,
-0.15046261250972748,
0.039357371628284454,
-0.2094326913356781,
0.004434775561094284,
0.19653275609016418,
0.18865160644054413,
0.3339882493019104,
-0.38910603523254395,
0.07388314604759216,
0.0885208398103714,
-0.1270572394132614,
0.15106362104415894,
-0.17428220808506012,
-0.038719382137060165,
0.42163482308387756,
0.22241081297397614,
-0.09813587367534637,
0.02054847776889801,
0.18087947368621826,
0.3149508237838745,
-0.024270281195640564,
0.1088908314704895,
0.05636593699455261,
-0.3148227632045746,
-0.009957768023014069,
0.12965773046016693,
0.12420237809419632,
0.13639339804649353,
0.11386445164680481,
0.45975080132484436,
-0.1619085967540741,
0.13113579154014587,
0.0660303458571434,
-0.014071551151573658,
-0.08029252290725708,
0.8988839983940125,
-0.22436031699180603,
0.4074941575527191,
0.030397731810808182,
0.039091289043426514,
0.09726522862911224,
-0.6985108256340027,
-0.21427983045578003,
-0.05441521108150482,
-0.007361516356468201,
0.060829006135463715,
-0.2923765182495117,
0.04129385948181152,
0.02868098020553589,
-0.0874343067407608,
-0.10704222321510315,
-0.018980592489242554,
-0.25120750069618225,
-0.08251640200614929,
-0.12938956916332245,
-0.2040594220161438,
-0.14729413390159607,
-0.1571212112903595,
0.06340783834457397,
-0.28873497247695923,
-0.07393743842840195,
-0.04750536382198334,
-0.2672598659992218,
-0.4673945903778076,
-0.1540500372648239,
0.3910534083843231,
-0.09949997067451477,
-0.27229034900665283,
0.18082375824451447,
0.13996946811676025,
-0.17519401013851166,
0.2032659947872162,
0.036555126309394836,
0.3927079141139984,
0.33654487133026123,
0.11311185359954834,
-0.00881991907954216,
0.06839632987976074,
-0.08951470255851746,
-0.05382370948791504,
0.32571130990982056,
0.018409622833132744,
0.01881876215338707,
0.1188163012266159,
0.15775474905967712,
-0.14908279478549957,
0.013177745044231415,
0.06812439858913422,
0.147878035902977,
-0.4115777313709259,
0.6753382086753845,
-0.014006948098540306,
-0.035210058093070984,
-0.07902685552835464,
-0.013069555163383484,
-0.17682966589927673,
0.15439696609973907,
0.4685194492340088,
0.5160109996795654,
0.13145557045936584,
-0.06462574005126953,
0.05696434900164604,
-0.27369779348373413,
0.018211692571640015,
0.2814217507839203,
0.12152883410453796,
-0.27276408672332764,
-0.10952982306480408,
-0.5426763296127319,
0.21436794102191925,
-0.19485068321228027,
0.03525610268115997,
0.07518143951892853,
0.17126160860061646,
0.034354787319898605,
-0.0045303902588784695,
0.008310392498970032,
-0.18820546567440033,
0.139938086271286,
-0.00018130429089069366,
-0.35037705302238464,
0.15781879425048828,
-0.1407383680343628,
0.09081344306468964,
-0.05974877253174782,
-0.34398791193962097,
0.24760836362838745,
-0.46930354833602905,
0.05932067334651947,
0.09167651832103729,
-0.1657373011112213,
0.3439353108406067,
0.04435603320598602,
0.44294169545173645,
-0.06856614351272583,
0.5454875230789185,
0.18930351734161377,
-0.006011530756950378,
-0.48485514521598816,
-0.11298957467079163,
-0.06665646284818649,
-0.019816331565380096,
-0.0484277568757534,
0.4261566996574402,
-0.11922357231378555,
0.09364233165979385,
-0.10235899686813354,
0.5386843085289001,
0.0681702196598053,
-0.30353426933288574,
-0.014957446604967117,
0.27618956565856934,
-0.2686639726161957,
0.09203465282917023,
-0.22059455513954163,
0.1756274700164795,
-0.13644734025001526,
0.2609393894672394,
-0.28115302324295044,
-0.44798147678375244,
0.6067176461219788,
-0.9213750958442688,
-0.274496853351593,
-0.3013049364089966,
0.33413374423980713,
0.2956402599811554,
-0.33133310079574585,
-0.31565582752227783,
0.037909135222435,
0.4488331377506256,
-0.22370590269565582,
-0.1739804446697235,
0.07295959442853928,
0.05988955870270729,
0.2671825587749481,
-0.0992252305150032,
0.1554233580827713,
-0.21189753711223602,
-0.13566854596138,
0.2832014262676239,
-0.2477751523256302
] |
https://github.com/huggingface/datasets/issues/6124 | i once had the same error and I could fix that by pushing a fake or a dummy commit on my hugging face dataset repo | Datasets crashing runs due to KeyError | ### Describe the bug
Hi all,
I have been running into a pretty persistent issue recently when trying to load datasets.
```python
train_dataset = load_dataset(
'llama-2-7b-tokenized',
split = 'train'
)
```
I receive a KeyError which crashes the runs.
```
Traceback (most recent call last):
main()
train_dataset = load_dataset(
^^^^^^^^^^^^^
builder_instance = load_dataset_builder(
^^^^^^^^^^^^^^^^^^^^^
dataset_module = dataset_module_factory(
^^^^^^^^^^^^^^^^^^^^^^^
raise e1 from None
).get_module()
^^^^^^^^^^^^
else get_data_patterns(base_path, download_config=self.download_config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return _get_data_files_patterns(resolver)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
data_files = pattern_resolver(pattern)
^^^^^^^^^^^^^^^^^^^^^^^^^
fs, _, _ = get_fs_token_paths(pattern, storage_options=storage_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
paths = [f for f in sorted(fs.glob(paths)) if not fs.isdir(f)]
^^^^^^^^^^^^^^
allpaths = self.find(root, maxdepth=depth, withdirs=True, detail=True, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
for _, dirs, files in self.walk(path, maxdepth, detail=True, **kwargs):
listing = self.ls(path, detail=True, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"last_modified": parse_datetime(tree_item["lastCommit"]["date"]),
~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'lastCommit'
```
Any help would be greatly appreciated.
Thank you,
Enrico
### Steps to reproduce the bug
Load the dataset from the Huggingface hub.
```python
train_dataset = load_dataset(
'llama-2-7b-tokenized',
split = 'train'
)
```
### Expected behavior
Loads the dataset.
### Environment info
datasets-2.14.3
CUDA 11.8
Python 3.11 | 25 | Datasets crashing runs due to KeyError
### Describe the bug
Hi all,
I have been running into a pretty persistent issue recently when trying to load datasets.
```python
train_dataset = load_dataset(
'llama-2-7b-tokenized',
split = 'train'
)
```
I receive a KeyError which crashes the runs.
```
Traceback (most recent call last):
main()
train_dataset = load_dataset(
^^^^^^^^^^^^^
builder_instance = load_dataset_builder(
^^^^^^^^^^^^^^^^^^^^^
dataset_module = dataset_module_factory(
^^^^^^^^^^^^^^^^^^^^^^^
raise e1 from None
).get_module()
^^^^^^^^^^^^
else get_data_patterns(base_path, download_config=self.download_config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return _get_data_files_patterns(resolver)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
data_files = pattern_resolver(pattern)
^^^^^^^^^^^^^^^^^^^^^^^^^
fs, _, _ = get_fs_token_paths(pattern, storage_options=storage_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
paths = [f for f in sorted(fs.glob(paths)) if not fs.isdir(f)]
^^^^^^^^^^^^^^
allpaths = self.find(root, maxdepth=depth, withdirs=True, detail=True, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
for _, dirs, files in self.walk(path, maxdepth, detail=True, **kwargs):
listing = self.ls(path, detail=True, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"last_modified": parse_datetime(tree_item["lastCommit"]["date"]),
~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'lastCommit'
```
Any help would be greatly appreciated.
Thank you,
Enrico
### Steps to reproduce the bug
Load the dataset from the Huggingface hub.
```python
train_dataset = load_dataset(
'llama-2-7b-tokenized',
split = 'train'
)
```
### Expected behavior
Loads the dataset.
### Environment info
datasets-2.14.3
CUDA 11.8
Python 3.11
i once had the same error and I could fix that by pushing a fake or a dummy commit on my hugging face dataset repo | [
-0.42707476019859314,
0.023738786578178406,
0.022228755056858063,
0.4859738051891327,
0.30645328760147095,
0.0008221939206123352,
0.21553976833820343,
0.35969728231430054,
0.11036781966686249,
0.11428549140691757,
-0.09585358202457428,
0.2865358591079712,
-0.5202809572219849,
0.11676494777202606,
-0.0821552723646164,
-0.1831982433795929,
0.2587061822414398,
-0.08482568711042404,
-0.009821034967899323,
0.2759476602077484,
-0.3752565383911133,
0.14289608597755432,
-0.2992304265499115,
0.3856133222579956,
-0.3659202456474304,
0.01628289185464382,
-0.12070383131504059,
0.3122744560241699,
-0.08844556659460068,
-0.5742260217666626,
0.2582567632198334,
-0.21703198552131653,
0.3512708246707916,
0.7258263230323792,
-0.00010778708383440971,
0.0744071900844574,
0.29728201031684875,
0.07194454222917557,
-0.4508287012577057,
0.0042586177587509155,
-0.0330754779279232,
0.025367923080921173,
0.008905228227376938,
0.041181936860084534,
0.3142654001712799,
-0.1591518074274063,
-0.04748483747243881,
-0.26435190439224243,
0.4190462529659271,
0.33266153931617737,
0.24679285287857056,
0.3559716045856476,
0.11014184355735779,
-0.08194898813962936,
0.2926027774810791,
-0.2497287392616272,
0.0014320611953735352,
0.21234866976737976,
0.11898387968540192,
-0.3914499878883362,
-0.09810957312583923,
0.0963214561343193,
-0.3707219362258911,
-0.39105385541915894,
0.1513330340385437,
-0.19409921765327454,
-0.10256250202655792,
-0.3402501344680786,
0.06001593545079231,
0.22836728394031525,
0.18002980947494507,
-0.3865939974784851,
-0.2587990462779999,
-0.42574596405029297,
-0.07476475834846497,
-0.11273117363452911,
0.2843566834926605,
0.13999617099761963,
-0.12092249095439911,
0.21219582855701447,
0.2502463757991791,
-0.00020983442664146423,
-0.010611385107040405,
0.04610713571310043,
-0.12132266163825989,
0.4295060634613037,
0.11861768364906311,
0.17091383039951324,
0.24242211878299713,
-0.21403419971466064,
0.08738483488559723,
-0.18812692165374756,
-0.2228800654411316,
0.08152870833873749,
-0.46995943784713745,
0.12704552710056305,
-0.11475798487663269,
-0.03534319996833801,
0.2103884071111679,
-0.2565107047557831,
-0.05740155279636383,
0.16383683681488037,
-0.08373130857944489,
0.13623055815696716,
0.26883435249328613,
0.17144937813282013,
0.10517565906047821,
0.4175080955028534,
0.3696298897266388,
0.11064700037240982,
-0.21765686571598053,
0.07246585190296173,
-0.013321224600076675,
-0.15063926577568054,
0.014805637300014496,
0.22338131070137024,
0.07909972965717316,
0.0012384578585624695,
-0.22377300262451172,
0.20517206192016602,
-0.5834248661994934,
-0.11251980811357498,
0.20353764295578003,
0.4744129776954651,
-0.02193581871688366,
0.1989515721797943,
0.0013306811451911926,
0.14465056359767914,
-0.2029612809419632,
-0.2686884105205536,
-0.28055867552757263,
0.04479695484042168,
-0.15770260989665985,
0.17085745930671692,
0.14204499125480652,
-0.22479824721813202,
0.2258131504058838,
-0.05281488597393036,
0.0097039258107543,
-0.13913558423519135,
0.03474994748830795,
-0.012100521475076675,
-0.4365098476409912,
0.2576104402542114,
-0.22150081396102905,
0.18465499579906464,
0.24419282376766205,
-0.2656557261943817,
0.01294216513633728,
0.2182428538799286,
-0.1012861505150795,
-0.23547518253326416,
0.230588898062706,
0.22530385851860046,
-0.11003454029560089,
-0.050864558666944504,
-0.3673360049724579,
0.11826444417238235,
0.2496488392353058,
0.015403419733047485,
-0.08157825469970703,
-0.33701440691947937,
0.038915544748306274,
-0.3264094591140747,
-0.03447314724326134,
0.3828943073749542,
-0.3289088010787964,
-0.052491746842861176,
-0.1389826387166977,
-0.17200013995170593,
-0.047293733805418015,
0.14028842747211456,
-0.3109462857246399,
0.4556069076061249,
-0.3732549548149109,
0.3195402920246124,
0.14909085631370544,
-0.26024314761161804,
-0.3864023983478546,
0.0743444412946701,
-0.02558230608701706,
0.11732500046491623,
-0.05528886243700981,
0.018474522978067398,
-0.051637012511491776,
-0.11301809549331665,
0.20378223061561584,
0.21121886372566223,
-0.08458680659532547,
-0.051740601658821106,
-0.07719692587852478,
-0.14965039491653442,
-0.03696726635098457,
0.18489252030849457,
0.4227626323699951,
-0.18357576429843903,
-0.053213637322187424,
0.04831977188587189,
0.1541459858417511,
-0.15597635507583618,
-0.21549944579601288,
0.1601945161819458,
0.271412193775177,
-0.030375748872756958,
0.1354776918888092,
-0.16064044833183289,
-0.4946630895137787,
0.4387160539627075,
-0.0953129231929779,
-0.0475296676158905,
-0.3489287495613098,
-0.08413773030042648,
-0.20942986011505127,
0.4288804531097412,
-0.21768751740455627,
-0.1845736801624298,
0.14870084822177887,
-0.16055819392204285,
-0.08317729085683823,
0.2851247191429138,
-0.3161592483520508,
0.23396369814872742,
-0.16656632721424103,
0.28436779975891113,
-0.2144715040922165,
0.25156378746032715,
-0.1706230789422989,
-0.23731064796447754,
0.07652638852596283,
-0.003495166078209877,
0.22015602886676788,
-0.02361389808356762,
-0.06436608731746674,
0.4597488045692444,
0.1866815984249115,
-0.025122568011283875,
-0.31137651205062866,
0.07991580665111542,
0.1313229352235794,
0.09431156516075134,
0.18498842418193817,
0.1659012883901596,
0.059100206941366196,
-0.19777141511440277,
0.1598697155714035,
0.3206261396408081,
-0.04136907681822777,
0.1875944435596466,
0.03214677423238754,
0.029994763433933258,
0.07766781002283096,
-0.05758708715438843,
0.014312207698822021,
0.008204199373722076,
0.16583530604839325,
-0.17115293443202972,
-0.005198419094085693,
-0.11659898608922958,
-0.16346649825572968,
-0.0740039199590683,
0.47251996397972107,
-0.005251482129096985,
0.24364636838436127,
0.02898159995675087,
-0.3056827783584595,
0.17315730452537537,
0.04753948003053665,
0.4570123255252838,
0.41297417879104614,
0.09927449375391006,
-0.017982877790927887,
0.17301177978515625,
0.014340732246637344,
-0.1530425250530243,
0.192536860704422,
0.1691923588514328,
0.08420799672603607,
0.2540402412414551,
0.01378188282251358,
-0.051237598061561584,
-0.2809138298034668,
-0.17582589387893677,
-0.05213170498609543,
0.4013002812862396,
-0.3456524610519409,
0.28507816791534424,
-0.3515448272228241,
-0.25962066650390625,
-0.14094628393650055,
0.06017329543828964,
-0.24364739656448364,
-0.5724019408226013,
-0.11107175052165985,
0.20066964626312256,
-0.2171984314918518,
0.22269415855407715,
-0.05259830877184868,
0.04616272449493408,
0.08318646252155304,
0.0351666659116745,
0.08859796822071075,
-0.1854124367237091,
-0.421764075756073,
0.004588071256875992,
0.703942596912384,
-0.28533095121383667,
0.13791722059249878,
0.05217228829860687,
-0.10074383020401001,
-0.07161978632211685,
-0.24646875262260437,
0.03104068711400032,
-0.26333656907081604,
0.1140303984284401,
0.2701537609100342,
0.22070495784282684,
-0.1247829720377922,
-0.4931541085243225,
0.23354680836200714,
0.06276824325323105,
-0.14149808883666992,
0.15539826452732086,
0.3257589042186737,
0.13826517760753632,
-0.0321471206843853,
-0.2257927507162094,
-0.16355250775814056,
-0.279489129781723,
-0.05056382715702057,
-0.15432199835777283,
0.08665589988231659,
0.17819450795650482,
0.3296273648738861,
0.13140659034252167,
-0.15013420581817627,
-0.34188857674598694,
-0.022200729697942734,
-0.0028348490595817566,
0.11715179681777954,
-0.1419067233800888,
-0.1912265121936798,
-0.01679512858390808,
-0.15977390110492706,
0.10078512132167816,
-0.2977178394794464,
-0.7480368614196777,
0.04224233329296112,
-0.2447790503501892,
0.2559606432914734,
-0.03307580575346947,
0.04896138608455658,
-0.16396550834178925,
0.21840213239192963,
0.002098720520734787,
0.009695395827293396,
-0.07501214742660522,
-0.013009931892156601,
-0.21302741765975952,
0.3528372645378113,
0.011950520798563957,
0.46700865030288696,
0.11054471135139465,
0.5798467397689819,
-0.11252093315124512,
-0.051256172358989716,
0.269713431596756,
0.1578381210565567,
0.16185683012008667,
-0.2310597002506256,
-0.35910841822624207,
-0.15900447964668274,
-0.10709404945373535,
-0.13808485865592957,
0.1258116513490677,
-0.01644216477870941,
-0.13046397268772125,
-0.0874377191066742,
-0.19135677814483643,
0.11934240162372589,
-0.21151763200759888,
0.17470800876617432,
-0.0884617418050766,
-0.11350494623184204,
-0.11137698590755463,
0.14462251961231232,
-0.0785670131444931,
0.009385675191879272,
0.15512382984161377,
-0.04905761778354645,
-0.010532621294260025,
-0.3051636815071106,
-0.3779470920562744,
0.04466941952705383,
-0.32278165221214294,
0.2705495357513428,
-0.09128616750240326,
0.36483505368232727,
0.040113285183906555,
-0.07779502123594284,
-0.08652645349502563,
-0.035053811967372894,
0.6078673005104065,
0.0453384593129158,
-0.016390638425946236,
0.18551692366600037,
-0.06419406831264496,
-0.3200216293334961,
-0.2568816542625427,
-0.16623914241790771,
0.2193959653377533,
0.24906118214130402,
0.5175326466560364,
-0.31462231278419495,
-0.08809832483530045,
0.03389209508895874,
0.3671298921108246,
-0.25569948554039,
-0.28140804171562195,
-0.1907690167427063,
-0.12781770527362823,
-0.2502499222755432,
0.2697964012622833,
0.1088467463850975,
0.20313599705696106,
-0.13371403515338898,
-0.10875400900840759,
-0.10892235487699509,
-0.35275769233703613,
0.23407098650932312,
0.14290861785411835,
0.014329377561807632,
-0.01268453523516655,
0.31144416332244873,
-0.08649194985628128,
-0.06382954120635986,
0.23190635442733765,
0.5363825559616089,
-0.3034793436527252,
-0.32567599415779114,
-0.1191963404417038,
0.13513417541980743,
0.2992806136608124,
0.2735697627067566,
-0.261308878660202,
0.18363508582115173,
0.034136008471250534,
-0.0903707891702652,
-0.03389284387230873,
-0.013618167489767075,
0.26212432980537415,
0.17645613849163055,
-0.5402937531471252,
-0.31938090920448303,
0.37323856353759766,
0.1588355302810669,
-0.09564787149429321,
0.16530852019786835,
0.010416984558105469,
-0.30372658371925354,
0.5918175578117371,
0.11510812491178513,
0.803276538848877,
-0.3008520305156708,
0.22453175485134125,
0.4237912893295288,
0.38358622789382935,
0.45790672302246094,
-0.15012454986572266,
-0.004076192155480385,
-0.5529822707176208,
-0.20497307181358337,
0.0020761638879776,
-0.19148659706115723,
0.18131513893604279,
-0.1121874451637268,
-0.14363011717796326,
0.1795659363269806,
-0.4170820713043213,
0.23384112119674683,
-0.10707622021436691,
0.23683522641658783,
-0.2632588744163513,
-0.1094667837023735,
-0.5293250679969788,
0.17562749981880188,
-0.058551959693431854,
-0.07743297517299652,
-0.15694677829742432,
-0.09791599959135056,
0.019600719213485718,
-0.3092416226863861,
-0.39495131373405457,
0.029791295528411865,
-0.25001227855682373,
0.11328436434268951,
0.020608827471733093,
-0.07739964127540588,
0.0958259329199791,
0.5452219843864441,
0.22360646724700928,
0.13985313475131989,
0.09890594333410263,
0.13302338123321533,
-0.2303423136472702,
-0.12396213412284851,
-0.02221503295004368,
0.03491317853331566,
0.15161849558353424,
0.020601235330104828,
-0.24618473649024963,
0.18769830465316772,
0.10410657525062561,
-0.29184579849243164,
0.029098138213157654,
0.135121688246727,
0.015560482628643513,
-0.41373211145401,
-0.22677193582057953,
-0.2134818434715271,
0.151007741689682,
-0.21329477429389954,
0.13798820972442627,
0.21644261479377747,
-0.020916730165481567,
0.2371865212917328,
0.14678293466567993,
-0.17697633802890778,
-0.07827401906251907,
0.4070196747779846,
-0.058263227343559265,
0.01598704606294632,
0.7515345215797424,
0.6398617029190063,
-0.1245405301451683,
-0.3088960349559784,
0.25522738695144653,
0.3470575213432312,
-0.18799267709255219,
0.1934090256690979,
-0.15607649087905884,
-0.0601947158575058,
0.10024113953113556,
0.3280290365219116,
0.2934340238571167,
-0.03353074565529823,
-0.040191881358623505,
-0.5118392705917358,
-0.36713188886642456,
0.3505438268184662,
-0.07412981986999512,
0.1860986202955246,
-0.22559785842895508,
-0.22190174460411072,
-0.35542112588882446,
0.19041666388511658,
-0.2964797019958496,
0.15056046843528748,
-0.3613344728946686,
-0.013410653918981552,
0.1972876489162445,
0.12952877581119537,
0.2392226904630661,
0.1475379765033722,
0.14386071264743805,
0.17143622040748596,
-0.03518955409526825,
-0.24899114668369293,
-0.16835439205169678,
0.0916120857000351,
0.014589011669158936,
0.08556770533323288,
-0.011595562100410461,
-0.412996381521225,
0.18934333324432373,
-0.09067495167255402,
0.19798675179481506,
0.3382595181465149,
-0.14379248023033142,
0.25753310322761536,
0.27094030380249023,
0.3091321289539337,
0.1130010336637497,
0.3450332283973694,
-0.315295934677124,
0.20305591821670532,
0.24104146659374237,
0.18760940432548523,
0.09614565968513489,
-0.05323314666748047,
-0.16836369037628174,
-0.08337997645139694,
-0.318864643573761,
0.12927253544330597,
0.31374791264533997,
-0.4271368980407715,
-0.0958770215511322,
0.08907850086688995,
0.10017986595630646,
0.542427122592926,
-0.40196603536605835,
-0.07373721897602081,
0.45831453800201416,
0.20904964208602905,
-0.1180562749505043,
-0.2962983548641205,
0.3270525336265564,
-0.04949980974197388,
-0.2528999149799347,
0.35362523794174194,
-0.02666325867176056,
-0.2713947892189026,
-0.19288457930088043,
0.194559708237648,
0.33912423253059387,
0.4652552306652069,
0.10011617094278336,
0.5537570714950562,
-0.2332507222890854,
-0.1800144463777542,
0.2515196204185486,
-0.025470273569226265,
0.2725743353366852,
0.2227729707956314,
-0.4685109853744507,
0.04698174446821213,
0.041030753403902054,
0.03444233909249306,
0.30811649560928345,
-0.4735734164714813,
0.3034434914588928,
0.3587430715560913,
-0.05766611546278,
-0.21548685431480408,
0.008546784520149231,
0.3558684289455414,
0.060260917991399765,
0.0012029185891151428,
-0.16473685204982758,
0.24536152184009552,
-0.195283442735672,
0.004876773804426193,
-0.0440760962665081,
-0.1965109407901764,
-0.05635163187980652,
0.03411141037940979,
-0.023369772359728813,
-0.21713486313819885,
0.0652981773018837,
0.16963599622249603,
-0.17228956520557404,
-0.2207922786474228,
-0.011844895780086517,
0.18529585003852844,
-0.008922755718231201,
-0.22830387949943542,
-0.06519300490617752,
0.3388657867908478,
0.20705068111419678,
0.06138819083571434,
0.06584633886814117,
0.3838295638561249,
0.3625398576259613,
-0.3930125832557678,
0.2586612403392792,
-0.1352144330739975,
0.08768626302480698,
0.047300372272729874,
0.29331597685813904,
-0.014923647046089172,
0.2597935199737549,
0.409945011138916,
0.12878382205963135,
-0.1841488927602768,
-0.2022673487663269,
0.28653016686439514,
0.18625381588935852,
-0.07272004336118698,
0.05058473348617554,
-0.1249636709690094,
0.09137746691703796,
-0.15161734819412231,
0.17001888155937195,
-0.3826930522918701,
-0.12419843673706055,
0.4378187954425812,
-0.04496831074357033,
0.1976901888847351,
-0.12962231040000916,
0.07993774116039276,
-0.029271265491843224,
0.6063300967216492,
0.4886808395385742,
0.3700910210609436,
-0.4185542166233063,
0.1090223491191864,
-0.4707636833190918,
0.1318569779396057,
-0.3399411141872406,
0.1000346913933754,
0.013757705688476562,
-0.22939415276050568,
0.022688627243041992,
0.28569266200065613,
0.09390406310558319,
0.0017531290650367737,
-0.0985233411192894,
0.425285667181015,
-0.33426082134246826,
-0.2762293219566345,
0.2710147202014923,
-0.021075734868645668,
-0.08009070158004761,
-0.19425153732299805,
0.2401561290025711,
-0.3664935231208801,
0.04391933232545853,
-0.039196573197841644,
-0.21189573407173157,
0.020259983837604523,
-0.1291724145412445,
0.4378739297389984,
0.1872028410434723,
0.4227040410041809,
0.2123417854309082,
-0.1855921745300293,
-0.22884945571422577,
-0.29481711983680725,
0.01272226870059967,
-0.03728600591421127,
-0.014175981283187866,
0.495428204536438,
-0.2799762487411499,
0.009539775550365448,
-0.30488520860671997,
0.396695077419281,
0.06581006944179535,
-0.1375439465045929,
-0.31999969482421875,
0.1432713121175766,
0.06726516783237457,
-0.043537676334381104,
0.08731237053871155,
0.3415440618991852,
-0.04335809499025345,
0.31703999638557434,
-0.1256978064775467,
-0.15048229694366455,
0.4363164007663727,
-0.6287791728973389,
-0.24552376568317413,
0.0040539465844631195,
0.04991031438112259,
0.1430416703224182,
-0.04084964096546173,
-0.5292084813117981,
-0.019964098930358887,
0.2950016260147095,
-0.06387746334075928,
-0.23206350207328796,
0.02746504917740822,
0.1646777093410492,
0.05752702057361603,
-0.06600692868232727,
-0.08988693356513977,
-0.0659877359867096,
-0.14181819558143616,
0.2631465196609497,
-0.14197276532649994
] |
https://github.com/huggingface/datasets/issues/6124 | Hi! We need a reproducer to fix this. Can you provide a link to the dataset (if it's public)? | Datasets crashing runs due to KeyError | ### Describe the bug
Hi all,
I have been running into a pretty persistent issue recently when trying to load datasets.
```python
train_dataset = load_dataset(
'llama-2-7b-tokenized',
split = 'train'
)
```
I receive a KeyError which crashes the runs.
```
Traceback (most recent call last):
main()
train_dataset = load_dataset(
^^^^^^^^^^^^^
builder_instance = load_dataset_builder(
^^^^^^^^^^^^^^^^^^^^^
dataset_module = dataset_module_factory(
^^^^^^^^^^^^^^^^^^^^^^^
raise e1 from None
).get_module()
^^^^^^^^^^^^
else get_data_patterns(base_path, download_config=self.download_config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return _get_data_files_patterns(resolver)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
data_files = pattern_resolver(pattern)
^^^^^^^^^^^^^^^^^^^^^^^^^
fs, _, _ = get_fs_token_paths(pattern, storage_options=storage_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
paths = [f for f in sorted(fs.glob(paths)) if not fs.isdir(f)]
^^^^^^^^^^^^^^
allpaths = self.find(root, maxdepth=depth, withdirs=True, detail=True, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
for _, dirs, files in self.walk(path, maxdepth, detail=True, **kwargs):
listing = self.ls(path, detail=True, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"last_modified": parse_datetime(tree_item["lastCommit"]["date"]),
~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'lastCommit'
```
Any help would be greatly appreciated.
Thank you,
Enrico
### Steps to reproduce the bug
Load the dataset from the Huggingface hub.
```python
train_dataset = load_dataset(
'llama-2-7b-tokenized',
split = 'train'
)
```
### Expected behavior
Loads the dataset.
### Environment info
datasets-2.14.3
CUDA 11.8
Python 3.11 | 19 | Datasets crashing runs due to KeyError
### Describe the bug
Hi all,
I have been running into a pretty persistent issue recently when trying to load datasets.
```python
train_dataset = load_dataset(
'llama-2-7b-tokenized',
split = 'train'
)
```
I receive a KeyError which crashes the runs.
```
Traceback (most recent call last):
main()
train_dataset = load_dataset(
^^^^^^^^^^^^^
builder_instance = load_dataset_builder(
^^^^^^^^^^^^^^^^^^^^^
dataset_module = dataset_module_factory(
^^^^^^^^^^^^^^^^^^^^^^^
raise e1 from None
).get_module()
^^^^^^^^^^^^
else get_data_patterns(base_path, download_config=self.download_config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return _get_data_files_patterns(resolver)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
data_files = pattern_resolver(pattern)
^^^^^^^^^^^^^^^^^^^^^^^^^
fs, _, _ = get_fs_token_paths(pattern, storage_options=storage_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
paths = [f for f in sorted(fs.glob(paths)) if not fs.isdir(f)]
^^^^^^^^^^^^^^
allpaths = self.find(root, maxdepth=depth, withdirs=True, detail=True, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
for _, dirs, files in self.walk(path, maxdepth, detail=True, **kwargs):
listing = self.ls(path, detail=True, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"last_modified": parse_datetime(tree_item["lastCommit"]["date"]),
~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'lastCommit'
```
Any help would be greatly appreciated.
Thank you,
Enrico
### Steps to reproduce the bug
Load the dataset from the Huggingface hub.
```python
train_dataset = load_dataset(
'llama-2-7b-tokenized',
split = 'train'
)
```
### Expected behavior
Loads the dataset.
### Environment info
datasets-2.14.3
CUDA 11.8
Python 3.11
Hi! We need a reproducer to fix this. Can you provide a link to the dataset (if it's public)? | [
-0.42707476019859314,
0.023738786578178406,
0.022228755056858063,
0.4859738051891327,
0.30645328760147095,
0.0008221939206123352,
0.21553976833820343,
0.35969728231430054,
0.11036781966686249,
0.11428549140691757,
-0.09585358202457428,
0.2865358591079712,
-0.5202809572219849,
0.11676494777202606,
-0.0821552723646164,
-0.1831982433795929,
0.2587061822414398,
-0.08482568711042404,
-0.009821034967899323,
0.2759476602077484,
-0.3752565383911133,
0.14289608597755432,
-0.2992304265499115,
0.3856133222579956,
-0.3659202456474304,
0.01628289185464382,
-0.12070383131504059,
0.3122744560241699,
-0.08844556659460068,
-0.5742260217666626,
0.2582567632198334,
-0.21703198552131653,
0.3512708246707916,
0.7258263230323792,
-0.00010778708383440971,
0.0744071900844574,
0.29728201031684875,
0.07194454222917557,
-0.4508287012577057,
0.0042586177587509155,
-0.0330754779279232,
0.025367923080921173,
0.008905228227376938,
0.041181936860084534,
0.3142654001712799,
-0.1591518074274063,
-0.04748483747243881,
-0.26435190439224243,
0.4190462529659271,
0.33266153931617737,
0.24679285287857056,
0.3559716045856476,
0.11014184355735779,
-0.08194898813962936,
0.2926027774810791,
-0.2497287392616272,
0.0014320611953735352,
0.21234866976737976,
0.11898387968540192,
-0.3914499878883362,
-0.09810957312583923,
0.0963214561343193,
-0.3707219362258911,
-0.39105385541915894,
0.1513330340385437,
-0.19409921765327454,
-0.10256250202655792,
-0.3402501344680786,
0.06001593545079231,
0.22836728394031525,
0.18002980947494507,
-0.3865939974784851,
-0.2587990462779999,
-0.42574596405029297,
-0.07476475834846497,
-0.11273117363452911,
0.2843566834926605,
0.13999617099761963,
-0.12092249095439911,
0.21219582855701447,
0.2502463757991791,
-0.00020983442664146423,
-0.010611385107040405,
0.04610713571310043,
-0.12132266163825989,
0.4295060634613037,
0.11861768364906311,
0.17091383039951324,
0.24242211878299713,
-0.21403419971466064,
0.08738483488559723,
-0.18812692165374756,
-0.2228800654411316,
0.08152870833873749,
-0.46995943784713745,
0.12704552710056305,
-0.11475798487663269,
-0.03534319996833801,
0.2103884071111679,
-0.2565107047557831,
-0.05740155279636383,
0.16383683681488037,
-0.08373130857944489,
0.13623055815696716,
0.26883435249328613,
0.17144937813282013,
0.10517565906047821,
0.4175080955028534,
0.3696298897266388,
0.11064700037240982,
-0.21765686571598053,
0.07246585190296173,
-0.013321224600076675,
-0.15063926577568054,
0.014805637300014496,
0.22338131070137024,
0.07909972965717316,
0.0012384578585624695,
-0.22377300262451172,
0.20517206192016602,
-0.5834248661994934,
-0.11251980811357498,
0.20353764295578003,
0.4744129776954651,
-0.02193581871688366,
0.1989515721797943,
0.0013306811451911926,
0.14465056359767914,
-0.2029612809419632,
-0.2686884105205536,
-0.28055867552757263,
0.04479695484042168,
-0.15770260989665985,
0.17085745930671692,
0.14204499125480652,
-0.22479824721813202,
0.2258131504058838,
-0.05281488597393036,
0.0097039258107543,
-0.13913558423519135,
0.03474994748830795,
-0.012100521475076675,
-0.4365098476409912,
0.2576104402542114,
-0.22150081396102905,
0.18465499579906464,
0.24419282376766205,
-0.2656557261943817,
0.01294216513633728,
0.2182428538799286,
-0.1012861505150795,
-0.23547518253326416,
0.230588898062706,
0.22530385851860046,
-0.11003454029560089,
-0.050864558666944504,
-0.3673360049724579,
0.11826444417238235,
0.2496488392353058,
0.015403419733047485,
-0.08157825469970703,
-0.33701440691947937,
0.038915544748306274,
-0.3264094591140747,
-0.03447314724326134,
0.3828943073749542,
-0.3289088010787964,
-0.052491746842861176,
-0.1389826387166977,
-0.17200013995170593,
-0.047293733805418015,
0.14028842747211456,
-0.3109462857246399,
0.4556069076061249,
-0.3732549548149109,
0.3195402920246124,
0.14909085631370544,
-0.26024314761161804,
-0.3864023983478546,
0.0743444412946701,
-0.02558230608701706,
0.11732500046491623,
-0.05528886243700981,
0.018474522978067398,
-0.051637012511491776,
-0.11301809549331665,
0.20378223061561584,
0.21121886372566223,
-0.08458680659532547,
-0.051740601658821106,
-0.07719692587852478,
-0.14965039491653442,
-0.03696726635098457,
0.18489252030849457,
0.4227626323699951,
-0.18357576429843903,
-0.053213637322187424,
0.04831977188587189,
0.1541459858417511,
-0.15597635507583618,
-0.21549944579601288,
0.1601945161819458,
0.271412193775177,
-0.030375748872756958,
0.1354776918888092,
-0.16064044833183289,
-0.4946630895137787,
0.4387160539627075,
-0.0953129231929779,
-0.0475296676158905,
-0.3489287495613098,
-0.08413773030042648,
-0.20942986011505127,
0.4288804531097412,
-0.21768751740455627,
-0.1845736801624298,
0.14870084822177887,
-0.16055819392204285,
-0.08317729085683823,
0.2851247191429138,
-0.3161592483520508,
0.23396369814872742,
-0.16656632721424103,
0.28436779975891113,
-0.2144715040922165,
0.25156378746032715,
-0.1706230789422989,
-0.23731064796447754,
0.07652638852596283,
-0.003495166078209877,
0.22015602886676788,
-0.02361389808356762,
-0.06436608731746674,
0.4597488045692444,
0.1866815984249115,
-0.025122568011283875,
-0.31137651205062866,
0.07991580665111542,
0.1313229352235794,
0.09431156516075134,
0.18498842418193817,
0.1659012883901596,
0.059100206941366196,
-0.19777141511440277,
0.1598697155714035,
0.3206261396408081,
-0.04136907681822777,
0.1875944435596466,
0.03214677423238754,
0.029994763433933258,
0.07766781002283096,
-0.05758708715438843,
0.014312207698822021,
0.008204199373722076,
0.16583530604839325,
-0.17115293443202972,
-0.005198419094085693,
-0.11659898608922958,
-0.16346649825572968,
-0.0740039199590683,
0.47251996397972107,
-0.005251482129096985,
0.24364636838436127,
0.02898159995675087,
-0.3056827783584595,
0.17315730452537537,
0.04753948003053665,
0.4570123255252838,
0.41297417879104614,
0.09927449375391006,
-0.017982877790927887,
0.17301177978515625,
0.014340732246637344,
-0.1530425250530243,
0.192536860704422,
0.1691923588514328,
0.08420799672603607,
0.2540402412414551,
0.01378188282251358,
-0.051237598061561584,
-0.2809138298034668,
-0.17582589387893677,
-0.05213170498609543,
0.4013002812862396,
-0.3456524610519409,
0.28507816791534424,
-0.3515448272228241,
-0.25962066650390625,
-0.14094628393650055,
0.06017329543828964,
-0.24364739656448364,
-0.5724019408226013,
-0.11107175052165985,
0.20066964626312256,
-0.2171984314918518,
0.22269415855407715,
-0.05259830877184868,
0.04616272449493408,
0.08318646252155304,
0.0351666659116745,
0.08859796822071075,
-0.1854124367237091,
-0.421764075756073,
0.004588071256875992,
0.703942596912384,
-0.28533095121383667,
0.13791722059249878,
0.05217228829860687,
-0.10074383020401001,
-0.07161978632211685,
-0.24646875262260437,
0.03104068711400032,
-0.26333656907081604,
0.1140303984284401,
0.2701537609100342,
0.22070495784282684,
-0.1247829720377922,
-0.4931541085243225,
0.23354680836200714,
0.06276824325323105,
-0.14149808883666992,
0.15539826452732086,
0.3257589042186737,
0.13826517760753632,
-0.0321471206843853,
-0.2257927507162094,
-0.16355250775814056,
-0.279489129781723,
-0.05056382715702057,
-0.15432199835777283,
0.08665589988231659,
0.17819450795650482,
0.3296273648738861,
0.13140659034252167,
-0.15013420581817627,
-0.34188857674598694,
-0.022200729697942734,
-0.0028348490595817566,
0.11715179681777954,
-0.1419067233800888,
-0.1912265121936798,
-0.01679512858390808,
-0.15977390110492706,
0.10078512132167816,
-0.2977178394794464,
-0.7480368614196777,
0.04224233329296112,
-0.2447790503501892,
0.2559606432914734,
-0.03307580575346947,
0.04896138608455658,
-0.16396550834178925,
0.21840213239192963,
0.002098720520734787,
0.009695395827293396,
-0.07501214742660522,
-0.013009931892156601,
-0.21302741765975952,
0.3528372645378113,
0.011950520798563957,
0.46700865030288696,
0.11054471135139465,
0.5798467397689819,
-0.11252093315124512,
-0.051256172358989716,
0.269713431596756,
0.1578381210565567,
0.16185683012008667,
-0.2310597002506256,
-0.35910841822624207,
-0.15900447964668274,
-0.10709404945373535,
-0.13808485865592957,
0.1258116513490677,
-0.01644216477870941,
-0.13046397268772125,
-0.0874377191066742,
-0.19135677814483643,
0.11934240162372589,
-0.21151763200759888,
0.17470800876617432,
-0.0884617418050766,
-0.11350494623184204,
-0.11137698590755463,
0.14462251961231232,
-0.0785670131444931,
0.009385675191879272,
0.15512382984161377,
-0.04905761778354645,
-0.010532621294260025,
-0.3051636815071106,
-0.3779470920562744,
0.04466941952705383,
-0.32278165221214294,
0.2705495357513428,
-0.09128616750240326,
0.36483505368232727,
0.040113285183906555,
-0.07779502123594284,
-0.08652645349502563,
-0.035053811967372894,
0.6078673005104065,
0.0453384593129158,
-0.016390638425946236,
0.18551692366600037,
-0.06419406831264496,
-0.3200216293334961,
-0.2568816542625427,
-0.16623914241790771,
0.2193959653377533,
0.24906118214130402,
0.5175326466560364,
-0.31462231278419495,
-0.08809832483530045,
0.03389209508895874,
0.3671298921108246,
-0.25569948554039,
-0.28140804171562195,
-0.1907690167427063,
-0.12781770527362823,
-0.2502499222755432,
0.2697964012622833,
0.1088467463850975,
0.20313599705696106,
-0.13371403515338898,
-0.10875400900840759,
-0.10892235487699509,
-0.35275769233703613,
0.23407098650932312,
0.14290861785411835,
0.014329377561807632,
-0.01268453523516655,
0.31144416332244873,
-0.08649194985628128,
-0.06382954120635986,
0.23190635442733765,
0.5363825559616089,
-0.3034793436527252,
-0.32567599415779114,
-0.1191963404417038,
0.13513417541980743,
0.2992806136608124,
0.2735697627067566,
-0.261308878660202,
0.18363508582115173,
0.034136008471250534,
-0.0903707891702652,
-0.03389284387230873,
-0.013618167489767075,
0.26212432980537415,
0.17645613849163055,
-0.5402937531471252,
-0.31938090920448303,
0.37323856353759766,
0.1588355302810669,
-0.09564787149429321,
0.16530852019786835,
0.010416984558105469,
-0.30372658371925354,
0.5918175578117371,
0.11510812491178513,
0.803276538848877,
-0.3008520305156708,
0.22453175485134125,
0.4237912893295288,
0.38358622789382935,
0.45790672302246094,
-0.15012454986572266,
-0.004076192155480385,
-0.5529822707176208,
-0.20497307181358337,
0.0020761638879776,
-0.19148659706115723,
0.18131513893604279,
-0.1121874451637268,
-0.14363011717796326,
0.1795659363269806,
-0.4170820713043213,
0.23384112119674683,
-0.10707622021436691,
0.23683522641658783,
-0.2632588744163513,
-0.1094667837023735,
-0.5293250679969788,
0.17562749981880188,
-0.058551959693431854,
-0.07743297517299652,
-0.15694677829742432,
-0.09791599959135056,
0.019600719213485718,
-0.3092416226863861,
-0.39495131373405457,
0.029791295528411865,
-0.25001227855682373,
0.11328436434268951,
0.020608827471733093,
-0.07739964127540588,
0.0958259329199791,
0.5452219843864441,
0.22360646724700928,
0.13985313475131989,
0.09890594333410263,
0.13302338123321533,
-0.2303423136472702,
-0.12396213412284851,
-0.02221503295004368,
0.03491317853331566,
0.15161849558353424,
0.020601235330104828,
-0.24618473649024963,
0.18769830465316772,
0.10410657525062561,
-0.29184579849243164,
0.029098138213157654,
0.135121688246727,
0.015560482628643513,
-0.41373211145401,
-0.22677193582057953,
-0.2134818434715271,
0.151007741689682,
-0.21329477429389954,
0.13798820972442627,
0.21644261479377747,
-0.020916730165481567,
0.2371865212917328,
0.14678293466567993,
-0.17697633802890778,
-0.07827401906251907,
0.4070196747779846,
-0.058263227343559265,
0.01598704606294632,
0.7515345215797424,
0.6398617029190063,
-0.1245405301451683,
-0.3088960349559784,
0.25522738695144653,
0.3470575213432312,
-0.18799267709255219,
0.1934090256690979,
-0.15607649087905884,
-0.0601947158575058,
0.10024113953113556,
0.3280290365219116,
0.2934340238571167,
-0.03353074565529823,
-0.040191881358623505,
-0.5118392705917358,
-0.36713188886642456,
0.3505438268184662,
-0.07412981986999512,
0.1860986202955246,
-0.22559785842895508,
-0.22190174460411072,
-0.35542112588882446,
0.19041666388511658,
-0.2964797019958496,
0.15056046843528748,
-0.3613344728946686,
-0.013410653918981552,
0.1972876489162445,
0.12952877581119537,
0.2392226904630661,
0.1475379765033722,
0.14386071264743805,
0.17143622040748596,
-0.03518955409526825,
-0.24899114668369293,
-0.16835439205169678,
0.0916120857000351,
0.014589011669158936,
0.08556770533323288,
-0.011595562100410461,
-0.412996381521225,
0.18934333324432373,
-0.09067495167255402,
0.19798675179481506,
0.3382595181465149,
-0.14379248023033142,
0.25753310322761536,
0.27094030380249023,
0.3091321289539337,
0.1130010336637497,
0.3450332283973694,
-0.315295934677124,
0.20305591821670532,
0.24104146659374237,
0.18760940432548523,
0.09614565968513489,
-0.05323314666748047,
-0.16836369037628174,
-0.08337997645139694,
-0.318864643573761,
0.12927253544330597,
0.31374791264533997,
-0.4271368980407715,
-0.0958770215511322,
0.08907850086688995,
0.10017986595630646,
0.542427122592926,
-0.40196603536605835,
-0.07373721897602081,
0.45831453800201416,
0.20904964208602905,
-0.1180562749505043,
-0.2962983548641205,
0.3270525336265564,
-0.04949980974197388,
-0.2528999149799347,
0.35362523794174194,
-0.02666325867176056,
-0.2713947892189026,
-0.19288457930088043,
0.194559708237648,
0.33912423253059387,
0.4652552306652069,
0.10011617094278336,
0.5537570714950562,
-0.2332507222890854,
-0.1800144463777542,
0.2515196204185486,
-0.025470273569226265,
0.2725743353366852,
0.2227729707956314,
-0.4685109853744507,
0.04698174446821213,
0.041030753403902054,
0.03444233909249306,
0.30811649560928345,
-0.4735734164714813,
0.3034434914588928,
0.3587430715560913,
-0.05766611546278,
-0.21548685431480408,
0.008546784520149231,
0.3558684289455414,
0.060260917991399765,
0.0012029185891151428,
-0.16473685204982758,
0.24536152184009552,
-0.195283442735672,
0.004876773804426193,
-0.0440760962665081,
-0.1965109407901764,
-0.05635163187980652,
0.03411141037940979,
-0.023369772359728813,
-0.21713486313819885,
0.0652981773018837,
0.16963599622249603,
-0.17228956520557404,
-0.2207922786474228,
-0.011844895780086517,
0.18529585003852844,
-0.008922755718231201,
-0.22830387949943542,
-0.06519300490617752,
0.3388657867908478,
0.20705068111419678,
0.06138819083571434,
0.06584633886814117,
0.3838295638561249,
0.3625398576259613,
-0.3930125832557678,
0.2586612403392792,
-0.1352144330739975,
0.08768626302480698,
0.047300372272729874,
0.29331597685813904,
-0.014923647046089172,
0.2597935199737549,
0.409945011138916,
0.12878382205963135,
-0.1841488927602768,
-0.2022673487663269,
0.28653016686439514,
0.18625381588935852,
-0.07272004336118698,
0.05058473348617554,
-0.1249636709690094,
0.09137746691703796,
-0.15161734819412231,
0.17001888155937195,
-0.3826930522918701,
-0.12419843673706055,
0.4378187954425812,
-0.04496831074357033,
0.1976901888847351,
-0.12962231040000916,
0.07993774116039276,
-0.029271265491843224,
0.6063300967216492,
0.4886808395385742,
0.3700910210609436,
-0.4185542166233063,
0.1090223491191864,
-0.4707636833190918,
0.1318569779396057,
-0.3399411141872406,
0.1000346913933754,
0.013757705688476562,
-0.22939415276050568,
0.022688627243041992,
0.28569266200065613,
0.09390406310558319,
0.0017531290650367737,
-0.0985233411192894,
0.425285667181015,
-0.33426082134246826,
-0.2762293219566345,
0.2710147202014923,
-0.021075734868645668,
-0.08009070158004761,
-0.19425153732299805,
0.2401561290025711,
-0.3664935231208801,
0.04391933232545853,
-0.039196573197841644,
-0.21189573407173157,
0.020259983837604523,
-0.1291724145412445,
0.4378739297389984,
0.1872028410434723,
0.4227040410041809,
0.2123417854309082,
-0.1855921745300293,
-0.22884945571422577,
-0.29481711983680725,
0.01272226870059967,
-0.03728600591421127,
-0.014175981283187866,
0.495428204536438,
-0.2799762487411499,
0.009539775550365448,
-0.30488520860671997,
0.396695077419281,
0.06581006944179535,
-0.1375439465045929,
-0.31999969482421875,
0.1432713121175766,
0.06726516783237457,
-0.043537676334381104,
0.08731237053871155,
0.3415440618991852,
-0.04335809499025345,
0.31703999638557434,
-0.1256978064775467,
-0.15048229694366455,
0.4363164007663727,
-0.6287791728973389,
-0.24552376568317413,
0.0040539465844631195,
0.04991031438112259,
0.1430416703224182,
-0.04084964096546173,
-0.5292084813117981,
-0.019964098930358887,
0.2950016260147095,
-0.06387746334075928,
-0.23206350207328796,
0.02746504917740822,
0.1646777093410492,
0.05752702057361603,
-0.06600692868232727,
-0.08988693356513977,
-0.0659877359867096,
-0.14181819558143616,
0.2631465196609497,
-0.14197276532649994
] |
https://github.com/huggingface/datasets/issues/6124 | > Hi! We need a reproducer to fix this. Can you provide a link to the dataset (if it's public)?
Hi Mario,
Unfortunately, the dataset in question is currently private until the model is trained and released.
This is not happening with one dataset but numerous hosted private datasets.
I am only loading the dataset and doing nothing else currently. It seems to happen completely sporadically.
Thank you,
Enrico | Datasets crashing runs due to KeyError | ### Describe the bug
Hi all,
I have been running into a pretty persistent issue recently when trying to load datasets.
```python
train_dataset = load_dataset(
'llama-2-7b-tokenized',
split = 'train'
)
```
I receive a KeyError which crashes the runs.
```
Traceback (most recent call last):
main()
train_dataset = load_dataset(
^^^^^^^^^^^^^
builder_instance = load_dataset_builder(
^^^^^^^^^^^^^^^^^^^^^
dataset_module = dataset_module_factory(
^^^^^^^^^^^^^^^^^^^^^^^
raise e1 from None
).get_module()
^^^^^^^^^^^^
else get_data_patterns(base_path, download_config=self.download_config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return _get_data_files_patterns(resolver)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
data_files = pattern_resolver(pattern)
^^^^^^^^^^^^^^^^^^^^^^^^^
fs, _, _ = get_fs_token_paths(pattern, storage_options=storage_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
paths = [f for f in sorted(fs.glob(paths)) if not fs.isdir(f)]
^^^^^^^^^^^^^^
allpaths = self.find(root, maxdepth=depth, withdirs=True, detail=True, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
for _, dirs, files in self.walk(path, maxdepth, detail=True, **kwargs):
listing = self.ls(path, detail=True, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"last_modified": parse_datetime(tree_item["lastCommit"]["date"]),
~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'lastCommit'
```
Any help would be greatly appreciated.
Thank you,
Enrico
### Steps to reproduce the bug
Load the dataset from the Huggingface hub.
```python
train_dataset = load_dataset(
'llama-2-7b-tokenized',
split = 'train'
)
```
### Expected behavior
Loads the dataset.
### Environment info
datasets-2.14.3
CUDA 11.8
Python 3.11 | 69 | Datasets crashing runs due to KeyError
### Describe the bug
Hi all,
I have been running into a pretty persistent issue recently when trying to load datasets.
```python
train_dataset = load_dataset(
'llama-2-7b-tokenized',
split = 'train'
)
```
I receive a KeyError which crashes the runs.
```
Traceback (most recent call last):
main()
train_dataset = load_dataset(
^^^^^^^^^^^^^
builder_instance = load_dataset_builder(
^^^^^^^^^^^^^^^^^^^^^
dataset_module = dataset_module_factory(
^^^^^^^^^^^^^^^^^^^^^^^
raise e1 from None
).get_module()
^^^^^^^^^^^^
else get_data_patterns(base_path, download_config=self.download_config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return _get_data_files_patterns(resolver)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
data_files = pattern_resolver(pattern)
^^^^^^^^^^^^^^^^^^^^^^^^^
fs, _, _ = get_fs_token_paths(pattern, storage_options=storage_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
paths = [f for f in sorted(fs.glob(paths)) if not fs.isdir(f)]
^^^^^^^^^^^^^^
allpaths = self.find(root, maxdepth=depth, withdirs=True, detail=True, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
for _, dirs, files in self.walk(path, maxdepth, detail=True, **kwargs):
listing = self.ls(path, detail=True, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"last_modified": parse_datetime(tree_item["lastCommit"]["date"]),
~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'lastCommit'
```
Any help would be greatly appreciated.
Thank you,
Enrico
### Steps to reproduce the bug
Load the dataset from the Huggingface hub.
```python
train_dataset = load_dataset(
'llama-2-7b-tokenized',
split = 'train'
)
```
### Expected behavior
Loads the dataset.
### Environment info
datasets-2.14.3
CUDA 11.8
Python 3.11
> Hi! We need a reproducer to fix this. Can you provide a link to the dataset (if it's public)?
Hi Mario,
Unfortunately, the dataset in question is currently private until the model is trained and released.
This is not happening with one dataset but numerous hosted private datasets.
I am only loading the dataset and doing nothing else currently. It seems to happen completely sporadically.
Thank you,
Enrico | [
-0.42707476019859314,
0.023738786578178406,
0.022228755056858063,
0.4859738051891327,
0.30645328760147095,
0.0008221939206123352,
0.21553976833820343,
0.35969728231430054,
0.11036781966686249,
0.11428549140691757,
-0.09585358202457428,
0.2865358591079712,
-0.5202809572219849,
0.11676494777202606,
-0.0821552723646164,
-0.1831982433795929,
0.2587061822414398,
-0.08482568711042404,
-0.009821034967899323,
0.2759476602077484,
-0.3752565383911133,
0.14289608597755432,
-0.2992304265499115,
0.3856133222579956,
-0.3659202456474304,
0.01628289185464382,
-0.12070383131504059,
0.3122744560241699,
-0.08844556659460068,
-0.5742260217666626,
0.2582567632198334,
-0.21703198552131653,
0.3512708246707916,
0.7258263230323792,
-0.00010778708383440971,
0.0744071900844574,
0.29728201031684875,
0.07194454222917557,
-0.4508287012577057,
0.0042586177587509155,
-0.0330754779279232,
0.025367923080921173,
0.008905228227376938,
0.041181936860084534,
0.3142654001712799,
-0.1591518074274063,
-0.04748483747243881,
-0.26435190439224243,
0.4190462529659271,
0.33266153931617737,
0.24679285287857056,
0.3559716045856476,
0.11014184355735779,
-0.08194898813962936,
0.2926027774810791,
-0.2497287392616272,
0.0014320611953735352,
0.21234866976737976,
0.11898387968540192,
-0.3914499878883362,
-0.09810957312583923,
0.0963214561343193,
-0.3707219362258911,
-0.39105385541915894,
0.1513330340385437,
-0.19409921765327454,
-0.10256250202655792,
-0.3402501344680786,
0.06001593545079231,
0.22836728394031525,
0.18002980947494507,
-0.3865939974784851,
-0.2587990462779999,
-0.42574596405029297,
-0.07476475834846497,
-0.11273117363452911,
0.2843566834926605,
0.13999617099761963,
-0.12092249095439911,
0.21219582855701447,
0.2502463757991791,
-0.00020983442664146423,
-0.010611385107040405,
0.04610713571310043,
-0.12132266163825989,
0.4295060634613037,
0.11861768364906311,
0.17091383039951324,
0.24242211878299713,
-0.21403419971466064,
0.08738483488559723,
-0.18812692165374756,
-0.2228800654411316,
0.08152870833873749,
-0.46995943784713745,
0.12704552710056305,
-0.11475798487663269,
-0.03534319996833801,
0.2103884071111679,
-0.2565107047557831,
-0.05740155279636383,
0.16383683681488037,
-0.08373130857944489,
0.13623055815696716,
0.26883435249328613,
0.17144937813282013,
0.10517565906047821,
0.4175080955028534,
0.3696298897266388,
0.11064700037240982,
-0.21765686571598053,
0.07246585190296173,
-0.013321224600076675,
-0.15063926577568054,
0.014805637300014496,
0.22338131070137024,
0.07909972965717316,
0.0012384578585624695,
-0.22377300262451172,
0.20517206192016602,
-0.5834248661994934,
-0.11251980811357498,
0.20353764295578003,
0.4744129776954651,
-0.02193581871688366,
0.1989515721797943,
0.0013306811451911926,
0.14465056359767914,
-0.2029612809419632,
-0.2686884105205536,
-0.28055867552757263,
0.04479695484042168,
-0.15770260989665985,
0.17085745930671692,
0.14204499125480652,
-0.22479824721813202,
0.2258131504058838,
-0.05281488597393036,
0.0097039258107543,
-0.13913558423519135,
0.03474994748830795,
-0.012100521475076675,
-0.4365098476409912,
0.2576104402542114,
-0.22150081396102905,
0.18465499579906464,
0.24419282376766205,
-0.2656557261943817,
0.01294216513633728,
0.2182428538799286,
-0.1012861505150795,
-0.23547518253326416,
0.230588898062706,
0.22530385851860046,
-0.11003454029560089,
-0.050864558666944504,
-0.3673360049724579,
0.11826444417238235,
0.2496488392353058,
0.015403419733047485,
-0.08157825469970703,
-0.33701440691947937,
0.038915544748306274,
-0.3264094591140747,
-0.03447314724326134,
0.3828943073749542,
-0.3289088010787964,
-0.052491746842861176,
-0.1389826387166977,
-0.17200013995170593,
-0.047293733805418015,
0.14028842747211456,
-0.3109462857246399,
0.4556069076061249,
-0.3732549548149109,
0.3195402920246124,
0.14909085631370544,
-0.26024314761161804,
-0.3864023983478546,
0.0743444412946701,
-0.02558230608701706,
0.11732500046491623,
-0.05528886243700981,
0.018474522978067398,
-0.051637012511491776,
-0.11301809549331665,
0.20378223061561584,
0.21121886372566223,
-0.08458680659532547,
-0.051740601658821106,
-0.07719692587852478,
-0.14965039491653442,
-0.03696726635098457,
0.18489252030849457,
0.4227626323699951,
-0.18357576429843903,
-0.053213637322187424,
0.04831977188587189,
0.1541459858417511,
-0.15597635507583618,
-0.21549944579601288,
0.1601945161819458,
0.271412193775177,
-0.030375748872756958,
0.1354776918888092,
-0.16064044833183289,
-0.4946630895137787,
0.4387160539627075,
-0.0953129231929779,
-0.0475296676158905,
-0.3489287495613098,
-0.08413773030042648,
-0.20942986011505127,
0.4288804531097412,
-0.21768751740455627,
-0.1845736801624298,
0.14870084822177887,
-0.16055819392204285,
-0.08317729085683823,
0.2851247191429138,
-0.3161592483520508,
0.23396369814872742,
-0.16656632721424103,
0.28436779975891113,
-0.2144715040922165,
0.25156378746032715,
-0.1706230789422989,
-0.23731064796447754,
0.07652638852596283,
-0.003495166078209877,
0.22015602886676788,
-0.02361389808356762,
-0.06436608731746674,
0.4597488045692444,
0.1866815984249115,
-0.025122568011283875,
-0.31137651205062866,
0.07991580665111542,
0.1313229352235794,
0.09431156516075134,
0.18498842418193817,
0.1659012883901596,
0.059100206941366196,
-0.19777141511440277,
0.1598697155714035,
0.3206261396408081,
-0.04136907681822777,
0.1875944435596466,
0.03214677423238754,
0.029994763433933258,
0.07766781002283096,
-0.05758708715438843,
0.014312207698822021,
0.008204199373722076,
0.16583530604839325,
-0.17115293443202972,
-0.005198419094085693,
-0.11659898608922958,
-0.16346649825572968,
-0.0740039199590683,
0.47251996397972107,
-0.005251482129096985,
0.24364636838436127,
0.02898159995675087,
-0.3056827783584595,
0.17315730452537537,
0.04753948003053665,
0.4570123255252838,
0.41297417879104614,
0.09927449375391006,
-0.017982877790927887,
0.17301177978515625,
0.014340732246637344,
-0.1530425250530243,
0.192536860704422,
0.1691923588514328,
0.08420799672603607,
0.2540402412414551,
0.01378188282251358,
-0.051237598061561584,
-0.2809138298034668,
-0.17582589387893677,
-0.05213170498609543,
0.4013002812862396,
-0.3456524610519409,
0.28507816791534424,
-0.3515448272228241,
-0.25962066650390625,
-0.14094628393650055,
0.06017329543828964,
-0.24364739656448364,
-0.5724019408226013,
-0.11107175052165985,
0.20066964626312256,
-0.2171984314918518,
0.22269415855407715,
-0.05259830877184868,
0.04616272449493408,
0.08318646252155304,
0.0351666659116745,
0.08859796822071075,
-0.1854124367237091,
-0.421764075756073,
0.004588071256875992,
0.703942596912384,
-0.28533095121383667,
0.13791722059249878,
0.05217228829860687,
-0.10074383020401001,
-0.07161978632211685,
-0.24646875262260437,
0.03104068711400032,
-0.26333656907081604,
0.1140303984284401,
0.2701537609100342,
0.22070495784282684,
-0.1247829720377922,
-0.4931541085243225,
0.23354680836200714,
0.06276824325323105,
-0.14149808883666992,
0.15539826452732086,
0.3257589042186737,
0.13826517760753632,
-0.0321471206843853,
-0.2257927507162094,
-0.16355250775814056,
-0.279489129781723,
-0.05056382715702057,
-0.15432199835777283,
0.08665589988231659,
0.17819450795650482,
0.3296273648738861,
0.13140659034252167,
-0.15013420581817627,
-0.34188857674598694,
-0.022200729697942734,
-0.0028348490595817566,
0.11715179681777954,
-0.1419067233800888,
-0.1912265121936798,
-0.01679512858390808,
-0.15977390110492706,
0.10078512132167816,
-0.2977178394794464,
-0.7480368614196777,
0.04224233329296112,
-0.2447790503501892,
0.2559606432914734,
-0.03307580575346947,
0.04896138608455658,
-0.16396550834178925,
0.21840213239192963,
0.002098720520734787,
0.009695395827293396,
-0.07501214742660522,
-0.013009931892156601,
-0.21302741765975952,
0.3528372645378113,
0.011950520798563957,
0.46700865030288696,
0.11054471135139465,
0.5798467397689819,
-0.11252093315124512,
-0.051256172358989716,
0.269713431596756,
0.1578381210565567,
0.16185683012008667,
-0.2310597002506256,
-0.35910841822624207,
-0.15900447964668274,
-0.10709404945373535,
-0.13808485865592957,
0.1258116513490677,
-0.01644216477870941,
-0.13046397268772125,
-0.0874377191066742,
-0.19135677814483643,
0.11934240162372589,
-0.21151763200759888,
0.17470800876617432,
-0.0884617418050766,
-0.11350494623184204,
-0.11137698590755463,
0.14462251961231232,
-0.0785670131444931,
0.009385675191879272,
0.15512382984161377,
-0.04905761778354645,
-0.010532621294260025,
-0.3051636815071106,
-0.3779470920562744,
0.04466941952705383,
-0.32278165221214294,
0.2705495357513428,
-0.09128616750240326,
0.36483505368232727,
0.040113285183906555,
-0.07779502123594284,
-0.08652645349502563,
-0.035053811967372894,
0.6078673005104065,
0.0453384593129158,
-0.016390638425946236,
0.18551692366600037,
-0.06419406831264496,
-0.3200216293334961,
-0.2568816542625427,
-0.16623914241790771,
0.2193959653377533,
0.24906118214130402,
0.5175326466560364,
-0.31462231278419495,
-0.08809832483530045,
0.03389209508895874,
0.3671298921108246,
-0.25569948554039,
-0.28140804171562195,
-0.1907690167427063,
-0.12781770527362823,
-0.2502499222755432,
0.2697964012622833,
0.1088467463850975,
0.20313599705696106,
-0.13371403515338898,
-0.10875400900840759,
-0.10892235487699509,
-0.35275769233703613,
0.23407098650932312,
0.14290861785411835,
0.014329377561807632,
-0.01268453523516655,
0.31144416332244873,
-0.08649194985628128,
-0.06382954120635986,
0.23190635442733765,
0.5363825559616089,
-0.3034793436527252,
-0.32567599415779114,
-0.1191963404417038,
0.13513417541980743,
0.2992806136608124,
0.2735697627067566,
-0.261308878660202,
0.18363508582115173,
0.034136008471250534,
-0.0903707891702652,
-0.03389284387230873,
-0.013618167489767075,
0.26212432980537415,
0.17645613849163055,
-0.5402937531471252,
-0.31938090920448303,
0.37323856353759766,
0.1588355302810669,
-0.09564787149429321,
0.16530852019786835,
0.010416984558105469,
-0.30372658371925354,
0.5918175578117371,
0.11510812491178513,
0.803276538848877,
-0.3008520305156708,
0.22453175485134125,
0.4237912893295288,
0.38358622789382935,
0.45790672302246094,
-0.15012454986572266,
-0.004076192155480385,
-0.5529822707176208,
-0.20497307181358337,
0.0020761638879776,
-0.19148659706115723,
0.18131513893604279,
-0.1121874451637268,
-0.14363011717796326,
0.1795659363269806,
-0.4170820713043213,
0.23384112119674683,
-0.10707622021436691,
0.23683522641658783,
-0.2632588744163513,
-0.1094667837023735,
-0.5293250679969788,
0.17562749981880188,
-0.058551959693431854,
-0.07743297517299652,
-0.15694677829742432,
-0.09791599959135056,
0.019600719213485718,
-0.3092416226863861,
-0.39495131373405457,
0.029791295528411865,
-0.25001227855682373,
0.11328436434268951,
0.020608827471733093,
-0.07739964127540588,
0.0958259329199791,
0.5452219843864441,
0.22360646724700928,
0.13985313475131989,
0.09890594333410263,
0.13302338123321533,
-0.2303423136472702,
-0.12396213412284851,
-0.02221503295004368,
0.03491317853331566,
0.15161849558353424,
0.020601235330104828,
-0.24618473649024963,
0.18769830465316772,
0.10410657525062561,
-0.29184579849243164,
0.029098138213157654,
0.135121688246727,
0.015560482628643513,
-0.41373211145401,
-0.22677193582057953,
-0.2134818434715271,
0.151007741689682,
-0.21329477429389954,
0.13798820972442627,
0.21644261479377747,
-0.020916730165481567,
0.2371865212917328,
0.14678293466567993,
-0.17697633802890778,
-0.07827401906251907,
0.4070196747779846,
-0.058263227343559265,
0.01598704606294632,
0.7515345215797424,
0.6398617029190063,
-0.1245405301451683,
-0.3088960349559784,
0.25522738695144653,
0.3470575213432312,
-0.18799267709255219,
0.1934090256690979,
-0.15607649087905884,
-0.0601947158575058,
0.10024113953113556,
0.3280290365219116,
0.2934340238571167,
-0.03353074565529823,
-0.040191881358623505,
-0.5118392705917358,
-0.36713188886642456,
0.3505438268184662,
-0.07412981986999512,
0.1860986202955246,
-0.22559785842895508,
-0.22190174460411072,
-0.35542112588882446,
0.19041666388511658,
-0.2964797019958496,
0.15056046843528748,
-0.3613344728946686,
-0.013410653918981552,
0.1972876489162445,
0.12952877581119537,
0.2392226904630661,
0.1475379765033722,
0.14386071264743805,
0.17143622040748596,
-0.03518955409526825,
-0.24899114668369293,
-0.16835439205169678,
0.0916120857000351,
0.014589011669158936,
0.08556770533323288,
-0.011595562100410461,
-0.412996381521225,
0.18934333324432373,
-0.09067495167255402,
0.19798675179481506,
0.3382595181465149,
-0.14379248023033142,
0.25753310322761536,
0.27094030380249023,
0.3091321289539337,
0.1130010336637497,
0.3450332283973694,
-0.315295934677124,
0.20305591821670532,
0.24104146659374237,
0.18760940432548523,
0.09614565968513489,
-0.05323314666748047,
-0.16836369037628174,
-0.08337997645139694,
-0.318864643573761,
0.12927253544330597,
0.31374791264533997,
-0.4271368980407715,
-0.0958770215511322,
0.08907850086688995,
0.10017986595630646,
0.542427122592926,
-0.40196603536605835,
-0.07373721897602081,
0.45831453800201416,
0.20904964208602905,
-0.1180562749505043,
-0.2962983548641205,
0.3270525336265564,
-0.04949980974197388,
-0.2528999149799347,
0.35362523794174194,
-0.02666325867176056,
-0.2713947892189026,
-0.19288457930088043,
0.194559708237648,
0.33912423253059387,
0.4652552306652069,
0.10011617094278336,
0.5537570714950562,
-0.2332507222890854,
-0.1800144463777542,
0.2515196204185486,
-0.025470273569226265,
0.2725743353366852,
0.2227729707956314,
-0.4685109853744507,
0.04698174446821213,
0.041030753403902054,
0.03444233909249306,
0.30811649560928345,
-0.4735734164714813,
0.3034434914588928,
0.3587430715560913,
-0.05766611546278,
-0.21548685431480408,
0.008546784520149231,
0.3558684289455414,
0.060260917991399765,
0.0012029185891151428,
-0.16473685204982758,
0.24536152184009552,
-0.195283442735672,
0.004876773804426193,
-0.0440760962665081,
-0.1965109407901764,
-0.05635163187980652,
0.03411141037940979,
-0.023369772359728813,
-0.21713486313819885,
0.0652981773018837,
0.16963599622249603,
-0.17228956520557404,
-0.2207922786474228,
-0.011844895780086517,
0.18529585003852844,
-0.008922755718231201,
-0.22830387949943542,
-0.06519300490617752,
0.3388657867908478,
0.20705068111419678,
0.06138819083571434,
0.06584633886814117,
0.3838295638561249,
0.3625398576259613,
-0.3930125832557678,
0.2586612403392792,
-0.1352144330739975,
0.08768626302480698,
0.047300372272729874,
0.29331597685813904,
-0.014923647046089172,
0.2597935199737549,
0.409945011138916,
0.12878382205963135,
-0.1841488927602768,
-0.2022673487663269,
0.28653016686439514,
0.18625381588935852,
-0.07272004336118698,
0.05058473348617554,
-0.1249636709690094,
0.09137746691703796,
-0.15161734819412231,
0.17001888155937195,
-0.3826930522918701,
-0.12419843673706055,
0.4378187954425812,
-0.04496831074357033,
0.1976901888847351,
-0.12962231040000916,
0.07993774116039276,
-0.029271265491843224,
0.6063300967216492,
0.4886808395385742,
0.3700910210609436,
-0.4185542166233063,
0.1090223491191864,
-0.4707636833190918,
0.1318569779396057,
-0.3399411141872406,
0.1000346913933754,
0.013757705688476562,
-0.22939415276050568,
0.022688627243041992,
0.28569266200065613,
0.09390406310558319,
0.0017531290650367737,
-0.0985233411192894,
0.425285667181015,
-0.33426082134246826,
-0.2762293219566345,
0.2710147202014923,
-0.021075734868645668,
-0.08009070158004761,
-0.19425153732299805,
0.2401561290025711,
-0.3664935231208801,
0.04391933232545853,
-0.039196573197841644,
-0.21189573407173157,
0.020259983837604523,
-0.1291724145412445,
0.4378739297389984,
0.1872028410434723,
0.4227040410041809,
0.2123417854309082,
-0.1855921745300293,
-0.22884945571422577,
-0.29481711983680725,
0.01272226870059967,
-0.03728600591421127,
-0.014175981283187866,
0.495428204536438,
-0.2799762487411499,
0.009539775550365448,
-0.30488520860671997,
0.396695077419281,
0.06581006944179535,
-0.1375439465045929,
-0.31999969482421875,
0.1432713121175766,
0.06726516783237457,
-0.043537676334381104,
0.08731237053871155,
0.3415440618991852,
-0.04335809499025345,
0.31703999638557434,
-0.1256978064775467,
-0.15048229694366455,
0.4363164007663727,
-0.6287791728973389,
-0.24552376568317413,
0.0040539465844631195,
0.04991031438112259,
0.1430416703224182,
-0.04084964096546173,
-0.5292084813117981,
-0.019964098930358887,
0.2950016260147095,
-0.06387746334075928,
-0.23206350207328796,
0.02746504917740822,
0.1646777093410492,
0.05752702057361603,
-0.06600692868232727,
-0.08988693356513977,
-0.0659877359867096,
-0.14181819558143616,
0.2631465196609497,
-0.14197276532649994
] |
https://github.com/huggingface/datasets/issues/6124 | Hi,
I have the same error in the dataset viewer with my dataset
https://huggingface.co/datasets/elsaEU/ELSA10M_track1
Has anyone solved this issue?
Edit: After a dummy commit the error changed in ConfigNamesError | Datasets crashing runs due to KeyError | ### Describe the bug
Hi all,
I have been running into a pretty persistent issue recently when trying to load datasets.
```python
train_dataset = load_dataset(
'llama-2-7b-tokenized',
split = 'train'
)
```
I receive a KeyError which crashes the runs.
```
Traceback (most recent call last):
main()
train_dataset = load_dataset(
^^^^^^^^^^^^^
builder_instance = load_dataset_builder(
^^^^^^^^^^^^^^^^^^^^^
dataset_module = dataset_module_factory(
^^^^^^^^^^^^^^^^^^^^^^^
raise e1 from None
).get_module()
^^^^^^^^^^^^
else get_data_patterns(base_path, download_config=self.download_config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return _get_data_files_patterns(resolver)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
data_files = pattern_resolver(pattern)
^^^^^^^^^^^^^^^^^^^^^^^^^
fs, _, _ = get_fs_token_paths(pattern, storage_options=storage_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
paths = [f for f in sorted(fs.glob(paths)) if not fs.isdir(f)]
^^^^^^^^^^^^^^
allpaths = self.find(root, maxdepth=depth, withdirs=True, detail=True, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
for _, dirs, files in self.walk(path, maxdepth, detail=True, **kwargs):
listing = self.ls(path, detail=True, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"last_modified": parse_datetime(tree_item["lastCommit"]["date"]),
~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'lastCommit'
```
Any help would be greatly appreciated.
Thank you,
Enrico
### Steps to reproduce the bug
Load the dataset from the Huggingface hub.
```python
train_dataset = load_dataset(
'llama-2-7b-tokenized',
split = 'train'
)
```
### Expected behavior
Loads the dataset.
### Environment info
datasets-2.14.3
CUDA 11.8
Python 3.11 | 29 | Datasets crashing runs due to KeyError
### Describe the bug
Hi all,
I have been running into a pretty persistent issue recently when trying to load datasets.
```python
train_dataset = load_dataset(
'llama-2-7b-tokenized',
split = 'train'
)
```
I receive a KeyError which crashes the runs.
```
Traceback (most recent call last):
main()
train_dataset = load_dataset(
^^^^^^^^^^^^^
builder_instance = load_dataset_builder(
^^^^^^^^^^^^^^^^^^^^^
dataset_module = dataset_module_factory(
^^^^^^^^^^^^^^^^^^^^^^^
raise e1 from None
).get_module()
^^^^^^^^^^^^
else get_data_patterns(base_path, download_config=self.download_config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return _get_data_files_patterns(resolver)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
data_files = pattern_resolver(pattern)
^^^^^^^^^^^^^^^^^^^^^^^^^
fs, _, _ = get_fs_token_paths(pattern, storage_options=storage_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
paths = [f for f in sorted(fs.glob(paths)) if not fs.isdir(f)]
^^^^^^^^^^^^^^
allpaths = self.find(root, maxdepth=depth, withdirs=True, detail=True, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
for _, dirs, files in self.walk(path, maxdepth, detail=True, **kwargs):
listing = self.ls(path, detail=True, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"last_modified": parse_datetime(tree_item["lastCommit"]["date"]),
~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'lastCommit'
```
Any help would be greatly appreciated.
Thank you,
Enrico
### Steps to reproduce the bug
Load the dataset from the Huggingface hub.
```python
train_dataset = load_dataset(
'llama-2-7b-tokenized',
split = 'train'
)
```
### Expected behavior
Loads the dataset.
### Environment info
datasets-2.14.3
CUDA 11.8
Python 3.11
Hi,
I have the same error in the dataset viewer with my dataset
https://huggingface.co/datasets/elsaEU/ELSA10M_track1
Has anyone solved this issue?
Edit: After a dummy commit the error changed in ConfigNamesError | [
-0.42707476019859314,
0.023738786578178406,
0.022228755056858063,
0.4859738051891327,
0.30645328760147095,
0.0008221939206123352,
0.21553976833820343,
0.35969728231430054,
0.11036781966686249,
0.11428549140691757,
-0.09585358202457428,
0.2865358591079712,
-0.5202809572219849,
0.11676494777202606,
-0.0821552723646164,
-0.1831982433795929,
0.2587061822414398,
-0.08482568711042404,
-0.009821034967899323,
0.2759476602077484,
-0.3752565383911133,
0.14289608597755432,
-0.2992304265499115,
0.3856133222579956,
-0.3659202456474304,
0.01628289185464382,
-0.12070383131504059,
0.3122744560241699,
-0.08844556659460068,
-0.5742260217666626,
0.2582567632198334,
-0.21703198552131653,
0.3512708246707916,
0.7258263230323792,
-0.00010778708383440971,
0.0744071900844574,
0.29728201031684875,
0.07194454222917557,
-0.4508287012577057,
0.0042586177587509155,
-0.0330754779279232,
0.025367923080921173,
0.008905228227376938,
0.041181936860084534,
0.3142654001712799,
-0.1591518074274063,
-0.04748483747243881,
-0.26435190439224243,
0.4190462529659271,
0.33266153931617737,
0.24679285287857056,
0.3559716045856476,
0.11014184355735779,
-0.08194898813962936,
0.2926027774810791,
-0.2497287392616272,
0.0014320611953735352,
0.21234866976737976,
0.11898387968540192,
-0.3914499878883362,
-0.09810957312583923,
0.0963214561343193,
-0.3707219362258911,
-0.39105385541915894,
0.1513330340385437,
-0.19409921765327454,
-0.10256250202655792,
-0.3402501344680786,
0.06001593545079231,
0.22836728394031525,
0.18002980947494507,
-0.3865939974784851,
-0.2587990462779999,
-0.42574596405029297,
-0.07476475834846497,
-0.11273117363452911,
0.2843566834926605,
0.13999617099761963,
-0.12092249095439911,
0.21219582855701447,
0.2502463757991791,
-0.00020983442664146423,
-0.010611385107040405,
0.04610713571310043,
-0.12132266163825989,
0.4295060634613037,
0.11861768364906311,
0.17091383039951324,
0.24242211878299713,
-0.21403419971466064,
0.08738483488559723,
-0.18812692165374756,
-0.2228800654411316,
0.08152870833873749,
-0.46995943784713745,
0.12704552710056305,
-0.11475798487663269,
-0.03534319996833801,
0.2103884071111679,
-0.2565107047557831,
-0.05740155279636383,
0.16383683681488037,
-0.08373130857944489,
0.13623055815696716,
0.26883435249328613,
0.17144937813282013,
0.10517565906047821,
0.4175080955028534,
0.3696298897266388,
0.11064700037240982,
-0.21765686571598053,
0.07246585190296173,
-0.013321224600076675,
-0.15063926577568054,
0.014805637300014496,
0.22338131070137024,
0.07909972965717316,
0.0012384578585624695,
-0.22377300262451172,
0.20517206192016602,
-0.5834248661994934,
-0.11251980811357498,
0.20353764295578003,
0.4744129776954651,
-0.02193581871688366,
0.1989515721797943,
0.0013306811451911926,
0.14465056359767914,
-0.2029612809419632,
-0.2686884105205536,
-0.28055867552757263,
0.04479695484042168,
-0.15770260989665985,
0.17085745930671692,
0.14204499125480652,
-0.22479824721813202,
0.2258131504058838,
-0.05281488597393036,
0.0097039258107543,
-0.13913558423519135,
0.03474994748830795,
-0.012100521475076675,
-0.4365098476409912,
0.2576104402542114,
-0.22150081396102905,
0.18465499579906464,
0.24419282376766205,
-0.2656557261943817,
0.01294216513633728,
0.2182428538799286,
-0.1012861505150795,
-0.23547518253326416,
0.230588898062706,
0.22530385851860046,
-0.11003454029560089,
-0.050864558666944504,
-0.3673360049724579,
0.11826444417238235,
0.2496488392353058,
0.015403419733047485,
-0.08157825469970703,
-0.33701440691947937,
0.038915544748306274,
-0.3264094591140747,
-0.03447314724326134,
0.3828943073749542,
-0.3289088010787964,
-0.052491746842861176,
-0.1389826387166977,
-0.17200013995170593,
-0.047293733805418015,
0.14028842747211456,
-0.3109462857246399,
0.4556069076061249,
-0.3732549548149109,
0.3195402920246124,
0.14909085631370544,
-0.26024314761161804,
-0.3864023983478546,
0.0743444412946701,
-0.02558230608701706,
0.11732500046491623,
-0.05528886243700981,
0.018474522978067398,
-0.051637012511491776,
-0.11301809549331665,
0.20378223061561584,
0.21121886372566223,
-0.08458680659532547,
-0.051740601658821106,
-0.07719692587852478,
-0.14965039491653442,
-0.03696726635098457,
0.18489252030849457,
0.4227626323699951,
-0.18357576429843903,
-0.053213637322187424,
0.04831977188587189,
0.1541459858417511,
-0.15597635507583618,
-0.21549944579601288,
0.1601945161819458,
0.271412193775177,
-0.030375748872756958,
0.1354776918888092,
-0.16064044833183289,
-0.4946630895137787,
0.4387160539627075,
-0.0953129231929779,
-0.0475296676158905,
-0.3489287495613098,
-0.08413773030042648,
-0.20942986011505127,
0.4288804531097412,
-0.21768751740455627,
-0.1845736801624298,
0.14870084822177887,
-0.16055819392204285,
-0.08317729085683823,
0.2851247191429138,
-0.3161592483520508,
0.23396369814872742,
-0.16656632721424103,
0.28436779975891113,
-0.2144715040922165,
0.25156378746032715,
-0.1706230789422989,
-0.23731064796447754,
0.07652638852596283,
-0.003495166078209877,
0.22015602886676788,
-0.02361389808356762,
-0.06436608731746674,
0.4597488045692444,
0.1866815984249115,
-0.025122568011283875,
-0.31137651205062866,
0.07991580665111542,
0.1313229352235794,
0.09431156516075134,
0.18498842418193817,
0.1659012883901596,
0.059100206941366196,
-0.19777141511440277,
0.1598697155714035,
0.3206261396408081,
-0.04136907681822777,
0.1875944435596466,
0.03214677423238754,
0.029994763433933258,
0.07766781002283096,
-0.05758708715438843,
0.014312207698822021,
0.008204199373722076,
0.16583530604839325,
-0.17115293443202972,
-0.005198419094085693,
-0.11659898608922958,
-0.16346649825572968,
-0.0740039199590683,
0.47251996397972107,
-0.005251482129096985,
0.24364636838436127,
0.02898159995675087,
-0.3056827783584595,
0.17315730452537537,
0.04753948003053665,
0.4570123255252838,
0.41297417879104614,
0.09927449375391006,
-0.017982877790927887,
0.17301177978515625,
0.014340732246637344,
-0.1530425250530243,
0.192536860704422,
0.1691923588514328,
0.08420799672603607,
0.2540402412414551,
0.01378188282251358,
-0.051237598061561584,
-0.2809138298034668,
-0.17582589387893677,
-0.05213170498609543,
0.4013002812862396,
-0.3456524610519409,
0.28507816791534424,
-0.3515448272228241,
-0.25962066650390625,
-0.14094628393650055,
0.06017329543828964,
-0.24364739656448364,
-0.5724019408226013,
-0.11107175052165985,
0.20066964626312256,
-0.2171984314918518,
0.22269415855407715,
-0.05259830877184868,
0.04616272449493408,
0.08318646252155304,
0.0351666659116745,
0.08859796822071075,
-0.1854124367237091,
-0.421764075756073,
0.004588071256875992,
0.703942596912384,
-0.28533095121383667,
0.13791722059249878,
0.05217228829860687,
-0.10074383020401001,
-0.07161978632211685,
-0.24646875262260437,
0.03104068711400032,
-0.26333656907081604,
0.1140303984284401,
0.2701537609100342,
0.22070495784282684,
-0.1247829720377922,
-0.4931541085243225,
0.23354680836200714,
0.06276824325323105,
-0.14149808883666992,
0.15539826452732086,
0.3257589042186737,
0.13826517760753632,
-0.0321471206843853,
-0.2257927507162094,
-0.16355250775814056,
-0.279489129781723,
-0.05056382715702057,
-0.15432199835777283,
0.08665589988231659,
0.17819450795650482,
0.3296273648738861,
0.13140659034252167,
-0.15013420581817627,
-0.34188857674598694,
-0.022200729697942734,
-0.0028348490595817566,
0.11715179681777954,
-0.1419067233800888,
-0.1912265121936798,
-0.01679512858390808,
-0.15977390110492706,
0.10078512132167816,
-0.2977178394794464,
-0.7480368614196777,
0.04224233329296112,
-0.2447790503501892,
0.2559606432914734,
-0.03307580575346947,
0.04896138608455658,
-0.16396550834178925,
0.21840213239192963,
0.002098720520734787,
0.009695395827293396,
-0.07501214742660522,
-0.013009931892156601,
-0.21302741765975952,
0.3528372645378113,
0.011950520798563957,
0.46700865030288696,
0.11054471135139465,
0.5798467397689819,
-0.11252093315124512,
-0.051256172358989716,
0.269713431596756,
0.1578381210565567,
0.16185683012008667,
-0.2310597002506256,
-0.35910841822624207,
-0.15900447964668274,
-0.10709404945373535,
-0.13808485865592957,
0.1258116513490677,
-0.01644216477870941,
-0.13046397268772125,
-0.0874377191066742,
-0.19135677814483643,
0.11934240162372589,
-0.21151763200759888,
0.17470800876617432,
-0.0884617418050766,
-0.11350494623184204,
-0.11137698590755463,
0.14462251961231232,
-0.0785670131444931,
0.009385675191879272,
0.15512382984161377,
-0.04905761778354645,
-0.010532621294260025,
-0.3051636815071106,
-0.3779470920562744,
0.04466941952705383,
-0.32278165221214294,
0.2705495357513428,
-0.09128616750240326,
0.36483505368232727,
0.040113285183906555,
-0.07779502123594284,
-0.08652645349502563,
-0.035053811967372894,
0.6078673005104065,
0.0453384593129158,
-0.016390638425946236,
0.18551692366600037,
-0.06419406831264496,
-0.3200216293334961,
-0.2568816542625427,
-0.16623914241790771,
0.2193959653377533,
0.24906118214130402,
0.5175326466560364,
-0.31462231278419495,
-0.08809832483530045,
0.03389209508895874,
0.3671298921108246,
-0.25569948554039,
-0.28140804171562195,
-0.1907690167427063,
-0.12781770527362823,
-0.2502499222755432,
0.2697964012622833,
0.1088467463850975,
0.20313599705696106,
-0.13371403515338898,
-0.10875400900840759,
-0.10892235487699509,
-0.35275769233703613,
0.23407098650932312,
0.14290861785411835,
0.014329377561807632,
-0.01268453523516655,
0.31144416332244873,
-0.08649194985628128,
-0.06382954120635986,
0.23190635442733765,
0.5363825559616089,
-0.3034793436527252,
-0.32567599415779114,
-0.1191963404417038,
0.13513417541980743,
0.2992806136608124,
0.2735697627067566,
-0.261308878660202,
0.18363508582115173,
0.034136008471250534,
-0.0903707891702652,
-0.03389284387230873,
-0.013618167489767075,
0.26212432980537415,
0.17645613849163055,
-0.5402937531471252,
-0.31938090920448303,
0.37323856353759766,
0.1588355302810669,
-0.09564787149429321,
0.16530852019786835,
0.010416984558105469,
-0.30372658371925354,
0.5918175578117371,
0.11510812491178513,
0.803276538848877,
-0.3008520305156708,
0.22453175485134125,
0.4237912893295288,
0.38358622789382935,
0.45790672302246094,
-0.15012454986572266,
-0.004076192155480385,
-0.5529822707176208,
-0.20497307181358337,
0.0020761638879776,
-0.19148659706115723,
0.18131513893604279,
-0.1121874451637268,
-0.14363011717796326,
0.1795659363269806,
-0.4170820713043213,
0.23384112119674683,
-0.10707622021436691,
0.23683522641658783,
-0.2632588744163513,
-0.1094667837023735,
-0.5293250679969788,
0.17562749981880188,
-0.058551959693431854,
-0.07743297517299652,
-0.15694677829742432,
-0.09791599959135056,
0.019600719213485718,
-0.3092416226863861,
-0.39495131373405457,
0.029791295528411865,
-0.25001227855682373,
0.11328436434268951,
0.020608827471733093,
-0.07739964127540588,
0.0958259329199791,
0.5452219843864441,
0.22360646724700928,
0.13985313475131989,
0.09890594333410263,
0.13302338123321533,
-0.2303423136472702,
-0.12396213412284851,
-0.02221503295004368,
0.03491317853331566,
0.15161849558353424,
0.020601235330104828,
-0.24618473649024963,
0.18769830465316772,
0.10410657525062561,
-0.29184579849243164,
0.029098138213157654,
0.135121688246727,
0.015560482628643513,
-0.41373211145401,
-0.22677193582057953,
-0.2134818434715271,
0.151007741689682,
-0.21329477429389954,
0.13798820972442627,
0.21644261479377747,
-0.020916730165481567,
0.2371865212917328,
0.14678293466567993,
-0.17697633802890778,
-0.07827401906251907,
0.4070196747779846,
-0.058263227343559265,
0.01598704606294632,
0.7515345215797424,
0.6398617029190063,
-0.1245405301451683,
-0.3088960349559784,
0.25522738695144653,
0.3470575213432312,
-0.18799267709255219,
0.1934090256690979,
-0.15607649087905884,
-0.0601947158575058,
0.10024113953113556,
0.3280290365219116,
0.2934340238571167,
-0.03353074565529823,
-0.040191881358623505,
-0.5118392705917358,
-0.36713188886642456,
0.3505438268184662,
-0.07412981986999512,
0.1860986202955246,
-0.22559785842895508,
-0.22190174460411072,
-0.35542112588882446,
0.19041666388511658,
-0.2964797019958496,
0.15056046843528748,
-0.3613344728946686,
-0.013410653918981552,
0.1972876489162445,
0.12952877581119537,
0.2392226904630661,
0.1475379765033722,
0.14386071264743805,
0.17143622040748596,
-0.03518955409526825,
-0.24899114668369293,
-0.16835439205169678,
0.0916120857000351,
0.014589011669158936,
0.08556770533323288,
-0.011595562100410461,
-0.412996381521225,
0.18934333324432373,
-0.09067495167255402,
0.19798675179481506,
0.3382595181465149,
-0.14379248023033142,
0.25753310322761536,
0.27094030380249023,
0.3091321289539337,
0.1130010336637497,
0.3450332283973694,
-0.315295934677124,
0.20305591821670532,
0.24104146659374237,
0.18760940432548523,
0.09614565968513489,
-0.05323314666748047,
-0.16836369037628174,
-0.08337997645139694,
-0.318864643573761,
0.12927253544330597,
0.31374791264533997,
-0.4271368980407715,
-0.0958770215511322,
0.08907850086688995,
0.10017986595630646,
0.542427122592926,
-0.40196603536605835,
-0.07373721897602081,
0.45831453800201416,
0.20904964208602905,
-0.1180562749505043,
-0.2962983548641205,
0.3270525336265564,
-0.04949980974197388,
-0.2528999149799347,
0.35362523794174194,
-0.02666325867176056,
-0.2713947892189026,
-0.19288457930088043,
0.194559708237648,
0.33912423253059387,
0.4652552306652069,
0.10011617094278336,
0.5537570714950562,
-0.2332507222890854,
-0.1800144463777542,
0.2515196204185486,
-0.025470273569226265,
0.2725743353366852,
0.2227729707956314,
-0.4685109853744507,
0.04698174446821213,
0.041030753403902054,
0.03444233909249306,
0.30811649560928345,
-0.4735734164714813,
0.3034434914588928,
0.3587430715560913,
-0.05766611546278,
-0.21548685431480408,
0.008546784520149231,
0.3558684289455414,
0.060260917991399765,
0.0012029185891151428,
-0.16473685204982758,
0.24536152184009552,
-0.195283442735672,
0.004876773804426193,
-0.0440760962665081,
-0.1965109407901764,
-0.05635163187980652,
0.03411141037940979,
-0.023369772359728813,
-0.21713486313819885,
0.0652981773018837,
0.16963599622249603,
-0.17228956520557404,
-0.2207922786474228,
-0.011844895780086517,
0.18529585003852844,
-0.008922755718231201,
-0.22830387949943542,
-0.06519300490617752,
0.3388657867908478,
0.20705068111419678,
0.06138819083571434,
0.06584633886814117,
0.3838295638561249,
0.3625398576259613,
-0.3930125832557678,
0.2586612403392792,
-0.1352144330739975,
0.08768626302480698,
0.047300372272729874,
0.29331597685813904,
-0.014923647046089172,
0.2597935199737549,
0.409945011138916,
0.12878382205963135,
-0.1841488927602768,
-0.2022673487663269,
0.28653016686439514,
0.18625381588935852,
-0.07272004336118698,
0.05058473348617554,
-0.1249636709690094,
0.09137746691703796,
-0.15161734819412231,
0.17001888155937195,
-0.3826930522918701,
-0.12419843673706055,
0.4378187954425812,
-0.04496831074357033,
0.1976901888847351,
-0.12962231040000916,
0.07993774116039276,
-0.029271265491843224,
0.6063300967216492,
0.4886808395385742,
0.3700910210609436,
-0.4185542166233063,
0.1090223491191864,
-0.4707636833190918,
0.1318569779396057,
-0.3399411141872406,
0.1000346913933754,
0.013757705688476562,
-0.22939415276050568,
0.022688627243041992,
0.28569266200065613,
0.09390406310558319,
0.0017531290650367737,
-0.0985233411192894,
0.425285667181015,
-0.33426082134246826,
-0.2762293219566345,
0.2710147202014923,
-0.021075734868645668,
-0.08009070158004761,
-0.19425153732299805,
0.2401561290025711,
-0.3664935231208801,
0.04391933232545853,
-0.039196573197841644,
-0.21189573407173157,
0.020259983837604523,
-0.1291724145412445,
0.4378739297389984,
0.1872028410434723,
0.4227040410041809,
0.2123417854309082,
-0.1855921745300293,
-0.22884945571422577,
-0.29481711983680725,
0.01272226870059967,
-0.03728600591421127,
-0.014175981283187866,
0.495428204536438,
-0.2799762487411499,
0.009539775550365448,
-0.30488520860671997,
0.396695077419281,
0.06581006944179535,
-0.1375439465045929,
-0.31999969482421875,
0.1432713121175766,
0.06726516783237457,
-0.043537676334381104,
0.08731237053871155,
0.3415440618991852,
-0.04335809499025345,
0.31703999638557434,
-0.1256978064775467,
-0.15048229694366455,
0.4363164007663727,
-0.6287791728973389,
-0.24552376568317413,
0.0040539465844631195,
0.04991031438112259,
0.1430416703224182,
-0.04084964096546173,
-0.5292084813117981,
-0.019964098930358887,
0.2950016260147095,
-0.06387746334075928,
-0.23206350207328796,
0.02746504917740822,
0.1646777093410492,
0.05752702057361603,
-0.06600692868232727,
-0.08988693356513977,
-0.0659877359867096,
-0.14181819558143616,
0.2631465196609497,
-0.14197276532649994
] |
https://github.com/huggingface/datasets/issues/6124 | @rs9000 The problem seems to be the (large) number of commits, as explained in https://huggingface.co/docs/hub/repositories-recommendations. This can be fixed by running:
```python
import huggingface_hub
huggingface_hub.super_squash_history(repo_id="elsaEU/ELSA10M_track1")
```
The issue stems from `push_to_hub` creating one commit per shard - https://github.com/huggingface/datasets/pull/6269 should fix this issue (will create one commit per 50 uploaded shards by default). The linked PR will be included in the next `datasets` release.
cc @lhoestq @severo for visibility | Datasets crashing runs due to KeyError | ### Describe the bug
Hi all,
I have been running into a pretty persistent issue recently when trying to load datasets.
```python
train_dataset = load_dataset(
'llama-2-7b-tokenized',
split = 'train'
)
```
I receive a KeyError which crashes the runs.
```
Traceback (most recent call last):
main()
train_dataset = load_dataset(
^^^^^^^^^^^^^
builder_instance = load_dataset_builder(
^^^^^^^^^^^^^^^^^^^^^
dataset_module = dataset_module_factory(
^^^^^^^^^^^^^^^^^^^^^^^
raise e1 from None
).get_module()
^^^^^^^^^^^^
else get_data_patterns(base_path, download_config=self.download_config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return _get_data_files_patterns(resolver)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
data_files = pattern_resolver(pattern)
^^^^^^^^^^^^^^^^^^^^^^^^^
fs, _, _ = get_fs_token_paths(pattern, storage_options=storage_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
paths = [f for f in sorted(fs.glob(paths)) if not fs.isdir(f)]
^^^^^^^^^^^^^^
allpaths = self.find(root, maxdepth=depth, withdirs=True, detail=True, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
for _, dirs, files in self.walk(path, maxdepth, detail=True, **kwargs):
listing = self.ls(path, detail=True, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"last_modified": parse_datetime(tree_item["lastCommit"]["date"]),
~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'lastCommit'
```
Any help would be greatly appreciated.
Thank you,
Enrico
### Steps to reproduce the bug
Load the dataset from the Huggingface hub.
```python
train_dataset = load_dataset(
'llama-2-7b-tokenized',
split = 'train'
)
```
### Expected behavior
Loads the dataset.
### Environment info
datasets-2.14.3
CUDA 11.8
Python 3.11 | 68 | Datasets crashing runs due to KeyError
### Describe the bug
Hi all,
I have been running into a pretty persistent issue recently when trying to load datasets.
```python
train_dataset = load_dataset(
'llama-2-7b-tokenized',
split = 'train'
)
```
I receive a KeyError which crashes the runs.
```
Traceback (most recent call last):
main()
train_dataset = load_dataset(
^^^^^^^^^^^^^
builder_instance = load_dataset_builder(
^^^^^^^^^^^^^^^^^^^^^
dataset_module = dataset_module_factory(
^^^^^^^^^^^^^^^^^^^^^^^
raise e1 from None
).get_module()
^^^^^^^^^^^^
else get_data_patterns(base_path, download_config=self.download_config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return _get_data_files_patterns(resolver)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
data_files = pattern_resolver(pattern)
^^^^^^^^^^^^^^^^^^^^^^^^^
fs, _, _ = get_fs_token_paths(pattern, storage_options=storage_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
paths = [f for f in sorted(fs.glob(paths)) if not fs.isdir(f)]
^^^^^^^^^^^^^^
allpaths = self.find(root, maxdepth=depth, withdirs=True, detail=True, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
for _, dirs, files in self.walk(path, maxdepth, detail=True, **kwargs):
listing = self.ls(path, detail=True, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"last_modified": parse_datetime(tree_item["lastCommit"]["date"]),
~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'lastCommit'
```
Any help would be greatly appreciated.
Thank you,
Enrico
### Steps to reproduce the bug
Load the dataset from the Huggingface hub.
```python
train_dataset = load_dataset(
'llama-2-7b-tokenized',
split = 'train'
)
```
### Expected behavior
Loads the dataset.
### Environment info
datasets-2.14.3
CUDA 11.8
Python 3.11
@rs9000 The problem seems to be the (large) number of commits, as explained in https://huggingface.co/docs/hub/repositories-recommendations. This can be fixed by running:
```python
import huggingface_hub
huggingface_hub.super_squash_history(repo_id="elsaEU/ELSA10M_track1")
```
The issue stems from `push_to_hub` creating one commit per shard - https://github.com/huggingface/datasets/pull/6269 should fix this issue (will create one commit per 50 uploaded shards by default). The linked PR will be included in the next `datasets` release.
cc @lhoestq @severo for visibility | [
-0.42707476019859314,
0.023738786578178406,
0.022228755056858063,
0.4859738051891327,
0.30645328760147095,
0.0008221939206123352,
0.21553976833820343,
0.35969728231430054,
0.11036781966686249,
0.11428549140691757,
-0.09585358202457428,
0.2865358591079712,
-0.5202809572219849,
0.11676494777202606,
-0.0821552723646164,
-0.1831982433795929,
0.2587061822414398,
-0.08482568711042404,
-0.009821034967899323,
0.2759476602077484,
-0.3752565383911133,
0.14289608597755432,
-0.2992304265499115,
0.3856133222579956,
-0.3659202456474304,
0.01628289185464382,
-0.12070383131504059,
0.3122744560241699,
-0.08844556659460068,
-0.5742260217666626,
0.2582567632198334,
-0.21703198552131653,
0.3512708246707916,
0.7258263230323792,
-0.00010778708383440971,
0.0744071900844574,
0.29728201031684875,
0.07194454222917557,
-0.4508287012577057,
0.0042586177587509155,
-0.0330754779279232,
0.025367923080921173,
0.008905228227376938,
0.041181936860084534,
0.3142654001712799,
-0.1591518074274063,
-0.04748483747243881,
-0.26435190439224243,
0.4190462529659271,
0.33266153931617737,
0.24679285287857056,
0.3559716045856476,
0.11014184355735779,
-0.08194898813962936,
0.2926027774810791,
-0.2497287392616272,
0.0014320611953735352,
0.21234866976737976,
0.11898387968540192,
-0.3914499878883362,
-0.09810957312583923,
0.0963214561343193,
-0.3707219362258911,
-0.39105385541915894,
0.1513330340385437,
-0.19409921765327454,
-0.10256250202655792,
-0.3402501344680786,
0.06001593545079231,
0.22836728394031525,
0.18002980947494507,
-0.3865939974784851,
-0.2587990462779999,
-0.42574596405029297,
-0.07476475834846497,
-0.11273117363452911,
0.2843566834926605,
0.13999617099761963,
-0.12092249095439911,
0.21219582855701447,
0.2502463757991791,
-0.00020983442664146423,
-0.010611385107040405,
0.04610713571310043,
-0.12132266163825989,
0.4295060634613037,
0.11861768364906311,
0.17091383039951324,
0.24242211878299713,
-0.21403419971466064,
0.08738483488559723,
-0.18812692165374756,
-0.2228800654411316,
0.08152870833873749,
-0.46995943784713745,
0.12704552710056305,
-0.11475798487663269,
-0.03534319996833801,
0.2103884071111679,
-0.2565107047557831,
-0.05740155279636383,
0.16383683681488037,
-0.08373130857944489,
0.13623055815696716,
0.26883435249328613,
0.17144937813282013,
0.10517565906047821,
0.4175080955028534,
0.3696298897266388,
0.11064700037240982,
-0.21765686571598053,
0.07246585190296173,
-0.013321224600076675,
-0.15063926577568054,
0.014805637300014496,
0.22338131070137024,
0.07909972965717316,
0.0012384578585624695,
-0.22377300262451172,
0.20517206192016602,
-0.5834248661994934,
-0.11251980811357498,
0.20353764295578003,
0.4744129776954651,
-0.02193581871688366,
0.1989515721797943,
0.0013306811451911926,
0.14465056359767914,
-0.2029612809419632,
-0.2686884105205536,
-0.28055867552757263,
0.04479695484042168,
-0.15770260989665985,
0.17085745930671692,
0.14204499125480652,
-0.22479824721813202,
0.2258131504058838,
-0.05281488597393036,
0.0097039258107543,
-0.13913558423519135,
0.03474994748830795,
-0.012100521475076675,
-0.4365098476409912,
0.2576104402542114,
-0.22150081396102905,
0.18465499579906464,
0.24419282376766205,
-0.2656557261943817,
0.01294216513633728,
0.2182428538799286,
-0.1012861505150795,
-0.23547518253326416,
0.230588898062706,
0.22530385851860046,
-0.11003454029560089,
-0.050864558666944504,
-0.3673360049724579,
0.11826444417238235,
0.2496488392353058,
0.015403419733047485,
-0.08157825469970703,
-0.33701440691947937,
0.038915544748306274,
-0.3264094591140747,
-0.03447314724326134,
0.3828943073749542,
-0.3289088010787964,
-0.052491746842861176,
-0.1389826387166977,
-0.17200013995170593,
-0.047293733805418015,
0.14028842747211456,
-0.3109462857246399,
0.4556069076061249,
-0.3732549548149109,
0.3195402920246124,
0.14909085631370544,
-0.26024314761161804,
-0.3864023983478546,
0.0743444412946701,
-0.02558230608701706,
0.11732500046491623,
-0.05528886243700981,
0.018474522978067398,
-0.051637012511491776,
-0.11301809549331665,
0.20378223061561584,
0.21121886372566223,
-0.08458680659532547,
-0.051740601658821106,
-0.07719692587852478,
-0.14965039491653442,
-0.03696726635098457,
0.18489252030849457,
0.4227626323699951,
-0.18357576429843903,
-0.053213637322187424,
0.04831977188587189,
0.1541459858417511,
-0.15597635507583618,
-0.21549944579601288,
0.1601945161819458,
0.271412193775177,
-0.030375748872756958,
0.1354776918888092,
-0.16064044833183289,
-0.4946630895137787,
0.4387160539627075,
-0.0953129231929779,
-0.0475296676158905,
-0.3489287495613098,
-0.08413773030042648,
-0.20942986011505127,
0.4288804531097412,
-0.21768751740455627,
-0.1845736801624298,
0.14870084822177887,
-0.16055819392204285,
-0.08317729085683823,
0.2851247191429138,
-0.3161592483520508,
0.23396369814872742,
-0.16656632721424103,
0.28436779975891113,
-0.2144715040922165,
0.25156378746032715,
-0.1706230789422989,
-0.23731064796447754,
0.07652638852596283,
-0.003495166078209877,
0.22015602886676788,
-0.02361389808356762,
-0.06436608731746674,
0.4597488045692444,
0.1866815984249115,
-0.025122568011283875,
-0.31137651205062866,
0.07991580665111542,
0.1313229352235794,
0.09431156516075134,
0.18498842418193817,
0.1659012883901596,
0.059100206941366196,
-0.19777141511440277,
0.1598697155714035,
0.3206261396408081,
-0.04136907681822777,
0.1875944435596466,
0.03214677423238754,
0.029994763433933258,
0.07766781002283096,
-0.05758708715438843,
0.014312207698822021,
0.008204199373722076,
0.16583530604839325,
-0.17115293443202972,
-0.005198419094085693,
-0.11659898608922958,
-0.16346649825572968,
-0.0740039199590683,
0.47251996397972107,
-0.005251482129096985,
0.24364636838436127,
0.02898159995675087,
-0.3056827783584595,
0.17315730452537537,
0.04753948003053665,
0.4570123255252838,
0.41297417879104614,
0.09927449375391006,
-0.017982877790927887,
0.17301177978515625,
0.014340732246637344,
-0.1530425250530243,
0.192536860704422,
0.1691923588514328,
0.08420799672603607,
0.2540402412414551,
0.01378188282251358,
-0.051237598061561584,
-0.2809138298034668,
-0.17582589387893677,
-0.05213170498609543,
0.4013002812862396,
-0.3456524610519409,
0.28507816791534424,
-0.3515448272228241,
-0.25962066650390625,
-0.14094628393650055,
0.06017329543828964,
-0.24364739656448364,
-0.5724019408226013,
-0.11107175052165985,
0.20066964626312256,
-0.2171984314918518,
0.22269415855407715,
-0.05259830877184868,
0.04616272449493408,
0.08318646252155304,
0.0351666659116745,
0.08859796822071075,
-0.1854124367237091,
-0.421764075756073,
0.004588071256875992,
0.703942596912384,
-0.28533095121383667,
0.13791722059249878,
0.05217228829860687,
-0.10074383020401001,
-0.07161978632211685,
-0.24646875262260437,
0.03104068711400032,
-0.26333656907081604,
0.1140303984284401,
0.2701537609100342,
0.22070495784282684,
-0.1247829720377922,
-0.4931541085243225,
0.23354680836200714,
0.06276824325323105,
-0.14149808883666992,
0.15539826452732086,
0.3257589042186737,
0.13826517760753632,
-0.0321471206843853,
-0.2257927507162094,
-0.16355250775814056,
-0.279489129781723,
-0.05056382715702057,
-0.15432199835777283,
0.08665589988231659,
0.17819450795650482,
0.3296273648738861,
0.13140659034252167,
-0.15013420581817627,
-0.34188857674598694,
-0.022200729697942734,
-0.0028348490595817566,
0.11715179681777954,
-0.1419067233800888,
-0.1912265121936798,
-0.01679512858390808,
-0.15977390110492706,
0.10078512132167816,
-0.2977178394794464,
-0.7480368614196777,
0.04224233329296112,
-0.2447790503501892,
0.2559606432914734,
-0.03307580575346947,
0.04896138608455658,
-0.16396550834178925,
0.21840213239192963,
0.002098720520734787,
0.009695395827293396,
-0.07501214742660522,
-0.013009931892156601,
-0.21302741765975952,
0.3528372645378113,
0.011950520798563957,
0.46700865030288696,
0.11054471135139465,
0.5798467397689819,
-0.11252093315124512,
-0.051256172358989716,
0.269713431596756,
0.1578381210565567,
0.16185683012008667,
-0.2310597002506256,
-0.35910841822624207,
-0.15900447964668274,
-0.10709404945373535,
-0.13808485865592957,
0.1258116513490677,
-0.01644216477870941,
-0.13046397268772125,
-0.0874377191066742,
-0.19135677814483643,
0.11934240162372589,
-0.21151763200759888,
0.17470800876617432,
-0.0884617418050766,
-0.11350494623184204,
-0.11137698590755463,
0.14462251961231232,
-0.0785670131444931,
0.009385675191879272,
0.15512382984161377,
-0.04905761778354645,
-0.010532621294260025,
-0.3051636815071106,
-0.3779470920562744,
0.04466941952705383,
-0.32278165221214294,
0.2705495357513428,
-0.09128616750240326,
0.36483505368232727,
0.040113285183906555,
-0.07779502123594284,
-0.08652645349502563,
-0.035053811967372894,
0.6078673005104065,
0.0453384593129158,
-0.016390638425946236,
0.18551692366600037,
-0.06419406831264496,
-0.3200216293334961,
-0.2568816542625427,
-0.16623914241790771,
0.2193959653377533,
0.24906118214130402,
0.5175326466560364,
-0.31462231278419495,
-0.08809832483530045,
0.03389209508895874,
0.3671298921108246,
-0.25569948554039,
-0.28140804171562195,
-0.1907690167427063,
-0.12781770527362823,
-0.2502499222755432,
0.2697964012622833,
0.1088467463850975,
0.20313599705696106,
-0.13371403515338898,
-0.10875400900840759,
-0.10892235487699509,
-0.35275769233703613,
0.23407098650932312,
0.14290861785411835,
0.014329377561807632,
-0.01268453523516655,
0.31144416332244873,
-0.08649194985628128,
-0.06382954120635986,
0.23190635442733765,
0.5363825559616089,
-0.3034793436527252,
-0.32567599415779114,
-0.1191963404417038,
0.13513417541980743,
0.2992806136608124,
0.2735697627067566,
-0.261308878660202,
0.18363508582115173,
0.034136008471250534,
-0.0903707891702652,
-0.03389284387230873,
-0.013618167489767075,
0.26212432980537415,
0.17645613849163055,
-0.5402937531471252,
-0.31938090920448303,
0.37323856353759766,
0.1588355302810669,
-0.09564787149429321,
0.16530852019786835,
0.010416984558105469,
-0.30372658371925354,
0.5918175578117371,
0.11510812491178513,
0.803276538848877,
-0.3008520305156708,
0.22453175485134125,
0.4237912893295288,
0.38358622789382935,
0.45790672302246094,
-0.15012454986572266,
-0.004076192155480385,
-0.5529822707176208,
-0.20497307181358337,
0.0020761638879776,
-0.19148659706115723,
0.18131513893604279,
-0.1121874451637268,
-0.14363011717796326,
0.1795659363269806,
-0.4170820713043213,
0.23384112119674683,
-0.10707622021436691,
0.23683522641658783,
-0.2632588744163513,
-0.1094667837023735,
-0.5293250679969788,
0.17562749981880188,
-0.058551959693431854,
-0.07743297517299652,
-0.15694677829742432,
-0.09791599959135056,
0.019600719213485718,
-0.3092416226863861,
-0.39495131373405457,
0.029791295528411865,
-0.25001227855682373,
0.11328436434268951,
0.020608827471733093,
-0.07739964127540588,
0.0958259329199791,
0.5452219843864441,
0.22360646724700928,
0.13985313475131989,
0.09890594333410263,
0.13302338123321533,
-0.2303423136472702,
-0.12396213412284851,
-0.02221503295004368,
0.03491317853331566,
0.15161849558353424,
0.020601235330104828,
-0.24618473649024963,
0.18769830465316772,
0.10410657525062561,
-0.29184579849243164,
0.029098138213157654,
0.135121688246727,
0.015560482628643513,
-0.41373211145401,
-0.22677193582057953,
-0.2134818434715271,
0.151007741689682,
-0.21329477429389954,
0.13798820972442627,
0.21644261479377747,
-0.020916730165481567,
0.2371865212917328,
0.14678293466567993,
-0.17697633802890778,
-0.07827401906251907,
0.4070196747779846,
-0.058263227343559265,
0.01598704606294632,
0.7515345215797424,
0.6398617029190063,
-0.1245405301451683,
-0.3088960349559784,
0.25522738695144653,
0.3470575213432312,
-0.18799267709255219,
0.1934090256690979,
-0.15607649087905884,
-0.0601947158575058,
0.10024113953113556,
0.3280290365219116,
0.2934340238571167,
-0.03353074565529823,
-0.040191881358623505,
-0.5118392705917358,
-0.36713188886642456,
0.3505438268184662,
-0.07412981986999512,
0.1860986202955246,
-0.22559785842895508,
-0.22190174460411072,
-0.35542112588882446,
0.19041666388511658,
-0.2964797019958496,
0.15056046843528748,
-0.3613344728946686,
-0.013410653918981552,
0.1972876489162445,
0.12952877581119537,
0.2392226904630661,
0.1475379765033722,
0.14386071264743805,
0.17143622040748596,
-0.03518955409526825,
-0.24899114668369293,
-0.16835439205169678,
0.0916120857000351,
0.014589011669158936,
0.08556770533323288,
-0.011595562100410461,
-0.412996381521225,
0.18934333324432373,
-0.09067495167255402,
0.19798675179481506,
0.3382595181465149,
-0.14379248023033142,
0.25753310322761536,
0.27094030380249023,
0.3091321289539337,
0.1130010336637497,
0.3450332283973694,
-0.315295934677124,
0.20305591821670532,
0.24104146659374237,
0.18760940432548523,
0.09614565968513489,
-0.05323314666748047,
-0.16836369037628174,
-0.08337997645139694,
-0.318864643573761,
0.12927253544330597,
0.31374791264533997,
-0.4271368980407715,
-0.0958770215511322,
0.08907850086688995,
0.10017986595630646,
0.542427122592926,
-0.40196603536605835,
-0.07373721897602081,
0.45831453800201416,
0.20904964208602905,
-0.1180562749505043,
-0.2962983548641205,
0.3270525336265564,
-0.04949980974197388,
-0.2528999149799347,
0.35362523794174194,
-0.02666325867176056,
-0.2713947892189026,
-0.19288457930088043,
0.194559708237648,
0.33912423253059387,
0.4652552306652069,
0.10011617094278336,
0.5537570714950562,
-0.2332507222890854,
-0.1800144463777542,
0.2515196204185486,
-0.025470273569226265,
0.2725743353366852,
0.2227729707956314,
-0.4685109853744507,
0.04698174446821213,
0.041030753403902054,
0.03444233909249306,
0.30811649560928345,
-0.4735734164714813,
0.3034434914588928,
0.3587430715560913,
-0.05766611546278,
-0.21548685431480408,
0.008546784520149231,
0.3558684289455414,
0.060260917991399765,
0.0012029185891151428,
-0.16473685204982758,
0.24536152184009552,
-0.195283442735672,
0.004876773804426193,
-0.0440760962665081,
-0.1965109407901764,
-0.05635163187980652,
0.03411141037940979,
-0.023369772359728813,
-0.21713486313819885,
0.0652981773018837,
0.16963599622249603,
-0.17228956520557404,
-0.2207922786474228,
-0.011844895780086517,
0.18529585003852844,
-0.008922755718231201,
-0.22830387949943542,
-0.06519300490617752,
0.3388657867908478,
0.20705068111419678,
0.06138819083571434,
0.06584633886814117,
0.3838295638561249,
0.3625398576259613,
-0.3930125832557678,
0.2586612403392792,
-0.1352144330739975,
0.08768626302480698,
0.047300372272729874,
0.29331597685813904,
-0.014923647046089172,
0.2597935199737549,
0.409945011138916,
0.12878382205963135,
-0.1841488927602768,
-0.2022673487663269,
0.28653016686439514,
0.18625381588935852,
-0.07272004336118698,
0.05058473348617554,
-0.1249636709690094,
0.09137746691703796,
-0.15161734819412231,
0.17001888155937195,
-0.3826930522918701,
-0.12419843673706055,
0.4378187954425812,
-0.04496831074357033,
0.1976901888847351,
-0.12962231040000916,
0.07993774116039276,
-0.029271265491843224,
0.6063300967216492,
0.4886808395385742,
0.3700910210609436,
-0.4185542166233063,
0.1090223491191864,
-0.4707636833190918,
0.1318569779396057,
-0.3399411141872406,
0.1000346913933754,
0.013757705688476562,
-0.22939415276050568,
0.022688627243041992,
0.28569266200065613,
0.09390406310558319,
0.0017531290650367737,
-0.0985233411192894,
0.425285667181015,
-0.33426082134246826,
-0.2762293219566345,
0.2710147202014923,
-0.021075734868645668,
-0.08009070158004761,
-0.19425153732299805,
0.2401561290025711,
-0.3664935231208801,
0.04391933232545853,
-0.039196573197841644,
-0.21189573407173157,
0.020259983837604523,
-0.1291724145412445,
0.4378739297389984,
0.1872028410434723,
0.4227040410041809,
0.2123417854309082,
-0.1855921745300293,
-0.22884945571422577,
-0.29481711983680725,
0.01272226870059967,
-0.03728600591421127,
-0.014175981283187866,
0.495428204536438,
-0.2799762487411499,
0.009539775550365448,
-0.30488520860671997,
0.396695077419281,
0.06581006944179535,
-0.1375439465045929,
-0.31999969482421875,
0.1432713121175766,
0.06726516783237457,
-0.043537676334381104,
0.08731237053871155,
0.3415440618991852,
-0.04335809499025345,
0.31703999638557434,
-0.1256978064775467,
-0.15048229694366455,
0.4363164007663727,
-0.6287791728973389,
-0.24552376568317413,
0.0040539465844631195,
0.04991031438112259,
0.1430416703224182,
-0.04084964096546173,
-0.5292084813117981,
-0.019964098930358887,
0.2950016260147095,
-0.06387746334075928,
-0.23206350207328796,
0.02746504917740822,
0.1646777093410492,
0.05752702057361603,
-0.06600692868232727,
-0.08988693356513977,
-0.0659877359867096,
-0.14181819558143616,
0.2631465196609497,
-0.14197276532649994
] |
https://github.com/huggingface/datasets/issues/6123 | Hi! Thanks for the investigation, but we are not the authors of these datasets, so please report this on the Hub instead so that the actual authors can fix it. | Inaccurate Bounding Boxes in "wildreceipt" Dataset | ### Describe the bug
I would like to bring to your attention an issue related to the accuracy of bounding boxes within the "wildreceipt" dataset, which is made available through the Hugging Face API. Specifically, I have identified a discrepancy between the bounding boxes generated by the dataset loading commands, namely `load_dataset("Theivaprakasham/wildreceipt")` and `load_dataset("jinhybr/WildReceipt")`, and the actual labels and corresponding bounding boxes present in the dataset.
To illustrate this divergence, I've provided two examples in the form of screenshots. These screenshots highlight the contrasting outcomes between my personal implementation of the dataloader and the implementation offered by Hugging Face:
**Example 1:**
![image](https://github.com/huggingface/datasets/assets/50714796/7a6604d2-899d-4102-a008-1a28c90698f1)
![image](https://github.com/huggingface/datasets/assets/50714796/eba458c7-d3af-4868-a520-8b683aa96f66)
![image](https://github.com/huggingface/datasets/assets/50714796/9f394891-5f5b-46f7-8e52-071b724aedab)
**Example 2:**
![image](https://github.com/huggingface/datasets/assets/50714796/a2b2a8d3-124e-4990-b64a-5133cf4be2fe)
![image](https://github.com/huggingface/datasets/assets/50714796/6ee25642-35aa-40ad-ac1e-899d33be90df)
![image](https://github.com/huggingface/datasets/assets/50714796/5e42ff91-9fc4-4520-8803-0e225656f96c)
It's important to note that my dataloader implementation is based on the same dataset files as utilized in the Hugging Face implementation. For your reference, you can access the dataset files through this link: [wildreceipt dataset files](https://download.openmmlab.com/mmocr/data/wildreceipt.tar).
This inconsistency in bounding box accuracy warrants investigation and rectification for maintaining the integrity of the "wildreceipt" dataset. Your attention and assistance in addressing this matter would be greatly appreciated.
### Steps to reproduce the bug
```python
import matplotlib.pyplot as plt
from datasets import load_dataset
# Define functions to convert bounding box formats
def convert_format1(box):
x, y, w, h = box
x2, y2 = x + w, y + h
return [x, y, x2, y2]
def convert_format2(box):
x1, y1, x2, y2 = box
return [x1, y1, x2, y2]
def plot_cropped_image(image, box, title):
cropped_image = image.crop(box)
plt.imshow(cropped_image)
plt.title(title)
plt.axis('off')
plt.savefig(title+'.png')
plt.show()
doc_index = 1
word_index = 3
dataset = load_dataset("Theivaprakasham/wildreceipt")['train']
bbox_hugging_face = dataset[doc_index]['bboxes'][word_index]
text_unit_face = dataset[doc_index]['words'][word_index]
common_box_hugface_1 = convert_format1(bbox_hugging_face)
common_box_hugface_2 = convert_format2(bbox_hugging_face)
plot_cropped_image(image_hugging, common_box_hugface_1,
f'Hugging Face Bouding boxes (x,y,w,h format) \n its associated text unit: {text_unit_face}')
plot_cropped_image(image_hugging, common_box_hugface_2,
f'Hugging Face Bouding boxes (x1,y1,x2, y2 format) \n its associated text unit: {text_unit_face}')
```
### Expected behavior
The bounding boxes generated by the "wildreceipt" dataset in HuggingFace implementation loading commands should accurately match the actual labels and bounding boxes of the dataset.
### Environment info
- Python version: 3.8
- Hugging Face datasets version: 2.14.2
- Dataset file taken from this link: https://download.openmmlab.com/mmocr/data/wildreceipt.tar | 30 | Inaccurate Bounding Boxes in "wildreceipt" Dataset
### Describe the bug
I would like to bring to your attention an issue related to the accuracy of bounding boxes within the "wildreceipt" dataset, which is made available through the Hugging Face API. Specifically, I have identified a discrepancy between the bounding boxes generated by the dataset loading commands, namely `load_dataset("Theivaprakasham/wildreceipt")` and `load_dataset("jinhybr/WildReceipt")`, and the actual labels and corresponding bounding boxes present in the dataset.
To illustrate this divergence, I've provided two examples in the form of screenshots. These screenshots highlight the contrasting outcomes between my personal implementation of the dataloader and the implementation offered by Hugging Face:
**Example 1:**
![image](https://github.com/huggingface/datasets/assets/50714796/7a6604d2-899d-4102-a008-1a28c90698f1)
![image](https://github.com/huggingface/datasets/assets/50714796/eba458c7-d3af-4868-a520-8b683aa96f66)
![image](https://github.com/huggingface/datasets/assets/50714796/9f394891-5f5b-46f7-8e52-071b724aedab)
**Example 2:**
![image](https://github.com/huggingface/datasets/assets/50714796/a2b2a8d3-124e-4990-b64a-5133cf4be2fe)
![image](https://github.com/huggingface/datasets/assets/50714796/6ee25642-35aa-40ad-ac1e-899d33be90df)
![image](https://github.com/huggingface/datasets/assets/50714796/5e42ff91-9fc4-4520-8803-0e225656f96c)
It's important to note that my dataloader implementation is based on the same dataset files as utilized in the Hugging Face implementation. For your reference, you can access the dataset files through this link: [wildreceipt dataset files](https://download.openmmlab.com/mmocr/data/wildreceipt.tar).
This inconsistency in bounding box accuracy warrants investigation and rectification for maintaining the integrity of the "wildreceipt" dataset. Your attention and assistance in addressing this matter would be greatly appreciated.
### Steps to reproduce the bug
```python
import matplotlib.pyplot as plt
from datasets import load_dataset
# Define functions to convert bounding box formats
def convert_format1(box):
x, y, w, h = box
x2, y2 = x + w, y + h
return [x, y, x2, y2]
def convert_format2(box):
x1, y1, x2, y2 = box
return [x1, y1, x2, y2]
def plot_cropped_image(image, box, title):
cropped_image = image.crop(box)
plt.imshow(cropped_image)
plt.title(title)
plt.axis('off')
plt.savefig(title+'.png')
plt.show()
doc_index = 1
word_index = 3
dataset = load_dataset("Theivaprakasham/wildreceipt")['train']
bbox_hugging_face = dataset[doc_index]['bboxes'][word_index]
text_unit_face = dataset[doc_index]['words'][word_index]
common_box_hugface_1 = convert_format1(bbox_hugging_face)
common_box_hugface_2 = convert_format2(bbox_hugging_face)
plot_cropped_image(image_hugging, common_box_hugface_1,
f'Hugging Face Bouding boxes (x,y,w,h format) \n its associated text unit: {text_unit_face}')
plot_cropped_image(image_hugging, common_box_hugface_2,
f'Hugging Face Bouding boxes (x1,y1,x2, y2 format) \n its associated text unit: {text_unit_face}')
```
### Expected behavior
The bounding boxes generated by the "wildreceipt" dataset in HuggingFace implementation loading commands should accurately match the actual labels and bounding boxes of the dataset.
### Environment info
- Python version: 3.8
- Hugging Face datasets version: 2.14.2
- Dataset file taken from this link: https://download.openmmlab.com/mmocr/data/wildreceipt.tar
Hi! Thanks for the investigation, but we are not the authors of these datasets, so please report this on the Hub instead so that the actual authors can fix it. | [
0.05812062323093414,
-0.16705407202243805,
0.01744590699672699,
0.37785378098487854,
-0.0714922547340393,
-0.10320500284433365,
-0.04753547161817551,
0.1165100634098053,
0.15703505277633667,
0.0594196580350399,
-0.26452022790908813,
-0.02778661623597145,
-0.041489433497190475,
0.3027552366256714,
0.06198427826166153,
-0.21361161768436432,
0.19976873695850372,
-0.08308586478233337,
-0.1578693836927414,
-0.1484309583902359,
-0.09230600297451019,
0.36913010478019714,
-0.1916234940290451,
-0.04681772366166115,
-0.11789071559906006,
0.04505355656147003,
0.08109720796346664,
0.22399422526359558,
-0.08549266308546066,
-0.12203125655651093,
0.2416219711303711,
-0.12150398641824722,
-0.14575669169425964,
0.6215757727622986,
-0.0001122916946769692,
-0.12487350404262543,
0.05344081297516823,
0.0261019766330719,
-0.2363632172346115,
-0.0651877373456955,
-0.07437847554683685,
-0.2695755064487457,
-0.10291535407304764,
0.23033711314201355,
-0.0745045617222786,
-0.2532041668891907,
-0.15578687191009521,
-0.14290545880794525,
0.4233427941799164,
0.05351614952087402,
0.19137060642242432,
0.5997320413589478,
0.08403358608484268,
-0.02861027792096138,
0.3164266347885132,
0.18001076579093933,
-0.05832526832818985,
0.11754996329545975,
0.1948605477809906,
-0.03855577111244202,
-0.328548401594162,
0.17315325140953064,
0.34274744987487793,
-0.2481931746006012,
0.07101769745349884,
0.12792226672172546,
-0.6036744117736816,
-0.29006874561309814,
-0.2003256380558014,
0.3068118095397949,
0.1836913824081421,
-0.1708003431558609,
-0.659264862537384,
-0.5113648176193237,
-0.25760939717292786,
-0.13065677881240845,
0.12557195127010345,
0.1378052830696106,
0.13312621414661407,
0.10569840669631958,
-0.33000388741493225,
0.20104093849658966,
0.032955363392829895,
-0.18589147925376892,
-0.14943289756774902,
0.07658348232507706,
-0.042319029569625854,
0.07397735118865967,
-0.1485925018787384,
-0.14265325665473938,
-0.034726276993751526,
-0.05217170715332031,
0.030496425926685333,
0.19387325644493103,
-0.3355231285095215,
-0.021885588765144348,
-0.028357092291116714,
0.22914588451385498,
0.1218370795249939,
0.5903315544128418,
0.24666820466518402,
-0.005699454341083765,
-0.32436618208885193,
-0.07410959154367447,
0.2898768484592438,
0.39876145124435425,
-0.037943750619888306,
0.10352253913879395,
0.1419251263141632,
0.21814954280853271,
0.12346121668815613,
0.02927970513701439,
0.1306016594171524,
-0.16910381615161896,
-0.05351947247982025,
-0.08817476779222488,
-0.2768171429634094,
-0.3734894096851349,
-0.40464064478874207,
0.3242766559123993,
-0.05555887520313263,
0.07012351602315903,
0.1412927508354187,
-0.26509758830070496,
-0.1042390763759613,
0.11545813083648682,
0.03787960112094879,
0.16313594579696655,
-0.19691070914268494,
-0.5612539649009705,
-0.3718489408493042,
0.07424142956733704,
-0.2176077961921692,
0.09548329561948776,
0.21605141460895538,
0.013670217245817184,
0.27222001552581787,
0.15544550120830536,
0.27733176946640015,
-0.0019796565175056458,
-0.34932366013526917,
0.00010507553815841675,
0.27428096532821655,
0.16172583401203156,
-0.30475306510925293,
-0.027553677558898926,
0.028963439166545868,
0.15318211913108826,
-0.011564761400222778,
-0.20747241377830505,
-0.11941581964492798,
0.013317003846168518,
0.1543106734752655,
0.1535525768995285,
-0.3520073890686035,
0.018575938418507576,
-0.10964934527873993,
0.04583880677819252,
-0.008473813533782959,
-0.07628221809864044,
0.15933412313461304,
-0.056811653077602386,
0.1316242516040802,
-0.0003697015345096588,
0.20302754640579224,
0.3547336161136627,
-0.34541597962379456,
-0.19266144931316376,
0.2712551951408386,
0.004975294694304466,
0.006640911102294922,
0.32679399847984314,
-0.1967652440071106,
0.10649532079696655,
-0.3394114673137665,
0.09858064353466034,
-0.28281906247138977,
-0.303684264421463,
-0.4492858648300171,
-0.018717002123594284,
-0.16086138784885406,
0.5044747591018677,
-0.1098783016204834,
0.011985920369625092,
-0.12614063918590546,
-0.1497766375541687,
0.17717283964157104,
0.1207881048321724,
0.14806067943572998,
-0.05203027278184891,
-0.15851861238479614,
-0.12330339848995209,
-0.06112392619252205,
0.008479423820972443,
-0.1427973359823227,
-0.11187081038951874,
-0.08267218619585037,
-0.09917750954627991,
0.3077504336833954,
0.047103650867938995,
0.016230877488851547,
0.21931898593902588,
-0.033440012484788895,
-0.15590718388557434,
0.029385004192590714,
0.0350462943315506,
-0.47695910930633545,
0.39369872212409973,
-0.24851872026920319,
0.21219614148139954,
0.03397635370492935,
0.07783237844705582,
-0.2492087036371231,
0.08946850895881653,
0.055187568068504333,
-0.13503678143024445,
0.11605094373226166,
0.08946891874074936,
0.10070560872554779,
-0.08408171683549881,
-0.11102040857076645,
0.42663633823394775,
-0.19315320253372192,
0.3385670483112335,
-0.49637436866760254,
0.05468618869781494,
0.33840203285217285,
0.17794065177440643,
0.11851859092712402,
0.15589769184589386,
-0.05498676747083664,
-0.12572398781776428,
-0.030282553285360336,
0.38702329993247986,
0.21256983280181885,
0.2342069447040558,
-0.056949716061353683,
0.11528722196817398,
0.1557743102312088,
-0.2222784459590912,
-0.1836271584033966,
0.21944434940814972,
0.031054310500621796,
-0.009195588529109955,
-0.3155999481678009,
0.3890150487422943,
-0.1306568831205368,
0.2171798050403595,
-0.058865271508693695,
-0.2555992007255554,
0.004996456205844879,
0.08767847716808319,
-0.06954175978899002,
-0.30578821897506714,
0.2062656581401825,
0.11380204558372498,
0.537125289440155,
0.052013516426086426,
-0.033590592443943024,
0.16820576786994934,
-0.04447861388325691,
-0.11472083628177643,
-0.3783884346485138,
0.36724138259887695,
-0.0867115706205368,
-0.06420467793941498,
0.21204808354377747,
0.4713454246520996,
0.250055730342865,
0.20476661622524261,
0.21137815713882446,
0.06940176337957382,
-0.09599579870700836,
-0.22389715909957886,
0.09116031229496002,
0.21248984336853027,
-0.27932778000831604,
0.06168442964553833,
0.15248747169971466,
0.22619685530662537,
-0.2157357633113861,
0.10908389836549759,
-0.2643069624900818,
-0.020470885559916496,
-0.3902888596057892,
0.07258082181215286,
-0.2316139191389084,
-0.15797914564609528,
-0.15670344233512878,
-0.06262364983558655,
-0.5819794535636902,
-0.274948388338089,
-0.07916319370269775,
0.009500456042587757,
-0.17861633002758026,
-0.06886717677116394,
-0.23063459992408752,
0.2793259024620056,
-0.22352629899978638,
-0.04985550791025162,
-0.08035524934530258,
0.33214181661605835,
-0.3038511276245117,
0.06582548469305038,
0.09292382001876831,
-0.20274333655834198,
0.33016687631607056,
-0.29321548342704773,
0.14897342026233673,
-0.10029391944408417,
-0.37589916586875916,
0.2933318018913269,
-0.13865426182746887,
0.3248606324195862,
0.29624706506729126,
-0.12064416706562042,
0.006604783236980438,
-0.01801697164773941,
0.06585439294576645,
-0.12921403348445892,
-0.38936206698417664,
-0.24265162646770477,
0.13390007615089417,
0.11745572835206985,
-0.22636999189853668,
0.1844508945941925,
0.04083915054798126,
-0.11136426031589508,
0.4203769564628601,
0.10476559400558472,
-0.013790365308523178,
0.13191811740398407,
-0.23554903268814087,
-0.15404391288757324,
-0.18270786106586456,
0.0027312077581882477,
-0.21087650954723358,
-0.6857311725616455,
0.0811576172709465,
-0.16887617111206055,
-0.35451140999794006,
-0.31546035408973694,
-0.0030708983540534973,
0.20804047584533691,
0.058345213532447815,
-0.3810599744319916,
0.06405468285083771,
-0.4652124345302582,
0.18320126831531525,
-0.026452206075191498,
0.10083557665348053,
0.027719413861632347,
-0.1419287621974945,
-0.12960685789585114,
-0.3214193880558014,
-0.44374895095825195,
0.46062055230140686,
0.07942546904087067,
0.23235566914081573,
-0.04637788236141205,
-0.05405116826295853,
0.012299001216888428,
0.21137285232543945,
0.3478872776031494,
-0.01554328203201294,
0.28171205520629883,
-0.013459566049277782,
0.4452524185180664,
-0.211630180478096,
0.1592542827129364,
-0.06978422403335571,
-0.05279363691806793,
0.061387836933135986,
0.31079086661338806,
0.40286242961883545,
0.34664615988731384,
-0.08851145952939987,
-0.16090881824493408,
-0.1482478678226471,
-0.1842326819896698,
0.06837189942598343,
0.12045001983642578,
-0.01358654722571373,
-0.009451866149902344,
0.04370323568582535,
-0.21018317341804504,
-0.23535016179084778,
0.18057461082935333,
-0.31035757064819336,
0.5734007358551025,
0.17109939455986023,
-0.31354814767837524,
0.034473810344934464,
-0.3952785134315491,
0.10662102699279785,
0.09626864641904831,
0.23526442050933838,
0.06391067057847977,
-0.2665241062641144,
-0.018737904727458954,
0.20246970653533936,
0.40191754698753357,
0.1777309775352478,
0.1989385485649109,
-0.058105822652578354,
-0.08264274150133133,
-0.22443105280399323,
-0.1137036606669426,
-0.12650784850120544,
0.11731831729412079,
0.01354200579226017,
0.5134560465812683,
-0.36860552430152893,
0.03161390498280525,
-0.11914488673210144,
0.4683644771575928,
-0.29994240403175354,
-0.16665437817573547,
-0.08797114342451096,
0.16174544394016266,
0.20020157098770142,
-0.09944067895412445,
0.33535999059677124,
0.2032170444726944,
-0.16239216923713684,
0.2359485924243927,
0.23583786189556122,
-0.11213326454162598,
0.09635048359632492,
0.1442902684211731,
0.5690093040466309,
-0.22034481167793274,
0.3217591345310211,
0.4787338674068451,
0.13971573114395142,
0.12343785166740417,
0.9153375625610352,
-0.38682299852371216,
-0.27691563963890076,
-0.04841610789299011,
0.17752385139465332,
0.3073330521583557,
0.3577924966812134,
0.08184795081615448,
-0.10779903084039688,
0.06304041296243668,
0.1149422824382782,
-0.29634419083595276,
0.1914578229188919,
0.1165180578827858,
0.039593640714883804,
-0.03450889140367508,
-0.24422454833984375,
0.46288543939590454,
0.026871152222156525,
-0.08080147951841354,
0.377948135137558,
0.694387674331665,
-0.37109166383743286,
0.1623838245868683,
0.1801796704530716,
0.8176002502441406,
0.1883906126022339,
0.3477592468261719,
0.30055180191993713,
-0.4308754503726959,
0.5786980390548706,
0.31779247522354126,
0.13206832110881805,
-0.3595693111419678,
-0.06902916729450226,
0.03116419166326523,
-0.02685113251209259,
-0.31495973467826843,
0.031186748296022415,
0.21314221620559692,
0.21785834431648254,
-0.3247971534729004,
0.1331530213356018,
0.016994182020425797,
-0.025172501802444458,
0.038311026990413666,
-0.13455171883106232,
-0.15542104840278625,
0.14360912144184113,
0.032759688794612885,
0.29376375675201416,
-0.13515064120292664,
-0.0962938666343689,
-0.3180761933326721,
-0.11727242171764374,
-0.20518088340759277,
0.054512180387973785,
0.10291258990764618,
-0.143894761800766,
0.21279072761535645,
-0.1279568374156952,
-0.23125126957893372,
0.17290538549423218,
0.28757670521736145,
-0.14792314171791077,
-0.17170433700084686,
0.22933484613895416,
0.035443488508462906,
0.3726978003978729,
0.44659051299095154,
0.14396478235721588,
0.2811368405818939,
0.022078976035118103,
-0.013495534658432007,
-0.3161559998989105,
-0.192976176738739,
-0.18337979912757874,
-0.2989724576473236,
0.1384419947862625,
0.010324777103960514,
-0.4346924126148224,
0.13737645745277405,
-0.3055385649204254,
0.21493491530418396,
-0.10099972039461136,
0.1026298850774765,
0.2238570600748062,
0.22369369864463806,
-0.14803829789161682,
0.19129407405853271,
-0.3502172827720642,
-0.20174099504947662,
0.5693621635437012,
-0.31160545349121094,
-0.052956320345401764,
0.4618047773838043,
0.002845168113708496,
-0.08434072881937027,
-0.02456311136484146,
0.053085558116436005,
0.5245453119277954,
-0.783504843711853,
0.1451352834701538,
-0.31744620203971863,
-0.0535409152507782,
0.01694604381918907,
0.3087661862373352,
0.5740024447441101,
-0.3526512086391449,
0.1552577018737793,
-0.1932622343301773,
-0.19356530904769897,
0.11992324143648148,
-0.022120269015431404,
0.2070164978504181,
-0.16776293516159058,
-0.08461245894432068,
0.07902942597866058,
-0.11874629557132721,
-0.2952880263328552,
-0.10681384801864624,
-0.02177586406469345,
-0.22317185997962952,
-0.23483142256736755,
0.0303646307438612,
0.1372459977865219,
0.03177238628268242,
0.07348102331161499,
0.09805361926555634,
-0.1305423080921173,
-0.07227487862110138,
-0.39168983697891235,
0.1007978543639183,
-0.006810898892581463,
-0.306155800819397,
-0.012822918593883514,
0.17775234580039978,
0.001914527267217636,
-0.33171209692955017,
0.0524708554148674,
0.14298591017723083,
0.25732120871543884,
0.0778849720954895,
-0.030954066663980484,
0.20458343625068665,
-0.006118886172771454,
0.17400823533535004,
0.19838373363018036,
0.05136716738343239,
0.18410292267799377,
0.07935556769371033,
-0.3333131968975067,
-0.1429474949836731,
0.30825740098953247,
0.07820577919483185,
0.06876980513334274,
0.1044493019580841,
0.13403159379959106,
-0.043011683970689774,
-0.09016591310501099,
0.009177014231681824,
0.7150453329086304,
0.19239303469657898,
-0.16474181413650513,
-0.3030374348163605,
0.16213026642799377,
0.16795292496681213,
-0.19813485443592072,
-0.25381165742874146,
-0.002832069993019104,
0.26509958505630493,
-0.15581980347633362,
0.19910681247711182,
0.35356852412223816,
-0.34282273054122925,
-0.1454569399356842,
-0.09853023290634155,
0.46114224195480347,
0.2381216287612915,
0.031616099178791046,
0.41000431776046753,
-0.16056741774082184,
0.10480638593435287,
0.29954469203948975,
0.04662023484706879,
0.4290820360183716,
0.1588214784860611,
-0.0073595233261585236,
0.17720603942871094,
-0.2661174237728119,
0.16021420061588287,
0.0389266163110733,
-0.4246973991394043,
0.18028190732002258,
0.18257731199264526,
0.13959187269210815,
0.19553788006305695,
-0.09648504853248596,
0.4254888892173767,
-0.2818235754966736,
-0.036251384764909744,
-0.44055184721946716,
0.23720493912696838,
-0.11709396541118622,
-0.1114521473646164,
0.20522984862327576,
-0.329165518283844,
0.014887392520904541,
-0.01272512972354889,
-0.1550348997116089,
-0.3580321669578552,
0.09843304753303528,
-0.2041674107313156,
-0.1830219179391861,
-0.0737684890627861,
-0.8173342347145081,
-0.09534904360771179,
0.2692157030105591,
-0.13908910751342773,
0.2600405216217041,
0.6864337921142578,
-0.30267879366874695,
0.43261802196502686,
0.14591529965400696,
0.22272105515003204,
0.07912570238113403,
0.29934656620025635,
-0.03519333899021149,
0.0017935074865818024,
0.22288581728935242,
-0.10325208306312561,
0.48088210821151733,
-0.1594325453042984,
-0.23863619565963745,
0.49328404664993286,
0.07194867730140686,
-0.10719652473926544,
-0.16842463612556458,
-0.09681404381990433,
0.4982624053955078,
-0.1812453716993332,
0.14823877811431885,
-0.28551435470581055,
-0.15572550892829895,
-0.1976882517337799,
-0.1687730848789215,
-0.061331041157245636,
-0.244132861495018,
-0.049488365650177,
-0.10449111461639404,
0.08114588260650635,
0.049557581543922424,
0.08235495537519455,
0.03848351165652275,
0.6528759002685547,
0.4371184706687927,
-0.2971091866493225,
-0.09307806193828583,
-0.28790250420570374,
-0.5834439992904663,
0.11291465163230896,
-0.030810095369815826,
-0.19361022114753723,
0.1044951006770134,
-0.06834230571985245,
0.09381604194641113,
-0.1488061398267746,
0.12037283182144165,
-0.10302682220935822,
-0.13618093729019165,
-0.1953398883342743,
-0.28278255462646484,
0.03465668112039566,
0.08652281761169434,
-0.05148099735379219,
-0.046040941029787064,
0.07681582868099213,
0.1783113330602646,
-0.017414085566997528,
0.12198302894830704,
0.09530331194400787,
0.1325075626373291,
-0.10992546379566193,
0.01535838469862938,
0.390571266412735,
0.3619796931743622,
-0.017774682492017746,
-0.07969903945922852,
-0.3875892162322998,
-0.3817099630832672,
-0.06711214780807495,
-0.325367271900177,
0.3018578290939331,
-0.4024953246116638,
0.5513186454772949,
0.02021455019712448,
-0.1951780468225479,
0.03057871013879776,
0.06943343579769135,
0.2897133529186249,
-0.2613527774810791,
-0.4329640567302704,
0.16243556141853333,
-0.18925011157989502,
-0.1828385293483734,
0.40103262662887573,
0.4406992197036743,
0.05057647079229355,
0.11248942464590073,
-0.011660993099212646,
-0.3245551288127899,
0.6289236545562744,
-0.6206051111221313,
0.05826885253190994,
0.10201691836118698,
0.1193748414516449,
0.26945504546165466,
-0.45980188250541687,
-0.4103267788887024,
0.02728380262851715,
0.2842705547809601,
-0.05184166505932808,
0.06953968107700348,
0.21906057000160217,
-0.2872905135154724,
-0.14025895297527313,
0.10963481664657593,
0.7259294390678406,
0.23807473480701447,
-0.29366710782051086,
0.36637771129608154,
-0.012652993202209473
] |
https://github.com/huggingface/datasets/issues/6120 | In which format is your dataset? We could expose the `pre_buffer` flag for Parquet to use PyArrow's background thread pool to speed up loading. | Lookahead streaming support? | ### Feature request
From what I understand, streaming dataset currently pulls the data, and process the data as it is requested.
This can introduce significant latency delays when data is loaded into the training process, needing to wait for each segment.
While the delays might be dataset specific (or even mapping instruction/tokenizer specific)
Is it possible to introduce a `streaming_lookahead` parameter, which is used for predictable workloads (even shuffled dataset with fixed seed). As we can predict in advance what the next few datasamples will be. And fetch them while the current set is being trained.
With enough CPU & bandwidth to keep up with the training process, and a sufficiently large lookahead, this will reduce the various latency involved while waiting for the dataset to be ready between batches.
### Motivation
Faster streaming performance, while training over extra large TB sized datasets
### Your contribution
I currently use HF dataset, with pytorch lightning trainer for RWKV project, and would be able to help test this feature if supported. | 24 | Lookahead streaming support?
### Feature request
From what I understand, streaming dataset currently pulls the data, and process the data as it is requested.
This can introduce significant latency delays when data is loaded into the training process, needing to wait for each segment.
While the delays might be dataset specific (or even mapping instruction/tokenizer specific)
Is it possible to introduce a `streaming_lookahead` parameter, which is used for predictable workloads (even shuffled dataset with fixed seed). As we can predict in advance what the next few datasamples will be. And fetch them while the current set is being trained.
With enough CPU & bandwidth to keep up with the training process, and a sufficiently large lookahead, this will reduce the various latency involved while waiting for the dataset to be ready between batches.
### Motivation
Faster streaming performance, while training over extra large TB sized datasets
### Your contribution
I currently use HF dataset, with pytorch lightning trainer for RWKV project, and would be able to help test this feature if supported.
In which format is your dataset? We could expose the `pre_buffer` flag for Parquet to use PyArrow's background thread pool to speed up loading. | [
-0.4858854413032532,
-0.04234813153743744,
0.018325448036193848,
-0.33982226252555847,
0.020538561046123505,
-0.15050531923770905,
0.16886287927627563,
0.38475334644317627,
0.0726713240146637,
-0.13585174083709717,
-0.025371843948960304,
0.11459393799304962,
-0.23636990785598755,
0.5027632713317871,
0.23880209028720856,
-0.3053702116012573,
0.01262754574418068,
0.1788724809885025,
0.05767837166786194,
0.2589164078235626,
0.12567821145057678,
-0.13058505952358246,
-0.09433361142873764,
-0.050662703812122345,
0.03996412456035614,
0.055033519864082336,
-0.11732816696166992,
-0.1723671853542328,
-0.046660520136356354,
-0.24135920405387878,
0.12277095764875412,
0.34519097208976746,
0.10323631018400192,
0.035372864454984665,
-0.00011698572780005634,
-0.01693471521139145,
0.3420262932777405,
-0.02555614709854126,
-0.15729178488254547,
-0.011989489197731018,
0.004652068018913269,
-0.17761105298995972,
-0.034296393394470215,
-0.17542509734630585,
-0.20743414759635925,
-0.13664430379867554,
0.18413379788398743,
-0.26476284861564636,
0.17662225663661957,
-0.05592934042215347,
0.06664538383483887,
0.3066241443157196,
-0.20403705537319183,
0.07059500366449356,
0.37849506735801697,
0.1415753960609436,
-0.13951535522937775,
-0.21681053936481476,
0.4699789881706238,
-0.14960521459579468,
-0.2317133992910385,
0.2849373519420624,
-0.07562198489904404,
0.10153789818286896,
0.267244815826416,
0.08051015436649323,
0.01592947356402874,
-0.21970388293266296,
-0.3618699014186859,
0.31109994649887085,
0.23397177457809448,
-0.303818017244339,
-0.31196367740631104,
-0.641258955001831,
0.10683460533618927,
-0.03198971971869469,
-0.1324710249900818,
0.4130932092666626,
-0.3716732859611511,
-0.027670200914144516,
-0.16083930432796478,
-0.28928953409194946,
-0.1890045404434204,
0.014566561207175255,
0.11467169225215912,
0.3408377468585968,
0.26680153608322144,
-0.03467894345521927,
0.019988376647233963,
0.05354345217347145,
0.347750186920166,
-0.41107377409935,
0.21097517013549805,
0.16038991510868073,
-0.3798362612724304,
-0.24618303775787354,
-0.32346317172050476,
0.12548913061618805,
0.3148851990699768,
-0.04426974803209305,
0.22007612884044647,
0.32946717739105225,
-0.0349559523165226,
0.2971118092536926,
0.16315515339374542,
-0.21138620376586914,
-0.435538649559021,
-0.08782216161489487,
0.09210685640573502,
0.1497756391763687,
-0.03681829571723938,
-0.03524138033390045,
0.06433884054422379,
0.07439492642879486,
0.08420880883932114,
-0.1390324831008911,
-0.14382782578468323,
0.03679564595222473,
-0.025838468223810196,
-0.09287211298942566,
-0.06507077813148499,
-0.032034389674663544,
0.10513845086097717,
0.1752522736787796,
-0.339362770318985,
0.12120814621448517,
-0.11143743991851807,
0.037082474678754807,
-0.11357273161411285,
-0.5196300148963928,
-0.010681141167879105,
-0.12292923033237457,
-0.09049223363399506,
0.36856937408447266,
0.07841214537620544,
-0.2398589700460434,
0.020880527794361115,
0.027743928134441376,
0.3723577558994293,
0.642261266708374,
-0.081698477268219,
-0.15596982836723328,
0.009555850178003311,
0.2659080922603607,
-0.3370716869831085,
-0.36590129137039185,
0.026864193379878998,
0.33891624212265015,
-0.3011068105697632,
0.27503451704978943,
-0.07899381220340729,
-0.2748027443885803,
0.18196876347064972,
0.06580103933811188,
-0.008485522121191025,
-0.2531776428222656,
-0.6042265295982361,
0.3978244960308075,
-0.214480459690094,
-0.3855903744697571,
-0.22114601731300354,
-0.2182413786649704,
0.002414815127849579,
0.1592172533273697,
0.26505470275878906,
-0.11768083274364471,
-0.19544509053230286,
-0.3129403591156006,
0.06448633968830109,
0.15825895965099335,
0.39157095551490784,
0.2776697874069214,
-0.31708991527557373,
-0.29020002484321594,
-0.06556888669729233,
0.3166012763977051,
0.6532832384109497,
0.04048989713191986,
0.040716834366321564,
0.3917470872402191,
-0.019674092531204224,
0.13168512284755707,
0.17720645666122437,
0.21733541786670685,
0.5025833249092102,
0.06397032737731934,
-0.1261390745639801,
0.5028005838394165,
-0.2957161068916321,
0.09944560378789902,
-0.41067788004875183,
-0.2534286379814148,
-0.1825948804616928,
0.5160233974456787,
-0.01628057099878788,
-0.15854045748710632,
-0.0063683465123176575,
-0.25480037927627563,
0.40782472491264343,
-0.153251051902771,
0.14310255646705627,
-0.27126193046569824,
0.3498164415359497,
0.1193644106388092,
-0.09713754057884216,
-0.23580016195774078,
-0.045919403433799744,
0.11602586507797241,
0.06949631124734879,
0.037185780704021454,
0.11090496927499771,
-0.09240946173667908,
0.23559421300888062,
0.10231846570968628,
-0.038264449685811996,
0.08799561113119125,
-0.009080260992050171,
0.05119720473885536,
-0.02867875248193741,
-0.020066361874341965,
-0.2812197506427765,
0.6176353693008423,
-0.3669019341468811,
0.03716467693448067,
-0.027500029653310776,
0.6513296961784363,
0.1970171183347702,
0.022599462419748306,
0.1981729418039322,
-0.17883040010929108,
-0.004278194159269333,
0.12726256251335144,
0.17437903583049774,
0.2355618178844452,
0.07849031686782837,
0.2006407380104065,
0.06652934849262238,
0.33287984132766724,
0.2387784719467163,
-0.18204867839813232,
0.2769674062728882,
-0.015458671376109123,
0.06612570583820343,
-0.15912862122058868,
-0.18518729507923126,
0.4982563555240631,
0.20911067724227905,
0.24254724383354187,
0.12018489092588425,
-0.3693176507949829,
0.14683496952056885,
0.20736190676689148,
-0.21075597405433655,
0.24645091593265533,
0.17379090189933777,
-0.15522022545337677,
-0.016183525323867798,
-0.39586442708969116,
-0.5465582609176636,
0.15778496861457825,
0.3940851390361786,
-0.16326722502708435,
-0.18587635457515717,
0.34982383251190186,
-0.00741344690322876,
-0.29412025213241577,
-0.04958735406398773,
0.14226742088794708,
0.2233164757490158,
0.2780103087425232,
-0.023718681186437607,
0.10383080691099167,
-0.20245428383350372,
-0.153389111161232,
0.236883744597435,
0.14307165145874023,
0.22328642010688782,
0.054310716688632965,
0.331869900226593,
0.06046619638800621,
-0.23960892856121063,
-0.29195916652679443,
0.12382297962903976,
-0.15134501457214355,
-0.07017269730567932,
0.21971020102500916,
0.056637153029441833,
-0.1693262755870819,
-0.2479410171508789,
-0.031980566680431366,
-0.02298406884074211,
-0.27120789885520935,
0.05941113084554672,
0.5011979341506958,
0.055982351303100586,
-0.02842692844569683,
-0.22803136706352234,
0.38999617099761963,
-0.07184669375419617,
-0.3783838748931885,
-0.292022168636322,
-0.27097955346107483,
0.0710718110203743,
0.05408806353807449,
0.037669405341148376,
0.03455725684762001,
0.36342954635620117,
0.2804441452026367,
0.07171481102705002,
-0.3853289484977722,
-0.3987236022949219,
0.07000499963760376,
-0.033267512917518616,
0.17453359067440033,
-0.11019447445869446,
0.03191230818629265,
-0.02309829741716385,
-0.24987873435020447,
0.054723434150218964,
-0.48617345094680786,
-0.02149767428636551,
-0.22374233603477478,
-0.07297176867723465,
0.14890062808990479,
0.07349920272827148,
0.19104602932929993,
-0.3285517990589142,
-0.22621679306030273,
-0.208974227309227,
0.06271755695343018,
-0.21081717312335968,
-0.3388034403324127,
-0.25737977027893066,
-0.07757571339607239,
0.12018989026546478,
-0.23832882940769196,
-0.06470313668251038,
-0.5863085985183716,
0.5189818143844604,
-0.15516050159931183,
-0.31752344965934753,
-0.14773498475551605,
-0.21589139103889465,
0.09244118630886078,
0.5364739894866943,
-0.5260925889015198,
0.15018725395202637,
0.0640234500169754,
0.11364006996154785,
-0.15757840871810913,
-0.3617297112941742,
0.20931601524353027,
-0.11544115096330643,
-0.004905968904495239,
-0.0713830441236496,
-0.15251848101615906,
-0.1720631867647171,
0.2877092957496643,
0.11282145977020264,
0.23938171565532684,
0.46048715710639954,
0.10634685307741165,
1.071863055229187,
-0.31392914056777954,
-0.059722620993852615,
0.43639200925827026,
0.35490965843200684,
-0.10459272563457489,
-0.09473231434822083,
0.14881430566310883,
0.07612545788288116,
-0.15522414445877075,
-0.004329219460487366,
0.28089362382888794,
-0.17268294095993042,
-0.67177414894104,
-0.256868839263916,
-0.20865005254745483,
0.038587868213653564,
-0.1018451675772667,
0.16030848026275635,
-0.03871617093682289,
0.3303613066673279,
-0.011771731078624725,
0.07547150552272797,
-0.1545562595129013,
-0.2834413945674896,
0.07198929041624069,
0.07612483203411102,
0.5814406871795654,
-0.07162073254585266,
0.0007731318473815918,
0.07906587421894073,
-0.3083943724632263,
0.04268908500671387,
0.1531706154346466,
0.1273200958967209,
0.030626967549324036,
-0.16203761100769043,
0.21348637342453003,
-0.34301361441612244,
0.3860818147659302,
0.11734088510274887,
0.017966659739613533,
-0.15412406623363495,
-0.21516495943069458,
-0.018969476222991943,
-0.17491623759269714,
0.15096347033977509,
-0.3512018620967865,
-0.28695347905158997,
0.14805801212787628,
-0.5506390333175659,
-0.12865664064884186,
0.11541767418384552,
-0.19560465216636658,
-0.003956258296966553,
-0.1947045475244522,
0.016925573348999023,
0.14082907140254974,
0.008272603154182434,
0.21035385131835938,
-0.08689988404512405,
0.32488107681274414,
-0.24939581751823425,
0.1003521978855133,
0.0307502169162035,
0.1317252814769745,
-0.029593195766210556,
-0.017247866839170456,
-0.07355475425720215,
0.16663789749145508,
0.33968019485473633,
0.1790347546339035,
0.03169379383325577,
-0.05669417232275009,
0.201576828956604,
0.5142862200737,
-0.48875993490219116,
-0.04705513268709183,
0.3431849479675293,
0.24489909410476685,
0.20891523361206055,
0.30797526240348816,
0.19591450691223145,
0.3629094362258911,
0.22453950345516205,
-0.2727164030075073,
0.058255307376384735,
0.331983357667923,
-0.13666750490665436,
-0.5877031683921814,
-0.6056268811225891,
0.5079820156097412,
-0.11467491090297699,
0.03716056048870087,
0.5007820725440979,
0.021356238052248955,
-0.05382324010133743,
0.2589424252510071,
0.4482283592224121,
0.880124568939209,
-0.15401999652385712,
0.25679731369018555,
0.3307536542415619,
-0.40404409170150757,
-0.17717164754867554,
-0.3568522036075592,
0.1424376219511032,
-0.25227752327919006,
-0.1067320927977562,
-0.12317338585853577,
-0.19906273484230042,
0.16682381927967072,
0.032088570296764374,
-0.1485404521226883,
0.019978124648332596,
0.4154214560985565,
0.2687179744243622,
0.003751363605260849,
0.16147209703922272,
-0.0575869157910347,
-0.25270509719848633,
-0.34618037939071655,
0.12766125798225403,
-0.2890782952308655,
-0.22668319940567017,
-0.04543019086122513,
-0.3388713002204895,
0.5293931365013123,
0.2255774736404419,
-0.32961133122444153,
0.02982160449028015,
-0.08668629825115204,
-0.35522812604904175,
-0.24538978934288025,
-0.4636848568916321,
0.28500449657440186,
0.006462883669883013,
-0.146052286028862,
-0.2794994115829468,
-0.2444421797990799,
0.48720231652259827,
-0.16296091675758362,
0.23895008862018585,
-0.03875810652971268,
-0.16711020469665527,
0.2681153416633606,
-0.24516534805297852,
-0.17088989913463593,
0.32577160000801086,
0.05389884114265442,
-0.48091962933540344,
-0.2477724850177765,
-0.1384960263967514,
0.6367473602294922,
0.00290515273809433,
0.08382682502269745,
0.13739359378814697,
0.11970295011997223,
-0.1420373171567917,
0.0452037937939167,
0.054872628301382065,
-0.14952009916305542,
-0.03477678820490837,
0.07834300398826599,
0.04273952543735504,
-0.33797892928123474,
0.3762799799442291,
-0.04124092683196068,
0.4811363220214844,
0.33082062005996704,
0.16222676634788513,
-0.351584792137146,
0.032243512570858,
-0.023818418383598328,
0.09934790432453156,
-0.05534522980451584,
-0.1936621367931366,
0.017974350601434708,
0.1438322216272354,
0.18140055239200592,
0.1225726455450058,
-0.20753484964370728,
-0.3009909689426422,
-0.10843541473150253,
-0.3623218238353729,
-0.029408060014247894,
-0.03651833534240723,
-0.3203893005847931,
0.020199697464704514,
0.3194469213485718,
0.18378658592700958,
-0.07181678712368011,
0.1666521579027176,
-0.26178503036499023,
-0.012493327260017395,
0.31781625747680664,
0.1648103892803192,
-0.29554781317710876,
0.10501152276992798,
0.2578422427177429,
0.19209761917591095,
0.013778511434793472,
0.03661750257015228,
-0.1833568513393402,
-0.09510154277086258,
-0.02634376287460327,
0.17897038161754608,
0.20987525582313538,
0.06242433190345764,
-0.37200576066970825,
-0.20126605033874512,
-0.2783837616443634,
-0.08486703038215637,
0.14015713334083557,
-0.0729079619050026,
-0.07556107640266418,
0.006179720163345337,
1.0368572473526,
-0.08833097666501999,
-0.17505553364753723,
-0.0004395022988319397,
0.12538129091262817,
0.0687498152256012,
0.01283174380660057,
-0.06870018690824509,
-0.08213506639003754,
-0.10290027409791946,
0.09108173847198486,
0.08967529982328415,
0.5071395635604858,
0.05256626754999161,
0.5893095135688782,
-0.1734505444765091,
-0.053527455776929855,
-0.1357748806476593,
0.34523922204971313,
0.3105389177799225,
0.1715703308582306,
-0.28785812854766846,
0.5049688816070557,
0.12992966175079346,
-0.15247510373592377,
-0.3672359585762024,
0.037291351705789566,
0.13978877663612366,
0.06746715307235718,
-0.06473509967327118,
0.028314724564552307,
0.49219995737075806,
0.08362196385860443,
0.22922305762767792,
0.3651508688926697,
-0.3591195046901703,
0.19866208732128143,
0.41826996207237244,
0.29863402247428894,
0.07832465320825577,
0.04513072967529297,
0.21661020815372467,
-0.00026046857237815857,
0.019866177812218666,
-0.24718111753463745,
0.3214716613292694,
0.3709927797317505,
-0.023247502744197845,
0.06305313855409622,
-0.3284587860107422,
-0.4753701090812683,
0.34329578280448914,
0.07874795794487,
0.2902959883213043,
0.04762158542871475,
0.11575652658939362,
0.5580372214317322,
-0.18034592270851135,
-0.21308137476444244,
0.18341025710105896,
0.12178296595811844,
0.21309182047843933,
0.017534568905830383,
-0.15782955288887024,
0.098382368683815,
0.3127850890159607,
-0.08885195851325989,
0.03051428124308586,
0.3182523846626282,
0.18989114463329315,
0.3357681632041931,
-0.04978000372648239,
0.1321653127670288,
0.022523818537592888,
0.44272977113723755,
-0.11815375089645386,
-0.0034327730536460876,
0.011078834533691406,
-0.10789202153682709,
0.28190040588378906,
-0.10095766931772232,
0.04518403485417366,
0.024608448147773743,
-0.35082367062568665,
0.0629863440990448,
-0.16689853370189667,
-0.07886236906051636,
0.12857685983181,
0.19144612550735474,
0.20367297530174255,
-0.1986747831106186,
0.42522138357162476,
0.081828773021698,
-0.01905594766139984,
0.27204108238220215,
-0.1428648680448532,
-0.2246502935886383,
-0.27321872115135193,
0.40287578105926514,
0.2637835741043091,
0.08343945443630219,
0.01255745068192482,
-0.16789019107818604,
-0.12314163148403168,
0.08964381366968155,
0.14994198083877563,
-0.2730407118797302,
-0.05442202463746071,
0.17129763960838318,
0.06481169164180756,
-0.17325147986412048,
0.6299979090690613,
0.1862393021583557,
0.04251622036099434,
-0.23112955689430237,
-0.22360661625862122,
-0.30161458253860474,
-0.25125735998153687,
-0.12022767961025238,
-0.018882587552070618,
0.2586173713207245,
0.03899949789047241,
0.32642945647239685,
0.1625211238861084,
-0.2896541357040405,
-0.38334646821022034,
-0.3354910910129547,
0.37026774883270264,
-0.15432381629943848,
-0.07956957817077637,
-0.23128139972686768,
0.1987401843070984,
-0.12141627073287964,
-0.16950534284114838,
0.28906312584877014,
0.11794258654117584,
-0.06167585775256157,
0.168412446975708,
0.0525733083486557,
0.08880425989627838,
0.001483286963775754,
0.005045495927333832,
-0.17464770376682281,
0.16354233026504517,
-0.1264858841896057,
0.15653440356254578,
-0.018987197428941727,
-0.09311497211456299,
-0.15707001090049744,
0.21058756113052368,
-0.2446138560771942,
0.38033437728881836,
0.10625682026147842,
-0.18045935034751892,
-0.1828272044658661,
0.0869295671582222,
-0.05324661731719971,
-0.14207814633846283,
-0.05749160423874855,
-0.09064479172229767,
-0.010582655668258667,
0.14099068939685822,
-0.04896630346775055,
0.1230577826499939,
0.06946901977062225,
-0.24630969762802124,
-0.15803208947181702,
-0.13064424693584442,
0.5625393390655518,
-0.49557703733444214,
-0.10003546625375748,
-0.12963776290416718,
-0.09492885321378708,
0.22492870688438416,
0.19134606420993805,
-0.567353367805481,
0.06999209523200989,
0.3626415729522705,
0.01797926425933838,
0.17809869349002838,
0.3576025664806366,
0.5086261034011841,
-0.004760824143886566,
-0.30632615089416504,
-0.03957629203796387,
0.03151001036167145,
-0.0757310688495636,
-0.2545914947986603,
-0.4257955849170685
] |
https://github.com/huggingface/datasets/issues/6118 | Hi! `IterableDataset.from_generator` expects a generator function, not the object (to be consistent with `Dataset.from_generator`).
You can fix the above snippet as follows:
```python
train_dataset = IterableDataset.from_generator(line_generator, fn_kwargs={"files": model_training_files})
``` | IterableDataset.from_generator() fails with pickle error when provided a generator or iterator | ### Describe the bug
**Description**
Providing a generator in an instantiation of IterableDataset.from_generator() fails with `TypeError: cannot pickle 'generator' object` when the generator argument is supplied with a generator.
**Code example**
```
def line_generator(files: List[Path]):
if isinstance(files, str):
files = [Path(files)]
for file in files:
if isinstance(file, str):
file = Path(file)
yield from open(file,'r').readlines()
...
model_training_files = ['file1.txt', 'file2.txt', 'file3.txt']
train_dataset = IterableDataset.from_generator(generator=line_generator(model_training_files))
```
**Traceback**
Traceback (most recent call last):
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/contextlib.py", line 135, in __exit__
self.gen.throw(type, value, traceback)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 691, in _no_cache_fields
yield
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 701, in dumps
dump(obj, file)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 676, in dump
Pickler(file, recurse=True).dump(obj)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/dill/_dill.py", line 394, in dump
StockPickler.dump(self, obj)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/pickle.py", line 487, in dump
self.save(obj)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 666, in save
dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/dill/_dill.py", line 388, in save
StockPickler.save(self, obj, save_persistent_id)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/dill/_dill.py", line 1186, in save_module_dict
StockPickler.save_dict(pickler, obj)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/pickle.py", line 971, in save_dict
self._batch_setitems(obj.items())
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/pickle.py", line 997, in _batch_setitems
save(v)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 666, in save
dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/dill/_dill.py", line 388, in save
StockPickler.save(self, obj, save_persistent_id)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/pickle.py", line 578, in save
rv = reduce(self.proto)
TypeError: cannot pickle 'generator' object
### Steps to reproduce the bug
1. Create a set of text files to iterate over.
2. Create a generator that returns the lines in each file until all files are exhausted.
3. Instantiate the dataset over the generator by instantiating an IterableDataset.from_generator().
4. Wait for the explosion.
### Expected behavior
I would expect that since the function claims to accept a generator that there would be no crash. Instead, I would expect the dataset to return all the lines in the files as queued up in the `line_generator()` function.
### Environment info
datasets.__version__ == '2.13.1'
Python 3.9.6
Platform: Darwin WE35261 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:22 PDT 2023; root:xnu-8796.121.3~7/RELEASE_X86_64 x86_64
| 29 | IterableDataset.from_generator() fails with pickle error when provided a generator or iterator
### Describe the bug
**Description**
Providing a generator in an instantiation of IterableDataset.from_generator() fails with `TypeError: cannot pickle 'generator' object` when the generator argument is supplied with a generator.
**Code example**
```
def line_generator(files: List[Path]):
if isinstance(files, str):
files = [Path(files)]
for file in files:
if isinstance(file, str):
file = Path(file)
yield from open(file,'r').readlines()
...
model_training_files = ['file1.txt', 'file2.txt', 'file3.txt']
train_dataset = IterableDataset.from_generator(generator=line_generator(model_training_files))
```
**Traceback**
Traceback (most recent call last):
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/contextlib.py", line 135, in __exit__
self.gen.throw(type, value, traceback)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 691, in _no_cache_fields
yield
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 701, in dumps
dump(obj, file)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 676, in dump
Pickler(file, recurse=True).dump(obj)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/dill/_dill.py", line 394, in dump
StockPickler.dump(self, obj)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/pickle.py", line 487, in dump
self.save(obj)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 666, in save
dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/dill/_dill.py", line 388, in save
StockPickler.save(self, obj, save_persistent_id)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/dill/_dill.py", line 1186, in save_module_dict
StockPickler.save_dict(pickler, obj)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/pickle.py", line 971, in save_dict
self._batch_setitems(obj.items())
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/pickle.py", line 997, in _batch_setitems
save(v)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 666, in save
dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/dill/_dill.py", line 388, in save
StockPickler.save(self, obj, save_persistent_id)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/pickle.py", line 578, in save
rv = reduce(self.proto)
TypeError: cannot pickle 'generator' object
### Steps to reproduce the bug
1. Create a set of text files to iterate over.
2. Create a generator that returns the lines in each file until all files are exhausted.
3. Instantiate the dataset over the generator by instantiating an IterableDataset.from_generator().
4. Wait for the explosion.
### Expected behavior
I would expect that since the function claims to accept a generator that there would be no crash. Instead, I would expect the dataset to return all the lines in the files as queued up in the `line_generator()` function.
### Environment info
datasets.__version__ == '2.13.1'
Python 3.9.6
Platform: Darwin WE35261 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:22 PDT 2023; root:xnu-8796.121.3~7/RELEASE_X86_64 x86_64
Hi! `IterableDataset.from_generator` expects a generator function, not the object (to be consistent with `Dataset.from_generator`).
You can fix the above snippet as follows:
```python
train_dataset = IterableDataset.from_generator(line_generator, fn_kwargs={"files": model_training_files})
``` | [
-0.1925230324268341,
0.05175022780895233,
0.012485519051551819,
0.2545914649963379,
0.19072987139225006,
-0.06797074526548386,
0.3202352523803711,
0.22021400928497314,
-0.08589526265859604,
0.06891646981239319,
0.4876116216182709,
0.459286630153656,
-0.4644555449485779,
-0.08491630852222443,
-0.036905646324157715,
-0.3333512544631958,
0.04055904597043991,
0.10580587387084961,
-0.12430335581302643,
0.050520554184913635,
-0.28148266673088074,
0.4798559546470642,
-0.1844254583120346,
0.04283001273870468,
-0.17274895310401917,
0.09701970219612122,
0.046803973615169525,
0.2593997120857239,
-0.1528603732585907,
-0.3983778655529022,
0.27867329120635986,
-0.0247923843562603,
0.06596575677394867,
0.4712236225605011,
-0.00011172847007401288,
0.049042582511901855,
-0.06766095012426376,
-0.025879692286252975,
-0.31856608390808105,
-0.3198472857475281,
-0.11599233746528625,
0.009325340390205383,
-0.2776363492012024,
-0.16224153339862823,
0.06847743690013885,
-0.14221732318401337,
-0.011281516402959824,
-0.15105581283569336,
0.2864145338535309,
0.22026242315769196,
0.19660401344299316,
0.3701327443122864,
0.2988542318344116,
-0.301619291305542,
0.07212647795677185,
0.07130086421966553,
-0.3147541582584381,
0.4709703326225281,
0.0543573722243309,
0.16615402698516846,
0.22783929109573364,
0.16859671473503113,
-0.10908624529838562,
-0.11152355372905731,
0.4437803626060486,
0.04892892763018608,
0.06317594647407532,
-0.06270729005336761,
-0.19304782152175903,
0.18590815365314484,
0.023269155994057655,
-0.17596040666103363,
-0.27772417664527893,
-0.4122946262359619,
-0.10324925184249878,
-0.46006283164024353,
0.28986552357673645,
-0.031553782522678375,
-0.44480255246162415,
0.07213813811540604,
0.13988934457302094,
-0.1768902689218521,
-0.19001168012619019,
-0.04492805898189545,
0.31974345445632935,
0.13545991480350494,
-0.14315561950206757,
0.11355380713939667,
0.43019264936447144,
0.27187880873680115,
0.08063562214374542,
-0.10070764273405075,
-0.04819881543517113,
0.2213677167892456,
-0.07321806252002716,
-0.11078593134880066,
0.09522531926631927,
-0.36945202946662903,
-0.00544564425945282,
0.05299884080886841,
0.3211105167865753,
-0.20569069683551788,
-0.13869643211364746,
0.10064202547073364,
0.2800214886665344,
0.017536863684654236,
-0.011527851223945618,
0.4393742084503174,
0.06385687738656998,
0.3320436477661133,
-0.20199596881866455,
-0.1331021785736084,
0.003308437764644623,
-0.3711993396282196,
0.3407299816608429,
0.1577170193195343,
0.1340196281671524,
0.14466114342212677,
-0.19027113914489746,
-0.09980450570583344,
-0.43488895893096924,
-0.1959669142961502,
0.23257561028003693,
0.20791283249855042,
-0.07908075302839279,
0.2611444592475891,
0.017466090619564056,
0.10391969978809357,
-0.017824243754148483,
-0.41329100728034973,
-0.20048972964286804,
0.05411654710769653,
-0.04301297664642334,
0.02824266254901886,
-0.2747025191783905,
-0.23642976582050323,
0.28809523582458496,
-0.021791119128465652,
-0.4016466736793518,
0.07363885641098022,
0.2893819212913513,
-0.33443576097488403,
0.1235884577035904,
-0.026989195495843887,
0.036666542291641235,
-0.047771088778972626,
0.2951488792896271,
-0.39767855405807495,
0.008929863572120667,
0.007788239978253841,
-0.026016049087047577,
-0.29719826579093933,
-0.10887690633535385,
0.1893882304430008,
0.08852928876876831,
0.08536224067211151,
-0.32993775606155396,
-0.05208973586559296,
0.3180951774120331,
-0.08347854018211365,
-0.1310584992170334,
-0.3963388204574585,
-0.16647732257843018,
-0.3215799927711487,
0.12027428299188614,
0.2991344630718231,
-0.3090059161186218,
0.15342099964618683,
-0.3030065596103668,
-0.07654663920402527,
0.5325575470924377,
0.16262122988700867,
-0.22795547544956207,
0.6503434777259827,
-0.3881015181541443,
0.15830746293067932,
0.6200206279754639,
0.35463789105415344,
-0.1969817876815796,
0.0847165435552597,
0.06739691644906998,
0.3531544804573059,
0.11928854882717133,
-0.10093439370393753,
-0.3687475025653839,
-0.29655921459198,
0.2013365924358368,
0.14664465188980103,
-0.12453071773052216,
-0.0854288786649704,
-0.23213566839694977,
0.13901329040527344,
-0.0039291903376579285,
-0.13729190826416016,
0.1628793627023697,
0.17027094960212708,
-0.2782936692237854,
-0.10859953612089157,
0.3623785972595215,
-0.29144981503486633,
-0.0762200728058815,
0.06096896901726723,
0.3157936632633209,
0.02236420102417469,
0.06431354582309723,
-0.10113448649644852,
-0.22653433680534363,
0.17091777920722961,
-0.27182090282440186,
-0.011556334793567657,
-0.20150697231292725,
0.06083136796951294,
-0.058713652193546295,
0.3660954236984253,
-0.5099748969078064,
-0.2195863425731659,
0.08846022188663483,
0.39987608790397644,
0.20582540333271027,
-0.21184097230434418,
-0.33074870705604553,
-0.22317124903202057,
-0.5027743577957153,
0.05918758735060692,
-0.3441765606403351,
0.07616688311100006,
-0.07889793068170547,
-0.3262985944747925,
-0.07805541157722473,
0.15897789597511292,
0.060533396899700165,
-0.10855302214622498,
-0.04936349764466286,
0.16197186708450317,
0.07976877689361572,
-0.12847715616226196,
-0.27781960368156433,
0.0615607425570488,
-0.18453596532344818,
0.17625132203102112,
-0.23828935623168945,
0.095378577709198,
0.07410310208797455,
0.14187996089458466,
0.2544691562652588,
0.1932884007692337,
-0.17920458316802979,
0.16572730243206024,
0.11991934478282928,
0.04396685212850571,
0.15927855670452118,
0.1763865053653717,
0.20446640253067017,
-0.0977730005979538,
0.007102590519934893,
0.4257677495479584,
0.17218418419361115,
0.02925841696560383,
-0.32493799924850464,
0.054253287613391876,
0.681912362575531,
0.30341288447380066,
0.04395327717065811,
0.11402741074562073,
-0.12625250220298767,
-0.11414435505867004,
-0.2112656831741333,
0.4159000515937805,
0.2709732949733734,
-0.08868621289730072,
0.10913699120283127,
0.026384366676211357,
0.09466621279716492,
-0.17779506742954254,
0.23635421693325043,
-0.11372251063585281,
0.26229482889175415,
0.43095633387565613,
-0.2568524181842804,
-0.049858514219522476,
-0.2312973439693451,
-0.3782895803451538,
-0.18453338742256165,
0.4345347285270691,
-0.11518750339746475,
0.2506817877292633,
0.016792982816696167,
0.10996051132678986,
-0.25982314348220825,
-0.07658374309539795,
0.040728189051151276,
-0.2142079770565033,
-0.17783062160015106,
0.6049759387969971,
-0.17531397938728333,
-0.10471709817647934,
0.0667584091424942,
-0.08870361745357513,
0.14489391446113586,
0.09726741909980774,
-0.04735638573765755,
0.019606783986091614,
-0.25033241510391235,
0.07513708621263504,
0.3514643609523773,
-0.6439958214759827,
0.31880730390548706,
0.021703191101551056,
-0.3663593828678131,
-0.09861919283866882,
0.17938069999217987,
0.2689797282218933,
-0.2192152738571167,
0.31924864649772644,
0.6143232583999634,
0.1927531361579895,
-0.03184817358851433,
-0.40477868914604187,
0.22955209016799927,
0.013062134385108948,
0.04747761785984039,
0.0397767573595047,
-0.04189472272992134,
-0.014426149427890778,
-0.014364711940288544,
-0.213862344622612,
-0.027484344318509102,
-0.24847964942455292,
0.17210781574249268,
0.08828546106815338,
0.2946167290210724,
0.5304079055786133,
0.24700653553009033,
0.26870015263557434,
0.10620778799057007,
-0.03833753615617752,
0.003531079739332199,
-0.2891685366630554,
0.162314772605896,
-0.16582608222961426,
-0.17350056767463684,
-0.11056635528802872,
-0.3926813006401062,
0.30436307191848755,
0.01883254572749138,
-0.19052961468696594,
0.04141826927661896,
-0.12852434813976288,
0.3286254405975342,
-0.11812316626310349,
-0.0636196956038475,
0.08875502645969391,
0.26603421568870544,
-0.08564143627882004,
-0.08455739915370941,
0.3285022974014282,
0.31512749195098877,
-0.05591069161891937,
0.1957695484161377,
0.4288586974143982,
0.09875223785638809,
0.040626153349876404,
0.7318695783615112,
0.32333290576934814,
-0.22042356431484222,
0.5691491365432739,
-0.012173429131507874,
-0.022510461509227753,
-0.17707133293151855,
-0.3932430148124695,
-0.28373420238494873,
-0.02997303009033203,
-0.16251620650291443,
-0.106331005692482,
-0.2623312473297119,
0.1804051548242569,
-0.08289231359958649,
0.2692256271839142,
0.09411939978599548,
-0.31762605905532837,
0.20948301255702972,
-0.04866394028067589,
0.37743696570396423,
-0.3131876289844513,
0.16537366807460785,
-0.042089808732271194,
0.2270256131887436,
0.07754871249198914,
-0.1026659905910492,
0.5104563236236572,
-0.24732361733913422,
-0.16932940483093262,
-0.33129605650901794,
-0.38340499997138977,
0.09781533479690552,
0.32316190004348755,
-0.022082187235355377,
0.0018567070364952087,
-0.24985961616039276,
0.00950402021408081,
-0.035644546151161194,
0.8467940092086792,
-0.11296986043453217,
-0.06349457800388336,
0.2608496844768524,
0.11582933366298676,
0.05210021883249283,
0.019389450550079346,
0.030787207186222076,
0.33821940422058105,
0.20239822566509247,
0.3144550323486328,
-0.3117734491825104,
-0.1467672735452652,
0.13066670298576355,
0.17146985232830048,
-0.05883311480283737,
-0.048242997378110886,
-0.0988728478550911,
-0.0938713550567627,
-0.024632886052131653,
-0.17893247306346893,
-0.05198466405272484,
0.5016484260559082,
0.12010428309440613,
0.0002524927258491516,
0.05872870236635208,
-0.21367347240447998,
-0.15401186048984528,
0.20426180958747864,
0.33000561594963074,
-0.1772373616695404,
0.10863649100065231,
0.01720862276852131,
-0.0417320691049099,
0.055036574602127075,
0.45686689019203186,
-0.08185135573148727,
-0.41815346479415894,
-0.07295411080121994,
-0.05730476230382919,
0.2468603402376175,
0.18307067453861237,
-0.28727662563323975,
0.2581906318664551,
-0.1790970265865326,
0.22964562475681305,
0.12961173057556152,
0.02078358083963394,
0.5378000736236572,
-0.12659846246242523,
-0.14018702507019043,
-0.7267137765884399,
0.16432936489582062,
-0.09789780527353287,
0.19590047001838684,
0.47114139795303345,
-0.18524275720119476,
-0.1934690773487091,
0.3805631697177887,
-0.061329204589128494,
0.7563742399215698,
0.279938280582428,
-0.04163985699415207,
0.6355297565460205,
0.262696236371994,
0.41476598381996155,
0.1361096203327179,
0.21764791011810303,
-0.47713395953178406,
-0.012890702113509178,
-0.02770685777068138,
-0.16868099570274353,
0.08167780935764313,
0.23185095191001892,
-0.18367233872413635,
-0.005264636129140854,
-0.2075985074043274,
-0.5851503610610962,
-0.07217271625995636,
0.17506025731563568,
-0.27413004636764526,
0.018483951687812805,
-0.25570937991142273,
0.04044092446565628,
0.09592247754335403,
0.05180098116397858,
0.061890095472335815,
-0.2497137039899826,
0.15824569761753082,
-0.24538500607013702,
-0.44434577226638794,
0.18466348946094513,
-0.23255141079425812,
0.07742096483707428,
0.4607228636741638,
-0.34146568179130554,
0.0743221864104271,
0.30818384885787964,
0.23905853927135468,
-0.1292579174041748,
-0.007861878722906113,
0.15791884064674377,
0.05001635476946831,
-0.07539506256580353,
-0.03248428925871849,
0.14419694244861603,
0.4905312657356262,
-0.09061271697282791,
0.02096731960773468,
0.2748125493526459,
-0.17029279470443726,
-0.6808899641036987,
-0.06980037689208984,
-0.23282520473003387,
0.12484489381313324,
-0.26057684421539307,
-0.1854456514120102,
0.1436757892370224,
-0.24822735786437988,
-0.24279579520225525,
0.12805424630641937,
0.09824028611183167,
-0.19960714876651764,
0.01059856079518795,
-0.38729414343833923,
-0.016716115176677704,
0.16266947984695435,
-0.01842370256781578,
0.022709976881742477,
0.5848239064216614,
0.7412891387939453,
0.2858796715736389,
-0.04702747240662575,
-0.2107391655445099,
-0.19682538509368896,
0.22737009823322296,
-0.424854576587677,
0.49673768877983093,
0.21114332973957062,
0.28970396518707275,
-0.020622972398996353,
0.6592680811882019,
0.08537799119949341,
-0.043633393943309784,
-0.10776302218437195,
-0.16569626331329346,
0.0023341625928878784,
-0.2232099324464798,
0.1079225242137909,
0.08275941014289856,
-0.00683806836605072,
0.08702179789543152,
-0.1473567932844162,
0.037155888974666595,
-0.2585790455341339,
-0.2526107430458069,
-0.15431714057922363,
-0.0621284581720829,
-0.08300022780895233,
-0.1493382602930069,
0.17546170949935913,
0.07968159019947052,
0.22099362313747406,
0.06785010546445847,
-0.1406715214252472,
-0.25377967953681946,
-0.29147958755493164,
0.07996012270450592,
0.12461234629154205,
-0.37700381875038147,
0.06349246203899384,
0.02217545360326767,
-0.1386502981185913,
-0.18939663469791412,
0.17834055423736572,
-0.12309785932302475,
-0.12408266961574554,
0.30044952034950256,
0.04235684126615524,
0.299552321434021,
-0.19146019220352173,
-0.18857593834400177,
-0.2818688154220581,
0.03410651534795761,
0.20710012316703796,
0.08721660822629929,
0.029036954045295715,
-0.2505645453929901,
-0.29467156529426575,
0.046717569231987,
-0.03857588768005371,
-0.11948949098587036,
0.46193501353263855,
-0.3642887771129608,
-0.1713198721408844,
0.03070441633462906,
0.12944373488426208,
0.32324329018592834,
-0.16918683052062988,
0.1870732456445694,
-0.00849808007478714,
0.1938813477754593,
-0.19399334490299225,
-0.04666369780898094,
-0.3363754451274872,
0.051748473197221756,
0.1040538102388382,
-0.0017884820699691772,
-0.2672377824783325,
-0.037013761699199677,
-0.06119826063513756,
0.07143128663301468,
0.015973519533872604,
-0.21131698787212372,
0.1148296445608139,
0.431023508310318,
0.11529471725225449,
0.16627439856529236,
0.042041048407554626,
-0.027988802641630173,
0.3093007802963257,
0.15881216526031494,
-0.19311898946762085,
0.03843670338392258,
-0.23332975804805756,
-0.22387100756168365,
0.20400601625442505,
-0.4884359538555145,
0.022529931738972664,
0.1356012225151062,
0.028293872252106667,
0.18339471518993378,
0.016311518847942352,
0.2804776430130005,
-0.2924884855747223,
0.11902428418397903,
0.03580822795629501,
0.07095186412334442,
-0.0706738606095314,
0.03048687055706978,
-0.5972117781639099,
-0.1191500723361969,
-0.2867707312107086,
0.057106539607048035,
0.10375650972127914,
-0.017368871718645096,
-0.1130431517958641,
0.18608391284942627,
-0.13657498359680176,
-0.15665285289287567,
0.13830921053886414,
-0.08282048255205154,
0.3201562464237213,
-0.34869855642318726,
-0.0003261575475335121,
0.21060164272785187,
0.0051262713968753815,
-0.20974114537239075,
0.20814447104930878,
0.3001815378665924,
0.4587712585926056,
-0.02953994832932949,
-0.19102025032043457,
-0.37797924876213074,
-0.05551353842020035,
-0.19942206144332886,
-0.06765205413103104,
-0.2523706257343292,
0.10535323619842529,
0.27764230966567993,
0.06809834390878677,
-0.12505516409873962,
0.0012835876550525427,
0.248276486992836,
0.42423295974731445,
-0.12289990484714508,
0.422600656747818,
-0.10425363481044769,
-0.16154085099697113,
0.0455293208360672,
-0.006965227425098419,
-0.17683829367160797,
0.058934759348630905,
0.2462647557258606,
0.02885112166404724,
0.08894067257642746,
-0.1877593994140625,
0.10864101350307465,
0.19077499210834503,
0.23171111941337585,
0.30742117762565613,
-0.16957007348537445,
-0.39313504099845886,
-0.08034670352935791,
-0.15113385021686554,
0.15999826788902283,
0.06917020678520203,
0.14127500355243683,
-0.04152209311723709,
0.19027356803417206,
-0.07868556678295135,
0.118851438164711,
0.05897490307688713,
0.19910340011119843,
-0.11513039469718933,
0.5647182464599609,
-0.11503054946660995,
-0.35665056109428406,
0.11629250645637512,
-0.22585809230804443,
0.03212570399045944,
-0.41509366035461426,
-0.008950922638177872,
-0.4293174147605896,
0.14544595777988434,
0.006242120638489723,
-0.28881487250328064,
0.34553059935569763,
0.3340316414833069,
0.09331829845905304,
0.11441130191087723,
0.037171777337789536,
-0.06541936844587326,
-0.24236825108528137,
-0.14469832181930542,
0.03283053636550903,
-0.27974361181259155,
0.20203842222690582,
-0.04270298779010773,
0.5349317789077759,
0.054367005825042725,
0.22566470503807068,
-0.5787214040756226,
0.42826464772224426,
-0.019989855587482452,
-0.03581497445702553,
-0.2466881275177002,
0.12038618326187134,
-0.03245299309492111,
0.03455011919140816,
0.13586142659187317,
0.06955061852931976,
-0.10942977666854858,
0.0028062760829925537,
-0.5451462268829346,
-0.07154915481805801,
0.49246323108673096,
-0.4272841215133667,
-0.20177209377288818,
-0.05772821977734566,
-0.051382288336753845,
0.0901392474770546,
-0.1820099949836731,
-0.15153616666793823,
-0.17750056087970734,
0.39350786805152893,
-0.07653884589672089,
0.06312055885791779,
0.03691960126161575,
0.2218843549489975,
0.24874940514564514,
0.028500065207481384,
0.7765954732894897,
-0.0885528177022934,
-0.303718626499176,
0.2714304029941559,
-0.11455017328262329
] |
https://github.com/huggingface/datasets/issues/6118 | to anyone reaching this issue, the argument is `gen_kwargs`:
```py
train_dataset = IterableDataset.from_generator(line_generator, gen_kwargs={"files": model_training_files})
``` | IterableDataset.from_generator() fails with pickle error when provided a generator or iterator | ### Describe the bug
**Description**
Providing a generator in an instantiation of IterableDataset.from_generator() fails with `TypeError: cannot pickle 'generator' object` when the generator argument is supplied with a generator.
**Code example**
```
def line_generator(files: List[Path]):
if isinstance(files, str):
files = [Path(files)]
for file in files:
if isinstance(file, str):
file = Path(file)
yield from open(file,'r').readlines()
...
model_training_files = ['file1.txt', 'file2.txt', 'file3.txt']
train_dataset = IterableDataset.from_generator(generator=line_generator(model_training_files))
```
**Traceback**
Traceback (most recent call last):
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/contextlib.py", line 135, in __exit__
self.gen.throw(type, value, traceback)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 691, in _no_cache_fields
yield
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 701, in dumps
dump(obj, file)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 676, in dump
Pickler(file, recurse=True).dump(obj)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/dill/_dill.py", line 394, in dump
StockPickler.dump(self, obj)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/pickle.py", line 487, in dump
self.save(obj)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 666, in save
dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/dill/_dill.py", line 388, in save
StockPickler.save(self, obj, save_persistent_id)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/dill/_dill.py", line 1186, in save_module_dict
StockPickler.save_dict(pickler, obj)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/pickle.py", line 971, in save_dict
self._batch_setitems(obj.items())
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/pickle.py", line 997, in _batch_setitems
save(v)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 666, in save
dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/dill/_dill.py", line 388, in save
StockPickler.save(self, obj, save_persistent_id)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/pickle.py", line 578, in save
rv = reduce(self.proto)
TypeError: cannot pickle 'generator' object
### Steps to reproduce the bug
1. Create a set of text files to iterate over.
2. Create a generator that returns the lines in each file until all files are exhausted.
3. Instantiate the dataset over the generator by instantiating an IterableDataset.from_generator().
4. Wait for the explosion.
### Expected behavior
I would expect that since the function claims to accept a generator that there would be no crash. Instead, I would expect the dataset to return all the lines in the files as queued up in the `line_generator()` function.
### Environment info
datasets.__version__ == '2.13.1'
Python 3.9.6
Platform: Darwin WE35261 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:22 PDT 2023; root:xnu-8796.121.3~7/RELEASE_X86_64 x86_64
| 16 | IterableDataset.from_generator() fails with pickle error when provided a generator or iterator
### Describe the bug
**Description**
Providing a generator in an instantiation of IterableDataset.from_generator() fails with `TypeError: cannot pickle 'generator' object` when the generator argument is supplied with a generator.
**Code example**
```
def line_generator(files: List[Path]):
if isinstance(files, str):
files = [Path(files)]
for file in files:
if isinstance(file, str):
file = Path(file)
yield from open(file,'r').readlines()
...
model_training_files = ['file1.txt', 'file2.txt', 'file3.txt']
train_dataset = IterableDataset.from_generator(generator=line_generator(model_training_files))
```
**Traceback**
Traceback (most recent call last):
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/contextlib.py", line 135, in __exit__
self.gen.throw(type, value, traceback)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 691, in _no_cache_fields
yield
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 701, in dumps
dump(obj, file)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 676, in dump
Pickler(file, recurse=True).dump(obj)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/dill/_dill.py", line 394, in dump
StockPickler.dump(self, obj)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/pickle.py", line 487, in dump
self.save(obj)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 666, in save
dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/dill/_dill.py", line 388, in save
StockPickler.save(self, obj, save_persistent_id)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/dill/_dill.py", line 1186, in save_module_dict
StockPickler.save_dict(pickler, obj)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/pickle.py", line 971, in save_dict
self._batch_setitems(obj.items())
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/pickle.py", line 997, in _batch_setitems
save(v)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 666, in save
dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id)
File "/Users/d3p692/code/clem_bert/venv/lib/python3.9/site-packages/dill/_dill.py", line 388, in save
StockPickler.save(self, obj, save_persistent_id)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/pickle.py", line 578, in save
rv = reduce(self.proto)
TypeError: cannot pickle 'generator' object
### Steps to reproduce the bug
1. Create a set of text files to iterate over.
2. Create a generator that returns the lines in each file until all files are exhausted.
3. Instantiate the dataset over the generator by instantiating an IterableDataset.from_generator().
4. Wait for the explosion.
### Expected behavior
I would expect that since the function claims to accept a generator that there would be no crash. Instead, I would expect the dataset to return all the lines in the files as queued up in the `line_generator()` function.
### Environment info
datasets.__version__ == '2.13.1'
Python 3.9.6
Platform: Darwin WE35261 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:22 PDT 2023; root:xnu-8796.121.3~7/RELEASE_X86_64 x86_64
to anyone reaching this issue, the argument is `gen_kwargs`:
```py
train_dataset = IterableDataset.from_generator(line_generator, gen_kwargs={"files": model_training_files})
``` | [
-0.1925230324268341,
0.05175022780895233,
0.012485519051551819,
0.2545914649963379,
0.19072987139225006,
-0.06797074526548386,
0.3202352523803711,
0.22021400928497314,
-0.08589526265859604,
0.06891646981239319,
0.4876116216182709,
0.459286630153656,
-0.4644555449485779,
-0.08491630852222443,
-0.036905646324157715,
-0.3333512544631958,
0.04055904597043991,
0.10580587387084961,
-0.12430335581302643,
0.050520554184913635,
-0.28148266673088074,
0.4798559546470642,
-0.1844254583120346,
0.04283001273870468,
-0.17274895310401917,
0.09701970219612122,
0.046803973615169525,
0.2593997120857239,
-0.1528603732585907,
-0.3983778655529022,
0.27867329120635986,
-0.0247923843562603,
0.06596575677394867,
0.4712236225605011,
-0.00011172847007401288,
0.049042582511901855,
-0.06766095012426376,
-0.025879692286252975,
-0.31856608390808105,
-0.3198472857475281,
-0.11599233746528625,
0.009325340390205383,
-0.2776363492012024,
-0.16224153339862823,
0.06847743690013885,
-0.14221732318401337,
-0.011281516402959824,
-0.15105581283569336,
0.2864145338535309,
0.22026242315769196,
0.19660401344299316,
0.3701327443122864,
0.2988542318344116,
-0.301619291305542,
0.07212647795677185,
0.07130086421966553,
-0.3147541582584381,
0.4709703326225281,
0.0543573722243309,
0.16615402698516846,
0.22783929109573364,
0.16859671473503113,
-0.10908624529838562,
-0.11152355372905731,
0.4437803626060486,
0.04892892763018608,
0.06317594647407532,
-0.06270729005336761,
-0.19304782152175903,
0.18590815365314484,
0.023269155994057655,
-0.17596040666103363,
-0.27772417664527893,
-0.4122946262359619,
-0.10324925184249878,
-0.46006283164024353,
0.28986552357673645,
-0.031553782522678375,
-0.44480255246162415,
0.07213813811540604,
0.13988934457302094,
-0.1768902689218521,
-0.19001168012619019,
-0.04492805898189545,
0.31974345445632935,
0.13545991480350494,
-0.14315561950206757,
0.11355380713939667,
0.43019264936447144,
0.27187880873680115,
0.08063562214374542,
-0.10070764273405075,
-0.04819881543517113,
0.2213677167892456,
-0.07321806252002716,
-0.11078593134880066,
0.09522531926631927,
-0.36945202946662903,
-0.00544564425945282,
0.05299884080886841,
0.3211105167865753,
-0.20569069683551788,
-0.13869643211364746,
0.10064202547073364,
0.2800214886665344,
0.017536863684654236,
-0.011527851223945618,
0.4393742084503174,
0.06385687738656998,
0.3320436477661133,
-0.20199596881866455,
-0.1331021785736084,
0.003308437764644623,
-0.3711993396282196,
0.3407299816608429,
0.1577170193195343,
0.1340196281671524,
0.14466114342212677,
-0.19027113914489746,
-0.09980450570583344,
-0.43488895893096924,
-0.1959669142961502,
0.23257561028003693,
0.20791283249855042,
-0.07908075302839279,
0.2611444592475891,
0.017466090619564056,
0.10391969978809357,
-0.017824243754148483,
-0.41329100728034973,
-0.20048972964286804,
0.05411654710769653,
-0.04301297664642334,
0.02824266254901886,
-0.2747025191783905,
-0.23642976582050323,
0.28809523582458496,
-0.021791119128465652,
-0.4016466736793518,
0.07363885641098022,
0.2893819212913513,
-0.33443576097488403,
0.1235884577035904,
-0.026989195495843887,
0.036666542291641235,
-0.047771088778972626,
0.2951488792896271,
-0.39767855405807495,
0.008929863572120667,
0.007788239978253841,
-0.026016049087047577,
-0.29719826579093933,
-0.10887690633535385,
0.1893882304430008,
0.08852928876876831,
0.08536224067211151,
-0.32993775606155396,
-0.05208973586559296,
0.3180951774120331,
-0.08347854018211365,
-0.1310584992170334,
-0.3963388204574585,
-0.16647732257843018,
-0.3215799927711487,
0.12027428299188614,
0.2991344630718231,
-0.3090059161186218,
0.15342099964618683,
-0.3030065596103668,
-0.07654663920402527,
0.5325575470924377,
0.16262122988700867,
-0.22795547544956207,
0.6503434777259827,
-0.3881015181541443,
0.15830746293067932,
0.6200206279754639,
0.35463789105415344,
-0.1969817876815796,
0.0847165435552597,
0.06739691644906998,
0.3531544804573059,
0.11928854882717133,
-0.10093439370393753,
-0.3687475025653839,
-0.29655921459198,
0.2013365924358368,
0.14664465188980103,
-0.12453071773052216,
-0.0854288786649704,
-0.23213566839694977,
0.13901329040527344,
-0.0039291903376579285,
-0.13729190826416016,
0.1628793627023697,
0.17027094960212708,
-0.2782936692237854,
-0.10859953612089157,
0.3623785972595215,
-0.29144981503486633,
-0.0762200728058815,
0.06096896901726723,
0.3157936632633209,
0.02236420102417469,
0.06431354582309723,
-0.10113448649644852,
-0.22653433680534363,
0.17091777920722961,
-0.27182090282440186,
-0.011556334793567657,
-0.20150697231292725,
0.06083136796951294,
-0.058713652193546295,
0.3660954236984253,
-0.5099748969078064,
-0.2195863425731659,
0.08846022188663483,
0.39987608790397644,
0.20582540333271027,
-0.21184097230434418,
-0.33074870705604553,
-0.22317124903202057,
-0.5027743577957153,
0.05918758735060692,
-0.3441765606403351,
0.07616688311100006,
-0.07889793068170547,
-0.3262985944747925,
-0.07805541157722473,
0.15897789597511292,
0.060533396899700165,
-0.10855302214622498,
-0.04936349764466286,
0.16197186708450317,
0.07976877689361572,
-0.12847715616226196,
-0.27781960368156433,
0.0615607425570488,
-0.18453596532344818,
0.17625132203102112,
-0.23828935623168945,
0.095378577709198,
0.07410310208797455,
0.14187996089458466,
0.2544691562652588,
0.1932884007692337,
-0.17920458316802979,
0.16572730243206024,
0.11991934478282928,
0.04396685212850571,
0.15927855670452118,
0.1763865053653717,
0.20446640253067017,
-0.0977730005979538,
0.007102590519934893,
0.4257677495479584,
0.17218418419361115,
0.02925841696560383,
-0.32493799924850464,
0.054253287613391876,
0.681912362575531,
0.30341288447380066,
0.04395327717065811,
0.11402741074562073,
-0.12625250220298767,
-0.11414435505867004,
-0.2112656831741333,
0.4159000515937805,
0.2709732949733734,
-0.08868621289730072,
0.10913699120283127,
0.026384366676211357,
0.09466621279716492,
-0.17779506742954254,
0.23635421693325043,
-0.11372251063585281,
0.26229482889175415,
0.43095633387565613,
-0.2568524181842804,
-0.049858514219522476,
-0.2312973439693451,
-0.3782895803451538,
-0.18453338742256165,
0.4345347285270691,
-0.11518750339746475,
0.2506817877292633,
0.016792982816696167,
0.10996051132678986,
-0.25982314348220825,
-0.07658374309539795,
0.040728189051151276,
-0.2142079770565033,
-0.17783062160015106,
0.6049759387969971,
-0.17531397938728333,
-0.10471709817647934,
0.0667584091424942,
-0.08870361745357513,
0.14489391446113586,
0.09726741909980774,
-0.04735638573765755,
0.019606783986091614,
-0.25033241510391235,
0.07513708621263504,
0.3514643609523773,
-0.6439958214759827,
0.31880730390548706,
0.021703191101551056,
-0.3663593828678131,
-0.09861919283866882,
0.17938069999217987,
0.2689797282218933,
-0.2192152738571167,
0.31924864649772644,
0.6143232583999634,
0.1927531361579895,
-0.03184817358851433,
-0.40477868914604187,
0.22955209016799927,
0.013062134385108948,
0.04747761785984039,
0.0397767573595047,
-0.04189472272992134,
-0.014426149427890778,
-0.014364711940288544,
-0.213862344622612,
-0.027484344318509102,
-0.24847964942455292,
0.17210781574249268,
0.08828546106815338,
0.2946167290210724,
0.5304079055786133,
0.24700653553009033,
0.26870015263557434,
0.10620778799057007,
-0.03833753615617752,
0.003531079739332199,
-0.2891685366630554,
0.162314772605896,
-0.16582608222961426,
-0.17350056767463684,
-0.11056635528802872,
-0.3926813006401062,
0.30436307191848755,
0.01883254572749138,
-0.19052961468696594,
0.04141826927661896,
-0.12852434813976288,
0.3286254405975342,
-0.11812316626310349,
-0.0636196956038475,
0.08875502645969391,
0.26603421568870544,
-0.08564143627882004,
-0.08455739915370941,
0.3285022974014282,
0.31512749195098877,
-0.05591069161891937,
0.1957695484161377,
0.4288586974143982,
0.09875223785638809,
0.040626153349876404,
0.7318695783615112,
0.32333290576934814,
-0.22042356431484222,
0.5691491365432739,
-0.012173429131507874,
-0.022510461509227753,
-0.17707133293151855,
-0.3932430148124695,
-0.28373420238494873,
-0.02997303009033203,
-0.16251620650291443,
-0.106331005692482,
-0.2623312473297119,
0.1804051548242569,
-0.08289231359958649,
0.2692256271839142,
0.09411939978599548,
-0.31762605905532837,
0.20948301255702972,
-0.04866394028067589,
0.37743696570396423,
-0.3131876289844513,
0.16537366807460785,
-0.042089808732271194,
0.2270256131887436,
0.07754871249198914,
-0.1026659905910492,
0.5104563236236572,
-0.24732361733913422,
-0.16932940483093262,
-0.33129605650901794,
-0.38340499997138977,
0.09781533479690552,
0.32316190004348755,
-0.022082187235355377,
0.0018567070364952087,
-0.24985961616039276,
0.00950402021408081,
-0.035644546151161194,
0.8467940092086792,
-0.11296986043453217,
-0.06349457800388336,
0.2608496844768524,
0.11582933366298676,
0.05210021883249283,
0.019389450550079346,
0.030787207186222076,
0.33821940422058105,
0.20239822566509247,
0.3144550323486328,
-0.3117734491825104,
-0.1467672735452652,
0.13066670298576355,
0.17146985232830048,
-0.05883311480283737,
-0.048242997378110886,
-0.0988728478550911,
-0.0938713550567627,
-0.024632886052131653,
-0.17893247306346893,
-0.05198466405272484,
0.5016484260559082,
0.12010428309440613,
0.0002524927258491516,
0.05872870236635208,
-0.21367347240447998,
-0.15401186048984528,
0.20426180958747864,
0.33000561594963074,
-0.1772373616695404,
0.10863649100065231,
0.01720862276852131,
-0.0417320691049099,
0.055036574602127075,
0.45686689019203186,
-0.08185135573148727,
-0.41815346479415894,
-0.07295411080121994,
-0.05730476230382919,
0.2468603402376175,
0.18307067453861237,
-0.28727662563323975,
0.2581906318664551,
-0.1790970265865326,
0.22964562475681305,
0.12961173057556152,
0.02078358083963394,
0.5378000736236572,
-0.12659846246242523,
-0.14018702507019043,
-0.7267137765884399,
0.16432936489582062,
-0.09789780527353287,
0.19590047001838684,
0.47114139795303345,
-0.18524275720119476,
-0.1934690773487091,
0.3805631697177887,
-0.061329204589128494,
0.7563742399215698,
0.279938280582428,
-0.04163985699415207,
0.6355297565460205,
0.262696236371994,
0.41476598381996155,
0.1361096203327179,
0.21764791011810303,
-0.47713395953178406,
-0.012890702113509178,
-0.02770685777068138,
-0.16868099570274353,
0.08167780935764313,
0.23185095191001892,
-0.18367233872413635,
-0.005264636129140854,
-0.2075985074043274,
-0.5851503610610962,
-0.07217271625995636,
0.17506025731563568,
-0.27413004636764526,
0.018483951687812805,
-0.25570937991142273,
0.04044092446565628,
0.09592247754335403,
0.05180098116397858,
0.061890095472335815,
-0.2497137039899826,
0.15824569761753082,
-0.24538500607013702,
-0.44434577226638794,
0.18466348946094513,
-0.23255141079425812,
0.07742096483707428,
0.4607228636741638,
-0.34146568179130554,
0.0743221864104271,
0.30818384885787964,
0.23905853927135468,
-0.1292579174041748,
-0.007861878722906113,
0.15791884064674377,
0.05001635476946831,
-0.07539506256580353,
-0.03248428925871849,
0.14419694244861603,
0.4905312657356262,
-0.09061271697282791,
0.02096731960773468,
0.2748125493526459,
-0.17029279470443726,
-0.6808899641036987,
-0.06980037689208984,
-0.23282520473003387,
0.12484489381313324,
-0.26057684421539307,
-0.1854456514120102,
0.1436757892370224,
-0.24822735786437988,
-0.24279579520225525,
0.12805424630641937,
0.09824028611183167,
-0.19960714876651764,
0.01059856079518795,
-0.38729414343833923,
-0.016716115176677704,
0.16266947984695435,
-0.01842370256781578,
0.022709976881742477,
0.5848239064216614,
0.7412891387939453,
0.2858796715736389,
-0.04702747240662575,
-0.2107391655445099,
-0.19682538509368896,
0.22737009823322296,
-0.424854576587677,
0.49673768877983093,
0.21114332973957062,
0.28970396518707275,
-0.020622972398996353,
0.6592680811882019,
0.08537799119949341,
-0.043633393943309784,
-0.10776302218437195,
-0.16569626331329346,
0.0023341625928878784,
-0.2232099324464798,
0.1079225242137909,
0.08275941014289856,
-0.00683806836605072,
0.08702179789543152,
-0.1473567932844162,
0.037155888974666595,
-0.2585790455341339,
-0.2526107430458069,
-0.15431714057922363,
-0.0621284581720829,
-0.08300022780895233,
-0.1493382602930069,
0.17546170949935913,
0.07968159019947052,
0.22099362313747406,
0.06785010546445847,
-0.1406715214252472,
-0.25377967953681946,
-0.29147958755493164,
0.07996012270450592,
0.12461234629154205,
-0.37700381875038147,
0.06349246203899384,
0.02217545360326767,
-0.1386502981185913,
-0.18939663469791412,
0.17834055423736572,
-0.12309785932302475,
-0.12408266961574554,
0.30044952034950256,
0.04235684126615524,
0.299552321434021,
-0.19146019220352173,
-0.18857593834400177,
-0.2818688154220581,
0.03410651534795761,
0.20710012316703796,
0.08721660822629929,
0.029036954045295715,
-0.2505645453929901,
-0.29467156529426575,
0.046717569231987,
-0.03857588768005371,
-0.11948949098587036,
0.46193501353263855,
-0.3642887771129608,
-0.1713198721408844,
0.03070441633462906,
0.12944373488426208,
0.32324329018592834,
-0.16918683052062988,
0.1870732456445694,
-0.00849808007478714,
0.1938813477754593,
-0.19399334490299225,
-0.04666369780898094,
-0.3363754451274872,
0.051748473197221756,
0.1040538102388382,
-0.0017884820699691772,
-0.2672377824783325,
-0.037013761699199677,
-0.06119826063513756,
0.07143128663301468,
0.015973519533872604,
-0.21131698787212372,
0.1148296445608139,
0.431023508310318,
0.11529471725225449,
0.16627439856529236,
0.042041048407554626,
-0.027988802641630173,
0.3093007802963257,
0.15881216526031494,
-0.19311898946762085,
0.03843670338392258,
-0.23332975804805756,
-0.22387100756168365,
0.20400601625442505,
-0.4884359538555145,
0.022529931738972664,
0.1356012225151062,
0.028293872252106667,
0.18339471518993378,
0.016311518847942352,
0.2804776430130005,
-0.2924884855747223,
0.11902428418397903,
0.03580822795629501,
0.07095186412334442,
-0.0706738606095314,
0.03048687055706978,
-0.5972117781639099,
-0.1191500723361969,
-0.2867707312107086,
0.057106539607048035,
0.10375650972127914,
-0.017368871718645096,
-0.1130431517958641,
0.18608391284942627,
-0.13657498359680176,
-0.15665285289287567,
0.13830921053886414,
-0.08282048255205154,
0.3201562464237213,
-0.34869855642318726,
-0.0003261575475335121,
0.21060164272785187,
0.0051262713968753815,
-0.20974114537239075,
0.20814447104930878,
0.3001815378665924,
0.4587712585926056,
-0.02953994832932949,
-0.19102025032043457,
-0.37797924876213074,
-0.05551353842020035,
-0.19942206144332886,
-0.06765205413103104,
-0.2523706257343292,
0.10535323619842529,
0.27764230966567993,
0.06809834390878677,
-0.12505516409873962,
0.0012835876550525427,
0.248276486992836,
0.42423295974731445,
-0.12289990484714508,
0.422600656747818,
-0.10425363481044769,
-0.16154085099697113,
0.0455293208360672,
-0.006965227425098419,
-0.17683829367160797,
0.058934759348630905,
0.2462647557258606,
0.02885112166404724,
0.08894067257642746,
-0.1877593994140625,
0.10864101350307465,
0.19077499210834503,
0.23171111941337585,
0.30742117762565613,
-0.16957007348537445,
-0.39313504099845886,
-0.08034670352935791,
-0.15113385021686554,
0.15999826788902283,
0.06917020678520203,
0.14127500355243683,
-0.04152209311723709,
0.19027356803417206,
-0.07868556678295135,
0.118851438164711,
0.05897490307688713,
0.19910340011119843,
-0.11513039469718933,
0.5647182464599609,
-0.11503054946660995,
-0.35665056109428406,
0.11629250645637512,
-0.22585809230804443,
0.03212570399045944,
-0.41509366035461426,
-0.008950922638177872,
-0.4293174147605896,
0.14544595777988434,
0.006242120638489723,
-0.28881487250328064,
0.34553059935569763,
0.3340316414833069,
0.09331829845905304,
0.11441130191087723,
0.037171777337789536,
-0.06541936844587326,
-0.24236825108528137,
-0.14469832181930542,
0.03283053636550903,
-0.27974361181259155,
0.20203842222690582,
-0.04270298779010773,
0.5349317789077759,
0.054367005825042725,
0.22566470503807068,
-0.5787214040756226,
0.42826464772224426,
-0.019989855587482452,
-0.03581497445702553,
-0.2466881275177002,
0.12038618326187134,
-0.03245299309492111,
0.03455011919140816,
0.13586142659187317,
0.06955061852931976,
-0.10942977666854858,
0.0028062760829925537,
-0.5451462268829346,
-0.07154915481805801,
0.49246323108673096,
-0.4272841215133667,
-0.20177209377288818,
-0.05772821977734566,
-0.051382288336753845,
0.0901392474770546,
-0.1820099949836731,
-0.15153616666793823,
-0.17750056087970734,
0.39350786805152893,
-0.07653884589672089,
0.06312055885791779,
0.03691960126161575,
0.2218843549489975,
0.24874940514564514,
0.028500065207481384,
0.7765954732894897,
-0.0885528177022934,
-0.303718626499176,
0.2714304029941559,
-0.11455017328262329
] |
https://github.com/huggingface/datasets/issues/6114 | You can avoid this by using the `revision` parameter in `load_dataset` to always force downloading a specific commit (if not specified it defaults to HEAD, hence the redownload). | Cache not being used when loading commonvoice 8.0.0 | ### Describe the bug
I have commonvoice 8.0.0 downloaded in `~/.cache/huggingface/datasets/mozilla-foundation___common_voice_8_0/en/8.0.0/b2f8b72f8f30b2e98c41ccf855954d9e35a5fa498c43332df198534ff9797a4a`. The folder contains all the arrow files etc, and was used as the cached version last time I touched the ec2 instance I'm working on. Now, with the same command that downloaded it initially:
```
dataset = load_dataset("mozilla-foundation/common_voice_8_0", "en", use_auth_token="<mytoken>")
```
it tries to redownload the dataset to `~/.cache/huggingface/datasets/mozilla-foundation___common_voice_8_0/en/8.0.0/05bdc7940b0a336ceeaeef13470c89522c29a8e4494cbeece64fb472a87acb32`
### Steps to reproduce the bug
Steps to reproduce the behavior:
1. ```dataset = load_dataset("mozilla-foundation/common_voice_8_0", "en", use_auth_token="<mytoken>")```
2. dataset is updated by maintainers
3. ```dataset = load_dataset("mozilla-foundation/common_voice_8_0", "en", use_auth_token="<mytoken>")```
### Expected behavior
I expect that it uses the already downloaded data in `~/.cache/huggingface/datasets/mozilla-foundation___common_voice_8_0/en/8.0.0/b2f8b72f8f30b2e98c41ccf855954d9e35a5fa498c43332df198534ff9797a4a`.
Not sure what's happening in 2. but if, say it's an issue with the dataset referenced by "mozilla-foundation/common_voice_8_0" being modified by the maintainers, how would I force datasets to point to the original version I downloaded?
EDIT: It was indeed that the maintainers had updated the dataset (v 8.0.0). However I still cant load the dataset from disk instead of redownloading, with for example:
```
load_dataset(".cache/huggingface/datasets/downloads/extracted/<hash>/cv-corpus-8.0-2022-01-19/en/", "en")
> ...
> File [~/miniconda3/envs/aa_torch2/lib/python3.10/site-packages/datasets/table.py:1938](.../ python3.10/site-packages/datasets/table.py:1938), in cast_array_to_feature(array, feature, allow_number_to_str)
1937 elif not isinstance(feature, (Sequence, dict, list, tuple)):
-> 1938 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
...
1794 e = e.__context__
-> 1795 raise DatasetGenerationError("An error occurred while generating the dataset") from e
1797 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths)
DatasetGenerationError: An error occurred while generating the dataset
```
### Environment info
datasets==2.7.0
python==3.10.8
OS: AWS Linux | 28 | Cache not being used when loading commonvoice 8.0.0
### Describe the bug
I have commonvoice 8.0.0 downloaded in `~/.cache/huggingface/datasets/mozilla-foundation___common_voice_8_0/en/8.0.0/b2f8b72f8f30b2e98c41ccf855954d9e35a5fa498c43332df198534ff9797a4a`. The folder contains all the arrow files etc, and was used as the cached version last time I touched the ec2 instance I'm working on. Now, with the same command that downloaded it initially:
```
dataset = load_dataset("mozilla-foundation/common_voice_8_0", "en", use_auth_token="<mytoken>")
```
it tries to redownload the dataset to `~/.cache/huggingface/datasets/mozilla-foundation___common_voice_8_0/en/8.0.0/05bdc7940b0a336ceeaeef13470c89522c29a8e4494cbeece64fb472a87acb32`
### Steps to reproduce the bug
Steps to reproduce the behavior:
1. ```dataset = load_dataset("mozilla-foundation/common_voice_8_0", "en", use_auth_token="<mytoken>")```
2. dataset is updated by maintainers
3. ```dataset = load_dataset("mozilla-foundation/common_voice_8_0", "en", use_auth_token="<mytoken>")```
### Expected behavior
I expect that it uses the already downloaded data in `~/.cache/huggingface/datasets/mozilla-foundation___common_voice_8_0/en/8.0.0/b2f8b72f8f30b2e98c41ccf855954d9e35a5fa498c43332df198534ff9797a4a`.
Not sure what's happening in 2. but if, say it's an issue with the dataset referenced by "mozilla-foundation/common_voice_8_0" being modified by the maintainers, how would I force datasets to point to the original version I downloaded?
EDIT: It was indeed that the maintainers had updated the dataset (v 8.0.0). However I still cant load the dataset from disk instead of redownloading, with for example:
```
load_dataset(".cache/huggingface/datasets/downloads/extracted/<hash>/cv-corpus-8.0-2022-01-19/en/", "en")
> ...
> File [~/miniconda3/envs/aa_torch2/lib/python3.10/site-packages/datasets/table.py:1938](.../ python3.10/site-packages/datasets/table.py:1938), in cast_array_to_feature(array, feature, allow_number_to_str)
1937 elif not isinstance(feature, (Sequence, dict, list, tuple)):
-> 1938 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
...
1794 e = e.__context__
-> 1795 raise DatasetGenerationError("An error occurred while generating the dataset") from e
1797 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths)
DatasetGenerationError: An error occurred while generating the dataset
```
### Environment info
datasets==2.7.0
python==3.10.8
OS: AWS Linux
You can avoid this by using the `revision` parameter in `load_dataset` to always force downloading a specific commit (if not specified it defaults to HEAD, hence the redownload). | [
-0.009360603988170624,
0.14862433075904846,
0.019389845430850983,
0.410950243473053,
0.010040823370218277,
0.1771545559167862,
0.09138081967830658,
0.255706787109375,
0.4379901885986328,
-0.15505504608154297,
-0.062359511852264404,
0.03413005173206329,
0.33451128005981445,
-0.43399593234062195,
-0.05302309989929199,
0.19094489514827728,
0.012009896337985992,
0.04142513871192932,
0.4155603349208832,
-0.16563880443572998,
0.042980752885341644,
0.23423591256141663,
-0.20167070627212524,
-0.23159000277519226,
-0.3531723916530609,
0.1071048304438591,
-0.018648795783519745,
0.25690844655036926,
0.22535191476345062,
-0.32011833786964417,
0.5896379351615906,
0.29314523935317993,
0.05241060256958008,
0.47877219319343567,
-0.0001245544117409736,
-0.038647934794425964,
0.32350194454193115,
-0.15220454335212708,
-0.48032793402671814,
0.0030465349555015564,
-0.06273043900728226,
0.07265840470790863,
0.05041433125734329,
0.045205965638160706,
-0.16377761960029602,
0.28449466824531555,
0.005870305001735687,
-0.8201926946640015,
0.41557955741882324,
-0.12669573724269867,
0.13057352602481842,
-0.3020462393760681,
-0.008275352418422699,
0.20940625667572021,
0.33727946877479553,
0.02844921313226223,
0.015307560563087463,
0.011666223406791687,
0.23465782403945923,
0.06836989521980286,
-0.15054042637348175,
0.33163225650787354,
-0.03272370994091034,
0.08860643208026886,
0.12009654939174652,
0.09612507373094559,
-0.20067572593688965,
0.25726082921028137,
0.2369585931301117,
0.00698633398860693,
0.7442426681518555,
-0.3037053644657135,
-0.23671036958694458,
-0.07084672152996063,
-0.2069806158542633,
-0.4766237139701843,
0.5905483961105347,
-0.1422109305858612,
0.1071254312992096,
0.1866132915019989,
-0.07964655011892319,
-0.07468178868293762,
0.045663751661777496,
0.26366040110588074,
0.033864252269268036,
0.0027200356125831604,
-0.27916887402534485,
-0.03284432366490364,
0.06398606300354004,
-0.0743643194437027,
-0.10392182320356369,
-0.09130451083183289,
-0.19389402866363525,
0.6030752062797546,
-0.16158942878246307,
0.16894862055778503,
-0.07698849588632584,
0.16386298835277557,
0.1450231373310089,
0.3432179093360901,
0.3806886076927185,
0.1892939805984497,
-0.18007534742355347,
0.052051469683647156,
0.30535823106765747,
0.5271017551422119,
0.08052420616149902,
0.04439488798379898,
0.009757895022630692,
0.34371891617774963,
-0.1461361199617386,
-0.2832590639591217,
-0.15130916237831116,
0.10120686888694763,
0.44043993949890137,
-0.10982552170753479,
0.1856851577758789,
-0.6415128707885742,
-0.1497497856616974,
0.15948788821697235,
0.01831527054309845,
-0.18009056150913239,
0.27210327982902527,
0.3592105209827423,
0.023577719926834106,
0.1942005306482315,
0.1573253571987152,
0.146608367562294,
-0.127643883228302,
0.14776216447353363,
-0.16285361349582672,
-0.3191099762916565,
-0.22408099472522736,
0.30066245794296265,
0.591927170753479,
-0.508486270904541,
0.42574405670166016,
0.06742411851882935,
0.1485573649406433,
-0.3938820958137512,
-0.06862487643957138,
-0.03682825341820717,
0.12819340825080872,
0.041923630982637405,
-0.3024197220802307,
0.2934983968734741,
0.09939826279878616,
0.11813660711050034,
-0.08485097438097,
0.0983344316482544,
-0.5452728867530823,
-0.23581144213676453,
0.07315441220998764,
-0.011383647099137306,
-0.03175191208720207,
-0.3846377730369568,
0.4554743468761444,
-0.18881167471408844,
0.44579505920410156,
-0.3673830032348633,
0.12473554909229279,
0.22950798273086548,
-0.04096058011054993,
-0.06854724884033203,
0.2350149303674698,
0.8257449865341187,
-0.20844216644763947,
-0.14447537064552307,
-0.44997119903564453,
0.0793529599905014,
0.08587700128555298,
0.36233842372894287,
-0.1466563642024994,
-0.2411116063594818,
-0.316234827041626,
-0.0833362340927124,
0.3245886564254761,
-0.7474913001060486,
-0.7354511618614197,
0.28055793046951294,
0.12999090552330017,
0.325932115316391,
0.21311645209789276,
-0.17825551331043243,
-0.07963462173938751,
-0.20343030989170074,
0.10475222021341324,
0.10610522329807281,
0.04567158967256546,
0.018562793731689453,
-0.3297356367111206,
-0.13861262798309326,
-0.119040846824646,
0.03290526568889618,
-0.23499922454357147,
0.2459694743156433,
-0.01969650387763977,
0.06643543392419815,
0.15553846955299377,
0.25197798013687134,
0.11500811576843262,
0.31433433294296265,
0.1401902139186859,
0.07950364053249359,
0.21068918704986572,
0.339375764131546,
-0.5602461099624634,
0.3198917508125305,
-0.17477160692214966,
-0.4535050094127655,
0.2295316457748413,
-0.04856227710843086,
-0.3732990026473999,
-0.3339730203151703,
-0.4485336244106293,
-0.4168989062309265,
-0.009362522512674332,
0.42786023020744324,
0.274154394865036,
-0.35307854413986206,
-0.14560112357139587,
0.1271296888589859,
0.44948992133140564,
0.18612681329250336,
0.16831624507904053,
-0.02482428401708603,
0.0006194273009896278,
-0.10792823135852814,
-0.38370823860168457,
0.13405919075012207,
0.3447297215461731,
-0.13901656866073608,
-0.3027045726776123,
0.4871666133403778,
0.024297431111335754,
0.5126725435256958,
-0.0009024301543831825,
0.019612222909927368,
-0.028156718239188194,
0.11974495649337769,
0.39957937598228455,
0.11928556859493256,
0.14400535821914673,
-0.13106048107147217,
-0.2167384773492813,
0.25411179661750793,
0.10114163905382156,
0.15756312012672424,
-0.10601542890071869,
-0.16716516017913818,
0.09990244358778,
-0.09882546216249466,
0.15944918990135193,
-0.333147794008255,
0.17198818922042847,
-0.06944285333156586,
0.7876895666122437,
-0.03719499707221985,
-0.054427504539489746,
0.09666390717029572,
0.38096460700035095,
0.3357505798339844,
0.05462615191936493,
0.061297640204429626,
-0.3330565094947815,
-0.18533286452293396,
0.08475647121667862,
-0.0367957279086113,
0.26475900411605835,
0.21462276577949524,
0.2156846672296524,
0.10911565274000168,
0.11960755288600922,
-0.10168059170246124,
0.09213314950466156,
-0.08467227220535278,
0.2062322050333023,
0.13224634528160095,
-0.10017785429954529,
0.11493644118309021,
-0.3584301471710205,
0.10840640962123871,
0.1567833125591278,
-0.0625968798995018,
-0.4079645276069641,
0.07345795631408691,
-0.24281644821166992,
0.40258675813674927,
-0.2665497660636902,
0.26831862330436707,
-0.14672605693340302,
-0.1739884316921234,
-0.023331180214881897,
0.5447608828544617,
0.1715558022260666,
0.07283525168895721,
-0.3475187420845032,
0.39373907446861267,
-0.08575208485126495,
-0.43302786350250244,
-0.6827781796455383,
-0.02197999693453312,
-0.3100067377090454,
-0.08512008190155029,
0.24983742833137512,
-0.4904143810272217,
-0.009423687122762203,
0.03426353633403778,
0.24329672753810883,
-0.13187825679779053,
-0.1953771859407425,
0.0028404593467712402,
0.12724509835243225,
-0.2282232642173767,
-0.39828675985336304,
-0.2034607082605362,
-0.11866505444049835,
0.055299218744039536,
0.08510508388280869,
-0.23592215776443481,
-0.19323992729187012,
0.01663348823785782,
0.0010524354875087738,
0.22893746197223663,
0.016393303871154785,
-0.1744307428598404,
0.11879461258649826,
-0.3178601861000061,
0.10941863059997559,
0.07079079002141953,
-0.05398382619023323,
0.2111491560935974,
-0.2630135715007782,
0.08217549324035645,
-0.20825260877609253,
0.3591808080673218,
-0.5825795531272888,
-0.5771807432174683,
0.166118323802948,
-0.20011892914772034,
-0.034580398350954056,
0.10744346678256989,
0.13861046731472015,
0.30499267578125,
0.28514382243156433,
-0.38944000005722046,
0.299077570438385,
0.018355978652834892,
-0.10996094346046448,
0.09426379948854446,
-0.05672067403793335,
0.45362231135368347,
-0.019161885604262352,
0.0030525438487529755,
-0.0636039674282074,
-0.30240681767463684,
-0.0018179342150688171,
0.035032834857702255,
0.2734769880771637,
-0.1386311799287796,
0.16170048713684082,
0.1253964900970459,
0.9760412573814392,
0.26476022601127625,
0.19324654340744019,
0.552335798740387,
0.17816442251205444,
0.288382887840271,
-0.1390424221754074,
-0.13146460056304932,
0.06134926155209541,
-0.08515088260173798,
0.09126608073711395,
0.21715691685676575,
0.3979877531528473,
-0.35510751605033875,
-0.20546239614486694,
0.04716973751783371,
-0.4464467167854309,
-0.12566474080085754,
-0.015693005174398422,
-0.44288620352745056,
0.2437092512845993,
0.29486894607543945,
0.22429034113883972,
-0.189933180809021,
-0.2399938404560089,
-0.03237028419971466,
0.07736804336309433,
0.10344970226287842,
0.061715930700302124,
0.1773364543914795,
0.17811128497123718,
-0.12412430346012115,
0.4677373766899109,
-0.14646241068840027,
0.27236855030059814,
-0.23495951294898987,
-0.2456008493900299,
0.09545791149139404,
-0.019328907132148743,
0.4388119578361511,
-0.009030595421791077,
0.09020164608955383,
0.17517024278640747,
-0.10333716124296188,
-0.2764524817466736,
-0.16120073199272156,
0.0619465708732605,
0.34633389115333557,
-0.15574488043785095,
-0.03337199613451958,
-0.07404378056526184,
-0.1145390123128891,
-0.09275023639202118,
-0.10217729210853577,
-0.1608874797821045,
-0.17398300766944885,
-0.08883970230817795,
0.13842126727104187,
-0.2912869453430176,
0.1174522191286087,
-0.37102067470550537,
0.02066592127084732,
-0.05470031499862671,
-0.0007841289043426514,
-0.09269966185092926,
0.06716546416282654,
-0.09220157563686371,
-0.27994558215141296,
0.5256372690200806,
0.017851680517196655,
0.17505793273448944,
0.5611405372619629,
0.11574947834014893,
0.06726385653018951,
0.670677125453949,
0.08394816517829895,
0.12336377799510956,
-0.06072060391306877,
-0.13321542739868164,
-0.12201032042503357,
0.43949875235557556,
-0.029143454506993294,
-0.49741923809051514,
0.22439226508140564,
-0.2956983745098114,
-0.019178243353962898,
-0.3718706965446472,
0.06453149020671844,
0.34243977069854736,
-0.10697276890277863,
-0.11571289598941803,
0.15046432614326477,
0.16786304116249084,
-0.25974032282829285,
0.19654983282089233,
-0.1167607232928276,
-0.2023160755634308,
0.0422801598906517,
-0.22228683531284332,
0.7129603624343872,
-0.017112713307142258,
0.19140908122062683,
0.17788423597812653,
0.00244787335395813,
-0.004846487194299698,
-0.4583308696746826,
0.06821942329406738,
-0.06456035375595093,
0.03208785131573677,
-0.0576188899576664,
-0.08517798036336899,
0.2480563223361969,
0.27371346950531006,
-0.24369069933891296,
0.37054240703582764,
-0.22392696142196655,
-0.1742773950099945,
0.21286766231060028,
-0.06958122551441193,
-0.23511041700839996,
-0.31951314210891724,
0.08003917336463928,
0.07102552056312561,
-0.06852952390909195,
0.9006820917129517,
-0.10810200870037079,
0.07775771617889404,
-0.0968405157327652,
-0.2941637933254242,
-0.08306173980236053,
0.26712679862976074,
-0.26738885045051575,
-0.008278332650661469,
0.04237282648682594,
-0.04076752811670303,
-0.010054796934127808,
-0.33986443281173706,
0.24753844738006592,
-0.1830250471830368,
-0.29415997862815857,
0.3109845519065857,
0.4403584599494934,
0.07623445987701416,
0.013321787118911743,
-0.042525798082351685,
0.30243799090385437,
-0.0468820184469223,
-0.10741441696882248,
-0.11990080028772354,
-0.19727428257465363,
-0.3585380017757416,
0.16964781284332275,
0.019275598227977753,
0.11615616083145142,
-0.036260101944208145,
-0.1539432406425476,
0.3151035010814667,
-0.02140131965279579,
-0.19106417894363403,
0.08667132258415222,
0.25935637950897217,
-0.1045195534825325,
-0.15221935510635376,
-0.021743927150964737,
-0.18444940447807312,
-0.031175296753644943,
0.807100772857666,
0.14153030514717102,
-0.42506277561187744,
0.6353763341903687,
-0.243185892701149,
-0.04121464863419533,
-0.12177525460720062,
-0.24643433094024658,
0.23061522841453552,
-0.5931640863418579,
-0.14376285672187805,
-0.15889769792556763,
-0.19811458885669708,
0.1476159691810608,
-0.22855955362319946,
0.19414015114307404,
0.2536107003688812,
-0.22897078096866608,
-0.29452309012413025,
-0.3105168342590332,
-0.12527717649936676,
0.04388012737035751,
-0.007716629654169083,
-0.06083995848894119,
-0.15733660757541656,
0.2613868713378906,
0.10093232989311218,
-0.18938414752483368,
0.38334572315216064,
0.23786720633506775,
-0.018062954768538475,
0.37229716777801514,
0.007634001784026623,
0.4141761064529419,
0.1267198622226715,
0.035392969846725464,
-0.013466370292007923,
-0.2377641797065735,
-0.12716151773929596,
-0.22357968986034393,
0.1731564849615097,
-0.07046857476234436,
-0.035204775631427765,
-0.02362745814025402,
-0.04687558859586716,
0.01635781303048134,
-0.2001708745956421,
0.0754949301481247,
-0.17984727025032043,
-0.03384491056203842,
0.036501750349998474,
-0.010609878227114677,
0.04772811383008957,
-0.021301493048667908,
-0.0053684161975979805,
-0.05499360337853432,
0.04939228296279907,
0.031141020357608795,
0.21850955486297607,
-0.1827755868434906,
-0.11230526119470596,
-0.265494704246521,
-0.08421746641397476,
0.06121349334716797,
0.24348372220993042,
0.25849705934524536,
-0.29714134335517883,
-0.09088221192359924,
0.23405084013938904,
-0.03469451144337654,
0.07672431319952011,
0.07752006500959396,
-0.08090127259492874,
-0.12055088579654694,
0.11555592715740204,
-0.01586882770061493,
0.06726665794849396,
0.08091989904642105,
0.10749159753322601,
0.018695026636123657,
0.05242510885000229,
0.12868845462799072,
-0.09511066973209381,
0.36883383989334106,
0.012334533035755157,
0.3161635994911194,
-0.30040860176086426,
0.3644717335700989,
-0.07309900224208832,
0.0204433873295784,
0.2144525796175003,
0.17357100546360016,
0.10999760031700134,
-0.06893007457256317,
0.0879662036895752,
-0.08500685542821884,
0.06398003548383713,
0.15735960006713867,
0.19645309448242188,
-0.3323212265968323,
-0.6497993469238281,
0.06864812970161438,
0.45552077889442444,
-0.030233796685934067,
0.35390955209732056,
0.012874109670519829,
0.292362779378891,
0.1942637860774994,
-0.20298057794570923,
-0.31200888752937317,
0.06603159010410309,
-0.1438799798488617,
-0.22676008939743042,
0.135653555393219,
-0.1856742948293686,
-0.0885239988565445,
-0.15209294855594635,
-0.14543208479881287,
0.1455967128276825,
0.3843434751033783,
-0.04849930852651596,
-0.11491755396127701,
-0.559829592704773,
-0.26502853631973267,
0.22015774250030518,
0.21984024345874786,
-0.2134663462638855,
0.5540749430656433,
-0.15190017223358154,
-0.37214410305023193,
0.3189655542373657,
0.5042787194252014,
0.29373398423194885,
0.11862806975841522,
0.19617319107055664,
0.21506664156913757,
0.15393534302711487,
-0.014590315520763397,
-0.32187575101852417,
0.173964262008667,
0.18132078647613525,
-0.14746248722076416,
0.003981698304414749,
0.011000268161296844,
0.0113593228161335,
-0.04260187968611717,
-0.08862718939781189,
0.20469459891319275,
-0.3843447268009186,
0.06768633425235748,
-0.19960074126720428,
0.09396474063396454,
-0.13103170692920685,
0.2116698920726776,
-0.2785925269126892,
-0.126276895403862,
0.12818048894405365,
-0.10686218738555908,
0.07898519933223724,
-0.031021414324641228,
0.00807926058769226,
0.3644903302192688,
0.13695743680000305,
0.21525144577026367,
-0.12790663540363312,
-0.24168133735656738,
-0.041441790759563446,
-0.6332527995109558,
0.43470141291618347,
0.05681603029370308,
0.225569486618042,
-0.1294528841972351,
0.25180870294570923,
-0.0038064010441303253,
-0.08031024038791656,
0.38410401344299316,
-0.38620319962501526,
0.12409118562936783,
-0.16967564821243286,
-0.22003158926963806,
-0.06866972893476486,
0.3141077756881714,
0.1443944275379181,
0.06811226904392242,
-0.37369871139526367,
-0.043520912528038025,
0.09175359457731247,
-0.05002836138010025,
-0.02013435773551464,
-0.08435162156820297,
-0.27737873792648315,
0.07798333466053009,
0.44226813316345215,
0.04039508104324341,
0.04930148646235466,
0.18665075302124023,
-0.16090992093086243,
-0.5663543939590454,
-0.08102750033140182,
-0.08907388150691986,
-0.05107839033007622,
-0.055183280259370804,
0.09928339719772339,
-0.463421493768692,
-0.25541800260543823,
-0.2807026505470276,
-0.016472917050123215,
-0.053511615842580795,
-0.18742230534553528,
-0.028849460184574127,
0.11629883944988251,
-0.12063971906900406,
0.11705804616212845,
0.11048942804336548,
0.3273738920688629,
-0.0442981943488121,
0.08949335664510727,
-0.4306321144104004,
0.11648514866828918,
0.30748555064201355,
-0.009592320770025253,
0.03478941321372986,
0.04277786612510681,
0.5218454003334045,
0.12357545644044876,
-0.33582696318626404,
-0.10289154946804047,
0.27667850255966187,
0.21312229335308075,
0.003381289541721344,
-0.300178200006485,
-0.10401622951030731,
-0.15169323980808258,
0.05758277326822281,
-0.17006132006645203,
0.17541350424289703,
0.20784330368041992,
-0.05058693885803223,
0.06418177485466003,
-0.07249148935079575
] |
https://github.com/huggingface/datasets/issues/6114 | Thanks @mariosasko this works well, looks like I should have read the documentation a bit more carefully.
It is still a bit confusing which hash I should provide: passing `revision = c8fd66e85f086e3abb11eeee55b1737a3d1e8487` from https://huggingface.co/datasets/mozilla-foundation/common_voice_8_0/commits/main caused the cached version at `~/.cache/huggingface/datasets/mozilla-foundation___common_voice_8_0/en/8.0.0/b2f8b72f8f30b2e98c41ccf855954d9e35a5fa498c43332df198534ff9797a4a` to be loaded, so I had to know that it was the previous commit unless I've missed something else. | Cache not being used when loading commonvoice 8.0.0 | ### Describe the bug
I have commonvoice 8.0.0 downloaded in `~/.cache/huggingface/datasets/mozilla-foundation___common_voice_8_0/en/8.0.0/b2f8b72f8f30b2e98c41ccf855954d9e35a5fa498c43332df198534ff9797a4a`. The folder contains all the arrow files etc, and was used as the cached version last time I touched the ec2 instance I'm working on. Now, with the same command that downloaded it initially:
```
dataset = load_dataset("mozilla-foundation/common_voice_8_0", "en", use_auth_token="<mytoken>")
```
it tries to redownload the dataset to `~/.cache/huggingface/datasets/mozilla-foundation___common_voice_8_0/en/8.0.0/05bdc7940b0a336ceeaeef13470c89522c29a8e4494cbeece64fb472a87acb32`
### Steps to reproduce the bug
Steps to reproduce the behavior:
1. ```dataset = load_dataset("mozilla-foundation/common_voice_8_0", "en", use_auth_token="<mytoken>")```
2. dataset is updated by maintainers
3. ```dataset = load_dataset("mozilla-foundation/common_voice_8_0", "en", use_auth_token="<mytoken>")```
### Expected behavior
I expect that it uses the already downloaded data in `~/.cache/huggingface/datasets/mozilla-foundation___common_voice_8_0/en/8.0.0/b2f8b72f8f30b2e98c41ccf855954d9e35a5fa498c43332df198534ff9797a4a`.
Not sure what's happening in 2. but if, say it's an issue with the dataset referenced by "mozilla-foundation/common_voice_8_0" being modified by the maintainers, how would I force datasets to point to the original version I downloaded?
EDIT: It was indeed that the maintainers had updated the dataset (v 8.0.0). However I still cant load the dataset from disk instead of redownloading, with for example:
```
load_dataset(".cache/huggingface/datasets/downloads/extracted/<hash>/cv-corpus-8.0-2022-01-19/en/", "en")
> ...
> File [~/miniconda3/envs/aa_torch2/lib/python3.10/site-packages/datasets/table.py:1938](.../ python3.10/site-packages/datasets/table.py:1938), in cast_array_to_feature(array, feature, allow_number_to_str)
1937 elif not isinstance(feature, (Sequence, dict, list, tuple)):
-> 1938 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
...
1794 e = e.__context__
-> 1795 raise DatasetGenerationError("An error occurred while generating the dataset") from e
1797 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths)
DatasetGenerationError: An error occurred while generating the dataset
```
### Environment info
datasets==2.7.0
python==3.10.8
OS: AWS Linux | 59 | Cache not being used when loading commonvoice 8.0.0
### Describe the bug
I have commonvoice 8.0.0 downloaded in `~/.cache/huggingface/datasets/mozilla-foundation___common_voice_8_0/en/8.0.0/b2f8b72f8f30b2e98c41ccf855954d9e35a5fa498c43332df198534ff9797a4a`. The folder contains all the arrow files etc, and was used as the cached version last time I touched the ec2 instance I'm working on. Now, with the same command that downloaded it initially:
```
dataset = load_dataset("mozilla-foundation/common_voice_8_0", "en", use_auth_token="<mytoken>")
```
it tries to redownload the dataset to `~/.cache/huggingface/datasets/mozilla-foundation___common_voice_8_0/en/8.0.0/05bdc7940b0a336ceeaeef13470c89522c29a8e4494cbeece64fb472a87acb32`
### Steps to reproduce the bug
Steps to reproduce the behavior:
1. ```dataset = load_dataset("mozilla-foundation/common_voice_8_0", "en", use_auth_token="<mytoken>")```
2. dataset is updated by maintainers
3. ```dataset = load_dataset("mozilla-foundation/common_voice_8_0", "en", use_auth_token="<mytoken>")```
### Expected behavior
I expect that it uses the already downloaded data in `~/.cache/huggingface/datasets/mozilla-foundation___common_voice_8_0/en/8.0.0/b2f8b72f8f30b2e98c41ccf855954d9e35a5fa498c43332df198534ff9797a4a`.
Not sure what's happening in 2. but if, say it's an issue with the dataset referenced by "mozilla-foundation/common_voice_8_0" being modified by the maintainers, how would I force datasets to point to the original version I downloaded?
EDIT: It was indeed that the maintainers had updated the dataset (v 8.0.0). However I still cant load the dataset from disk instead of redownloading, with for example:
```
load_dataset(".cache/huggingface/datasets/downloads/extracted/<hash>/cv-corpus-8.0-2022-01-19/en/", "en")
> ...
> File [~/miniconda3/envs/aa_torch2/lib/python3.10/site-packages/datasets/table.py:1938](.../ python3.10/site-packages/datasets/table.py:1938), in cast_array_to_feature(array, feature, allow_number_to_str)
1937 elif not isinstance(feature, (Sequence, dict, list, tuple)):
-> 1938 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
...
1794 e = e.__context__
-> 1795 raise DatasetGenerationError("An error occurred while generating the dataset") from e
1797 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths)
DatasetGenerationError: An error occurred while generating the dataset
```
### Environment info
datasets==2.7.0
python==3.10.8
OS: AWS Linux
Thanks @mariosasko this works well, looks like I should have read the documentation a bit more carefully.
It is still a bit confusing which hash I should provide: passing `revision = c8fd66e85f086e3abb11eeee55b1737a3d1e8487` from https://huggingface.co/datasets/mozilla-foundation/common_voice_8_0/commits/main caused the cached version at `~/.cache/huggingface/datasets/mozilla-foundation___common_voice_8_0/en/8.0.0/b2f8b72f8f30b2e98c41ccf855954d9e35a5fa498c43332df198534ff9797a4a` to be loaded, so I had to know that it was the previous commit unless I've missed something else. | [
-0.009360603988170624,
0.14862433075904846,
0.019389845430850983,
0.410950243473053,
0.010040823370218277,
0.1771545559167862,
0.09138081967830658,
0.255706787109375,
0.4379901885986328,
-0.15505504608154297,
-0.062359511852264404,
0.03413005173206329,
0.33451128005981445,
-0.43399593234062195,
-0.05302309989929199,
0.19094489514827728,
0.012009896337985992,
0.04142513871192932,
0.4155603349208832,
-0.16563880443572998,
0.042980752885341644,
0.23423591256141663,
-0.20167070627212524,
-0.23159000277519226,
-0.3531723916530609,
0.1071048304438591,
-0.018648795783519745,
0.25690844655036926,
0.22535191476345062,
-0.32011833786964417,
0.5896379351615906,
0.29314523935317993,
0.05241060256958008,
0.47877219319343567,
-0.0001245544117409736,
-0.038647934794425964,
0.32350194454193115,
-0.15220454335212708,
-0.48032793402671814,
0.0030465349555015564,
-0.06273043900728226,
0.07265840470790863,
0.05041433125734329,
0.045205965638160706,
-0.16377761960029602,
0.28449466824531555,
0.005870305001735687,
-0.8201926946640015,
0.41557955741882324,
-0.12669573724269867,
0.13057352602481842,
-0.3020462393760681,
-0.008275352418422699,
0.20940625667572021,
0.33727946877479553,
0.02844921313226223,
0.015307560563087463,
0.011666223406791687,
0.23465782403945923,
0.06836989521980286,
-0.15054042637348175,
0.33163225650787354,
-0.03272370994091034,
0.08860643208026886,
0.12009654939174652,
0.09612507373094559,
-0.20067572593688965,
0.25726082921028137,
0.2369585931301117,
0.00698633398860693,
0.7442426681518555,
-0.3037053644657135,
-0.23671036958694458,
-0.07084672152996063,
-0.2069806158542633,
-0.4766237139701843,
0.5905483961105347,
-0.1422109305858612,
0.1071254312992096,
0.1866132915019989,
-0.07964655011892319,
-0.07468178868293762,
0.045663751661777496,
0.26366040110588074,
0.033864252269268036,
0.0027200356125831604,
-0.27916887402534485,
-0.03284432366490364,
0.06398606300354004,
-0.0743643194437027,
-0.10392182320356369,
-0.09130451083183289,
-0.19389402866363525,
0.6030752062797546,
-0.16158942878246307,
0.16894862055778503,
-0.07698849588632584,
0.16386298835277557,
0.1450231373310089,
0.3432179093360901,
0.3806886076927185,
0.1892939805984497,
-0.18007534742355347,
0.052051469683647156,
0.30535823106765747,
0.5271017551422119,
0.08052420616149902,
0.04439488798379898,
0.009757895022630692,
0.34371891617774963,
-0.1461361199617386,
-0.2832590639591217,
-0.15130916237831116,
0.10120686888694763,
0.44043993949890137,
-0.10982552170753479,
0.1856851577758789,
-0.6415128707885742,
-0.1497497856616974,
0.15948788821697235,
0.01831527054309845,
-0.18009056150913239,
0.27210327982902527,
0.3592105209827423,
0.023577719926834106,
0.1942005306482315,
0.1573253571987152,
0.146608367562294,
-0.127643883228302,
0.14776216447353363,
-0.16285361349582672,
-0.3191099762916565,
-0.22408099472522736,
0.30066245794296265,
0.591927170753479,
-0.508486270904541,
0.42574405670166016,
0.06742411851882935,
0.1485573649406433,
-0.3938820958137512,
-0.06862487643957138,
-0.03682825341820717,
0.12819340825080872,
0.041923630982637405,
-0.3024197220802307,
0.2934983968734741,
0.09939826279878616,
0.11813660711050034,
-0.08485097438097,
0.0983344316482544,
-0.5452728867530823,
-0.23581144213676453,
0.07315441220998764,
-0.011383647099137306,
-0.03175191208720207,
-0.3846377730369568,
0.4554743468761444,
-0.18881167471408844,
0.44579505920410156,
-0.3673830032348633,
0.12473554909229279,
0.22950798273086548,
-0.04096058011054993,
-0.06854724884033203,
0.2350149303674698,
0.8257449865341187,
-0.20844216644763947,
-0.14447537064552307,
-0.44997119903564453,
0.0793529599905014,
0.08587700128555298,
0.36233842372894287,
-0.1466563642024994,
-0.2411116063594818,
-0.316234827041626,
-0.0833362340927124,
0.3245886564254761,
-0.7474913001060486,
-0.7354511618614197,
0.28055793046951294,
0.12999090552330017,
0.325932115316391,
0.21311645209789276,
-0.17825551331043243,
-0.07963462173938751,
-0.20343030989170074,
0.10475222021341324,
0.10610522329807281,
0.04567158967256546,
0.018562793731689453,
-0.3297356367111206,
-0.13861262798309326,
-0.119040846824646,
0.03290526568889618,
-0.23499922454357147,
0.2459694743156433,
-0.01969650387763977,
0.06643543392419815,
0.15553846955299377,
0.25197798013687134,
0.11500811576843262,
0.31433433294296265,
0.1401902139186859,
0.07950364053249359,
0.21068918704986572,
0.339375764131546,
-0.5602461099624634,
0.3198917508125305,
-0.17477160692214966,
-0.4535050094127655,
0.2295316457748413,
-0.04856227710843086,
-0.3732990026473999,
-0.3339730203151703,
-0.4485336244106293,
-0.4168989062309265,
-0.009362522512674332,
0.42786023020744324,
0.274154394865036,
-0.35307854413986206,
-0.14560112357139587,
0.1271296888589859,
0.44948992133140564,
0.18612681329250336,
0.16831624507904053,
-0.02482428401708603,
0.0006194273009896278,
-0.10792823135852814,
-0.38370823860168457,
0.13405919075012207,
0.3447297215461731,
-0.13901656866073608,
-0.3027045726776123,
0.4871666133403778,
0.024297431111335754,
0.5126725435256958,
-0.0009024301543831825,
0.019612222909927368,
-0.028156718239188194,
0.11974495649337769,
0.39957937598228455,
0.11928556859493256,
0.14400535821914673,
-0.13106048107147217,
-0.2167384773492813,
0.25411179661750793,
0.10114163905382156,
0.15756312012672424,
-0.10601542890071869,
-0.16716516017913818,
0.09990244358778,
-0.09882546216249466,
0.15944918990135193,
-0.333147794008255,
0.17198818922042847,
-0.06944285333156586,
0.7876895666122437,
-0.03719499707221985,
-0.054427504539489746,
0.09666390717029572,
0.38096460700035095,
0.3357505798339844,
0.05462615191936493,
0.061297640204429626,
-0.3330565094947815,
-0.18533286452293396,
0.08475647121667862,
-0.0367957279086113,
0.26475900411605835,
0.21462276577949524,
0.2156846672296524,
0.10911565274000168,
0.11960755288600922,
-0.10168059170246124,
0.09213314950466156,
-0.08467227220535278,
0.2062322050333023,
0.13224634528160095,
-0.10017785429954529,
0.11493644118309021,
-0.3584301471710205,
0.10840640962123871,
0.1567833125591278,
-0.0625968798995018,
-0.4079645276069641,
0.07345795631408691,
-0.24281644821166992,
0.40258675813674927,
-0.2665497660636902,
0.26831862330436707,
-0.14672605693340302,
-0.1739884316921234,
-0.023331180214881897,
0.5447608828544617,
0.1715558022260666,
0.07283525168895721,
-0.3475187420845032,
0.39373907446861267,
-0.08575208485126495,
-0.43302786350250244,
-0.6827781796455383,
-0.02197999693453312,
-0.3100067377090454,
-0.08512008190155029,
0.24983742833137512,
-0.4904143810272217,
-0.009423687122762203,
0.03426353633403778,
0.24329672753810883,
-0.13187825679779053,
-0.1953771859407425,
0.0028404593467712402,
0.12724509835243225,
-0.2282232642173767,
-0.39828675985336304,
-0.2034607082605362,
-0.11866505444049835,
0.055299218744039536,
0.08510508388280869,
-0.23592215776443481,
-0.19323992729187012,
0.01663348823785782,
0.0010524354875087738,
0.22893746197223663,
0.016393303871154785,
-0.1744307428598404,
0.11879461258649826,
-0.3178601861000061,
0.10941863059997559,
0.07079079002141953,
-0.05398382619023323,
0.2111491560935974,
-0.2630135715007782,
0.08217549324035645,
-0.20825260877609253,
0.3591808080673218,
-0.5825795531272888,
-0.5771807432174683,
0.166118323802948,
-0.20011892914772034,
-0.034580398350954056,
0.10744346678256989,
0.13861046731472015,
0.30499267578125,
0.28514382243156433,
-0.38944000005722046,
0.299077570438385,
0.018355978652834892,
-0.10996094346046448,
0.09426379948854446,
-0.05672067403793335,
0.45362231135368347,
-0.019161885604262352,
0.0030525438487529755,
-0.0636039674282074,
-0.30240681767463684,
-0.0018179342150688171,
0.035032834857702255,
0.2734769880771637,
-0.1386311799287796,
0.16170048713684082,
0.1253964900970459,
0.9760412573814392,
0.26476022601127625,
0.19324654340744019,
0.552335798740387,
0.17816442251205444,
0.288382887840271,
-0.1390424221754074,
-0.13146460056304932,
0.06134926155209541,
-0.08515088260173798,
0.09126608073711395,
0.21715691685676575,
0.3979877531528473,
-0.35510751605033875,
-0.20546239614486694,
0.04716973751783371,
-0.4464467167854309,
-0.12566474080085754,
-0.015693005174398422,
-0.44288620352745056,
0.2437092512845993,
0.29486894607543945,
0.22429034113883972,
-0.189933180809021,
-0.2399938404560089,
-0.03237028419971466,
0.07736804336309433,
0.10344970226287842,
0.061715930700302124,
0.1773364543914795,
0.17811128497123718,
-0.12412430346012115,
0.4677373766899109,
-0.14646241068840027,
0.27236855030059814,
-0.23495951294898987,
-0.2456008493900299,
0.09545791149139404,
-0.019328907132148743,
0.4388119578361511,
-0.009030595421791077,
0.09020164608955383,
0.17517024278640747,
-0.10333716124296188,
-0.2764524817466736,
-0.16120073199272156,
0.0619465708732605,
0.34633389115333557,
-0.15574488043785095,
-0.03337199613451958,
-0.07404378056526184,
-0.1145390123128891,
-0.09275023639202118,
-0.10217729210853577,
-0.1608874797821045,
-0.17398300766944885,
-0.08883970230817795,
0.13842126727104187,
-0.2912869453430176,
0.1174522191286087,
-0.37102067470550537,
0.02066592127084732,
-0.05470031499862671,
-0.0007841289043426514,
-0.09269966185092926,
0.06716546416282654,
-0.09220157563686371,
-0.27994558215141296,
0.5256372690200806,
0.017851680517196655,
0.17505793273448944,
0.5611405372619629,
0.11574947834014893,
0.06726385653018951,
0.670677125453949,
0.08394816517829895,
0.12336377799510956,
-0.06072060391306877,
-0.13321542739868164,
-0.12201032042503357,
0.43949875235557556,
-0.029143454506993294,
-0.49741923809051514,
0.22439226508140564,
-0.2956983745098114,
-0.019178243353962898,
-0.3718706965446472,
0.06453149020671844,
0.34243977069854736,
-0.10697276890277863,
-0.11571289598941803,
0.15046432614326477,
0.16786304116249084,
-0.25974032282829285,
0.19654983282089233,
-0.1167607232928276,
-0.2023160755634308,
0.0422801598906517,
-0.22228683531284332,
0.7129603624343872,
-0.017112713307142258,
0.19140908122062683,
0.17788423597812653,
0.00244787335395813,
-0.004846487194299698,
-0.4583308696746826,
0.06821942329406738,
-0.06456035375595093,
0.03208785131573677,
-0.0576188899576664,
-0.08517798036336899,
0.2480563223361969,
0.27371346950531006,
-0.24369069933891296,
0.37054240703582764,
-0.22392696142196655,
-0.1742773950099945,
0.21286766231060028,
-0.06958122551441193,
-0.23511041700839996,
-0.31951314210891724,
0.08003917336463928,
0.07102552056312561,
-0.06852952390909195,
0.9006820917129517,
-0.10810200870037079,
0.07775771617889404,
-0.0968405157327652,
-0.2941637933254242,
-0.08306173980236053,
0.26712679862976074,
-0.26738885045051575,
-0.008278332650661469,
0.04237282648682594,
-0.04076752811670303,
-0.010054796934127808,
-0.33986443281173706,
0.24753844738006592,
-0.1830250471830368,
-0.29415997862815857,
0.3109845519065857,
0.4403584599494934,
0.07623445987701416,
0.013321787118911743,
-0.042525798082351685,
0.30243799090385437,
-0.0468820184469223,
-0.10741441696882248,
-0.11990080028772354,
-0.19727428257465363,
-0.3585380017757416,
0.16964781284332275,
0.019275598227977753,
0.11615616083145142,
-0.036260101944208145,
-0.1539432406425476,
0.3151035010814667,
-0.02140131965279579,
-0.19106417894363403,
0.08667132258415222,
0.25935637950897217,
-0.1045195534825325,
-0.15221935510635376,
-0.021743927150964737,
-0.18444940447807312,
-0.031175296753644943,
0.807100772857666,
0.14153030514717102,
-0.42506277561187744,
0.6353763341903687,
-0.243185892701149,
-0.04121464863419533,
-0.12177525460720062,
-0.24643433094024658,
0.23061522841453552,
-0.5931640863418579,
-0.14376285672187805,
-0.15889769792556763,
-0.19811458885669708,
0.1476159691810608,
-0.22855955362319946,
0.19414015114307404,
0.2536107003688812,
-0.22897078096866608,
-0.29452309012413025,
-0.3105168342590332,
-0.12527717649936676,
0.04388012737035751,
-0.007716629654169083,
-0.06083995848894119,
-0.15733660757541656,
0.2613868713378906,
0.10093232989311218,
-0.18938414752483368,
0.38334572315216064,
0.23786720633506775,
-0.018062954768538475,
0.37229716777801514,
0.007634001784026623,
0.4141761064529419,
0.1267198622226715,
0.035392969846725464,
-0.013466370292007923,
-0.2377641797065735,
-0.12716151773929596,
-0.22357968986034393,
0.1731564849615097,
-0.07046857476234436,
-0.035204775631427765,
-0.02362745814025402,
-0.04687558859586716,
0.01635781303048134,
-0.2001708745956421,
0.0754949301481247,
-0.17984727025032043,
-0.03384491056203842,
0.036501750349998474,
-0.010609878227114677,
0.04772811383008957,
-0.021301493048667908,
-0.0053684161975979805,
-0.05499360337853432,
0.04939228296279907,
0.031141020357608795,
0.21850955486297607,
-0.1827755868434906,
-0.11230526119470596,
-0.265494704246521,
-0.08421746641397476,
0.06121349334716797,
0.24348372220993042,
0.25849705934524536,
-0.29714134335517883,
-0.09088221192359924,
0.23405084013938904,
-0.03469451144337654,
0.07672431319952011,
0.07752006500959396,
-0.08090127259492874,
-0.12055088579654694,
0.11555592715740204,
-0.01586882770061493,
0.06726665794849396,
0.08091989904642105,
0.10749159753322601,
0.018695026636123657,
0.05242510885000229,
0.12868845462799072,
-0.09511066973209381,
0.36883383989334106,
0.012334533035755157,
0.3161635994911194,
-0.30040860176086426,
0.3644717335700989,
-0.07309900224208832,
0.0204433873295784,
0.2144525796175003,
0.17357100546360016,
0.10999760031700134,
-0.06893007457256317,
0.0879662036895752,
-0.08500685542821884,
0.06398003548383713,
0.15735960006713867,
0.19645309448242188,
-0.3323212265968323,
-0.6497993469238281,
0.06864812970161438,
0.45552077889442444,
-0.030233796685934067,
0.35390955209732056,
0.012874109670519829,
0.292362779378891,
0.1942637860774994,
-0.20298057794570923,
-0.31200888752937317,
0.06603159010410309,
-0.1438799798488617,
-0.22676008939743042,
0.135653555393219,
-0.1856742948293686,
-0.0885239988565445,
-0.15209294855594635,
-0.14543208479881287,
0.1455967128276825,
0.3843434751033783,
-0.04849930852651596,
-0.11491755396127701,
-0.559829592704773,
-0.26502853631973267,
0.22015774250030518,
0.21984024345874786,
-0.2134663462638855,
0.5540749430656433,
-0.15190017223358154,
-0.37214410305023193,
0.3189655542373657,
0.5042787194252014,
0.29373398423194885,
0.11862806975841522,
0.19617319107055664,
0.21506664156913757,
0.15393534302711487,
-0.014590315520763397,
-0.32187575101852417,
0.173964262008667,
0.18132078647613525,
-0.14746248722076416,
0.003981698304414749,
0.011000268161296844,
0.0113593228161335,
-0.04260187968611717,
-0.08862718939781189,
0.20469459891319275,
-0.3843447268009186,
0.06768633425235748,
-0.19960074126720428,
0.09396474063396454,
-0.13103170692920685,
0.2116698920726776,
-0.2785925269126892,
-0.126276895403862,
0.12818048894405365,
-0.10686218738555908,
0.07898519933223724,
-0.031021414324641228,
0.00807926058769226,
0.3644903302192688,
0.13695743680000305,
0.21525144577026367,
-0.12790663540363312,
-0.24168133735656738,
-0.041441790759563446,
-0.6332527995109558,
0.43470141291618347,
0.05681603029370308,
0.225569486618042,
-0.1294528841972351,
0.25180870294570923,
-0.0038064010441303253,
-0.08031024038791656,
0.38410401344299316,
-0.38620319962501526,
0.12409118562936783,
-0.16967564821243286,
-0.22003158926963806,
-0.06866972893476486,
0.3141077756881714,
0.1443944275379181,
0.06811226904392242,
-0.37369871139526367,
-0.043520912528038025,
0.09175359457731247,
-0.05002836138010025,
-0.02013435773551464,
-0.08435162156820297,
-0.27737873792648315,
0.07798333466053009,
0.44226813316345215,
0.04039508104324341,
0.04930148646235466,
0.18665075302124023,
-0.16090992093086243,
-0.5663543939590454,
-0.08102750033140182,
-0.08907388150691986,
-0.05107839033007622,
-0.055183280259370804,
0.09928339719772339,
-0.463421493768692,
-0.25541800260543823,
-0.2807026505470276,
-0.016472917050123215,
-0.053511615842580795,
-0.18742230534553528,
-0.028849460184574127,
0.11629883944988251,
-0.12063971906900406,
0.11705804616212845,
0.11048942804336548,
0.3273738920688629,
-0.0442981943488121,
0.08949335664510727,
-0.4306321144104004,
0.11648514866828918,
0.30748555064201355,
-0.009592320770025253,
0.03478941321372986,
0.04277786612510681,
0.5218454003334045,
0.12357545644044876,
-0.33582696318626404,
-0.10289154946804047,
0.27667850255966187,
0.21312229335308075,
0.003381289541721344,
-0.300178200006485,
-0.10401622951030731,
-0.15169323980808258,
0.05758277326822281,
-0.17006132006645203,
0.17541350424289703,
0.20784330368041992,
-0.05058693885803223,
0.06418177485466003,
-0.07249148935079575
] |